SlideShare a Scribd company logo
Make Your Life Easier 
With WP-CLI
About Me 
WordCamp Montreal - August 2014 
• Web developer with over 
15 years of experience. 
• Senior Web Developer at 
Carleton University in 
Ottawa, Ontario. 
• Developing for WordPress 
for since 2005.
About Carleton 
• Over 26,000 students and 4,000 Staff. 
WordCamp Montreal - August 2014 
• Over 250 WordPress sites. 
• More than a million page views per month. 
• Small team who are responsible for the 
support, maintenance and training for all 
WordPress powered sites on campus. 
• WP-CLI, along with other tools helps us do this 
with a relatively small team.
What is WP-CLI? 
A super awesome open-source tool to manage your 
WordPress installations. 
http://wp-cli.org/! 
WordCamp Montreal - August 2014
Why? 
Simple and faster then traditional methods 
Automate and script common tasks 
Efficient (uses WordPress to perform operations) 
Extensible (user contributed commands / custom 
commands) 
WordCamp Montreal - August 2014
What’s Required 
SSH access to your WordPress install's directory 
PHP 5.3+ 
WordPress 3.3+ 
Enough server memory for shell processes to run 
WordPress 
WordCamp Montreal - August 2014
WordCamp Montreal - August 2014
Fear Not! 
Read a few simple guides about SSH and learn 
basic commands: 
How to SSH: http://code.tutsplus.com/tutorials/ 
ssh-what-and-how--net-25138 
Basic Commands: http://www.servermom.org/top-most- 
used-common-ssh-commands/56/ 
WordCamp Montreal - August 2014
Installing WP-CLI 
Instructions at: http://wp-cli.org/ 
Hosts with WP-CLI pre-installed: https:// 
github.com/wp-cli/wp-cli/wiki/List-of-hosting-companies 
WordCamp Montreal - August 2014
What Can It Do? 
All the things. 
WordCamp Montreal - August 2014
Anatomy of a Command 
wp generate posts --count=500! 
“generate” is the command 
“posts” is the subcommand 
“count” is a parameter 
WordCamp Montreal - August 2014
Global Command Parameters 
The following parameters can be passed to any command: 
--user = set the current user 
--url = set the current URL 
--path = set the current path to the WP install 
--require = load a file before running the command 
--versionprint = WP-CLI version 
WordCamp Montreal - August 2014
Manage Core 
wp core download! 
wp core config --dbname=testing --dbuser=wp! 
wp core update! 
wp core update-db! 
wp core multisite-convert! 
WordCamp Montreal - August 2014
Manage Plugins 
wp plugin update --all! 
wp plugin install bbpress --activate! 
wp plugin uninstall hello! 
wp plugin delete hello! 
WordCamp Montreal - August 2014
Search & Replace 
wp search-replace 'http://example.dev' 'http:// 
example.com' --skip-columns=guid! 
wp search-replace 'foo' 'bar' wp_posts 
wp_postmeta wp_terms --dry-run! 
WP-CLI will correctly handle serialized values, and will 
not change primary key values. 
WordCamp Montreal - August 2014
Database Import / Export 
wp db export mybackup.sql! 
wp db import mybackup.sql! 
WordCamp Montreal - August 2014 
!
Manage Media / Dummy Data 
wp media regenerate —yes! 
wp generate posts --count=500! 
wp generate users --role=contributor! 
WordCamp Montreal - August 2014 
!
So Much More 
A full list of commands is available with full 
documentation and examples: 
http://wp-cli.org/commands/ 
WordCamp Montreal - August 2014 
!
Custom Commands 
Site specific tasks 
One-off fixes / Annoying client requests 
Commands that don’t currently exist 
There is a large list of community commands: 
http://wp-cli.org/package-index/ 
WordCamp Montreal - August 2014
Lets Make a Plugin 
WordCamp Montreal - August 2014
Defining a Command 
I use sub-commands to keep things organized. 
WordCamp Montreal - August 2014
Subcommand 
$args: stand-alone arguments 
$assoc_args: --arg=value in associative array 
wp example example-command Hello World --param=Hello! 
$args[0] == ‘Hello’ 
$args[1] == ‘World’ 
$assoc_args[‘param’] == ‘Hello’ 
WordCamp Montreal - August 2014
Example Command 
Let’s see some code! 
Basics / PHPDoc Guide: https://github.com/wp-cli/wp-cli/ 
wiki/Commands-Cookbook 
WP-CLI API: https://github.com/wp-cli/wp-cli/wiki/API 
WP-CLI Example Code: https://github.com/cuweb/wp-cli 
WordCamp Montreal - August 2014
Resources 
http://wp-cli.org/ 
http://code.tutsplus.com/tutorials/ssh-what-and-how--net-25138 
http://www.servermom.org/top-most-used-common-ssh-commands/56/ 
https://github.com/wp-cli/wp-cli/wiki/List-of-hosting-companies 
http://wp-cli.org/commands/ 
https://github.com/wp-cli/wp-cli/wiki 
https://github.com/cuweb/wp-cli 
WordCamp Montreal - August 2014
Questions?

More Related Content

What's hot

codeigniter
codeignitercodeigniter
codeigniter
Mohamed Syam
 
WordPress, React, oh my! (DevelCZ 2016)
WordPress, React, oh my! (DevelCZ 2016)WordPress, React, oh my! (DevelCZ 2016)
WordPress, React, oh my! (DevelCZ 2016)
Borek Bernard
 
Working in harmony
Working in harmonyWorking in harmony
Working in harmony
Edmund Turbin
 
Next generation WordPress developement... today
Next generation WordPress developement... todayNext generation WordPress developement... today
Next generation WordPress developement... today
flowcom
 
DevOps For Small Teams
DevOps For Small TeamsDevOps For Small Teams
DevOps For Small Teams
Joe Ferguson
 
Wordcamp Toronto Presentation
Wordcamp Toronto PresentationWordcamp Toronto Presentation
Wordcamp Toronto Presentation
Roy Sivan
 
Workshop On WP-CLI
Workshop On WP-CLIWorkshop On WP-CLI
Workshop On WP-CLI
Ajit Bohra
 
Working in Harmony: Manchester - Optimize development and content workflows
Working in Harmony: Manchester - Optimize development and content workflowsWorking in Harmony: Manchester - Optimize development and content workflows
Working in Harmony: Manchester - Optimize development and content workflows
Edmund Turbin
 
Ember addons, served three ways
Ember addons, served three waysEmber addons, served three ways
Ember addons, served three ways
Mike North
 
The Themer's Guide to WP-CLI
The Themer's Guide to WP-CLIThe Themer's Guide to WP-CLI
The Themer's Guide to WP-CLI
Edmund Turbin
 
Modern Web UI - Web components
Modern Web UI - Web componentsModern Web UI - Web components
Modern Web UI - Web components
Mike North
 
Brief Intro to Phoenix - Elixir Meetup at BukaLapak
Brief Intro to Phoenix - Elixir Meetup at BukaLapakBrief Intro to Phoenix - Elixir Meetup at BukaLapak
Brief Intro to Phoenix - Elixir Meetup at BukaLapak
Riza Fahmi
 
An Introduction to hapi.js
An Introduction to hapi.jsAn Introduction to hapi.js
An Introduction to hapi.js
Dave Stevens
 
Nürnberg WooCommerce Talk - 11/24/16
Nürnberg WooCommerce Talk - 11/24/16Nürnberg WooCommerce Talk - 11/24/16
Nürnberg WooCommerce Talk - 11/24/16
tshellberg
 
Modern infrastructure as code with ansible cake fest 2021
Modern infrastructure as code with ansible cake fest 2021Modern infrastructure as code with ansible cake fest 2021
Modern infrastructure as code with ansible cake fest 2021
Joe Ferguson
 
How to create your own WordPress plugin
How to create your own WordPress pluginHow to create your own WordPress plugin
How to create your own WordPress plugin
John Tighe
 
Slim PHP when you don't need the kitchen sink
Slim PHP   when you don't need the kitchen sinkSlim PHP   when you don't need the kitchen sink
Slim PHP when you don't need the kitchen sink
Joe Ferguson
 
Performance testing with VSTs on- and off-premises
Performance testing with VSTs on-  and off-premisesPerformance testing with VSTs on-  and off-premises
Performance testing with VSTs on- and off-premises
Jeff Bramwell
 
Convox - Develop and Deploy With Confidence and Ease
Convox - Develop and Deploy With Confidence and EaseConvox - Develop and Deploy With Confidence and Ease
Convox - Develop and Deploy With Confidence and Ease
Yuval Yatskan
 
Using a Private Git Server for Packaging Software
Using a Private Git Server for Packaging SoftwareUsing a Private Git Server for Packaging Software
Using a Private Git Server for Packaging Software
Chris Jean
 

What's hot (20)

codeigniter
codeignitercodeigniter
codeigniter
 
WordPress, React, oh my! (DevelCZ 2016)
WordPress, React, oh my! (DevelCZ 2016)WordPress, React, oh my! (DevelCZ 2016)
WordPress, React, oh my! (DevelCZ 2016)
 
Working in harmony
Working in harmonyWorking in harmony
Working in harmony
 
Next generation WordPress developement... today
Next generation WordPress developement... todayNext generation WordPress developement... today
Next generation WordPress developement... today
 
DevOps For Small Teams
DevOps For Small TeamsDevOps For Small Teams
DevOps For Small Teams
 
Wordcamp Toronto Presentation
Wordcamp Toronto PresentationWordcamp Toronto Presentation
Wordcamp Toronto Presentation
 
Workshop On WP-CLI
Workshop On WP-CLIWorkshop On WP-CLI
Workshop On WP-CLI
 
Working in Harmony: Manchester - Optimize development and content workflows
Working in Harmony: Manchester - Optimize development and content workflowsWorking in Harmony: Manchester - Optimize development and content workflows
Working in Harmony: Manchester - Optimize development and content workflows
 
Ember addons, served three ways
Ember addons, served three waysEmber addons, served three ways
Ember addons, served three ways
 
The Themer's Guide to WP-CLI
The Themer's Guide to WP-CLIThe Themer's Guide to WP-CLI
The Themer's Guide to WP-CLI
 
Modern Web UI - Web components
Modern Web UI - Web componentsModern Web UI - Web components
Modern Web UI - Web components
 
Brief Intro to Phoenix - Elixir Meetup at BukaLapak
Brief Intro to Phoenix - Elixir Meetup at BukaLapakBrief Intro to Phoenix - Elixir Meetup at BukaLapak
Brief Intro to Phoenix - Elixir Meetup at BukaLapak
 
An Introduction to hapi.js
An Introduction to hapi.jsAn Introduction to hapi.js
An Introduction to hapi.js
 
Nürnberg WooCommerce Talk - 11/24/16
Nürnberg WooCommerce Talk - 11/24/16Nürnberg WooCommerce Talk - 11/24/16
Nürnberg WooCommerce Talk - 11/24/16
 
Modern infrastructure as code with ansible cake fest 2021
Modern infrastructure as code with ansible cake fest 2021Modern infrastructure as code with ansible cake fest 2021
Modern infrastructure as code with ansible cake fest 2021
 
How to create your own WordPress plugin
How to create your own WordPress pluginHow to create your own WordPress plugin
How to create your own WordPress plugin
 
Slim PHP when you don't need the kitchen sink
Slim PHP   when you don't need the kitchen sinkSlim PHP   when you don't need the kitchen sink
Slim PHP when you don't need the kitchen sink
 
Performance testing with VSTs on- and off-premises
Performance testing with VSTs on-  and off-premisesPerformance testing with VSTs on-  and off-premises
Performance testing with VSTs on- and off-premises
 
Convox - Develop and Deploy With Confidence and Ease
Convox - Develop and Deploy With Confidence and EaseConvox - Develop and Deploy With Confidence and Ease
Convox - Develop and Deploy With Confidence and Ease
 
Using a Private Git Server for Packaging Software
Using a Private Git Server for Packaging SoftwareUsing a Private Git Server for Packaging Software
Using a Private Git Server for Packaging Software
 

Viewers also liked

Victory Six
Victory SixVictory Six
Victory Six
New Capital
 
Firpta
FirptaFirpta
Firpta
New Capital
 
El llano en llamas 2
El llano en llamas 2El llano en llamas 2
El llano en llamas 2
Julian Bermudez
 
CAMFIL Capability broschyr
CAMFIL Capability broschyrCAMFIL Capability broschyr
CAMFIL Capability broschyr
Kevin Bouah
 
El llano en llamas
El llano en llamasEl llano en llamas
El llano en llamas
Julian Bermudez
 
El llano en llamas
El llano en llamasEl llano en llamas
El llano en llamas
Julian Bermudez
 
The elements of scale
The elements of scaleThe elements of scale
The elements of scale
Fastly
 
Making ops life easier
Making ops life easierMaking ops life easier
Making ops life easier
Fastly
 
Know your resolvers
Know your resolversKnow your resolvers
Know your resolvers
Fastly
 
Building a better web
Building a better webBuilding a better web
Building a better web
Fastly
 
Addressing IPv6
Addressing IPv6Addressing IPv6
Addressing IPv6
Fastly
 
Advanced VCL: how to use restart
Advanced VCL: how to use restartAdvanced VCL: how to use restart
Advanced VCL: how to use restart
Fastly
 
Building Customer User Experiences from the Edge
Building Customer User Experiences from the EdgeBuilding Customer User Experiences from the Edge
Building Customer User Experiences from the Edge
Fastly
 
Progressive web apps
Progressive web appsProgressive web apps
Progressive web apps
Fastly
 
The future of the edge
The future of the edge The future of the edge
The future of the edge
Fastly
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCL
Fastly
 
HTTP/2: What no one is telling you
HTTP/2: What no one is telling youHTTP/2: What no one is telling you
HTTP/2: What no one is telling you
Fastly
 

Viewers also liked (17)

Victory Six
Victory SixVictory Six
Victory Six
 
Firpta
FirptaFirpta
Firpta
 
El llano en llamas 2
El llano en llamas 2El llano en llamas 2
El llano en llamas 2
 
CAMFIL Capability broschyr
CAMFIL Capability broschyrCAMFIL Capability broschyr
CAMFIL Capability broschyr
 
El llano en llamas
El llano en llamasEl llano en llamas
El llano en llamas
 
El llano en llamas
El llano en llamasEl llano en llamas
El llano en llamas
 
The elements of scale
The elements of scaleThe elements of scale
The elements of scale
 
Making ops life easier
Making ops life easierMaking ops life easier
Making ops life easier
 
Know your resolvers
Know your resolversKnow your resolvers
Know your resolvers
 
Building a better web
Building a better webBuilding a better web
Building a better web
 
Addressing IPv6
Addressing IPv6Addressing IPv6
Addressing IPv6
 
Advanced VCL: how to use restart
Advanced VCL: how to use restartAdvanced VCL: how to use restart
Advanced VCL: how to use restart
 
Building Customer User Experiences from the Edge
Building Customer User Experiences from the EdgeBuilding Customer User Experiences from the Edge
Building Customer User Experiences from the Edge
 
Progressive web apps
Progressive web appsProgressive web apps
Progressive web apps
 
The future of the edge
The future of the edge The future of the edge
The future of the edge
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCL
 
HTTP/2: What no one is telling you
HTTP/2: What no one is telling youHTTP/2: What no one is telling you
HTTP/2: What no one is telling you
 

Similar to Make your life easy with WP-CLI

Command Line WordPress with WP-CLI - WordPress Perth User Group
Command Line WordPress with WP-CLI - WordPress Perth User GroupCommand Line WordPress with WP-CLI - WordPress Perth User Group
Command Line WordPress with WP-CLI - WordPress Perth User Group
James Collins
 
Advanced WordPress Tooling: By InstaWP.com
Advanced WordPress Tooling: By InstaWP.comAdvanced WordPress Tooling: By InstaWP.com
Advanced WordPress Tooling: By InstaWP.com
InstaWP Inc
 
WordPress London Developer Operations For Beginners
WordPress London Developer Operations For BeginnersWordPress London Developer Operations For Beginners
WordPress London Developer Operations For Beginners
Stewart Ritchie
 
PHP on Windows and on Azure
PHP on Windows and on AzurePHP on Windows and on Azure
PHP on Windows and on Azure
Maarten Balliauw
 
Developers, Be a Bada$$ with WP-CLI
Developers, Be a Bada$$ with WP-CLIDevelopers, Be a Bada$$ with WP-CLI
Developers, Be a Bada$$ with WP-CLI
WP Engine
 
WordPress and The Command Line
WordPress and The Command LineWordPress and The Command Line
WordPress and The Command Line
Kelly Dwan
 
PHP as a Service TDC2019
PHP as a Service TDC2019PHP as a Service TDC2019
PHP as a Service TDC2019
Paulo Victor Gomes
 
WordPress Continuous Maintenance
WordPress Continuous MaintenanceWordPress Continuous Maintenance
WordPress Continuous Maintenance
Olaf Lindström
 
Session: WP Site Management using WP-CLI from Scratch
Session: WP Site Management using WP-CLI from ScratchSession: WP Site Management using WP-CLI from Scratch
Session: WP Site Management using WP-CLI from Scratch
Roald Umandal
 
WordPress CLI in-depth
WordPress CLI in-depthWordPress CLI in-depth
WordPress CLI in-depth
Sanjay Willie
 
Save Time by Managing WordPress from the Command Line
Save Time by Managing WordPress from the Command LineSave Time by Managing WordPress from the Command Line
Save Time by Managing WordPress from the Command Line
Shawn Hooper
 
Mark Wall - F5 Agility 2017 - F5 Automation The Journey - PPT
Mark Wall - F5 Agility 2017 - F5 Automation The Journey - PPTMark Wall - F5 Agility 2017 - F5 Automation The Journey - PPT
Mark Wall - F5 Agility 2017 - F5 Automation The Journey - PPT
Mark Wall
 
F5 Automation - The Journey
F5 Automation - The JourneyF5 Automation - The Journey
F5 Automation - The Journey
World Wide Technology
 
Take Command of WordPress With WP-CLI
Take Command of WordPress With WP-CLITake Command of WordPress With WP-CLI
Take Command of WordPress With WP-CLI
Diana Thompson
 
PHP on Windows
PHP on WindowsPHP on Windows
PHP on Windows
Maarten Balliauw
 
PHP on Windows
PHP on WindowsPHP on Windows
PHP on Windows
guest60c7659
 
stackconf 2020 | Enterprise CI/CD Integration Testing Environments Done Right...
stackconf 2020 | Enterprise CI/CD Integration Testing Environments Done Right...stackconf 2020 | Enterprise CI/CD Integration Testing Environments Done Right...
stackconf 2020 | Enterprise CI/CD Integration Testing Environments Done Right...
NETWAYS
 
WP-CLI: WordCamp NYC 2015
WP-CLI: WordCamp NYC 2015WP-CLI: WordCamp NYC 2015
WP-CLI: WordCamp NYC 2015
Terell Moore
 
Modern Web Development with Perl
Modern Web Development with PerlModern Web Development with Perl
Modern Web Development with Perl
Dave Cross
 
Just Another Word Press Weblog But More Cloudy
Just Another Word Press Weblog   But More CloudyJust Another Word Press Weblog   But More Cloudy
Just Another Word Press Weblog But More Cloudy
Maarten Balliauw
 

Similar to Make your life easy with WP-CLI (20)

Command Line WordPress with WP-CLI - WordPress Perth User Group
Command Line WordPress with WP-CLI - WordPress Perth User GroupCommand Line WordPress with WP-CLI - WordPress Perth User Group
Command Line WordPress with WP-CLI - WordPress Perth User Group
 
Advanced WordPress Tooling: By InstaWP.com
Advanced WordPress Tooling: By InstaWP.comAdvanced WordPress Tooling: By InstaWP.com
Advanced WordPress Tooling: By InstaWP.com
 
WordPress London Developer Operations For Beginners
WordPress London Developer Operations For BeginnersWordPress London Developer Operations For Beginners
WordPress London Developer Operations For Beginners
 
PHP on Windows and on Azure
PHP on Windows and on AzurePHP on Windows and on Azure
PHP on Windows and on Azure
 
Developers, Be a Bada$$ with WP-CLI
Developers, Be a Bada$$ with WP-CLIDevelopers, Be a Bada$$ with WP-CLI
Developers, Be a Bada$$ with WP-CLI
 
WordPress and The Command Line
WordPress and The Command LineWordPress and The Command Line
WordPress and The Command Line
 
PHP as a Service TDC2019
PHP as a Service TDC2019PHP as a Service TDC2019
PHP as a Service TDC2019
 
WordPress Continuous Maintenance
WordPress Continuous MaintenanceWordPress Continuous Maintenance
WordPress Continuous Maintenance
 
Session: WP Site Management using WP-CLI from Scratch
Session: WP Site Management using WP-CLI from ScratchSession: WP Site Management using WP-CLI from Scratch
Session: WP Site Management using WP-CLI from Scratch
 
WordPress CLI in-depth
WordPress CLI in-depthWordPress CLI in-depth
WordPress CLI in-depth
 
Save Time by Managing WordPress from the Command Line
Save Time by Managing WordPress from the Command LineSave Time by Managing WordPress from the Command Line
Save Time by Managing WordPress from the Command Line
 
Mark Wall - F5 Agility 2017 - F5 Automation The Journey - PPT
Mark Wall - F5 Agility 2017 - F5 Automation The Journey - PPTMark Wall - F5 Agility 2017 - F5 Automation The Journey - PPT
Mark Wall - F5 Agility 2017 - F5 Automation The Journey - PPT
 
F5 Automation - The Journey
F5 Automation - The JourneyF5 Automation - The Journey
F5 Automation - The Journey
 
Take Command of WordPress With WP-CLI
Take Command of WordPress With WP-CLITake Command of WordPress With WP-CLI
Take Command of WordPress With WP-CLI
 
PHP on Windows
PHP on WindowsPHP on Windows
PHP on Windows
 
PHP on Windows
PHP on WindowsPHP on Windows
PHP on Windows
 
stackconf 2020 | Enterprise CI/CD Integration Testing Environments Done Right...
stackconf 2020 | Enterprise CI/CD Integration Testing Environments Done Right...stackconf 2020 | Enterprise CI/CD Integration Testing Environments Done Right...
stackconf 2020 | Enterprise CI/CD Integration Testing Environments Done Right...
 
WP-CLI: WordCamp NYC 2015
WP-CLI: WordCamp NYC 2015WP-CLI: WordCamp NYC 2015
WP-CLI: WordCamp NYC 2015
 
Modern Web Development with Perl
Modern Web Development with PerlModern Web Development with Perl
Modern Web Development with Perl
 
Just Another Word Press Weblog But More Cloudy
Just Another Word Press Weblog   But More CloudyJust Another Word Press Weblog   But More Cloudy
Just Another Word Press Weblog But More Cloudy
 

Recently uploaded

Getting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control TowerGetting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control Tower
Vladimir Samoylov
 
Presentatie 4. Jochen Cremer - TU Delft 28 mei 2024
Presentatie 4. Jochen Cremer - TU Delft 28 mei 2024Presentatie 4. Jochen Cremer - TU Delft 28 mei 2024
Presentatie 4. Jochen Cremer - TU Delft 28 mei 2024
Dutch Power
 
AWANG ANIQKMALBIN AWANG TAJUDIN B22080004 ASSIGNMENT 2 MPU3193 PHILOSOPHY AND...
AWANG ANIQKMALBIN AWANG TAJUDIN B22080004 ASSIGNMENT 2 MPU3193 PHILOSOPHY AND...AWANG ANIQKMALBIN AWANG TAJUDIN B22080004 ASSIGNMENT 2 MPU3193 PHILOSOPHY AND...
AWANG ANIQKMALBIN AWANG TAJUDIN B22080004 ASSIGNMENT 2 MPU3193 PHILOSOPHY AND...
AwangAniqkmals
 
Media as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern EraMedia as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern Era
faizulhassanfaiz1670
 
Tom tresser burning issue.pptx My Burning issue
Tom tresser burning issue.pptx My Burning issueTom tresser burning issue.pptx My Burning issue
Tom tresser burning issue.pptx My Burning issue
amekonnen
 
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
0x01 - Newton's Third Law:  Static vs. Dynamic Abusers0x01 - Newton's Third Law:  Static vs. Dynamic Abusers
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
OWASP Beja
 
Acorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutesAcorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutes
IP ServerOne
 
Bitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXOBitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXO
Matjaž Lipuš
 
International Workshop on Artificial Intelligence in Software Testing
International Workshop on Artificial Intelligence in Software TestingInternational Workshop on Artificial Intelligence in Software Testing
International Workshop on Artificial Intelligence in Software Testing
Sebastiano Panichella
 
Gregory Harris' Civics Presentation.pptx
Gregory Harris' Civics Presentation.pptxGregory Harris' Civics Presentation.pptx
Gregory Harris' Civics Presentation.pptx
gharris9
 
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
OECD Directorate for Financial and Enterprise Affairs
 
Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Doctoral Symposium at the 17th IEEE International Conference on Software Test...Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Sebastiano Panichella
 
Presentatie 8. Joost van der Linde & Daniel Anderton - Eliq 28 mei 2024
Presentatie 8. Joost van der Linde & Daniel Anderton - Eliq 28 mei 2024Presentatie 8. Joost van der Linde & Daniel Anderton - Eliq 28 mei 2024
Presentatie 8. Joost van der Linde & Daniel Anderton - Eliq 28 mei 2024
Dutch Power
 
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdfBonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
khadija278284
 
Burning Issue Presentation By Kenmaryon.pdf
Burning Issue Presentation By Kenmaryon.pdfBurning Issue Presentation By Kenmaryon.pdf
Burning Issue Presentation By Kenmaryon.pdf
kkirkland2
 
somanykidsbutsofewfathers-140705000023-phpapp02.pptx
somanykidsbutsofewfathers-140705000023-phpapp02.pptxsomanykidsbutsofewfathers-140705000023-phpapp02.pptx
somanykidsbutsofewfathers-140705000023-phpapp02.pptx
Howard Spence
 
María Carolina Martínez - eCommerce Day Colombia 2024
María Carolina Martínez - eCommerce Day Colombia 2024María Carolina Martínez - eCommerce Day Colombia 2024
María Carolina Martínez - eCommerce Day Colombia 2024
eCommerce Institute
 
Obesity causes and management and associated medical conditions
Obesity causes and management and associated medical conditionsObesity causes and management and associated medical conditions
Obesity causes and management and associated medical conditions
Faculty of Medicine And Health Sciences
 
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdfSupercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Access Innovations, Inc.
 
Announcement of 18th IEEE International Conference on Software Testing, Verif...
Announcement of 18th IEEE International Conference on Software Testing, Verif...Announcement of 18th IEEE International Conference on Software Testing, Verif...
Announcement of 18th IEEE International Conference on Software Testing, Verif...
Sebastiano Panichella
 

Recently uploaded (20)

Getting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control TowerGetting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control Tower
 
Presentatie 4. Jochen Cremer - TU Delft 28 mei 2024
Presentatie 4. Jochen Cremer - TU Delft 28 mei 2024Presentatie 4. Jochen Cremer - TU Delft 28 mei 2024
Presentatie 4. Jochen Cremer - TU Delft 28 mei 2024
 
AWANG ANIQKMALBIN AWANG TAJUDIN B22080004 ASSIGNMENT 2 MPU3193 PHILOSOPHY AND...
AWANG ANIQKMALBIN AWANG TAJUDIN B22080004 ASSIGNMENT 2 MPU3193 PHILOSOPHY AND...AWANG ANIQKMALBIN AWANG TAJUDIN B22080004 ASSIGNMENT 2 MPU3193 PHILOSOPHY AND...
AWANG ANIQKMALBIN AWANG TAJUDIN B22080004 ASSIGNMENT 2 MPU3193 PHILOSOPHY AND...
 
Media as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern EraMedia as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern Era
 
Tom tresser burning issue.pptx My Burning issue
Tom tresser burning issue.pptx My Burning issueTom tresser burning issue.pptx My Burning issue
Tom tresser burning issue.pptx My Burning issue
 
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
0x01 - Newton's Third Law:  Static vs. Dynamic Abusers0x01 - Newton's Third Law:  Static vs. Dynamic Abusers
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
 
Acorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutesAcorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutes
 
Bitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXOBitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXO
 
International Workshop on Artificial Intelligence in Software Testing
International Workshop on Artificial Intelligence in Software TestingInternational Workshop on Artificial Intelligence in Software Testing
International Workshop on Artificial Intelligence in Software Testing
 
Gregory Harris' Civics Presentation.pptx
Gregory Harris' Civics Presentation.pptxGregory Harris' Civics Presentation.pptx
Gregory Harris' Civics Presentation.pptx
 
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
 
Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Doctoral Symposium at the 17th IEEE International Conference on Software Test...Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Doctoral Symposium at the 17th IEEE International Conference on Software Test...
 
Presentatie 8. Joost van der Linde & Daniel Anderton - Eliq 28 mei 2024
Presentatie 8. Joost van der Linde & Daniel Anderton - Eliq 28 mei 2024Presentatie 8. Joost van der Linde & Daniel Anderton - Eliq 28 mei 2024
Presentatie 8. Joost van der Linde & Daniel Anderton - Eliq 28 mei 2024
 
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdfBonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
 
Burning Issue Presentation By Kenmaryon.pdf
Burning Issue Presentation By Kenmaryon.pdfBurning Issue Presentation By Kenmaryon.pdf
Burning Issue Presentation By Kenmaryon.pdf
 
somanykidsbutsofewfathers-140705000023-phpapp02.pptx
somanykidsbutsofewfathers-140705000023-phpapp02.pptxsomanykidsbutsofewfathers-140705000023-phpapp02.pptx
somanykidsbutsofewfathers-140705000023-phpapp02.pptx
 
María Carolina Martínez - eCommerce Day Colombia 2024
María Carolina Martínez - eCommerce Day Colombia 2024María Carolina Martínez - eCommerce Day Colombia 2024
María Carolina Martínez - eCommerce Day Colombia 2024
 
Obesity causes and management and associated medical conditions
Obesity causes and management and associated medical conditionsObesity causes and management and associated medical conditions
Obesity causes and management and associated medical conditions
 
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdfSupercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
 
Announcement of 18th IEEE International Conference on Software Testing, Verif...
Announcement of 18th IEEE International Conference on Software Testing, Verif...Announcement of 18th IEEE International Conference on Software Testing, Verif...
Announcement of 18th IEEE International Conference on Software Testing, Verif...
 

Make your life easy with WP-CLI

  • 1. Make Your Life Easier With WP-CLI
  • 2. About Me WordCamp Montreal - August 2014 • Web developer with over 15 years of experience. • Senior Web Developer at Carleton University in Ottawa, Ontario. • Developing for WordPress for since 2005.
  • 3. About Carleton • Over 26,000 students and 4,000 Staff. WordCamp Montreal - August 2014 • Over 250 WordPress sites. • More than a million page views per month. • Small team who are responsible for the support, maintenance and training for all WordPress powered sites on campus. • WP-CLI, along with other tools helps us do this with a relatively small team.
  • 4. What is WP-CLI? A super awesome open-source tool to manage your WordPress installations. http://wp-cli.org/! WordCamp Montreal - August 2014
  • 5. Why? Simple and faster then traditional methods Automate and script common tasks Efficient (uses WordPress to perform operations) Extensible (user contributed commands / custom commands) WordCamp Montreal - August 2014
  • 6. What’s Required SSH access to your WordPress install's directory PHP 5.3+ WordPress 3.3+ Enough server memory for shell processes to run WordPress WordCamp Montreal - August 2014
  • 7. WordCamp Montreal - August 2014
  • 8. Fear Not! Read a few simple guides about SSH and learn basic commands: How to SSH: http://code.tutsplus.com/tutorials/ ssh-what-and-how--net-25138 Basic Commands: http://www.servermom.org/top-most- used-common-ssh-commands/56/ WordCamp Montreal - August 2014
  • 9. Installing WP-CLI Instructions at: http://wp-cli.org/ Hosts with WP-CLI pre-installed: https:// github.com/wp-cli/wp-cli/wiki/List-of-hosting-companies WordCamp Montreal - August 2014
  • 10. What Can It Do? All the things. WordCamp Montreal - August 2014
  • 11. Anatomy of a Command wp generate posts --count=500! “generate” is the command “posts” is the subcommand “count” is a parameter WordCamp Montreal - August 2014
  • 12. Global Command Parameters The following parameters can be passed to any command: --user = set the current user --url = set the current URL --path = set the current path to the WP install --require = load a file before running the command --versionprint = WP-CLI version WordCamp Montreal - August 2014
  • 13. Manage Core wp core download! wp core config --dbname=testing --dbuser=wp! wp core update! wp core update-db! wp core multisite-convert! WordCamp Montreal - August 2014
  • 14. Manage Plugins wp plugin update --all! wp plugin install bbpress --activate! wp plugin uninstall hello! wp plugin delete hello! WordCamp Montreal - August 2014
  • 15. Search & Replace wp search-replace 'http://example.dev' 'http:// example.com' --skip-columns=guid! wp search-replace 'foo' 'bar' wp_posts wp_postmeta wp_terms --dry-run! WP-CLI will correctly handle serialized values, and will not change primary key values. WordCamp Montreal - August 2014
  • 16. Database Import / Export wp db export mybackup.sql! wp db import mybackup.sql! WordCamp Montreal - August 2014 !
  • 17. Manage Media / Dummy Data wp media regenerate —yes! wp generate posts --count=500! wp generate users --role=contributor! WordCamp Montreal - August 2014 !
  • 18. So Much More A full list of commands is available with full documentation and examples: http://wp-cli.org/commands/ WordCamp Montreal - August 2014 !
  • 19. Custom Commands Site specific tasks One-off fixes / Annoying client requests Commands that don’t currently exist There is a large list of community commands: http://wp-cli.org/package-index/ WordCamp Montreal - August 2014
  • 20. Lets Make a Plugin WordCamp Montreal - August 2014
  • 21. Defining a Command I use sub-commands to keep things organized. WordCamp Montreal - August 2014
  • 22. Subcommand $args: stand-alone arguments $assoc_args: --arg=value in associative array wp example example-command Hello World --param=Hello! $args[0] == ‘Hello’ $args[1] == ‘World’ $assoc_args[‘param’] == ‘Hello’ WordCamp Montreal - August 2014
  • 23. Example Command Let’s see some code! Basics / PHPDoc Guide: https://github.com/wp-cli/wp-cli/ wiki/Commands-Cookbook WP-CLI API: https://github.com/wp-cli/wp-cli/wiki/API WP-CLI Example Code: https://github.com/cuweb/wp-cli WordCamp Montreal - August 2014
  • 24. Resources http://wp-cli.org/ http://code.tutsplus.com/tutorials/ssh-what-and-how--net-25138 http://www.servermom.org/top-most-used-common-ssh-commands/56/ https://github.com/wp-cli/wp-cli/wiki/List-of-hosting-companies http://wp-cli.org/commands/ https://github.com/wp-cli/wp-cli/wiki https://github.com/cuweb/wp-cli WordCamp Montreal - August 2014