Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Introduction to WP-CLI
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Kyle B. Johnson
November 02, 2017
Programming
350
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Introduction to WP-CLI
Kyle B. Johnson
November 02, 2017
More Decks by Kyle B. Johnson
See All by Kyle B. Johnson
Continuously Delivering Value
kjohnson
0
150
Building Pages in WordPress
kjohnson
0
200
Gutenberg
kjohnson
0
390
Separate your time from your income
kjohnson
0
490
iThemes Exchange
kjohnson
0
130
Easy Digital Downloads
kjohnson
0
85
PHP Templating
kjohnson
0
130
WordPress Taxonomies
kjohnson
0
92
objects-a-short-intro.pdf
kjohnson
0
200
Other Decks in Programming
See All in Programming
My Marp Sample
sinoue0108
0
140
Press start. Python's next generation.
willingc
PRO
3
300
自動化したのに回らない テスト運用の壁―AI時代の品質責任と生産性
mfunaki
0
570
まだ間に合う!今年の夏こそSchemeのマクロ展開器を完全理解!
omasanori
0
600
DynamoDBの基礎を振り返りながらベクトル検索機能を理解する
musan
3
260
MySQLとPostgreSQLって何が違うの?
akagami
0
150
承認済みなのに差戻しできてしまうバグ、型で潰せます
shinchit
0
130
How I Won Prize Money at a Hackathon Using Codex and Symphony Alpha
yasei_no_otoko
0
130
週末にAI-DLCを本気で回したら$1,600溶けた
hbashimizu
0
110
AI駆動開発にグラフDBを重ねてみた
satoshi256kbyte
2
500
思考垂れ流し開発 ~音声入力 × AIエージェント × 開発ハーネスによる試行錯誤~
npostring
0
640
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
280
Featured
See All Featured
The Mindset for Success: Future Career Progression
greggifford
PRO
0
490
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
220
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
300
Mobile First: as difficult as doing things right
swwweet
225
10k
The untapped power of vector embeddings
frankvandijk
2
1.9k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
260
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.4k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
320
Rebuilding a faster, lazier Slack
samanthasiow
85
9.6k
How STYLIGHT went responsive
nonsquared
100
6.3k
Transcript
The command line interface for WordPress_ ./WP-CLI
$ wp plugin install ninja-forms Installing Ninja Forms (3.0) Downloading
install package... Unpacking the package... Installing the plugin... Plugin installed successfully. Success: Installed 1 of 1 plugins.
$ wp core download Downloading WordPress 4.8 Md5 hash verified:
c5366d0521831dd029dfc38e56a5 Success: WordPress downloaded.
$ wp core install Success: WordPress installed successfully.
$ wp plugin update Updating to version 4.9 Downloading update...
Unpacking the update... Success: WordPress updated successfully.
Use Cases
Example Use Cases • Plugin/Theme Development • Local Development Environments
• Client Site Maintenance • WordPress as a Service
Plugin/Theme Development • Scaffold new plugins • Run PHPUnit tests
Local Development Environments • Download/Install/Update WordPress • Auto install plugins/themes
• Search/Replace database values (site migration) • Launch PHP’s built-in web server $ wp serve –-host=wordpress.dev ~/code/wordpress now available at wordpress.dev:80
Client Site Maintenance • Remotely Update WordPress (SSH) • Check
for plugin updates • Restore down sites (white-screen of death) $ wp plugin deactivate <plugin name> --skip-plugins Success: Plugin <plugin name> deactivated.
WordPress as a Service • Check for updates • Create
user accounts • Create new installs $ wp site create --slug=example Success: Site 3 created. wordpress.dev/example
Extending WP-CLI
$ wp ninja-forms list-forms public function list_forms( $args, $assoc_args )
{ foreach( Ninja_Forms()->forms() as $form ){ WP_CLI::line( ‘#’ . $form[‘title’] ); } }
Outside of WordPress
Laravel $ artisan # Generate a new controller. $ artisan
make:controller PostController # Re-run database migration with seed data. $ artisan migrate:refresh --seeds
Drupal $ drush # Run pending updates on staging site.
$ drush @staging updatedb # Synchronize staging files to production. $ drush rsync @staging @ list