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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Kyle B. Johnson
November 02, 2017
Programming
340
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
140
Building Pages in WordPress
kjohnson
0
190
Gutenberg
kjohnson
0
380
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
90
objects-a-short-intro.pdf
kjohnson
0
200
Other Decks in Programming
See All in Programming
その問い、本当に正しいですか?AI時代のエンジニアに必要な哲学と認知科学 / ai-philosophy-cognitive-science
minodriven
14
6.4k
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
0
170
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
4
1.5k
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
980
SREは、MCPとSRE Agentをこう使え!
kazumax55
0
130
AI駆動開発を妨げる技術的負債の解消アプローチ / ai-refactoring-approach
minodriven
15
7.8k
さぁV100、メモリをお食べ・・・
nilpe
0
160
Oxlintのカスタムルールの現況
syumai
6
1.2k
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
8.9k
AI 輔助遺留系統現代化的經驗分享
jame2408
1
1.1k
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
4
5.4k
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
310
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
Rails Girls Zürich Keynote
gr2m
96
14k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
440
Navigating Team Friction
lara
192
16k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
570
Color Theory Basics | Prateek | Gurzu
gurzu
0
370
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.3k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
240
Typedesign – Prime Four
hannesfritz
42
3.1k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Google's AI Overviews - The New Search
badams
0
1.1k
Git: the NoSQL Database
bkeepers
PRO
432
67k
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