SlideShare a Scribd company logo
#wpewebinar
Improve Your Workflows via SSH Gateway
Jose De La Rosa and Scott Amerman, WP Engine
April 18, 2018
Developers, Be a Bada$$ with WP-CLI
#wpewebinar
What You’ll Learn
● What is WP-CLI?
● Top use cases for WP-CLI
● Top WP Engine support issues now self-serve
● Productivity tips for WP-CLI
● How to get started
● Q&A
#wpewebinar
Ask questions as we go.
We’ll answer as many questions as we can after
the presentation
Slides and recording will be
made available shortly after
the webinar
Use the “Questions” pane
throughout the webinar
#wpewebinar
Level 2 Customer Support, Sr.
WP Engine
Jose De La Rosa
● Plays the trumpet
● Studied biochemistry in college
● Big fan of cold brew coffee
Sr. Product Marketing Manager
WP Engine
Scott Amerman
● Minor villain in movie Spare Parts
● Worked in neuroprosthetics
● Brews hard cider
#wpewebinar
Poll: Have you ever used
WP-CLI?
#wpewebinar
What is WP-CLI?
Developers, Be a Bada$$ with WP-CLI
Developers, Be a Bada$$ with WP-CLI
Developers, Be a Bada$$ with WP-CLI
#wpewebinar
Available tools
#wpewebinar
Anatomy of a command
wp plugin install amazon-polly --activate
argument options/flagscommand
#wpewebinar
Top Use Cases
#wpewebinar
Setup new sites quickly
Maintain multiple sites easily
Troubleshoot WordPress faster
Database admin
Working with WP-CLI packages
Top use cases
#wpewebinar
Installing WP-CLI locally allows you to remotely execute commands from your machine. WordPress.org recommends you install this
by downloading the Phar build and adding it to your machine’s path.
You can then create a config file allows you defines aliases such as production, dev, and all.
How to move files between local machine and the Gateway
# copying a single file from local to the Gateway
$ rsync data-dump.csv jrdelarosa2@jrdelarosa2.ssh.wpengine.net:/home/wpe-user/sites/jrdelarosa2/_wpeprivate
# copying an entire directory from local to the Gateway
$ rsync -v customer_exports/
jrdelarosa2@jrdelarosa2.ssh.wpengine.net:/home/wpe-user/sites/jrdelarosa2/_wpeprivate/customer_exports
Ways to increase your productivity before you even make your first command
Before you start
#wpewebinar
It’s important to note that WP-CLI has a lot of great built in documentation, via wp help command
# install and activate my favorite plugins on my new install
$ wp plugin install woocommerce jetpack wordpress-seo --activate
*# import a list of users from a CSV, don’t update existing users
$ wp user import-csv users.csv --skip-update
We can even create a config file that defines aliases such as production, dev, and all!
* # use a local config file to install and activate themes on multiple installs
$ wp @all theme install twentythirteen --activate
By using a WP CLI, we can quickly perform common tasks like installing plugins, importing users, and
adding a theme to a group of sites
Setting up sites quickly
#wpewebinar
Poll: How many sites are you
managing at any point in
time?
#wpewebinar
# check to see which of my active plugins have updates pending
$ wp plugin list --update=available --status=active
* # update all plugins, except WooCommerce and WordPress SEO
$ wp @dev plugin update --all --except=woocommerce,wordpress-seo
# delete the user associated with ID 123 and assign posts to user 567
wp user delete 123 --reassign 567
# delete all comments that have been flagged as spam
wp comment delete `wp comment list --status=spam --format=ids`
Maintaining sites easier
Perform common maintenance tasks around things like plugin updates, user permissions, and
comment moderation
#wpewebinar
Use WordPress debug statements to generate and actively
monitor a log file
Luckily WordPress has some built in debug tools that facilitate troubleshooting. The following two statements, when added to your
wp-config.php will generate a useful debug log!
define( 'WP_DEBUG', true );
define('WP_DEBUG_LOG', true);
Now, as errors come in they will be added to the debug.log file which can be found in your wp-content directory. You would expect to
see something like:
[13-Apr-2018 18:34:23 UTC] PHP Warning: include(fake.php): failed to open stream: No such file or directory
in /nas/content/live/jrdelarosa2/index.php on line 18
[13-Apr-2018 18:34:23 UTC] PHP Warning: include(): Failed opening 'fake.php' for inclusion
(include_path='.:/usr/share/pear/php:/usr/share/php:/usr/share/pear') in
/nas/content/live/jrdelarosa2/index.php on line 18
Troubleshooting sites
#wpewebinar
There are times when you are troubleshooting problems, where you might want to deactivate plugins one at a time
# create list of plugins
wp plugin list --status=active --skip-plugins --field=name > /tmp/plugin-list.txt
# loop through the plugin list created. Deactivate each one for 60 seconds before reactivating
while read -r plugin
do
echo "--------------------------------------------------------------"
echo "Deactivating-$plugin"
wp plugin deactivate $plugin --skip-plugins
sleep 60
echo "Reactivating-$plugin"
wp plugin activate $plugin --skip-plugins
done < /tmp/plugin-list.txt
Use Bash to iteratively deactivate plugins to find a conflict
Troubleshooting sites
#wpewebinar
*# export a database dump to your local machine
$ DATE=`date +%Y-%m-%d`; wp @prod db export - >
wp_jrdelarosa2_$DATE.sql
*# run WP-CLI search and replace (often useful when adding SSL to a site)
$ wp search-replace “http://jrdelarosa2.wpengine.com”
“https://jrdelarosa2.wpengine.com” --precise --all-tables
--skip-columns=guid
# delete revisions from database
$ wp post delete `wp post list --post_type=revision --format=ids`
A few useful commands that help with database maintenance
Database administration
#wpewebinar
# wp-cli-login-command allows you to login to WordPress with secure passwordless magic links
- $ wp package install aaemnnosttv/wp-cli-login-command
- $ wp login create <USER>
# wp-checksum allows you to run checksums on your themes and plugins
- $ wp package install eriktorsner/wp-checksum
- $ wp checksum all
# wp-sec allows you to check your WordPress install for CVE security issues reported at wpvulndb.com
- $ wp package install markri/wp-sec
- $ wp wp-sec check --type=core
- $ wp wp-sec check --type=all
How to work with WP-CLI packages
Packages are a great way to extend the functionality of WP-CLI
#wpewebinar
Inquiring minds want to know.
Questions and Answers.
* Slides, recording and resources will be made available within
the next several days
#wpewebinar
YAML Config File
Resources.
Getting Started with SSH Gateway
SSH Key Management for Shell Access
SSH Gateway FAQ
Docs on Installing WP-CLI
WP-CLI Package Index
WP-CLI Login Command WP Checksum WP Sec
Demo Video -- WP-CLI in Action
#wpewebinar
Next Up.
Register Now:
http://wpeng.in/
pretty
Wednesday, May 2
11:00 a.m. CDT,
12:00 p.m. EDT,
9:00 a.m. PDT,
16:00 UTC/GMT
#wpewebinar
How helpful?
How to improve?
Future topics?
Help us get better.
How helpful?
How to improve?
Future topics?
#wpewebinar
Thank You.

More Related Content

What's hot (20)

PDF
The wp config.php
Anthony Montalbano
 
PDF
Improving WordPress performance (xdebug and profiling)
Otto Kekäläinen
 
PDF
Creating Your First WordPress Plugin
Brad Williams
 
PDF
Modern Web Application Development Workflow - EclipseCon France 2014
Stéphane Bégaudeau
 
PDF
Using composer with WordPress
Micah Wood
 
PDF
Modern Web Application Development Workflow - EclipseCon US 2014
Stéphane Bégaudeau
 
PDF
WPDay Bologna 2013
Danilo Ercoli
 
PDF
Modern Web Applications Utilizing HTML5 (Dev Con TLV 06-2013)
Ido Green
 
PDF
WordPress plugin development
Luc De Brouwer
 
ODP
WordPress Plugin Development For Beginners
johnpbloch
 
PPTX
Take Command of WordPress With WP-CLI
Diana Thompson
 
PPTX
Getting started with WordPress development
Steve Mortiboy
 
PDF
WordPress Realtime - WordCamp São Paulo 2015
Fernando Daciuk
 
PDF
Creating a full stack web app with python, npm, webpack and react
Angela Kristine Juvet Branaes
 
PPTX
Take Command of WordPress With WP-CLI at WordCamp Long Beach
Diana Thompson
 
PPTX
Use Symfony2 components inside WordPress
Maurizio Pelizzone
 
PDF
PHP SA 2014 - Releasing Your Open Source Project
xsist10
 
PDF
Automatic testing and quality assurance for WordPress plugins and themes
Otto Kekäläinen
 
PPTX
Anthony Somerset - Site Speed = Success!
WordCamp Cape Town
 
The wp config.php
Anthony Montalbano
 
Improving WordPress performance (xdebug and profiling)
Otto Kekäläinen
 
Creating Your First WordPress Plugin
Brad Williams
 
Modern Web Application Development Workflow - EclipseCon France 2014
Stéphane Bégaudeau
 
Using composer with WordPress
Micah Wood
 
Modern Web Application Development Workflow - EclipseCon US 2014
Stéphane Bégaudeau
 
WPDay Bologna 2013
Danilo Ercoli
 
Modern Web Applications Utilizing HTML5 (Dev Con TLV 06-2013)
Ido Green
 
WordPress plugin development
Luc De Brouwer
 
WordPress Plugin Development For Beginners
johnpbloch
 
Take Command of WordPress With WP-CLI
Diana Thompson
 
Getting started with WordPress development
Steve Mortiboy
 
WordPress Realtime - WordCamp São Paulo 2015
Fernando Daciuk
 
Creating a full stack web app with python, npm, webpack and react
Angela Kristine Juvet Branaes
 
Take Command of WordPress With WP-CLI at WordCamp Long Beach
Diana Thompson
 
Use Symfony2 components inside WordPress
Maurizio Pelizzone
 
PHP SA 2014 - Releasing Your Open Source Project
xsist10
 
Automatic testing and quality assurance for WordPress plugins and themes
Otto Kekäläinen
 
Anthony Somerset - Site Speed = Success!
WordCamp Cape Town
 

Similar to Developers, Be a Bada$$ with WP-CLI (20)

PDF
Introduction to WP-CLI: Manage WordPress from the command line
Behzod Saidov
 
PPTX
WordPress CLI in-depth
Sanjay Willie
 
PDF
WordCamp Vancouver 2012 - Manage WordPress with Awesome using wp-cli
GetSource
 
PDF
A Better WordPress Workflow with WP-CLI
Rikesh Ramlochund
 
PDF
The WP Engine Developer Experience. Increased agility, improved efficiency.
WP Engine
 
PPTX
WP-CLI: WordCamp NYC 2015
Terell Moore
 
PDF
Manage WordPress with Awesome using wp cli
GetSource
 
PDF
WP-CLI Talk from WordCamp Montreal
Shawn Hooper
 
PPTX
Aditya Shah - WPCLI - WordCamp Asia
Aditya Shah
 
PDF
Getting Started with WP-CLI, a tool to automate your life
AJ Morris
 
PDF
Save Time by Managing WordPress from the Command Line
Shawn Hooper
 
PDF
Command Line WordPress with WP-CLI
James Collins
 
PDF
WP-CLI - WordCamp Miami 2015
Shawn Hooper
 
PPTX
WP-CLI: WordCamp Nashville 2016
Terell Moore
 
ODP
Administer WordPress with WP-CLI
Suwash Kunwar
 
PDF
WordPress and The Command Line
Kelly Dwan
 
PDF
The Themer's Guide to WP-CLI
Edmund Turbin
 
PDF
The Themer's Guide to WP-CLI
Edmund Turbin
 
PDF
Migrating a Site Quickly with SSH and WP-CLI (It's not as scary as you think!)
Japheth Thomson
 
PDF
Command Line WordPress with WP-CLI - WordPress Perth User Group
James Collins
 
Introduction to WP-CLI: Manage WordPress from the command line
Behzod Saidov
 
WordPress CLI in-depth
Sanjay Willie
 
WordCamp Vancouver 2012 - Manage WordPress with Awesome using wp-cli
GetSource
 
A Better WordPress Workflow with WP-CLI
Rikesh Ramlochund
 
The WP Engine Developer Experience. Increased agility, improved efficiency.
WP Engine
 
WP-CLI: WordCamp NYC 2015
Terell Moore
 
Manage WordPress with Awesome using wp cli
GetSource
 
WP-CLI Talk from WordCamp Montreal
Shawn Hooper
 
Aditya Shah - WPCLI - WordCamp Asia
Aditya Shah
 
Getting Started with WP-CLI, a tool to automate your life
AJ Morris
 
Save Time by Managing WordPress from the Command Line
Shawn Hooper
 
Command Line WordPress with WP-CLI
James Collins
 
WP-CLI - WordCamp Miami 2015
Shawn Hooper
 
WP-CLI: WordCamp Nashville 2016
Terell Moore
 
Administer WordPress with WP-CLI
Suwash Kunwar
 
WordPress and The Command Line
Kelly Dwan
 
The Themer's Guide to WP-CLI
Edmund Turbin
 
The Themer's Guide to WP-CLI
Edmund Turbin
 
Migrating a Site Quickly with SSH and WP-CLI (It's not as scary as you think!)
Japheth Thomson
 
Command Line WordPress with WP-CLI - WordPress Perth User Group
James Collins
 
Ad

More from WP Engine (20)

PDF
More Dev. Less Drama.pdf
WP Engine
 
PDF
Why the Edge Isn't an Edge Case.pdf
WP Engine
 
PDF
Post eCommerce Site Launch- Optimizing Your Conversion Rate.pdf
WP Engine
 
PDF
Demo - New Features for Atlas.pdf
WP Engine
 
PDF
Debunking The Myths of Migration.pdf
WP Engine
 
PDF
Keeping Your WordPress Sites Safe Amidst A Rise in Global Cyberattacks.pdf
WP Engine
 
PDF
Building WordPress eCommerce at Scale .pdf
WP Engine
 
PDF
When to Choose Headless for Clients.pdf
WP Engine
 
PDF
Best Practices for Site Deployment With Local.pdf
WP Engine
 
PDF
Site Monitoring: The Intersection of Product, UX Design & Research .pdf
WP Engine
 
PDF
Front End: Building Future-Proof eCommerce Sites.pdf
WP Engine
 
PDF
Gutenberg and Headless WordPress.pdf
WP Engine
 
PDF
Blueprints and Other Local Features for Agencies.pdf
WP Engine
 
PDF
Modern Theming & The Future of WordPress- Working with Full Site Editing and ...
WP Engine
 
PDF
6 WooCommerce Dev Tricks for Building Fast eCommerce Websites.pdf
WP Engine
 
PDF
Headless 101 for WordPress Developers.pdf
WP Engine
 
PDF
Be the Change: The Future of WordPress with WP Engine's Developer Relations Team
WP Engine
 
PDF
An Atlas of Atlas.pdf
WP Engine
 
PDF
2022 – Year of the WordPress Developer.pdf
WP Engine
 
PDF
Using WooCommerce to Scale Your Store
WP Engine
 
More Dev. Less Drama.pdf
WP Engine
 
Why the Edge Isn't an Edge Case.pdf
WP Engine
 
Post eCommerce Site Launch- Optimizing Your Conversion Rate.pdf
WP Engine
 
Demo - New Features for Atlas.pdf
WP Engine
 
Debunking The Myths of Migration.pdf
WP Engine
 
Keeping Your WordPress Sites Safe Amidst A Rise in Global Cyberattacks.pdf
WP Engine
 
Building WordPress eCommerce at Scale .pdf
WP Engine
 
When to Choose Headless for Clients.pdf
WP Engine
 
Best Practices for Site Deployment With Local.pdf
WP Engine
 
Site Monitoring: The Intersection of Product, UX Design & Research .pdf
WP Engine
 
Front End: Building Future-Proof eCommerce Sites.pdf
WP Engine
 
Gutenberg and Headless WordPress.pdf
WP Engine
 
Blueprints and Other Local Features for Agencies.pdf
WP Engine
 
Modern Theming & The Future of WordPress- Working with Full Site Editing and ...
WP Engine
 
6 WooCommerce Dev Tricks for Building Fast eCommerce Websites.pdf
WP Engine
 
Headless 101 for WordPress Developers.pdf
WP Engine
 
Be the Change: The Future of WordPress with WP Engine's Developer Relations Team
WP Engine
 
An Atlas of Atlas.pdf
WP Engine
 
2022 – Year of the WordPress Developer.pdf
WP Engine
 
Using WooCommerce to Scale Your Store
WP Engine
 
Ad

Recently uploaded (20)

PPTX
L1A Season 1 ENGLISH made by A hegy fixed
toszolder91
 
PDF
BRKACI-1003 ACI Brownfield Migration - Real World Experiences and Best Practi...
fcesargonca
 
PPTX
Orchestrating things in Angular application
Peter Abraham
 
PPTX
Metaphysics_Presentation_With_Visuals.pptx
erikjohnsales1
 
PPTX
Softuni - Psychology of entrepreneurship
Kalin Karakehayov
 
PDF
Enhancing Parental Roles in Protecting Children from Online Sexual Exploitati...
ICT Frame Magazine Pvt. Ltd.
 
PDF
BRKAPP-1102 - Proactive Network and Application Monitoring.pdf
fcesargonca
 
PDF
Cleaning up your RPKI invalids, presented at PacNOG 35
APNIC
 
PPTX
Networking_Essentials_version_3.0_-_Module_3.pptx
ryan622010
 
PDF
Top 10 Testing Procedures to Ensure Your Magento to Shopify Migration Success...
CartCoders
 
PPTX
法国巴黎第二大学本科毕业证{Paris 2学费发票Paris 2成绩单}办理方法
Taqyea
 
PPTX
PHIPA-Compliant Web Hosting in Toronto: What Healthcare Providers Must Know
steve198109
 
PPTX
04 Output 1 Instruments & Tools (3).pptx
GEDYIONGebre
 
PDF
FutureCon Seattle 2025 Presentation Slides - You Had One Job
Suzanne Aldrich
 
PDF
The Internet - By the numbers, presented at npNOG 11
APNIC
 
PPTX
Networking_Essentials_version_3.0_-_Module_5.pptx
ryan622010
 
DOCX
Custom vs. Off-the-Shelf Banking Software
KristenCarter35
 
PDF
Boardroom AI: The Next 10 Moves | Cerebraix Talent Tech
ssuser73bdb11
 
PPTX
Lec15_Mutability Immutability-converted.pptx
khanjahanzaib1
 
PDF
Digital burnout toolkit for youth workers and teachers
asociatiastart123
 
L1A Season 1 ENGLISH made by A hegy fixed
toszolder91
 
BRKACI-1003 ACI Brownfield Migration - Real World Experiences and Best Practi...
fcesargonca
 
Orchestrating things in Angular application
Peter Abraham
 
Metaphysics_Presentation_With_Visuals.pptx
erikjohnsales1
 
Softuni - Psychology of entrepreneurship
Kalin Karakehayov
 
Enhancing Parental Roles in Protecting Children from Online Sexual Exploitati...
ICT Frame Magazine Pvt. Ltd.
 
BRKAPP-1102 - Proactive Network and Application Monitoring.pdf
fcesargonca
 
Cleaning up your RPKI invalids, presented at PacNOG 35
APNIC
 
Networking_Essentials_version_3.0_-_Module_3.pptx
ryan622010
 
Top 10 Testing Procedures to Ensure Your Magento to Shopify Migration Success...
CartCoders
 
法国巴黎第二大学本科毕业证{Paris 2学费发票Paris 2成绩单}办理方法
Taqyea
 
PHIPA-Compliant Web Hosting in Toronto: What Healthcare Providers Must Know
steve198109
 
04 Output 1 Instruments & Tools (3).pptx
GEDYIONGebre
 
FutureCon Seattle 2025 Presentation Slides - You Had One Job
Suzanne Aldrich
 
The Internet - By the numbers, presented at npNOG 11
APNIC
 
Networking_Essentials_version_3.0_-_Module_5.pptx
ryan622010
 
Custom vs. Off-the-Shelf Banking Software
KristenCarter35
 
Boardroom AI: The Next 10 Moves | Cerebraix Talent Tech
ssuser73bdb11
 
Lec15_Mutability Immutability-converted.pptx
khanjahanzaib1
 
Digital burnout toolkit for youth workers and teachers
asociatiastart123
 

Developers, Be a Bada$$ with WP-CLI

  • 1. #wpewebinar Improve Your Workflows via SSH Gateway Jose De La Rosa and Scott Amerman, WP Engine April 18, 2018 Developers, Be a Bada$$ with WP-CLI
  • 2. #wpewebinar What You’ll Learn ● What is WP-CLI? ● Top use cases for WP-CLI ● Top WP Engine support issues now self-serve ● Productivity tips for WP-CLI ● How to get started ● Q&A
  • 3. #wpewebinar Ask questions as we go. We’ll answer as many questions as we can after the presentation Slides and recording will be made available shortly after the webinar Use the “Questions” pane throughout the webinar
  • 4. #wpewebinar Level 2 Customer Support, Sr. WP Engine Jose De La Rosa ● Plays the trumpet ● Studied biochemistry in college ● Big fan of cold brew coffee Sr. Product Marketing Manager WP Engine Scott Amerman ● Minor villain in movie Spare Parts ● Worked in neuroprosthetics ● Brews hard cider
  • 5. #wpewebinar Poll: Have you ever used WP-CLI?
  • 11. #wpewebinar Anatomy of a command wp plugin install amazon-polly --activate argument options/flagscommand
  • 13. #wpewebinar Setup new sites quickly Maintain multiple sites easily Troubleshoot WordPress faster Database admin Working with WP-CLI packages Top use cases
  • 14. #wpewebinar Installing WP-CLI locally allows you to remotely execute commands from your machine. WordPress.org recommends you install this by downloading the Phar build and adding it to your machine’s path. You can then create a config file allows you defines aliases such as production, dev, and all. How to move files between local machine and the Gateway # copying a single file from local to the Gateway $ rsync data-dump.csv [email protected]:/home/wpe-user/sites/jrdelarosa2/_wpeprivate # copying an entire directory from local to the Gateway $ rsync -v customer_exports/ [email protected]:/home/wpe-user/sites/jrdelarosa2/_wpeprivate/customer_exports Ways to increase your productivity before you even make your first command Before you start
  • 15. #wpewebinar It’s important to note that WP-CLI has a lot of great built in documentation, via wp help command # install and activate my favorite plugins on my new install $ wp plugin install woocommerce jetpack wordpress-seo --activate *# import a list of users from a CSV, don’t update existing users $ wp user import-csv users.csv --skip-update We can even create a config file that defines aliases such as production, dev, and all! * # use a local config file to install and activate themes on multiple installs $ wp @all theme install twentythirteen --activate By using a WP CLI, we can quickly perform common tasks like installing plugins, importing users, and adding a theme to a group of sites Setting up sites quickly
  • 16. #wpewebinar Poll: How many sites are you managing at any point in time?
  • 17. #wpewebinar # check to see which of my active plugins have updates pending $ wp plugin list --update=available --status=active * # update all plugins, except WooCommerce and WordPress SEO $ wp @dev plugin update --all --except=woocommerce,wordpress-seo # delete the user associated with ID 123 and assign posts to user 567 wp user delete 123 --reassign 567 # delete all comments that have been flagged as spam wp comment delete `wp comment list --status=spam --format=ids` Maintaining sites easier Perform common maintenance tasks around things like plugin updates, user permissions, and comment moderation
  • 18. #wpewebinar Use WordPress debug statements to generate and actively monitor a log file Luckily WordPress has some built in debug tools that facilitate troubleshooting. The following two statements, when added to your wp-config.php will generate a useful debug log! define( 'WP_DEBUG', true ); define('WP_DEBUG_LOG', true); Now, as errors come in they will be added to the debug.log file which can be found in your wp-content directory. You would expect to see something like: [13-Apr-2018 18:34:23 UTC] PHP Warning: include(fake.php): failed to open stream: No such file or directory in /nas/content/live/jrdelarosa2/index.php on line 18 [13-Apr-2018 18:34:23 UTC] PHP Warning: include(): Failed opening 'fake.php' for inclusion (include_path='.:/usr/share/pear/php:/usr/share/php:/usr/share/pear') in /nas/content/live/jrdelarosa2/index.php on line 18 Troubleshooting sites
  • 19. #wpewebinar There are times when you are troubleshooting problems, where you might want to deactivate plugins one at a time # create list of plugins wp plugin list --status=active --skip-plugins --field=name > /tmp/plugin-list.txt # loop through the plugin list created. Deactivate each one for 60 seconds before reactivating while read -r plugin do echo "--------------------------------------------------------------" echo "Deactivating-$plugin" wp plugin deactivate $plugin --skip-plugins sleep 60 echo "Reactivating-$plugin" wp plugin activate $plugin --skip-plugins done < /tmp/plugin-list.txt Use Bash to iteratively deactivate plugins to find a conflict Troubleshooting sites
  • 20. #wpewebinar *# export a database dump to your local machine $ DATE=`date +%Y-%m-%d`; wp @prod db export - > wp_jrdelarosa2_$DATE.sql *# run WP-CLI search and replace (often useful when adding SSL to a site) $ wp search-replace “http://jrdelarosa2.wpengine.com” “https://jrdelarosa2.wpengine.com” --precise --all-tables --skip-columns=guid # delete revisions from database $ wp post delete `wp post list --post_type=revision --format=ids` A few useful commands that help with database maintenance Database administration
  • 21. #wpewebinar # wp-cli-login-command allows you to login to WordPress with secure passwordless magic links - $ wp package install aaemnnosttv/wp-cli-login-command - $ wp login create <USER> # wp-checksum allows you to run checksums on your themes and plugins - $ wp package install eriktorsner/wp-checksum - $ wp checksum all # wp-sec allows you to check your WordPress install for CVE security issues reported at wpvulndb.com - $ wp package install markri/wp-sec - $ wp wp-sec check --type=core - $ wp wp-sec check --type=all How to work with WP-CLI packages Packages are a great way to extend the functionality of WP-CLI
  • 22. #wpewebinar Inquiring minds want to know. Questions and Answers. * Slides, recording and resources will be made available within the next several days
  • 23. #wpewebinar YAML Config File Resources. Getting Started with SSH Gateway SSH Key Management for Shell Access SSH Gateway FAQ Docs on Installing WP-CLI WP-CLI Package Index WP-CLI Login Command WP Checksum WP Sec Demo Video -- WP-CLI in Action
  • 25. #wpewebinar How helpful? How to improve? Future topics? Help us get better. How helpful? How to improve? Future topics?