SlideShare a Scribd company logo
WordPress website onderhoud
met WP-CLI
Internet 2200 jaar geleden:
de Bibliotheek van Alexandrië
❖ Surfen in de oudheid
❖ De boot nemen naar…
Alexandrië in Egypte
❖ Snuisteren in één van de
400.000 boekrollen
Kopiisten: de webmasters van weleer
❖ Levensduur boekrol +/- 80 jaar
❖ Boekrol kopiëren => 2 kopiisten
(pair programming) 5 weken
❖ 400.000 boekrollen zou een
legertje van 1000 kopiisten
vergen… in een pre-industriële
samenleving was verval was
onvermijdelijk.
Gebrek aan onderhoud: vroeger en nu
❖ Website wordt traag
❖ Gebruiksgemak gaat achteruit
❖ SEO rankings slabakken
❖ En uiteindelijk...
WP-CLI: Tikken in plaats van klikken
❖ WP-CLI is de officiële command line interface om je
WordPress sites te beheren.
❖ Alle taken die je kan uitvoeren op de back end of
administratiepagina’s van je WordPress site kan je ook
uitvoeren met WP-CLI (en meer)
❖ WP-CLI leent zich tot uitbreiding en automatisering
❖ WPI-CLI is de snelste manier op je WordPress sites te
beheren
Een voorbeeldje
Mijn back end is zo perfect
getuned dat ik sneller kan
klikken dan jij kan tikken
met je WP-CLI...
De middeleeuwse webmaster installeert een nieuwe plugin
Wat nu… de back end is niet meer bereikbaar...
WP-CLI: uw ridder op het witte paard de witte geit
WP-CLI in actie
$ wp plugin deactivate evil-plugin
Plugin ‘evil-plugin’ deactivated.
Succes: Deactivated 1 of 1 plugins.
De Terminal
❖ Om met WP-CLI aan de slag te gaan heb je een
terminal nodig waarmee je via SSH connecteert
op je server.
❖ Linux en OS X systemen zijn standaard uitgerust
met terminal software.
❖ Op Windows kan je Putty of Cygwin installeren.
Installatie
❖ Alle betrouwbare hostingbedrijven bieden
WP-CLI standaard aan
❖ Alle goede kant-en-klare lokale WordPress
ontwikkelomgevingen zijn uitgerust met WP-CLI
❖ Steek je graag zelf de handen uit de mouwen volg
dan handleiding op wp-cli.org of vraag het aan je
favoriete systeembeheerder
$ wp
NAME
wp
DESCRIPTION
Manage WordPress through the command line
SYNOPSIS
Wp <command>
SUBCOMMANDS
cache Adds,removes,fetches,and flushes the WP Object Cache object.
cap Adds,removes, and lists capabilities of a user role.
:
WP-CLI in detail
wp admin
wp cache
wp cap
wp cli
wp comment
wp config
wp core
wp cron
wp db
wp dist-archive
wp embed
wp eval
wp eval-file
wp export
wp find
wp help
wp import
wp language
wp media
wp menu
wp network
wp option
wp package
wp plugin
wp post
wp post-type
wp rewrite
wp role
wp scaffold
wp search-replace
wp server
wp shell
wp sidebar
wp site
wp super-admin
wp taxonomy
wp term
wp theme
wp transient
wp user
wp widget
WP-CLI in detail
$ wp plugin deactivate evil-plugin
WP-CLI in detail
command subcommand option/parameter
Plugin ‘evil-plugin’ deactivated.
Succes: Deactivated 1 of 1 plugins.
$
$ wp plugin --help
WP-CLI in detail
command global parameter
NAME
Wp plugin
DESCRIPTION
Manages plugins, including installs, activation, and
updates.
SYNOPSIS
Wp plugin <command>
SUBCOMMANDS
activate Activates one or more plugins.
deactivate Deactivates one or more plugins
:
WP-CLI in detail
SUBCOMMANDS
activate Activates one or more plugins.
deactivate Deactivates one or more plugins.
delete Deletes plugin files without deactivating or uninstalling.
get Gets details about an installed plugin.
install Installs one or more plugins.
is-installed Checks if a given plugin is installed.
list Gets a list of plugins.
path Gets the path to a plugin or to the plugin directory.
search Searches the WordPress.org plugin directory.
status Reveals the status of one or all plugins.
toggle Toggles a plugin's activation state.
uninstall Uninstalls one or more plugins.
update Updates one or more plugins.
verify-checksums Verifies plugin files against WordPress.org's checksums.
WP-CLI in detail
$ wp plugin list
+-----------------------------+----------+-----------+-----------+
| name | status | update | version |
+-----------------------------+----------+-----------+-----------+
| bulk-delete | inactive | none | 5.6.1 |
| content-scheduler | inactive | none | 2.0.5 |
| debug-bar | active | available | 0.9 |
| disable-emojis | active | none | 1.7 |
| export-user-data | inactive | none | 1.3.1 |
| formidable | active | none | 3.0.05 |
| formidable-pro | active | none | 3.0.05 |
| formidable-wpml | active | none | 1.04 |
| formidable-registration | inactive | none | 1.11.07 |
| fusion-builder | active | none | 1.3.1 |
| fusion-core | active | none | 3.3.1 |
+-----------------------------+----------+-----------+-----------+
WP-CLI in detail
NAME
wp plugin update
DESCRIPTION
Updates one or more plugins.
SYNOPSIS
wp plugin update [<plugin>...] [--all] [--exclude=<name>] [--minor]
[--patch]
[--format=<format>] [--version=<version>] [--dry-run]
OPTIONS
[<plugin>...]
One or more plugins to update.
[--all]
If set, all plugins that have updates will be updated.
:
WP-CLI in detail
$ wp plugin update evil-plugin
WP-CLI in detail
command subcommand option/parameter
Installing evil-plugin
Downloading install package from
https://downloads.wordpress.org/plugin/evil-plugin.zip...
Unpacking the package...
Installing the plugin...
Removing the old version of the plugin...
Plugin updated successfully.
Success: Updated 1 of 1 plugins.
$ wp plugin update --all
$ wp theme update --all
$ wp core update
$ wp plugin update --all && wp theme
update --all && wp core update
WP-CLI in detail
$ wp db export
$ wp search-replace ‘http://tst.com’ ‘https://tst.com’ --dry-run
+--------------------+-----------------------+--------------+------+
| Table | Column | Replacements | Type |
+--------------------+-----------------------+--------------+------+
| main_options | option_value | 21 | PHP |
| main_options | autoload | 0 | SQL |
| main_postmeta | meta_key | 0 | SQL |
| main_postmeta | meta_value | 252 | PHP |
| main_posts | post_content | 1869 | SQL |
| main_posts | post_title | 0 | SQL |
| main_posts | post_excerpt | 0 | SQL |
| main_users | display_name | 0 | SQL |
+--------------------+-----------------------+--------------+------+
Success: 2142 replacements to be made.
WP-CLI in actie
Dankzij WP-CLI meer tijd voor de leuke dingen

More Related Content

ODP
Linux command-line-magic-jdnl15
PDF
Joomla in een doosje
PPTX
Wordpress
PDF
Installatie apache, qgis server en lizmap web client
PPT
Drupal Uitgebreide Starters Training
PDF
Mijn site beveiliging
PDF
PFZ Workshop - Automatiseren van functionele tests
ODP
Linux Nijmegen - Webserver (LAMP stack) opzetten met VirtualbBox & Vagrant
Linux command-line-magic-jdnl15
Joomla in een doosje
Wordpress
Installatie apache, qgis server en lizmap web client
Drupal Uitgebreide Starters Training
Mijn site beveiliging
PFZ Workshop - Automatiseren van functionele tests
Linux Nijmegen - Webserver (LAMP stack) opzetten met VirtualbBox & Vagrant

Similar to WordPress website onderhoud met wp cli (11)

PDF
XPages Introductie
PPT
Lucius Websystems Drupal Startersdag
PPTX
Speeding up WordPress
PPTX
Drupaljam2015 logstash
PPTX
Infra as Code workshop
ODP
Open Computer and Software Inventory
PDF
Joomla Website optimaliseren - jug073 augustus 2018
PPTX
DigiPinguïns: OwnCloud (Dag Geeraert)
PPTX
Drupal Deployment demo
PDF
Drupalgardens
KEY
Website-tool: CMS of Framework
XPages Introductie
Lucius Websystems Drupal Startersdag
Speeding up WordPress
Drupaljam2015 logstash
Infra as Code workshop
Open Computer and Software Inventory
Joomla Website optimaliseren - jug073 augustus 2018
DigiPinguïns: OwnCloud (Dag Geeraert)
Drupal Deployment demo
Drupalgardens
Website-tool: CMS of Framework
Ad

WordPress website onderhoud met wp cli

  • 2. Internet 2200 jaar geleden: de Bibliotheek van Alexandrië ❖ Surfen in de oudheid ❖ De boot nemen naar… Alexandrië in Egypte ❖ Snuisteren in één van de 400.000 boekrollen
  • 3. Kopiisten: de webmasters van weleer ❖ Levensduur boekrol +/- 80 jaar ❖ Boekrol kopiëren => 2 kopiisten (pair programming) 5 weken ❖ 400.000 boekrollen zou een legertje van 1000 kopiisten vergen… in een pre-industriële samenleving was verval was onvermijdelijk.
  • 4. Gebrek aan onderhoud: vroeger en nu ❖ Website wordt traag ❖ Gebruiksgemak gaat achteruit ❖ SEO rankings slabakken ❖ En uiteindelijk...
  • 5. WP-CLI: Tikken in plaats van klikken ❖ WP-CLI is de officiële command line interface om je WordPress sites te beheren. ❖ Alle taken die je kan uitvoeren op de back end of administratiepagina’s van je WordPress site kan je ook uitvoeren met WP-CLI (en meer) ❖ WP-CLI leent zich tot uitbreiding en automatisering ❖ WPI-CLI is de snelste manier op je WordPress sites te beheren
  • 6. Een voorbeeldje Mijn back end is zo perfect getuned dat ik sneller kan klikken dan jij kan tikken met je WP-CLI...
  • 7. De middeleeuwse webmaster installeert een nieuwe plugin
  • 8. Wat nu… de back end is niet meer bereikbaar...
  • 9. WP-CLI: uw ridder op het witte paard de witte geit
  • 10. WP-CLI in actie $ wp plugin deactivate evil-plugin Plugin ‘evil-plugin’ deactivated. Succes: Deactivated 1 of 1 plugins.
  • 11. De Terminal ❖ Om met WP-CLI aan de slag te gaan heb je een terminal nodig waarmee je via SSH connecteert op je server. ❖ Linux en OS X systemen zijn standaard uitgerust met terminal software. ❖ Op Windows kan je Putty of Cygwin installeren.
  • 12. Installatie ❖ Alle betrouwbare hostingbedrijven bieden WP-CLI standaard aan ❖ Alle goede kant-en-klare lokale WordPress ontwikkelomgevingen zijn uitgerust met WP-CLI ❖ Steek je graag zelf de handen uit de mouwen volg dan handleiding op wp-cli.org of vraag het aan je favoriete systeembeheerder
  • 13. $ wp NAME wp DESCRIPTION Manage WordPress through the command line SYNOPSIS Wp <command> SUBCOMMANDS cache Adds,removes,fetches,and flushes the WP Object Cache object. cap Adds,removes, and lists capabilities of a user role. : WP-CLI in detail
  • 14. wp admin wp cache wp cap wp cli wp comment wp config wp core wp cron wp db wp dist-archive wp embed wp eval wp eval-file wp export wp find wp help wp import wp language wp media wp menu wp network wp option wp package wp plugin wp post wp post-type wp rewrite wp role wp scaffold wp search-replace wp server wp shell wp sidebar wp site wp super-admin wp taxonomy wp term wp theme wp transient wp user wp widget WP-CLI in detail
  • 15. $ wp plugin deactivate evil-plugin WP-CLI in detail command subcommand option/parameter Plugin ‘evil-plugin’ deactivated. Succes: Deactivated 1 of 1 plugins. $
  • 16. $ wp plugin --help WP-CLI in detail command global parameter
  • 17. NAME Wp plugin DESCRIPTION Manages plugins, including installs, activation, and updates. SYNOPSIS Wp plugin <command> SUBCOMMANDS activate Activates one or more plugins. deactivate Deactivates one or more plugins : WP-CLI in detail
  • 18. SUBCOMMANDS activate Activates one or more plugins. deactivate Deactivates one or more plugins. delete Deletes plugin files without deactivating or uninstalling. get Gets details about an installed plugin. install Installs one or more plugins. is-installed Checks if a given plugin is installed. list Gets a list of plugins. path Gets the path to a plugin or to the plugin directory. search Searches the WordPress.org plugin directory. status Reveals the status of one or all plugins. toggle Toggles a plugin's activation state. uninstall Uninstalls one or more plugins. update Updates one or more plugins. verify-checksums Verifies plugin files against WordPress.org's checksums. WP-CLI in detail
  • 19. $ wp plugin list +-----------------------------+----------+-----------+-----------+ | name | status | update | version | +-----------------------------+----------+-----------+-----------+ | bulk-delete | inactive | none | 5.6.1 | | content-scheduler | inactive | none | 2.0.5 | | debug-bar | active | available | 0.9 | | disable-emojis | active | none | 1.7 | | export-user-data | inactive | none | 1.3.1 | | formidable | active | none | 3.0.05 | | formidable-pro | active | none | 3.0.05 | | formidable-wpml | active | none | 1.04 | | formidable-registration | inactive | none | 1.11.07 | | fusion-builder | active | none | 1.3.1 | | fusion-core | active | none | 3.3.1 | +-----------------------------+----------+-----------+-----------+ WP-CLI in detail
  • 20. NAME wp plugin update DESCRIPTION Updates one or more plugins. SYNOPSIS wp plugin update [<plugin>...] [--all] [--exclude=<name>] [--minor] [--patch] [--format=<format>] [--version=<version>] [--dry-run] OPTIONS [<plugin>...] One or more plugins to update. [--all] If set, all plugins that have updates will be updated. : WP-CLI in detail
  • 21. $ wp plugin update evil-plugin WP-CLI in detail command subcommand option/parameter Installing evil-plugin Downloading install package from https://downloads.wordpress.org/plugin/evil-plugin.zip... Unpacking the package... Installing the plugin... Removing the old version of the plugin... Plugin updated successfully. Success: Updated 1 of 1 plugins.
  • 22. $ wp plugin update --all $ wp theme update --all $ wp core update $ wp plugin update --all && wp theme update --all && wp core update WP-CLI in detail $ wp db export
  • 23. $ wp search-replace ‘http://tst.com’ ‘https://tst.com’ --dry-run +--------------------+-----------------------+--------------+------+ | Table | Column | Replacements | Type | +--------------------+-----------------------+--------------+------+ | main_options | option_value | 21 | PHP | | main_options | autoload | 0 | SQL | | main_postmeta | meta_key | 0 | SQL | | main_postmeta | meta_value | 252 | PHP | | main_posts | post_content | 1869 | SQL | | main_posts | post_title | 0 | SQL | | main_posts | post_excerpt | 0 | SQL | | main_users | display_name | 0 | SQL | +--------------------+-----------------------+--------------+------+ Success: 2142 replacements to be made. WP-CLI in actie
  • 24. Dankzij WP-CLI meer tijd voor de leuke dingen