Upgrade to Pro — share decks privately, control downloads, hide ads and more …

WordPress as a Service – WordPressを使った新しいプロダクト・...

WordPress as a Service – WordPressを使った新しいプロダクト・サービス開発について考える / wct2019

Hidetaka Okamoto

November 02, 2019
Tweet

More Decks by Hidetaka Okamoto

Other Decks in Programming

Transcript

  1. H i d e t a k a O k

    a m o t o • Digitalcube Co. Ltd. • Nishinomiya / Kobe • WordPress 4.7 / 5.0 / 5.3 Core contributor
  2. ͳ Μ ͷ ͨ Ί ʹ Wo rd P re

    s s Λ ࢖ ͬͯ ͍ · ͢ ͔ ʁ
  3. Wo rd P re s s Λ ࢖ ͏ ཧ

    ༝ • ϒϩά΍χϡʔεαΠτɾECͳͲΛ࡞Γ͍ͨ • WebαʔϏεͷج൫ʹ͍ͨ͠ • ΤΫεςϯγϣϯൢചʢϓϥάΠϯɾςʔϚɾetcʣ • ϗεςΟϯά΍ӡ༻อकͰ঎ച͍ͨ͠ • ্࢘ɾΫϥΠΞϯτʹݴΘΕ͔ͨΒ
  4. Wo rd P re s s Λ ࢖ ͏ ཧ

    ༝ • ൃ৴ʢPublishʣ • ։ൃʢDevelopʣ • ൢചʢSaleʣ • ӡ༻ʢMaintainʣ • ্࢘ɾΫϥΠΞϯτʹݴΘΕ͔ͨΒ
  5. ࣮ ࡍ ͷ ۀ ຿ • ςʔϚɾϓϥάΠϯͷ։ൃ • ίΞ ϝδϟʔΞοϓσʔτͷςετͱຊ൪൓ө

    • ϓϥάΠϯ / ςʔϚͷΞοϓσʔτςετͱຊ൪൓ө • PHP / MySQL / Apache / OpenSSLͳͲͷӡ༻อक • ʮͳʹ΋ͯ͠ͳ͍ͷʹյΕ·ͨ͠ʯͱ͍͏ి࿩΁ͷରԠ
  6. ͳ ʹ ͕ ͓ ͖ ͯ ͍ Δʁ • શͯͷ΋ͷ͸࣌ؒͱͱ΋ʹมԽ͢Δ

    • ୭͔͕౿Μͩόά΍੬ऑੑ / ෆศͳ఺Λ୭͔͕मਖ਼͍ͯ͠Δ • ʮΑΓྑ͍αΠτΛ࡞ΔͨΊʹαΠτɾهࣄΛߋ৽͢Δʯ ʹ> ʮΑΓྑ͍αΠτΛ࡞ΔͨΊʹɺΞοϓσʔτΛϦϦʔε͢Δʯ • ӡ༻ΛͪΌΜͱ·Θͤ͹ɺαΠτʢͷཪଆʣ͸ΑΓྑ͘ͳ͍ͬͯ͘
  7. ͱ ͸ ͍ ͑ ɾ ɾ ɾ • Ξοϓσʔτ͸ʮ࢖ͬͨ΋ͷͷ਺ʯʹൺྫ͢Δ •

    αʔόʔ / ϛυϧ΢ΣΞ / CMS / ϓϥάΠϯ / ςʔϚ / npm / etc… • ੈքத͔Βू·ΔΧΠθϯΛɺςετ -> σϓϩΠ͢Δ • ΧΠθϯͷ෺ྔ࡞ઓ
  8. ͭ · Δ ͱ ͜ Ζ • ӡ༻λεΫ͸ඞཁෆՄܽͱ͍͏͔ͪΌΜͱ΍Ε • ͨͩ͠࢖ͬͨ΋ͷͷ਺͚ͩλεΫྔ͕૿͍͑ͯ͘

    • ʮίʔσΟϯάෆཁʯ͸ʮϝϯςෆཁʯͰ͸ͳ͍ • ʮ΍Βͳ͍ʯͰ͸ͳ͘ʮࣗ෼Ͱ΍Βͣʹࡁ·ͤΔʯ
  9. ΍ Γ ͨ ͍ ͜ ͱ ʹ ू த ͢

    Δ ͨ Ί ʹ ͸ ɺ ʮ ࣗ ෼ Ͱ ΍ Β ͳ ͍ ͜ ͱ ʯ Λ ܾ Ί Δ
  10. ΍ Γ ͨ ͍ ͜ ͱ ͷ ͨ Ί ʹ

    ΍ Ί Δ Λ ܾ Ί Δ
  11. Ξ ο ϓ σ ʔ τ ର ৅ Λ ݮ

    Β ͤ ͹ ӡ ༻ λ ε Ϋ ͸ ݮ Δ
  12. ӡ ༻ λ ε Ϋ Λ ޮ ཰ Խ ͢

    Δ ͨ Ί ʹ ߟ ͑Δ ͜ ͱ • ʮࣗ෼Ͱ΍Δʯ or ʮଞਓʹ΍ͬͯ΋Β͏ʯ or ʮࣙΊΔʯ • ࣌ؒΛ࢖͑͹ɺࣗ෼ͰͳΜͱ͔ؤுΕΔ • ͓ۚΛग़ͤ͹ɺ୭͔͕Έͯ͘ΕΔ • ػೳΛఘΊΕ͹ɺͦ΋ͦ΋ӡ༻͠ͳͯ͘ࡁΉ
  13. ࣌ ؒ Λ ࢖ ͑ ͹ ɺ ࣗ ෼ Ͱ

    Ͱ ͖ Δ • ஌ࣝΛಘΔͨΊͷ࣌ؒ΋ؚΊͯͷ࿩ • ؒҧͬͨલఏɾ஌ࣝͰͱΓ͘Ί͹ɺ΋ͪΖΜԕճΓʹͳΔ • ݕࡧɾߪೖͯ͠ಘͨ஌ࣝ͸ɺ࠷৽൛͔ʁ • ΤϥʔจͱӳޠͷݩυΩϡϝϯτ͕ಡΊΔ͔͕෼ਫྮ
  14. ͓ ۚ Λ ग़ ͤ ͹ ɺ ୭ ͔ ͕

    Έ ͯ͘ Ε Δ • ਓΛޏ͏ɺ֎஫͢ΔɺASP / SaaSΛ࢖͏ɺ etc… • ࣗ෼Ͱ΍Βͳ͍͜ͱͰɺͦͷ෼ͷ࣌ؒΛු͔ͤΔ • Ҡৡ͢ΔͨΊͷ४උίετ͸ඞਢ • ਓʹཔΉɹɹɹɿ ϫʔΫϑϩʔͳͲͷೝࣝ߹Θͤ • αʔϏεΛ࢖͏ɿ࣮૷Λ࢓༷ʹ߹ΘͤΔ
  15. ػ ೳ Λ ఘ Ί Ε ͹ ɺ ͦ ΋

    ͦ ΋ ӡ ༻ ͠ ͳ ͘ ͯ ྑ ͍ • ʮͦͷػೳɺຊ౰ʹඞཁͰ͔͢ʁʯ • ͋Ε͹͍͍͸͍͍ͩͨ࢖Θͳ͍ • Only 10% of that extra stuff will ever get used, so you are wasting 90% of your time. • ޙͰ࢖͏ͩΖ͏ͱ͍͏༧ଌͷݩʹ࡞ͬͨ΋ͷ͸ɺ࣮ࡍʹ͸10%ఔ౓͔͠࢖ΘΕͳ͍ɻ
 ͕ͨͬͯ͠ɺͦΕʹඅ΍ͨ࣌ؒ͠ͷ90%͸ແବʹͳΔ • YAGNI ( You ain’t gonna need it ): ͦΜͳͷඞཁͳ͍ͬͯ
  16. ʮ ͦ Ε ɺ ຊ ౰ ʹ ඞ ཁ Ͱ

    ͢ ͔ ʁ ʯ • ʮ͋ͬͨΒศར͡Όͳ͍ʯ -> ࣙΊΑ͏ • ʮཁ๬͸͖ͯΔʯ -> ίʔυΛॻ͔ͣʹ࣮૷ͯ͠ΈΔ • Ͳ͏ͯ͠΋ඞཁʹͳͬͨΒɺίʔυΛॻ͍࣮ͯ૷͢Δ
  17. ʮ S a a S Ͱ ࢼ ͯ͠ ൓ Ԡ

    Λ ݟ Δ ʯ ͱ ͍ ͏ ͸ ͡ Ί ํ • ैྔ՝ۚܥSaaS͸ࣙΊ΍͘͢ɺτϥΠΞϧ͕͋Δ͜ͱ΋ଟ͍ • ґଘ͠ͳ͍Α͏ʹ૊ΈࠐΊ͹ɺ͙͢ʹࣙΊΔ͜ͱ΋Մೳ • ʮ·ͣSaaSͰࢼ͢ʯ -> ʮ෺଍Γͳ͍͔Β࡞Δʯͱ͍͏൑அ • ΍Ί΍͍͢ / ࣺͯ΍͍͔͢Βͦ͜ɺΑΓૉૣ͘มԽͰ͖Δ
  18. Wo rd P re s s Λ Α Γ ศ

    ར ʹ ͢ Δ S a a S / F a a S ׆ ༻ ๏
  19. Wo rd P re s s ʹ S a a

    S Λ ͭ ͔ ͏ ϝ Ϧ ο τ • WPͷίʔυྔ͕૿͑Δ = ϝϯςφϯεൣғ͕૿͑Δ • ίʔυྔͷଟ͍ϓϥάΠϯ / ςʔϚ -> Ξϓσස౓্͕ΔՄೳੑେ • SaaSͷAPIΛ࢖͏͜ͱͰɺWPͷதͷίʔυྔΛݮΒ͢ • APIͷ࢓༷͕มΘΒͳ͚Ε͹ɺWP΁ͷӨڹ͸গͳ͍ • ϝδϟʔͲ͜Ζ͸͍͍ͩͨϓϥάΠϯ͕͋Δ
  20. AW S / G C P i s n o

    t “ α ʔ όʔ ԰ ͞ Μ ” • ը૾ / ςΩετ / Ի੠ೝࣝAPI • ϨίϝϯσʔγϣϯΤϯδϯ / API • ϝʔϧ / CDN / ετϨʔδ / Ωϟογϡ • ʮཉ͍͠ػೳͷAPIΛఏڙ͢ΔαʔϏεʯͱͯ͠ͷΫϥ΢υϕϯμʔ
  21. Wo rd P re s s ʹ S a a

    S Λ ͭ ͔ ͏ σϝ Ϧ ο τ • ʮશ͕ͯࢥ͍௨Γʹ͍͘Θ͚Ͱ͸ͳ͍ʯ • SaaSଆͷ࢓༷ɾར༻੍ݶɾϓϥϯ੍ݶʹґଘ͢Δ • ഁյతมߋ͕ʮશ͘ͳ͍ʯΘ͚Ͱ͸ͳ͍ • SaaSଆͷো֐ͷר͖ఴ͑Λड͚ΔՄೳੑ • ʮαʔϏε͕ऴྃ͢Δʯͱ͍͏Մೳੑ
  22. S a a S ͱ ͍ ͍ ײ ͡ ʹ

    ෇ ͖ ߹ ͏ • ࢼ͚ͩ͢ͳΒ͋·ΓਂೖΓ͠ͳ͍ʢࣙΊΕͳ͘ͳΔʣ • ୅ସαʔϏε͕͋Δ͔ɺWP͚ͩͰ΍Δํ๏͕͋Δ͔͸֬ೝ͢Δ • ՝ۚ͢Δ • ෍ڭͯ͠՝ۚϢʔβʔΛ૿΍͢
  23. S a a S Λ ࡞ Δ ͨ Ί ʹ

    Wo rd P re s s Λ ར ༻ ͢ Δ
  24. Wo rd P re s s ͸ Wo rd P

    re s s ͱ ͯ͠ ͠ ͔ ࢖ ͑ ͳ ͍ ͷ ͔ ʁ
  25. W P A P I ͱ ͸ • WordPressͷREST API

    • WordPressͷσʔλʹHTTP APIܦ༝ͰΞΫηεͰ͖Δ • Page / PostͳͲͰެ։͞Ε͍ͯΔهࣄ͸ݪଇೝূෆཁ • POST / PUT / DELETE΍ඇެ։৘ใ͸ೝূ͕ඞཁ • WordPressͷσʔλΛ֎෦͔Βѻ͏͜ͱ͕Ͱ͖Δ
  26. Wo rd P re s s Λ A P I

    ͱ ͯ͠ ར ༻ ͢ Δ
  27. Wo rd P re s s Λ A P I

    α ʔ όʔ ʹ ͢ Δ • HTMLͷඳըΛWordPress֎͔Βߦ͏ • jQuery / Vue / React / Angular / Ionic / EC Cube / etc… • WordPressͷςʔϚɾϓϥάΠϯʹґଘ͠ͳ͍࣮૷͕ՄೳʹͳΔ
  28. ͳ ͥ Wo rd P re s s Λ A

    P I α ʔ όʔ ʹ ͢ Δ ͷ ͔ 1. ηΩϡϦςΟڧԽͷͨΊʹWPΛඇެ։ྖҬʹஔ͖͍ͨ 2. PWA(Progressive Web Application) / SPA(Single Page Application) 3. ViewͱAppͷαʔόʔΛ෼཭ͯ͠ෛՙΛ෼ࢄ͍ͨ͠ 4. WordPressͷ؅ཧը໘ػೳ͚ͩɺαʔϏεʹར༻͍ͨ͠ 5. etc…
  29. Static Site Generator(SSG) ͰWordPressΛ࢖͏ • ϑϩϯτΤϯυք۾Ͱਓؾͷ͋ΔSSG • ࣄલʹ੩తԽͯ͠ߴ଎Խ+ෛՙ࡟ݮ • ೖߘը໘͸WordPressͷ··

    • Gatsby( React )΍Nuxt( Vue ) ͳͲ • ϑϩϯτͱίϯςϯπ؅ཧͷ෼ۀԽ https://www.gatsbyjs.org/packages/gatsby-source-wordpress/
  30. WordPressΛStatic Site Generatorʹ͢Δ • WordPressΛͦͷ··SSGԽ • ϑϩϯτΤϯυʹWPςʔϚ͕࢖͑Δ • LP /

    ίʔϙʔϨʔταΠτͳͲ޲͚ • WordPressͷ؅ཧίετΛ࡟ݮ͢Δ • ͨͩ͠ಈతग़ྗʹ͸Ұ޻෉ඞཁ https://www.getshifter.io/japanese/
  31. Wo rd P re s s Λ 1 S a

    a S / F a a S ͱ ͯ͠ ݟ Δ • REST API͕༻ҙ͞Ε͍ͯΔ • Ϣʔβʔ΍ίϯςϯπͷ؅ཧ͕Ͱ͖ΔGUI͕͋Δ • ඞཁʹԠͯ͡ϓϥάΠϯ΍ϑοΫ(PHP)Ͱ֦ுͰ͖Δ • ʢWPͷʣϚωʔδυαʔϏε΍ӡ༻୅ߦͷબ୒ࢶ͕ଟ͍
  32. ί ϯ ςϯ π ؅ ཧ ʹ ಛ Խ ͠

    ͨ Wo rd P re s s ͱ ͯ͠ • ࣗࣾαʔϏεͷ͓஌Βͤ΍χϡʔεɾTipsͷ഑৴ج൫ͱͯ͠ͷWP • ձһݶఆίϯςϯπͷ഑৴ج൫ͱͯ͠ͷWP • Ϣʔβʔ౤ߘΛϨϏϡʔ -> ެ։͢ΔͨΊͷ؅ཧը໘ͱͯ͠ͷWP • ίϯςϯπ؅ཧ͚ͩʹϑΥʔΧεͯ͠΋Ϣʔεέʔε͸༷ʑ
  33. C o n c l u s i o n

    • ӡ༻͸ͪΌΜͱ΍Ζ͏ɻͰ͖ͳ͍ͳΒ՝͔ۚσάϨ͠Α͏ • SaaS / FaaSΛ࢖͏͜ͱͰɺޮ཰తʹػೳΛ௥Ճ͠Α͏ • WP APIΛ࢖ͬͯɺWPΛ࢖ͬͨαʔϏεΛߟ͑Α͏ • WordPressΛ࢖ͬͯɺΈΜͳͰPublishing͠Α͏
  34. N e e d m o re a b o

    u t W P + W P A P I ?
  35. 1 5 : 4 5 ~ R o o m

    A B https://2019.tokyo.wordcamp.org/session/diamond05/
  36. 1 2 / 7 Wo rd C a m p

    O s a k a 2 0 1 9 https://2019.osaka.wordcamp.org/
  37. 1 2 / 7 Wo rd C a m p

    O s a k a 2 0 1 9 https://2019.osaka.wordcamp.org/