プラグインとの付き合い方 #wpshinshu / 2019-08-24 Shinshu WordPress Meetup vol.15

プラグインとの付き合い方 #wpshinshu / 2019-08-24 Shinshu WordPress Meetup vol.15

E03953e0c18d776fead147601fdc3899?s=128

Toro_Unit (Hiroshi Urabe)

August 24, 2019
Tweet

Transcript

  1. ϓϥάΠϯͱͷ෇͖߹͍ํ Toro_Unit @Shinshu WP Meetup vol.15 1

  2. $ whoami 2

  3. Toro_Unit ઎෦ ߛ (͏Β΂ ͻΖ͠) • Frontend Engineer • WordPress

    Plugin and Theme Developer Github: @torounit Twitter: @Toro_Unit 3
  4. Contribution • WordPress 4.3 / 4.4 / 4.7 / 5.0

    / 5.1 / 5.2 • WordCamp Osaka 2019 • WordCamp Osaka 2018 Speaker. • etc... 4
  5. Plugins and Themes • Custom Post Type Permalinks • Advanced

    Posts Blocks • Simple Post Type Permalinks • Powerful Posts Per Page (PPPP) • Vanilla • and more... 5
  6. 1.Α͋͘Δͭ͠΋Μɻ 6

  7. Q.ʮϓϥάΠϯͬͯԿݸ͙Β͍͕͍͍ΜͰ͔͢ʁʯ 7

  8. ͦΜͳ΋Ͷ͐Αʂʂʂ 8

  9. • ϓϥάΠϯͷ1ສߦͷϓϥάΠϯ1ͭͱɺ10ߦͷϓϥάΠϯ 100ݸͳΒ͹ɺޙऀͷํ͕ߦ਺গͳ͍ɻ • PHPϑΝΠϧ 100ݸͷϓϥάΠϯ̍ͭͱɺ1ݸͷϓϥάΠϯ10 ݸͳΒʁ • ͍ͬͯ͏͔ͦΜͳʹߦ਺ͱ͔ϑΝΠϧ਺ͱ͔ͬͯҙຯ͋Δʁ ޡࠩ͡Όͳ͍ʁ

    9
  10. • ద੾ʹ؅ཧग़དྷΔͷͰ͋Ε͹ ɺ͓޷͖ͳ͚ͩͲ͏ͧɻ • ਺͕ଟ͍΄Ͳɺߋ৽ͳͲอकͷखؒ͸૿͑Δɻʢޙड़ʣ 10

  11. ʮઈରʹΠϯετʔϧ͢΂͖ϓϥάΠϯʯ ʮඞਢϓϥάΠϯ ◦બʯ 11

  12. Μͳ΋ΜͶ͐Αʂʂʂ 12

  13. • શͯͷ WordPress ϢʔβʔʹඞཁͳػೳͳΒͳΜͰຊମʹ ೖͬͯͳ͍ͷʁ • ͦ΋ͦ΋ຊମΛΧελϚΠζ͢ΔͨΊͷػೳɻͦΜͳʹΰϦ ΰϦΧελϚΠζ͠ͳ͍ͱ࢖͑ͳ͍Ϟϊʁ 13

  14. ྑ͘঺հ͞ΕΔ΋ͷɻ 14

  15. 1. ΩϟογϡܥϓϥάΠϯ • WP Super Cache • W3 Total Cache

    ͋ͨΓ͕Α͘ɺʮߴ଎ԽͷͨΊʹೖΕΑ͏ʂʯతϊϦ঺հ͞Ε ͯ·͕͢ɻ 15
  16. • Ωϟογϡ = Ұ࣌తʹอଘͯ͠σʔλΛ࢖͍·Θ͢࢓૊Έɻ • WordPress ͸جຊతʹಈతʹHTMLΛੜ੒͢Δઓུɻਖ਼͘͠ ෇͖߹Θͳ͍ͱࣄނΔɻ • Ωϟογϡػߏ͕ຊମʹଘࡏ͢Δ

    CMS ΋͋Δ( Drupal, Concrete 5 ౳) • ͦ΋ͦ΋ htmlϑΝΠϧΛ࣮ࡍʹੜ੒͢ΔCMS΋ɻ ( MovableType, ੩తαΠτδΣωϨʔλʔͳͲɻ) 16
  17. 17

  18. • Πϯετʔϧ͢Δ͚ͩͰ؆୯ʂߴ଎ԽʂͦΜͳ͏·͍࿩͕͋ ΔΘ͚ͳ͍ɻ • ͦ΋ͦ΋ WP Super Cache ͸ Automattic

    ͕ 12೥લ͔Β࡞ͬ ͍ͯΔϓϥάΠϯ͕ͩɺ͍·ͩʹίΞʹऔΓࠐ·ΕΔ༧ఆ΋ ؾ഑΋ແ͍࣌఺ͰશͯͷέʔεʹඞཁͳϞϊͰ͸ͳ͍ɻ • αΠτͷछྨɺઃఆɺػೳ࣍ୈͰ͸༷ʑͳෆ۩߹ΛҾ͖ى͜ ͢৔߹΋ɻ 18
  19. 19

  20. 2. ηΩϡϦςΟରࡦܥ • All In One WP Security & Firewall

    • Wordfence Security • SiteGuard WP Plugin • etc... ਖ਼͘͠ઃఆ͢Ε͹ηΩϡϦςΟΛ޲্ͤͯ͘͞ΕΔ৔߹΋͋Δ ͔΋͠Εͳ͍͚ͲɺͦΕΛ͠ͳ͚Ε͹΄΅ҙຯ͕ແ͍ɻ 20
  21. ηΩϡϦςΟӠʑΛؾʹ͢ΔͳΒɺ·ͣ౰ͨΓલͷ͜ͱΛ౰ͨΓલ ʹ΍͔ͬͯΒɻ ౰ͨΓલͷ͜ͱ • ຊମɾϓϥάΠϯɾςʔϚͷΞοϓσʔτ • े෼ͳ௕͞ͷύεϫʔυ • ΞΧ΢ϯτΛෳ਺ਓͰڞ༗͠ͳ͍ /

    ద੾ͳݖݶઃఆ • αʔόʔύεϫʔυͷద੾ͳ؅ཧɻαʔόʔ্Ͱݖݶͷઃఆɻ 21
  22. 3. ΤσΟλ֦ுܥ • AddQuicktag • TinyMCE Advanced ΫϥγοΫΤσΟλʔʹ͍Ζ͍ΖػೳΛ଍ͯ͠هࣄͷ૷০ͱ͔ Λ͍͡Δ΍ͭɻ σϑΥϧτͰຬ଍Ͱ͖ͳ͔ͬͨͱ͖ʹߟ͑Ε͹ʁ

    ϩΫʹ࢖͍ͬͯͳ͍ͷʹೖͬͯΔ͜ͱΊͬͪΌଟ͍ɻ 22
  23. • Classic Editor ͱΓ͋͑ͣɺϒϩοΫΤσΟλʔͱͪΌΜͱ෇͖߹͔ͬͯΒͩͱ ࢥ͏Αɻ 23

  24. 4. SEO ܥ • All in One SEO Pack •

    Yeost SEO • Google XML Sitemap • and more.... 24
  25. • ͱΓ͋͑ͣೖΕͱ͖ΌॱҐ্͕Δͱ͔͋Γಘͳ͍ɻద੾ͳઃ ఆ & ӡ༻͕ඞཁɻ • ྑ͘ղΒͳ͍ͳΒͪΌΜͱ࢖͑ͳ͍ͷͰɺ·ͣ͸ͦͬͪͷษ ڧΛɻͦͷ্Ͱඞཁͳઃఆ͕͋ΔͳΒ͹ߟ͑Δɻ 25

  26. ϓϥάΠϯͷબఆ 26

  27. ͪΌΜͱߟ͑ͯೖΕΔ • ͳΜͰೖΕ͔ͨྑ͘ղΒͳ͍ϓϥάΠϯ͸͍Ζ͍Ζॏՙʹ͔͠ͳΒ ͳ͍ɻ • ͳΜͰೖΕ͔ͨղΒͳ͍͔Βফͤͳ͍ɻ • ͪΌΜͱػೳΛ֬ೝͯ͠ೖΕΔɻ • ͨ·ʔʹɺಉ͡ػೳΛఏڙ͢ΔϓϥάΠϯ͕ෳ਺༗ޮʹͳͬͯͨ

    Γ͢Δɻ • ྑ͘ղΒͳ͍΋ͷ͍Εͳ͍ɻ 27
  28. ͳΔ΂͘γϯϓϧͳϞϊΛ • γϯϓϧʹɺͻͱͭͷ͜ͱΛ্ख͘͜ͳ͢ϓϥάΠϯͷํ͕ ཧղ͠қ͘ɺϝϯς͠΍͍͢ɻ • All in One ͳΜͱ͔Έ͍ͨͳͷͱ͔ɺԿ͔͛͢ʔύϫʔΞο ϓ͢ΔϓϥάΠϯ͸ɺͪΌΜͱཧղ͠ͳ͍ͱة͏͍ɻ

    • ϓϥάΠϯ͸։ൃ͕ࢭ·ͬͨΓ͢Δ͜ͱرʹΑ͋͘ΔͷͰɺ ͦͷࡍʹɺ༰қʹ৐Γ׵͑ΒΕΔ or ࣗ෼Ͱϝϯςφϯεग़དྷ ΔϞϊΛɻ 28
  29. େن໛ͳϞϊ͸৺த͢Δ֮ޛΛ • WooCommerce ΍ BuddyPress ౳ɺେن໛ʹαΠτͦͷ΋ͷ ͷੑ࣭Λม͑ͯ͠·͏Α͏ͳϓϥάΠϯ͸ɺWordPress ϕʔε ͷผͷ CMS

    ͱଊ͑ͯ৺த͢Δ֮ޛΛɻ • ʮWooCommerce ࣙΊΔ = ଞͷ CMS ʹ৐Γ׵͑Δʯ͘Β ͍ͷϞϊͱଊ͑ͯ෇͖߹͏ɻ • ͦͷࡍʹॏཁʹͳͬͯ͘Δͷ͸ɺ αϙʔτ ɺ ίϛϡχςΟ ɺ ΤίγεςϜ 29
  30. ๻ͷબఆج४ • ϓϥάΠϯ͸୭Ͱ΋࡞ΕΔͷͰɺۄੴࠞަɻ • ഁյతมߋ͕ೖͬͨΓɺPro൛ʹҠߦͯ͠Free൛͸ػೳ͕ݮͬͨΓ͢ Δ͜ͱ΋ɻ • ࡞ऀͷ࣮੷ɺWordPress.org ΍ɺGithub ౳Ͱͷ׆ಈɺίʔυͷ඼

    ࣭ɺαϙʔτϑΥʔϥϜͰͷճ౴ͳͲΛݟͯ൑அɻ • ࡞ऀͱͷίϛϡχέʔγϣϯίετɻ • ஌Γ߹͍΍ɺݴ༿͕௨͡΍͍͢ਓͷํ͕ίετ͸௿͍ɻ 30
  31. • Active install΍ɺμ΢ϯϩʔυ਺͸ɺ։ൃ࣌ظɺ༻్࣍ୈͳ ͷͰͦ͜·Ͱ͋ͯʹͯ͠ͳ͍ɻࣅͨΑ͏ͳϓϥάΠϯ͕͋ͬ ͨΒؾʹ͢Δ͔ͳʔͬͯఔ౓ɻ 31

  32. ϓϥάΠϯͱ্खʹ෇͖߹͏ͨΊʹɻ 32

  33. ΞοϓσʔτઓུΛߟ͑Δ • ྲྀੴʹɺ24࣌ؒ365೔؂ࢹ͠ଓ͚Δͷ͸೉͍͠ • ۓٸ౓ͷߴ͍ϞϊͰແ͚Ε͹ͪΐͬͱ์ஔͯ͠΋େৎ෉ɻ • ์ஔ͗͢͠Δͱɺόʔδϣϯ্͕͕Γ͗͢Δ & ಉ࣌ʹෳ਺ͷ ϓϥάΠϯΛΞοϓσʔτ͢Δ͜ͱʹͳΓɺෆ۩߹ͷݕূ͕

    ࠔ೉ʹɻ 33
  34. ৘ใऩू ੬ऑੑͳͲ͸க໋తʹͳΓ͕ͪͳͷͰɺϚϝʹνΣοΫɻ • WordPress Tavern – WordPress News — Free

    as in Beer. • WPScan Vulnerability Database • JVN iPedia - ੬ऑੑରࡦ৘ใσʔλϕʔε 34
  35. 35

  36. WPScan WPScan Vulnerability Database ͷσʔλΛ༻͍ͯɺ੬ऑੑݕࠪ Λ͢ΔϓϥάΠϯɻ • ੬ऑੑ͕ൃݟ͞Εͨ৔߹ϝʔϧͰͷ௨஌΋͞ΕΔɻ 36

  37. ྫ1 • ੬ऑੑ͕ൃݟ͞ΕͨΒ௚ͪʹߋ৽ • ͦ͏Ͱແ͚Ε͹ि1ͱ͔Ͱߋ৽ • ຊ൪ͱ΄΅ಉҰͷςετ؀ڥΛ༻ҙɺ֬ೝޙɺຊ൪΁ద༻ɻ 37

  38. ྫ2 • Advanced Automatic Updates ΍ɺ JetPack ౳Ͱࣗಈߋ৽ɻ • յΕͨΒόοΫΞοϓ͔Β෮چͯ͠ݪҼௐࠪɻ

    38
  39. ྫ3 • WordPress Λ੩తԽ • هࣄߋ৽࣌ͷΈαʔόʔΛىಈ 39

  40. ϓϥάΠϯΛ࢖͏͜ͱ΁ͷϦεΫ 1. ϓϥάΠϯͷόάɻෆ۩߹ɻηΩϡϦςΟϗʔϧɻ 2. ޙํޓ׵ੑͷແ͍มߋɻ 3. ։ൃͷఀࢭɻ 4. PHP ͷ

    ΞοϓσʔτʹΑΔෆ۩߹ͳͲ 40
  41. ͜ΕΒͱͲ͏෇͖߹͍ͬͯ͘ʁ 41

  42. ϑΥʔΫͯࣗ͠෼Ͱϝϯςφϯεɻ • ϋʔυϞʔυɻ ΋͘͠͸͓ۚΛ෷ͬͯ΍ͬͯ΋Β͏ɻ શ෦ࣗ෼Ͱ։ൃ • ϋʔυϞʔυɻ طଘͷϓϥάΠϯͷ࣮૷͕ؾʹ͘Θͳ͍ɺ ΦʔόʔεϖοΫա͗Δͱ͖ͱ͔ɻ 42

  43. or 43

  44. ࡞ऀ΁ϑΟʔυόοΫ 44

  45. ͨͱ͑͹ • ։ൃ൛ͷςετ • όάϨϙʔτ • ػೳఏҊ • υΩϡϝϯτ •

    मਖ਼ͨ͠Βύον΍ɺϓϧϦΫΤετͳͲΛૹͬͯΈΔɻ • ελʔΛ෇͚ͨΓɺد෇ͯ͠ΈͨΓɻ 45
  46. ࡞ऀ͸ϑΟʔυόοΫΛ଴ͬͯ·͢ʂ Φʔϓϯιʔεʂ 46

  47. ϓϥάΠϯΛެ։͍ͯ͠Δཧ༝ɻ • ؅ཧը໘͔ΒΞοϓσʔτ͍ͨ͠! • ϓϥάΠϯʹ͢Δ͜ͱͰɺ͍Ζ͍Ζ࢖͍ճͤΔΑ͏ʹͳΔɻ • ࣗ෼Ͱ͸ؾ෇͔ͳ͍όά΍ɺ஌ࣝɾΞΠσΞͳͲΛڭ͑ͯ΋ ΒͬͨΓɻ௚ͯ͠΋ΒͬͨΓɻ • ͦΕʹΑͬͯൃੜ͢Δίϛϡχέʔγϣϯɻ

    47
  48. ࡞ऀͱͷίϛϡχέʔγϣϯେ੾ɻ 48

  49. • όάϨϙʔτɺࠔΓ͝ͱͳͲͷϑΟʔυόοΫ͸ଟ͍͕ɺϙ δςΟϒͳϑΟʔυόοΫ͸ҙ֎ʹগͳ͍ɻ • ࢖ΘΕ͍ͯΔ͜ͱΛ࡞ऀ͸஌Βͳ͍͜ͱ͸ҙ֎ʹଟ͍ɻ • ελʔΛ෇͚ͨΓɺد෇ͳͲΛ͢Δͷ͸΄Μͱʹॏཁɻ • ʮ࢓ࣄͱͯ͠ϓϥάΠϯอकͯ͠ ʯΈ͍ͨͳέʔε΋͋Δɻ

    49
  50. WordPress ͸Φʔϓϯιʔε! ϓϥάΠϯɾςʔϚͳͲ΋΋ͪΖΜΦʔϓϯιʔεɻ 50

  51. Φʔϓϯιʔεͷιϑτ΢ΣΞͱ͸ ୭Ͱ΋ࣗ༝ʹɺར༻ɾมߋɾڞ༗ग़དྷΔιϑτ΢ΣΞɻ Φʔϓϯιʔεͷ఩ֶͱ͸ ୭Ͱ΋ࣗ༝ʹɺίϐʔɺมߋɺίϛϡχέʔγϣϯΛ͠ͳ͕ΒߩݙͰ͖ Δڞಉ࡞ۀͷߟ͑ํͰ͋Δɻ Ҿ༻ɿGovernment open source — ੓෎΍࣏ࣗମͷΦʔϓϯιʔε׆༻

    // Speaker Deck 51
  52. 52

  53. 53

  54. @See.. • Government open source — ੓෎΍࣏ࣗମͷΦʔϓϯιʔε׆ ༻ // Speaker

    Deck • Takayuki Miyauchi: ϫʔΫϑϩʔͱͯ͠ͷΦʔϓϯιʔε | WordPress.tv • Hiroshi Urabe: WordPressͷϓϥάΠϯ࡞ͬͨΓίΞίϯτϦ Ϗϡʔλʔʹͳͬͨ࿩ɻ ͦͯ͠ɺͦͷָ͠͞ͱҙٛ | WordPress.tv 54
  55. Thanks! Github: @torounit Twitter: @Toro_Unit Facebook: fb.me/torounit Blog: https://torounit.com 55