SlideShare a Scribd company logo

Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Cardinali

WP-CLI è un ottimo strumento per abbattere i tempi di sviluppo e per automatizzare i task ripetitivi ed è un vero e proprio coltellino svizzero a disposizione dello sviluppatore. In questo talk parlerò di alcuni utilizzi avanzati e di come è possibile comandare i plugin realizzati attraverso WP-CLI Talk tenuto durante il WordCamp Torino 2017- 8 Aprile 2017 WP-CLI is a great tool to cut down deployment time and to automate repetitive tasks. During the speech I'll talk about WP CLI and some of advanced tasks you can perform thanks to WP-CLI and its functionalities. Talk @WordCamp Turin 2017

1 of 82
GESTIONE AVANZATA DI
WORDPRESS CON WP-CLI
Andrea Cardinali
@andreacardinali
T.C. Informatica
WordCamp Torino - 8 Aprile 2017 - #wctrn
ANDREA CARDINALI
• DEVELOPER & SEO @ T.C. INFORMATICA
• WORDPRESS LOVER SINCE v2.8
• PROUD MEMBER OF WORDPRESS MEETUP ROMAGNA
• seoCMS ORGANIZER
BE SOCIAL
#WCTRN
@andreacardinali
TABLE OF CONTENTS
1. WHAT IS WP-CLI AND WHY USE IT
2. HOW TO USE IT (INSTALL AND EXAMPLES)
3. ADVANCED USAGES
4. DEMO TIME
5. QUESTIONS
POLL TIME
VERY SHORT HISTORY
• Open source Project created in 2011
https://github.com/wp-cli/wp-cli/
• Project maintained by Daniel Bachhuber.
• Initial code by Andreas Creten and Cristi Burcă (scribu).
• Officially supported by WordPress.org since December 2016
Ad

Recommended

Professional WordPress Development with Vagrant - Andrea Cardinali - WordCam...
Professional WordPress Development with Vagrant - Andrea Cardinali -  WordCam...Professional WordPress Development with Vagrant - Andrea Cardinali -  WordCam...
Professional WordPress Development with Vagrant - Andrea Cardinali - WordCam...Andrea Cardinali
 
WP-CLI: WordCamp Nashville 2016
WP-CLI: WordCamp Nashville 2016WP-CLI: WordCamp Nashville 2016
WP-CLI: WordCamp Nashville 2016Terell Moore
 
Coding with jetpack
Coding with jetpackCoding with jetpack
Coding with jetpackRich Collier
 
Why it's dangerous to turn off automatic updates and here's how to do it
Why it's dangerous to turn off automatic updates and here's how to do itWhy it's dangerous to turn off automatic updates and here's how to do it
Why it's dangerous to turn off automatic updates and here's how to do itOnni Hakala
 
Getting Started With WordPress Plugin Development
Getting Started With WordPress Plugin DevelopmentGetting Started With WordPress Plugin Development
Getting Started With WordPress Plugin DevelopmentThomas Vitale
 
Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!WordCamp Cape Town
 
WordPress Development with VVV, VV, and Vagrant
WordPress Development with VVV, VV, and VagrantWordPress Development with VVV, VV, and Vagrant
WordPress Development with VVV, VV, and VagrantMitch Canter
 
WordPress Performance optimization
WordPress Performance optimizationWordPress Performance optimization
WordPress Performance optimizationBrecht Ryckaert
 

More Related Content

What's hot

Ako na vlastne WP temy
Ako na vlastne WP temyAko na vlastne WP temy
Ako na vlastne WP temyJuraj Kiss
 
Building a community of Open Source intranet users
Building a community of Open Source intranet usersBuilding a community of Open Source intranet users
Building a community of Open Source intranet usersLuke Oatham
 
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/16tshellberg
 
Ryan Duff 2015 WordCamp US HTTP API
Ryan Duff 2015 WordCamp US HTTP APIRyan Duff 2015 WordCamp US HTTP API
Ryan Duff 2015 WordCamp US HTTP APIryanduff
 
Get Started in Professional WordPress Design & Development
Get Started in Professional WordPress Design & DevelopmentGet Started in Professional WordPress Design & Development
Get Started in Professional WordPress Design & DevelopmentCliff Seal
 
A crash course in scaling wordpress
A crash course inscaling wordpress A crash course inscaling wordpress
A crash course in scaling wordpress GovLoop
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansibleKrish
 
WordPress London Developer Operations For Beginners
WordPress London Developer Operations For BeginnersWordPress London Developer Operations For Beginners
WordPress London Developer Operations For BeginnersStewart Ritchie
 
How I Learned to Stop Worrying and Backup WordPress
How I Learned to Stop Worrying and Backup WordPressHow I Learned to Stop Worrying and Backup WordPress
How I Learned to Stop Worrying and Backup WordPressChris Jean
 
How to investigate and recover from a security breach in WordPress
How to investigate and recover from a security breach in WordPressHow to investigate and recover from a security breach in WordPress
How to investigate and recover from a security breach in WordPressOtto Kekäläinen
 
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-CLIWP Engine
 
Managing Multisite: Lessons from a Large Network
Managing Multisite: Lessons from a Large NetworkManaging Multisite: Lessons from a Large Network
Managing Multisite: Lessons from a Large NetworkWilliam Earnhardt
 
Workshop On WP-CLI
Workshop On WP-CLIWorkshop On WP-CLI
Workshop On WP-CLIAjit Bohra
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress developmentSteve Mortiboy
 
Introduction to apache maven
Introduction to apache mavenIntroduction to apache maven
Introduction to apache mavenKrish
 
Improving WordPress performance (xdebug and profiling)
Improving WordPress performance (xdebug and profiling)Improving WordPress performance (xdebug and profiling)
Improving WordPress performance (xdebug and profiling)Otto Kekäläinen
 
Java Fundamentals to Advance
Java Fundamentals to AdvanceJava Fundamentals to Advance
Java Fundamentals to AdvanceKrish
 

What's hot (20)

Ako na vlastne WP temy
Ako na vlastne WP temyAko na vlastne WP temy
Ako na vlastne WP temy
 
Building a community of Open Source intranet users
Building a community of Open Source intranet usersBuilding a community of Open Source intranet users
Building a community of Open Source intranet users
 
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
 
Ryan Duff 2015 WordCamp US HTTP API
Ryan Duff 2015 WordCamp US HTTP APIRyan Duff 2015 WordCamp US HTTP API
Ryan Duff 2015 WordCamp US HTTP API
 
Get Started in Professional WordPress Design & Development
Get Started in Professional WordPress Design & DevelopmentGet Started in Professional WordPress Design & Development
Get Started in Professional WordPress Design & Development
 
A crash course in scaling wordpress
A crash course inscaling wordpress A crash course inscaling wordpress
A crash course in scaling wordpress
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansible
 
WordPress London Developer Operations For Beginners
WordPress London Developer Operations For BeginnersWordPress London Developer Operations For Beginners
WordPress London Developer Operations For Beginners
 
How I Learned to Stop Worrying and Backup WordPress
How I Learned to Stop Worrying and Backup WordPressHow I Learned to Stop Worrying and Backup WordPress
How I Learned to Stop Worrying and Backup WordPress
 
How to investigate and recover from a security breach in WordPress
How to investigate and recover from a security breach in WordPressHow to investigate and recover from a security breach in WordPress
How to investigate and recover from a security breach in WordPress
 
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
 
Managing Multisite: Lessons from a Large Network
Managing Multisite: Lessons from a Large NetworkManaging Multisite: Lessons from a Large Network
Managing Multisite: Lessons from a Large Network
 
Workshop On WP-CLI
Workshop On WP-CLIWorkshop On WP-CLI
Workshop On WP-CLI
 
Way of the Future
Way of the FutureWay of the Future
Way of the Future
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress development
 
ICONUK 2015 - Gradle Up!
ICONUK 2015 - Gradle Up!ICONUK 2015 - Gradle Up!
ICONUK 2015 - Gradle Up!
 
Working in harmony
Working in harmonyWorking in harmony
Working in harmony
 
Introduction to apache maven
Introduction to apache mavenIntroduction to apache maven
Introduction to apache maven
 
Improving WordPress performance (xdebug and profiling)
Improving WordPress performance (xdebug and profiling)Improving WordPress performance (xdebug and profiling)
Improving WordPress performance (xdebug and profiling)
 
Java Fundamentals to Advance
Java Fundamentals to AdvanceJava Fundamentals to Advance
Java Fundamentals to Advance
 

Similar to Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Cardinali

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-CLIDiana Thompson
 
Advanced WordPress Tooling: By InstaWP.com
Advanced WordPress Tooling: By InstaWP.comAdvanced WordPress Tooling: By InstaWP.com
Advanced WordPress Tooling: By InstaWP.comInstaWP Inc
 
Administer WordPress with WP-CLI
Administer WordPress with WP-CLIAdminister WordPress with WP-CLI
Administer WordPress with WP-CLISuwash Kunwar
 
WordPress CLI in-depth
WordPress CLI in-depthWordPress CLI in-depth
WordPress CLI in-depthSanjay Willie
 
Introduction to WP-CLI: Manage WordPress from the command line
Introduction to WP-CLI: Manage WordPress from the command lineIntroduction to WP-CLI: Manage WordPress from the command line
Introduction to WP-CLI: Manage WordPress from the command lineBehzod Saidov
 
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 GroupJames Collins
 
Extending Your WordPress Toolbelt with WP-CLI
Extending Your WordPress Toolbelt with WP-CLIExtending Your WordPress Toolbelt with WP-CLI
Extending Your WordPress Toolbelt with WP-CLIryanduff
 
Make your life easy with WP-CLI
Make your life easy with WP-CLIMake your life easy with WP-CLI
Make your life easy with WP-CLIMichael Corkum
 
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-CLIDiana Thompson
 
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 ScratchRoald Umandal
 
WordPress and The Command Line
WordPress and The Command LineWordPress and The Command Line
WordPress and The Command LineKelly Dwan
 
Take Command of WordPress With WP-CLI at WordCamp Long Beach
Take Command of WordPress With WP-CLI at WordCamp Long BeachTake Command of WordPress With WP-CLI at WordCamp Long Beach
Take Command of WordPress With WP-CLI at WordCamp Long BeachDiana Thompson
 
WP-CLI For The Win
WP-CLI For The WinWP-CLI For The Win
WP-CLI For The WinMicah Wood
 
Command Line WordPress with WP-CLI
Command Line WordPress with WP-CLICommand Line WordPress with WP-CLI
Command Line WordPress with WP-CLIJames Collins
 
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-CLIEdmund Turbin
 
WordCamp Vancouver 2012 - Manage WordPress with Awesome using wp-cli
WordCamp Vancouver 2012 - Manage WordPress with Awesome using wp-cliWordCamp Vancouver 2012 - Manage WordPress with Awesome using wp-cli
WordCamp Vancouver 2012 - Manage WordPress with Awesome using wp-cliGetSource
 
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-CLIDiana Thompson
 
WP-CLI Workshop at WordPress Meetup Cluj-Napoca
WP-CLI Workshop at WordPress Meetup Cluj-NapocaWP-CLI Workshop at WordPress Meetup Cluj-Napoca
WP-CLI Workshop at WordPress Meetup Cluj-Napoca4nd4p0p
 
WooCommerce WP-CLI Basics
WooCommerce WP-CLI BasicsWooCommerce WP-CLI Basics
WooCommerce WP-CLI Basicscorsonr
 
WP-CLI: WordCamp NYC 2015
WP-CLI: WordCamp NYC 2015WP-CLI: WordCamp NYC 2015
WP-CLI: WordCamp NYC 2015Terell Moore
 

Similar to Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Cardinali (20)

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
 
Advanced WordPress Tooling: By InstaWP.com
Advanced WordPress Tooling: By InstaWP.comAdvanced WordPress Tooling: By InstaWP.com
Advanced WordPress Tooling: By InstaWP.com
 
Administer WordPress with WP-CLI
Administer WordPress with WP-CLIAdminister WordPress with WP-CLI
Administer WordPress with WP-CLI
 
WordPress CLI in-depth
WordPress CLI in-depthWordPress CLI in-depth
WordPress CLI in-depth
 
Introduction to WP-CLI: Manage WordPress from the command line
Introduction to WP-CLI: Manage WordPress from the command lineIntroduction to WP-CLI: Manage WordPress from the command line
Introduction to WP-CLI: Manage WordPress from the command line
 
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
 
Extending Your WordPress Toolbelt with WP-CLI
Extending Your WordPress Toolbelt with WP-CLIExtending Your WordPress Toolbelt with WP-CLI
Extending Your WordPress Toolbelt with WP-CLI
 
Make your life easy with WP-CLI
Make your life easy with WP-CLIMake your life easy with WP-CLI
Make your life easy with WP-CLI
 
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
 
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 and The Command Line
WordPress and The Command LineWordPress and The Command Line
WordPress and The Command Line
 
Take Command of WordPress With WP-CLI at WordCamp Long Beach
Take Command of WordPress With WP-CLI at WordCamp Long BeachTake Command of WordPress With WP-CLI at WordCamp Long Beach
Take Command of WordPress With WP-CLI at WordCamp Long Beach
 
WP-CLI For The Win
WP-CLI For The WinWP-CLI For The Win
WP-CLI For The Win
 
Command Line WordPress with WP-CLI
Command Line WordPress with WP-CLICommand Line WordPress with WP-CLI
Command Line WordPress with WP-CLI
 
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
 
WordCamp Vancouver 2012 - Manage WordPress with Awesome using wp-cli
WordCamp Vancouver 2012 - Manage WordPress with Awesome using wp-cliWordCamp Vancouver 2012 - Manage WordPress with Awesome using wp-cli
WordCamp Vancouver 2012 - Manage WordPress with Awesome using wp-cli
 
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
 
WP-CLI Workshop at WordPress Meetup Cluj-Napoca
WP-CLI Workshop at WordPress Meetup Cluj-NapocaWP-CLI Workshop at WordPress Meetup Cluj-Napoca
WP-CLI Workshop at WordPress Meetup Cluj-Napoca
 
WooCommerce WP-CLI Basics
WooCommerce WP-CLI BasicsWooCommerce WP-CLI Basics
WooCommerce WP-CLI Basics
 
WP-CLI: WordCamp NYC 2015
WP-CLI: WordCamp NYC 2015WP-CLI: WordCamp NYC 2015
WP-CLI: WordCamp NYC 2015
 

More from Andrea Cardinali

5 falsi miti su Woocommerce - Andrea Cardinali - WordCamp Catania 2019
5 falsi miti su Woocommerce - Andrea Cardinali - WordCamp Catania 20195 falsi miti su Woocommerce - Andrea Cardinali - WordCamp Catania 2019
5 falsi miti su Woocommerce - Andrea Cardinali - WordCamp Catania 2019Andrea Cardinali
 
WordPress Async 101 - An Introduction to wp-ajax and rest api - WordCamp Bari...
WordPress Async 101 - An Introduction to wp-ajax and rest api - WordCamp Bari...WordPress Async 101 - An Introduction to wp-ajax and rest api - WordCamp Bari...
WordPress Async 101 - An Introduction to wp-ajax and rest api - WordCamp Bari...Andrea Cardinali
 
From Cache to Ca$h - Advanced use of WP Cache - Andrea Cardinali
From Cache to Ca$h - Advanced use of WP Cache - Andrea CardinaliFrom Cache to Ca$h - Advanced use of WP Cache - Andrea Cardinali
From Cache to Ca$h - Advanced use of WP Cache - Andrea CardinaliAndrea Cardinali
 
4+1 Errori SEO Fatali per il tuo sito WordPress
4+1 Errori SEO Fatali per il tuo sito WordPress4+1 Errori SEO Fatali per il tuo sito WordPress
4+1 Errori SEO Fatali per il tuo sito WordPressAndrea Cardinali
 
Andrea Cardinali - WordPress Performance Optimization Cos'è cambiato con HTTP/2
Andrea Cardinali - WordPress Performance Optimization Cos'è cambiato con HTTP/2Andrea Cardinali - WordPress Performance Optimization Cos'è cambiato con HTTP/2
Andrea Cardinali - WordPress Performance Optimization Cos'è cambiato con HTTP/2Andrea Cardinali
 
Andrea Cardinali - SEO on Site e WordPress Errori da Evitare
Andrea Cardinali - SEO on Site e WordPress Errori da Evitare Andrea Cardinali - SEO on Site e WordPress Errori da Evitare
Andrea Cardinali - SEO on Site e WordPress Errori da Evitare Andrea Cardinali
 
Rivoluziona il tuo sito con le WP REST API - Andrea Cardinali
Rivoluziona il tuo sito con le WP REST API - Andrea CardinaliRivoluziona il tuo sito con le WP REST API - Andrea Cardinali
Rivoluziona il tuo sito con le WP REST API - Andrea CardinaliAndrea Cardinali
 
Realizzare siti velocissimi che si caricano in un secondo - WordCamp Milano 2...
Realizzare siti velocissimi che si caricano in un secondo - WordCamp Milano 2...Realizzare siti velocissimi che si caricano in un secondo - WordCamp Milano 2...
Realizzare siti velocissimi che si caricano in un secondo - WordCamp Milano 2...Andrea Cardinali
 
WordPress - 9 Falsi miti smascherati - Andrea Cardinali - WordPress Romagna M...
WordPress - 9 Falsi miti smascherati - Andrea Cardinali - WordPress Romagna M...WordPress - 9 Falsi miti smascherati - Andrea Cardinali - WordPress Romagna M...
WordPress - 9 Falsi miti smascherati - Andrea Cardinali - WordPress Romagna M...Andrea Cardinali
 
I vantaggi di utilizzare un Visual Composer - WordCamp Torino 2017 - Andrea C...
I vantaggi di utilizzare un Visual Composer - WordCamp Torino 2017 - Andrea C...I vantaggi di utilizzare un Visual Composer - WordCamp Torino 2017 - Andrea C...
I vantaggi di utilizzare un Visual Composer - WordCamp Torino 2017 - Andrea C...Andrea Cardinali
 
5 Errori Seo Da Non Commettere Sul Tuo E-Commerce
5 Errori Seo Da Non Commettere Sul Tuo E-Commerce5 Errori Seo Da Non Commettere Sul Tuo E-Commerce
5 Errori Seo Da Non Commettere Sul Tuo E-CommerceAndrea Cardinali
 
CMS in ottica SEO per i contenuti - SEMrush WebStudy Marathon - SEO Tecnico -...
CMS in ottica SEO per i contenuti - SEMrush WebStudy Marathon - SEO Tecnico -...CMS in ottica SEO per i contenuti - SEMrush WebStudy Marathon - SEO Tecnico -...
CMS in ottica SEO per i contenuti - SEMrush WebStudy Marathon - SEO Tecnico -...Andrea Cardinali
 
My WordPress Toolbox - WordPress Meetup Romagna #13 - 15 Settembre 2016
My WordPress Toolbox - WordPress Meetup Romagna #13 - 15 Settembre 2016My WordPress Toolbox - WordPress Meetup Romagna #13 - 15 Settembre 2016
My WordPress Toolbox - WordPress Meetup Romagna #13 - 15 Settembre 2016Andrea Cardinali
 
SEO On Site & WordPress - Errori da Evitare - #10 WordPress Meetup Romagna C...
SEO On Site & WordPress - Errori da Evitare  - #10 WordPress Meetup Romagna C...SEO On Site & WordPress - Errori da Evitare  - #10 WordPress Meetup Romagna C...
SEO On Site & WordPress - Errori da Evitare - #10 WordPress Meetup Romagna C...Andrea Cardinali
 
WordPress, migrazioni e re-branding: don't try this at home. #wmf15
WordPress, migrazioni e re-branding: don't try this at home. #wmf15WordPress, migrazioni e re-branding: don't try this at home. #wmf15
WordPress, migrazioni e re-branding: don't try this at home. #wmf15Andrea Cardinali
 
WPDay 2015 - WordPress Performance Optimization - Pordenone - 13 Novembre 2015
WPDay 2015 - WordPress Performance Optimization - Pordenone - 13 Novembre 2015WPDay 2015 - WordPress Performance Optimization - Pordenone - 13 Novembre 2015
WPDay 2015 - WordPress Performance Optimization - Pordenone - 13 Novembre 2015Andrea Cardinali
 
Seo on site - La stai facendo nel modo giusto? | GT Conference Torino 2013
Seo on site - La stai facendo nel modo giusto? | GT Conference Torino 2013Seo on site - La stai facendo nel modo giusto? | GT Conference Torino 2013
Seo on site - La stai facendo nel modo giusto? | GT Conference Torino 2013Andrea Cardinali
 
50 tips su Web  Performance Optimization per siti ad alto traffico @ WpCamp B...
50 tips su Web  Performance Optimization per siti ad alto traffico @ WpCamp B...50 tips su Web  Performance Optimization per siti ad alto traffico @ WpCamp B...
50 tips su Web  Performance Optimization per siti ad alto traffico @ WpCamp B...Andrea Cardinali
 
5 consigli SEO da tenere a mente durante lo sviluppo di temi e plugin @ WpCam...
5 consigli SEO da tenere a mente durante lo sviluppo di temi e plugin @ WpCam...5 consigli SEO da tenere a mente durante lo sviluppo di temi e plugin @ WpCam...
5 consigli SEO da tenere a mente durante lo sviluppo di temi e plugin @ WpCam...Andrea Cardinali
 

More from Andrea Cardinali (19)

5 falsi miti su Woocommerce - Andrea Cardinali - WordCamp Catania 2019
5 falsi miti su Woocommerce - Andrea Cardinali - WordCamp Catania 20195 falsi miti su Woocommerce - Andrea Cardinali - WordCamp Catania 2019
5 falsi miti su Woocommerce - Andrea Cardinali - WordCamp Catania 2019
 
WordPress Async 101 - An Introduction to wp-ajax and rest api - WordCamp Bari...
WordPress Async 101 - An Introduction to wp-ajax and rest api - WordCamp Bari...WordPress Async 101 - An Introduction to wp-ajax and rest api - WordCamp Bari...
WordPress Async 101 - An Introduction to wp-ajax and rest api - WordCamp Bari...
 
From Cache to Ca$h - Advanced use of WP Cache - Andrea Cardinali
From Cache to Ca$h - Advanced use of WP Cache - Andrea CardinaliFrom Cache to Ca$h - Advanced use of WP Cache - Andrea Cardinali
From Cache to Ca$h - Advanced use of WP Cache - Andrea Cardinali
 
4+1 Errori SEO Fatali per il tuo sito WordPress
4+1 Errori SEO Fatali per il tuo sito WordPress4+1 Errori SEO Fatali per il tuo sito WordPress
4+1 Errori SEO Fatali per il tuo sito WordPress
 
Andrea Cardinali - WordPress Performance Optimization Cos'è cambiato con HTTP/2
Andrea Cardinali - WordPress Performance Optimization Cos'è cambiato con HTTP/2Andrea Cardinali - WordPress Performance Optimization Cos'è cambiato con HTTP/2
Andrea Cardinali - WordPress Performance Optimization Cos'è cambiato con HTTP/2
 
Andrea Cardinali - SEO on Site e WordPress Errori da Evitare
Andrea Cardinali - SEO on Site e WordPress Errori da Evitare Andrea Cardinali - SEO on Site e WordPress Errori da Evitare
Andrea Cardinali - SEO on Site e WordPress Errori da Evitare
 
Rivoluziona il tuo sito con le WP REST API - Andrea Cardinali
Rivoluziona il tuo sito con le WP REST API - Andrea CardinaliRivoluziona il tuo sito con le WP REST API - Andrea Cardinali
Rivoluziona il tuo sito con le WP REST API - Andrea Cardinali
 
Realizzare siti velocissimi che si caricano in un secondo - WordCamp Milano 2...
Realizzare siti velocissimi che si caricano in un secondo - WordCamp Milano 2...Realizzare siti velocissimi che si caricano in un secondo - WordCamp Milano 2...
Realizzare siti velocissimi che si caricano in un secondo - WordCamp Milano 2...
 
WordPress - 9 Falsi miti smascherati - Andrea Cardinali - WordPress Romagna M...
WordPress - 9 Falsi miti smascherati - Andrea Cardinali - WordPress Romagna M...WordPress - 9 Falsi miti smascherati - Andrea Cardinali - WordPress Romagna M...
WordPress - 9 Falsi miti smascherati - Andrea Cardinali - WordPress Romagna M...
 
I vantaggi di utilizzare un Visual Composer - WordCamp Torino 2017 - Andrea C...
I vantaggi di utilizzare un Visual Composer - WordCamp Torino 2017 - Andrea C...I vantaggi di utilizzare un Visual Composer - WordCamp Torino 2017 - Andrea C...
I vantaggi di utilizzare un Visual Composer - WordCamp Torino 2017 - Andrea C...
 
5 Errori Seo Da Non Commettere Sul Tuo E-Commerce
5 Errori Seo Da Non Commettere Sul Tuo E-Commerce5 Errori Seo Da Non Commettere Sul Tuo E-Commerce
5 Errori Seo Da Non Commettere Sul Tuo E-Commerce
 
CMS in ottica SEO per i contenuti - SEMrush WebStudy Marathon - SEO Tecnico -...
CMS in ottica SEO per i contenuti - SEMrush WebStudy Marathon - SEO Tecnico -...CMS in ottica SEO per i contenuti - SEMrush WebStudy Marathon - SEO Tecnico -...
CMS in ottica SEO per i contenuti - SEMrush WebStudy Marathon - SEO Tecnico -...
 
My WordPress Toolbox - WordPress Meetup Romagna #13 - 15 Settembre 2016
My WordPress Toolbox - WordPress Meetup Romagna #13 - 15 Settembre 2016My WordPress Toolbox - WordPress Meetup Romagna #13 - 15 Settembre 2016
My WordPress Toolbox - WordPress Meetup Romagna #13 - 15 Settembre 2016
 
SEO On Site & WordPress - Errori da Evitare - #10 WordPress Meetup Romagna C...
SEO On Site & WordPress - Errori da Evitare  - #10 WordPress Meetup Romagna C...SEO On Site & WordPress - Errori da Evitare  - #10 WordPress Meetup Romagna C...
SEO On Site & WordPress - Errori da Evitare - #10 WordPress Meetup Romagna C...
 
WordPress, migrazioni e re-branding: don't try this at home. #wmf15
WordPress, migrazioni e re-branding: don't try this at home. #wmf15WordPress, migrazioni e re-branding: don't try this at home. #wmf15
WordPress, migrazioni e re-branding: don't try this at home. #wmf15
 
WPDay 2015 - WordPress Performance Optimization - Pordenone - 13 Novembre 2015
WPDay 2015 - WordPress Performance Optimization - Pordenone - 13 Novembre 2015WPDay 2015 - WordPress Performance Optimization - Pordenone - 13 Novembre 2015
WPDay 2015 - WordPress Performance Optimization - Pordenone - 13 Novembre 2015
 
Seo on site - La stai facendo nel modo giusto? | GT Conference Torino 2013
Seo on site - La stai facendo nel modo giusto? | GT Conference Torino 2013Seo on site - La stai facendo nel modo giusto? | GT Conference Torino 2013
Seo on site - La stai facendo nel modo giusto? | GT Conference Torino 2013
 
50 tips su Web  Performance Optimization per siti ad alto traffico @ WpCamp B...
50 tips su Web  Performance Optimization per siti ad alto traffico @ WpCamp B...50 tips su Web  Performance Optimization per siti ad alto traffico @ WpCamp B...
50 tips su Web  Performance Optimization per siti ad alto traffico @ WpCamp B...
 
5 consigli SEO da tenere a mente durante lo sviluppo di temi e plugin @ WpCam...
5 consigli SEO da tenere a mente durante lo sviluppo di temi e plugin @ WpCam...5 consigli SEO da tenere a mente durante lo sviluppo di temi e plugin @ WpCam...
5 consigli SEO da tenere a mente durante lo sviluppo di temi e plugin @ WpCam...
 

Recently uploaded

Essence of Requirements Engineering: Pragmatic Insights for 2024
Essence of Requirements Engineering: Pragmatic Insights for 2024Essence of Requirements Engineering: Pragmatic Insights for 2024
Essence of Requirements Engineering: Pragmatic Insights for 2024Asher Sterkin
 
SPM 2024 – Overview of and benefits of AI in Product Management
SPM 2024 – Overview of and benefits of AI in Product ManagementSPM 2024 – Overview of and benefits of AI in Product Management
SPM 2024 – Overview of and benefits of AI in Product ManagementISPMAIndia
 
maximum subarray ppt for killing camp students
maximum subarray ppt for killing camp studentsmaximum subarray ppt for killing camp students
maximum subarray ppt for killing camp studentsssuser82c38d
 
AI Product Management by Abhijit Bendigiri
AI Product Management by Abhijit BendigiriAI Product Management by Abhijit Bendigiri
AI Product Management by Abhijit BendigiriISPMAIndia
 
killingcamp longest common subsequence.pdf
killingcamp longest common subsequence.pdfkillingcamp longest common subsequence.pdf
killingcamp longest common subsequence.pdfssuser82c38d
 
Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)
Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)
Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)GDSCNiT
 
"Discovery and Delivery through Product IntelliGenAI framework" by Ramkumar A...
"Discovery and Delivery through Product IntelliGenAI framework" by Ramkumar A..."Discovery and Delivery through Product IntelliGenAI framework" by Ramkumar A...
"Discovery and Delivery through Product IntelliGenAI framework" by Ramkumar A...ISPMAIndia
 
The Game-Changer_ How Software Development Outsource Can Catapult Your Growth...
The Game-Changer_ How Software Development Outsource Can Catapult Your Growth...The Game-Changer_ How Software Development Outsource Can Catapult Your Growth...
The Game-Changer_ How Software Development Outsource Can Catapult Your Growth...emili denli
 
OpenChain AI Study Group - North America and Europe - 2024-02-20
OpenChain AI Study Group - North America and Europe - 2024-02-20OpenChain AI Study Group - North America and Europe - 2024-02-20
OpenChain AI Study Group - North America and Europe - 2024-02-20Shane Coughlan
 
P1 Inspection Types in Municity 5 Smartsheet
P1 Inspection Types in Municity 5 SmartsheetP1 Inspection Types in Municity 5 Smartsheet
P1 Inspection Types in Municity 5 SmartsheetMatthewTHawley
 
killingcamp 광고삽입문제 풀이, killingcamp 광고삽입문제 풀이
killingcamp 광고삽입문제 풀이, killingcamp 광고삽입문제 풀이killingcamp 광고삽입문제 풀이, killingcamp 광고삽입문제 풀이
killingcamp 광고삽입문제 풀이, killingcamp 광고삽입문제 풀이ssuser82c38d
 
"Taking an idea to a Product in Health diagnostics" by Dr. Geetha Manjunath, ...
"Taking an idea to a Product in Health diagnostics" by Dr. Geetha Manjunath, ..."Taking an idea to a Product in Health diagnostics" by Dr. Geetha Manjunath, ...
"Taking an idea to a Product in Health diagnostics" by Dr. Geetha Manjunath, ...ISPMAIndia
 
Automation for Bonterra Impact Management (fka Apricot)
Automation for Bonterra Impact Management (fka Apricot)Automation for Bonterra Impact Management (fka Apricot)
Automation for Bonterra Impact Management (fka Apricot)Jeffrey Haguewood
 
No more Dockerfiles? Buildpacks to help you ship your image!
No more Dockerfiles? Buildpacks to help you ship your image!No more Dockerfiles? Buildpacks to help you ship your image!
No more Dockerfiles? Buildpacks to help you ship your image!Anthony Dahanne
 
DBA Fundamentals Group: Continuous SQL with Kafka and Flink
DBA Fundamentals Group: Continuous SQL with Kafka and FlinkDBA Fundamentals Group: Continuous SQL with Kafka and Flink
DBA Fundamentals Group: Continuous SQL with Kafka and FlinkTimothy Spann
 
The Age of AI: Elevating Experiences & Delivering Customer Value!
The Age of AI: Elevating Experiences & Delivering Customer Value!The Age of AI: Elevating Experiences & Delivering Customer Value!
The Age of AI: Elevating Experiences & Delivering Customer Value!ISPMAIndia
 
killing camp week 6 problem - maximal matrix.pdf
killing camp week 6 problem - maximal matrix.pdfkilling camp week 6 problem - maximal matrix.pdf
killing camp week 6 problem - maximal matrix.pdfssuser82c38d
 
sql ppt for students who preparing for sql
sql ppt for students who preparing for sqlsql ppt for students who preparing for sql
sql ppt for students who preparing for sqlbharatjanadharwarud
 
LLMOps with Azure Machine Learning prompt flow
LLMOps with Azure Machine Learning prompt flowLLMOps with Azure Machine Learning prompt flow
LLMOps with Azure Machine Learning prompt flowNaoki (Neo) SATO
 

Recently uploaded (20)

Essence of Requirements Engineering: Pragmatic Insights for 2024
Essence of Requirements Engineering: Pragmatic Insights for 2024Essence of Requirements Engineering: Pragmatic Insights for 2024
Essence of Requirements Engineering: Pragmatic Insights for 2024
 
SPM 2024 – Overview of and benefits of AI in Product Management
SPM 2024 – Overview of and benefits of AI in Product ManagementSPM 2024 – Overview of and benefits of AI in Product Management
SPM 2024 – Overview of and benefits of AI in Product Management
 
maximum subarray ppt for killing camp students
maximum subarray ppt for killing camp studentsmaximum subarray ppt for killing camp students
maximum subarray ppt for killing camp students
 
AI Product Management by Abhijit Bendigiri
AI Product Management by Abhijit BendigiriAI Product Management by Abhijit Bendigiri
AI Product Management by Abhijit Bendigiri
 
killingcamp longest common subsequence.pdf
killingcamp longest common subsequence.pdfkillingcamp longest common subsequence.pdf
killingcamp longest common subsequence.pdf
 
Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)
Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)
Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)
 
"Discovery and Delivery through Product IntelliGenAI framework" by Ramkumar A...
"Discovery and Delivery through Product IntelliGenAI framework" by Ramkumar A..."Discovery and Delivery through Product IntelliGenAI framework" by Ramkumar A...
"Discovery and Delivery through Product IntelliGenAI framework" by Ramkumar A...
 
The Game-Changer_ How Software Development Outsource Can Catapult Your Growth...
The Game-Changer_ How Software Development Outsource Can Catapult Your Growth...The Game-Changer_ How Software Development Outsource Can Catapult Your Growth...
The Game-Changer_ How Software Development Outsource Can Catapult Your Growth...
 
OpenChain AI Study Group - North America and Europe - 2024-02-20
OpenChain AI Study Group - North America and Europe - 2024-02-20OpenChain AI Study Group - North America and Europe - 2024-02-20
OpenChain AI Study Group - North America and Europe - 2024-02-20
 
P1 Inspection Types in Municity 5 Smartsheet
P1 Inspection Types in Municity 5 SmartsheetP1 Inspection Types in Municity 5 Smartsheet
P1 Inspection Types in Municity 5 Smartsheet
 
killingcamp 광고삽입문제 풀이, killingcamp 광고삽입문제 풀이
killingcamp 광고삽입문제 풀이, killingcamp 광고삽입문제 풀이killingcamp 광고삽입문제 풀이, killingcamp 광고삽입문제 풀이
killingcamp 광고삽입문제 풀이, killingcamp 광고삽입문제 풀이
 
"Taking an idea to a Product in Health diagnostics" by Dr. Geetha Manjunath, ...
"Taking an idea to a Product in Health diagnostics" by Dr. Geetha Manjunath, ..."Taking an idea to a Product in Health diagnostics" by Dr. Geetha Manjunath, ...
"Taking an idea to a Product in Health diagnostics" by Dr. Geetha Manjunath, ...
 
Automation for Bonterra Impact Management (fka Apricot)
Automation for Bonterra Impact Management (fka Apricot)Automation for Bonterra Impact Management (fka Apricot)
Automation for Bonterra Impact Management (fka Apricot)
 
No more Dockerfiles? Buildpacks to help you ship your image!
No more Dockerfiles? Buildpacks to help you ship your image!No more Dockerfiles? Buildpacks to help you ship your image!
No more Dockerfiles? Buildpacks to help you ship your image!
 
DBA Fundamentals Group: Continuous SQL with Kafka and Flink
DBA Fundamentals Group: Continuous SQL with Kafka and FlinkDBA Fundamentals Group: Continuous SQL with Kafka and Flink
DBA Fundamentals Group: Continuous SQL with Kafka and Flink
 
eLearning Content Development Company Code and Pixels.pdf
eLearning Content Development Company Code and Pixels.pdfeLearning Content Development Company Code and Pixels.pdf
eLearning Content Development Company Code and Pixels.pdf
 
The Age of AI: Elevating Experiences & Delivering Customer Value!
The Age of AI: Elevating Experiences & Delivering Customer Value!The Age of AI: Elevating Experiences & Delivering Customer Value!
The Age of AI: Elevating Experiences & Delivering Customer Value!
 
killing camp week 6 problem - maximal matrix.pdf
killing camp week 6 problem - maximal matrix.pdfkilling camp week 6 problem - maximal matrix.pdf
killing camp week 6 problem - maximal matrix.pdf
 
sql ppt for students who preparing for sql
sql ppt for students who preparing for sqlsql ppt for students who preparing for sql
sql ppt for students who preparing for sql
 
LLMOps with Azure Machine Learning prompt flow
LLMOps with Azure Machine Learning prompt flowLLMOps with Azure Machine Learning prompt flow
LLMOps with Azure Machine Learning prompt flow
 

Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Cardinali

  • 1. GESTIONE AVANZATA DI WORDPRESS CON WP-CLI Andrea Cardinali @andreacardinali T.C. Informatica WordCamp Torino - 8 Aprile 2017 - #wctrn
  • 2. ANDREA CARDINALI • DEVELOPER & SEO @ T.C. INFORMATICA • WORDPRESS LOVER SINCE v2.8 • PROUD MEMBER OF WORDPRESS MEETUP ROMAGNA • seoCMS ORGANIZER
  • 4. TABLE OF CONTENTS 1. WHAT IS WP-CLI AND WHY USE IT 2. HOW TO USE IT (INSTALL AND EXAMPLES) 3. ADVANCED USAGES 4. DEMO TIME 5. QUESTIONS
  • 6. VERY SHORT HISTORY • Open source Project created in 2011 https://github.com/wp-cli/wp-cli/ • Project maintained by Daniel Bachhuber. • Initial code by Andreas Creten and Cristi Burcă (scribu). • Officially supported by WordPress.org since December 2016
  • 10. WHAT IS WP-CLI PHAR (PHP Archive) •Single file (*.phar) containing multiple files •PHP Application (kinda of *.exe on Win /*.app on Mac)
  • 12. WHAT IS WP-CLI WP-CLI is a set of command-line tools for managing WordPress installations. You can update plugins, configure multisite installs and much more, without using a web browser.
  • 14. MINIMUM REQUIREMENTS • UNIX-like environment (OS X, Linux, FreeBSD, Cygwin); (limited support in Windows environment) • PHP 5.3.29 or later (php 5.3 EOL 14 Aug 2014) • WordPress 3.7 or later (released on October 2013) • SSH access • no root privileges needed* • http://wp-cli.org/
  • 15. HOW TO INSTALL IT (locally) curl -O https://raw.githubusercontent.com/wp- cli/builds/gh-pages/phar/wp-cli.phar php wp-cli.phar --info or Download it manually and copy it into document root NOTICE: if installed locally WP-CLI must be placed in the same folder of WP core files (i.e. public_html) https://make.wordpress.org/cli/handbook/installing/
  • 16. HOW TO INSTALL IT (globally) curl -O https://raw.githubusercontent.com/wp- cli/builds/gh-pages/phar/wp-cli.phar php wp-cli.phar --info chmod +x wp-cli.phar sudo mv wp-cli.phar /usr/local/bin/wp wp --info https://make.wordpress.org/cli/handbook/installing/
  • 18. USE VVV TO TRY IT • VVV (Variable Varying Vagrant) provides WP-CLI • VVV uses WP-CLI under the hood to create new WP install https://www.slideshare.net/AndreaCardinali/professional-wordpress-development-with-vagrant-andrea-cardinali-wordcamp-milano-2016
  • 19. USE WP-CLI POWERED HOSTING https://make.wordpress.org/cli/handbook/hosting-companies/
  • 21. WP-CLI SYNOPSIS wp command subcommand args --global-arg1
  • 22. WP-CLI GLOBAL ARGS --path=<path>Path to the WordPress files. --ssh=[<user>@]<host>[:<port>][<path>]Perform operation against a remote server over SSH. --http=<http>Perform operation against a remote WordPress install over HTTP. --url=<url>Pretend request came from given URL. In multisite, this argument is how the target site is specified. --user=<id|login|email>Set the WordPress user. --skip-plugins[=<plugin>]Skip loading all or some plugins. Note: mu-plugins are still loaded. --skip-themes[=<theme>]Skip loading all or some themes. --skip-packagesSkip loading all installed packages. --require=<path>Load PHP file before running the command (may be used more than once). --[no-]colorWhether to colorize the output. --debug[=<group>]Show all PHP errors; add verbosity to WP-CLI bootstrap. --prompt[=<assoc>]Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. --quietSuppress informational messages.
  • 23. WHY SHOULD I USE IT?
  • 25. EXTENSIBLE • Extend functionalities with packages • Write your own functionality (more on this later) • You can concat multiple commands (pipe) • SSH support out of the box (control your WP from remote)
  • 26. FAST
  • 27. FAST • CLI is faster than browser • WP-CLI can skip plugin / themes loading • You can create a shell script with multiple wp-cli commands
  • 29. SAVE TIME • DRY: Don’t Repeat Yourself • You don’t have to login / visit url/ wait for page loads • You can export data in CSV, XML, JSON • You can pilot multiple installation at once
  • 30. TAKE AWAY • WP-CLI is a swiss army knife for wp users • WP-CLI can be installed if not available on your hosting • WP-CLI let you save a lot of time
  • 31. HOW LONG IT TAKES TO PERFORM THE FOLLOWING OPERATIONS? 1. Download WordPress 2. Install theme 3. Install and activate plugins 4. Create users 5. Import backup (from dev) 6. Replace production url
  • 33. HOW DO YOU USUALLY INSTALL WORDPRESS?
  • 34. BRAND NEW WP INSTALL wp core download --locale=it_IT wp core config --dbuser=‘wp’ --dbpass=‘wp’ -- dbprefix=‘wctrn17_’ wp core install --siteurl=‘’ wp core config --prompt wp core install --prompt http://wp-cli.org/commands/core/
  • 35. USEFUL SUBCOMMANDS WORDPRESS INSTALL wp core [subcommand] wp core download wp core config wp core update wp core update-db wp core version wp core multisite-convert http://wp-cli.org/commands/core/
  • 36. HOW DO YOU COPY DATABASE FROM DEV TO PRODUCTION?
  • 37. USEFUL SUBCOMMANDS REPLACE STRING IN DATABASE wp search-replace oldstring newstring wp search-replace http://dev.mysite.com http://www.mysite.com
  • 38. HOW DO YOU USUALLY INSTALL A PLUGIN?
  • 39. USEFUL SUBCOMMANDS INSTALL A PLUGIN wp plugin install sg-cachepress --activate wp plugin install sg-cachepress --activate http://wp-cli.org/commands/plugin/
  • 40. USEFUL SUBCOMMANDS PLUGINS wp plugin [subcommand] wp plugin install $slug --version= wp plugin activate wp plugin list wp plugin update $slug wp plugin --update-all wp plugin toggle
  • 41. WHAT IF YOU HAVE TO INSTALL 15 PLUGINS?
  • 42. INSTALL MULTIPLE PLUGINS AT ONCE cat plugins.txt | xargs wp plugin install https://gist.github.com/Cardy/347807cf73681783f1fb6c2911a7cddd
  • 43. INSTALL MULTIPLE PLUGINS AT ONCE WITH SPECIFIC VERSION sh plugins.sh https://gist.github.com/Cardy/347807cf73681783f1fb6c2911a7cddd #!/bin/bash input="./plugins.txt" # Set "," as the field separator using $IFS # and read line by line using while read combo while IFS=',' read -r f1 f2 do if [ -z "$f1" ] then continue; fi echo "Installing $f1 $f2" if [ -z "$f2" ] then wp plugin install $f1 --activate >> install.log 2>&1 else wp plugin install $f1 --version=$f2 --force --activate >> install.log 2>&1 fi done < "$input"
  • 44. HOW DO YOU REGENERATE POST THUMBNAILS?
  • 45. USEFUL SUBCOMMANDS THUMBNAILS wp media [subcommand] wp media regenerate wp media import ~/Pictures/**/*.jpg http://wp-cli.org/commands/media/
  • 46. WHAT IF YOU HAVE TO REGENERATE ONLY THE MOST RECENT THUMBNAILS?
  • 47. THUMBNAILS wp media regenerate $(wp post list -- post_type=attachment --format=ids -- posts_per_page=50) • http://wp-cli.org/commands/media/
  • 48. HOW DO YOU EMPTY CACHE / TRANSIENTS?
  • 49. USEFUL SUBCOMMANDS HANDLE CACHE wp cache [subcommand] wp cache set $key $value $group $expire wp cache add wp cache get
  • 50. USEFUL SUBCOMMANDS HANDLE TRANSIENTS wp transient [subcommand] wp transient delete --expired http://wp-cli.org/commands/transient/
  • 51. HOW DO YOU HANDLE YOUR DB?
  • 52. USEFUL SUBCOMMANDS BACKUP / RESTORE DB wp db [subcommand] wp db export filename.sql wp db import filename.sql
  • 53. USEFUL SUBCOMMANDS WORKS ON DB WITHOUT phpMyAdmin wp db [subcommand] wp db create wp db drop --yes wp db query < my_query.sql wp db optimize http://wp-cli.org/commands/db/
  • 54. HOW DO YOU MANAGE USERS / ROLES ?
  • 55. USEFUL SUBCOMMANDS USERS AND CAPABILITIES wp user [subcommand] wp user list wp user create username email --role=rolename wp user update 1 --user_pass=‘changeMe123’ wp user import-csv http://wp-cli.org/commands/user/
  • 58. YAML FILE You can define a wp-cli.yaml to store default configuration 1. inline args 2. wp-cli.local.yml file inside the current working directory (or upwards). 3. wp-cli.yml file inside the current working directory (or upwards). 4. ~/.wp-cli/config.yml file WP-CLI defaults.
  • 60. WP-CLI PACKAGE Available on all WordPress installs, as opposed to just where the plugin is activated.
  • 61. USEFUL SUBCOMMANDS WP-CLI PACKAGE wp cli [subcommand] wp package install wp-cli/restful wp package list wp package install
  • 62. (SOME) USEFUL WP-CLI PACKAGES wp-cli/restful binarygary/db-checkpoint runcommand/assign-featured-images and many more https://wp-cli.org/package-index/
  • 63. WP-CLI RESTFUL RESTful WP-CLI makes WP REST API endpoints available as WP- CLI commands. https://github.com/wp-cli/restful
  • 66. WP-CLI EXECUTION • WP_CLI::launch() - Launch an arbitrary external process that takes over I/O. • WP_CLI::launch_self() - Run a WP-CLI command in a new process reusing the current runtime arguments. • WP_CLI::runcommand() - Run a WP-CLI command. • WP_CLI::run_command() - Run a given command within the current process using the same global
  • 68. WP-CLI HOOKS • WP_CLI::add_hook() - Schedule a callback to be executed at a certain point. • WP_CLI::do_hook() - Execute callbacks registered to a given hook. • WP_CLI::add_wp_hook() - Add a callback to a WordPress action or filter. • WP_CLI::add_command() - Register a command to WP-CLI.
  • 69. WP-CLI HOOKS WP_CLI::add_hook( $when, $callback) esegue $callback quando viene scatenato $when WP_CLI::do_hook( $when ) scatena $when che può essere agganciato tramite add_hook
  • 70. WP-CLI $when before_invoke:<command> - Just before a command is invoked. after_invoke:<command> - Just after a command is involved. before_wp_load - Just before the WP load process begins. before_wp_config_load - After wp-config.php has been located. after_wp_config_load - After wp-config.php has been loaded into scope. after_wp_load - Just after the WP load process has completed.
  • 71. WP-CLI OUTPUT • WP_CLI::log() - Display informational message without prefix. • WP_CLI::success() - Display success message prefixed with "Success: ". • WP_CLI::debug() - Display debug message prefixed with "Debug: " when `-- debug` is used. • WP_CLI::warning() - Display warning message prefixed with "Warning: ". • WP_CLI::error() - Display error message prefixed with "Error: " and exit script. • WP_CLI::halt() - Halt script execution with a specific return code.
  • 72. CREATE YOUR OWN PACKAGE
  • 73. CREATE YOUR OWN PACKAGE 1. Create a new command 2. Extend an existing one (create a subcommand) 3. Make use of PHPDoc 4. Include your package inside a plugin or add it to wp package index https://make.wordpress.org/cli/handbook/commands-cookbook/
  • 74. CREATE YOUR OWN PACKAGE https://make.wordpress.org/cli/handbook/commands-cookbook/ https://wp-cli.org/docs/internal-api/ <?php class Cardy_Command { public function greetings( $args ) { WP_CLI::success(‘Hello World'); } } $instance = new Cardy_Command(); WP_CLI::add_command( 'cardy', $instance );
  • 75. ADD PACKAGE TO YOUR PLUGIN if ( defined( 'WP_CLI' ) && WP_CLI ) { require_once dirname( __FILE__ ) . '/inc/class- plugin-cli-command.php'; }
  • 77. HOW LONG IT TAKES TO PERFORM THE FOLLOWING OPERATIONS? 1. Download WordPress 2. Install theme 3. Install and activate plugins 4. Create users
  • 81. WORDPRESS MEETUP ROMAGNA QUANDO: ogni 1° giovedi del mese DOVE: Dinamo Coworking Space Cesena PERCHÉ: Per parlare di WordPress, conoscere bella gente e condividere le proprie esperienze wpromagna.com @romagnawp