SlideShare a Scribd company logo
WP-CLI ā€“
Super Admin Level
Tips and Tricks
JONATHAN PERLMAN
@JPURPLEMAN
WWW.JPURPLEMAN.CA/WCOTTAWA2016
Jonathan Perlman
14 years using PHP & MySql as a web developer at Dawson College
9 years teaching the web and Microsoft Office for Dawson College
6 years using WordPress
2 WordCamp talks
Iā€™m not a Linux unicorn
6/18/2016 WORDCAMP OTTAWA 2016
What you need to knowā€¦
This works on Linux computers / servers.
Might work on Mac. Not tested on Mac.
Won't work on Windows.
Shared and managed hosts don't allow you to install WP-CLI
We won't be talking about WP-CLI "Packagesā€œ
All WordPress code samples are located in the repo
https://github.com/jpurpleman/WordPress-Stuff
6/18/2016 WORDCAMP OTTAWA 2016
WP-CLI Requirements
UNIX-like environment (OS X, Linux, FreeBSD, Cygwin);
limited support in Windows environment
PHP 5.3.29 or later
WordPress 3.7 or later
WordPress 4.5 or later requires WP-CLI version 0.23.0
6/18/2016 WORDCAMP OTTAWA 2016
The way to level up ā€¦
Learn bash!
6/18/2016 WORDCAMP OTTAWA 2016
hello-world.sh
#!/bin/bash
echo 'Hello World!'
bash hello-world.sh
chmod +x hello-world.sh
./hello-world.sh
6/18/2016 WORDCAMP OTTAWA 2016
variables.sh
#!/bin/bash
error
X=hello world
X = "hello world"
OK
X="hello world"
#output
echo $X
6/18/2016 WORDCAMP OTTAWA 2016
conditionals.sh
#!/bin/bash
city=$1
if [ "$city" == "Ottawa" ]
then
echo "What a great city"
else
echo "Hello, you're in WordCamp $city!"
fi
6/18/2016 WORDCAMP OTTAWA 2016
loops-and-arrays.sh
#!/bin/bash
servers=( 'web1.example.com' 'web2.example.com' )
for server in "${servers[@]}"; do
echo $server
done
6/18/2016 WORDCAMP OTTAWA 2016
.bashrc & scripts
HTTPS://GITHUB.COM/JPURPLEMAN/WORDPRESS-STUFF
6/18/2016 WORDCAMP OTTAWA 2016
.bashrc & scripts
You can run the custom
command in any folder
Will work for only your user
account
Better if you have more than one
server
You have to copy it to work in a
specific directory
You can create reusable scripts
You can create scripts the run
scripts
6/18/2016 WORDCAMP OTTAWA 2016
Script ā€“ wp-cli-install.sh
#!/bin/bash
servers=( 'web1.example.com' 'web2.example.comā€˜ )
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
for server in "${servers[@]}"; do
echo $server
scp ./wp-cli.phar user@$server:
ssh user@$server "chmod +x wp-cli.phar"
ssh user@$server "sudo mv wp-cli.phar /usr/local/bin/wp"
ssh user@$server "/usr/local/bin/wp --info"
done
rm ./wp-cli.phar
6/18/2016 WORDCAMP OTTAWA 2016
.bashrc - Get WordPress Salts
alias wordpress-salt='wget
https://api.wordpress.org/secret-key/1.1/salt/ -qO-'
Normally one line, not multipleā€¦
6/18/2016 WORDCAMP OTTAWA 2016
.bashrc - Update WordPress
alias wordpress-update-all='wp core update &&
wp core update-db --network &&
wp plugin update --all &&
wp theme update --all '
Normally one line, not multipleā€¦
6/18/2016 WORDCAMP OTTAWA 2016
.bashrc ā€“ Delete Sample Page
alias wordpress-delete-sample-page=ā€˜wp post delete $(
wp post list
--post_type=page
--posts_per_page=1
--post_status=publish
--pagename="sample-page"
--field=ID
--format=ids
)ā€™
6/18/2016 WORDCAMP OTTAWA 2016
.bashrc - Remove Default Widgets
alias wordpress-remove-default-widgets='
wp widget delete search-2 &&
wp widget delete recent-posts-2 &&
wp widget delete recent-comments-2 &&
wp widget delete archives-2 &&
wp widget delete categories-2 &&
wp widget delete meta-2'
Normally one line, not multipleā€¦
6/18/2016 WORDCAMP OTTAWA 2016
Script - see-option-on-all-sites.sh
#!/bin/bash
for url in $( wp site list --field=url --url=http://site.com | sort ā€“u )
do
echo $url
wp option get blogname
done
6/18/2016 WORDCAMP OTTAWA 2016
see-all-sites-with-gravity-forms.sh
#!/bin/bash
for blog_id in $(wp site list --field=blog_id --url=http://site.com | sort -u )
do
echo $blog_id
wp db query "select count(id) from wp_${blog_id}_rg_form"
done
6/18/2016 WORDCAMP OTTAWA 2016
Script - create-pages-in-bluk.sh ( 1 )
userID=1
pages=( 'Home' 'About' 'Contact Us' )
for page in "${pages[@]}"; do
wp post create
--post_type=page
--post_title="$page"
--post_status=publish
--post_author=$userID
--porcelain
echo "wp post create $page"
done
6/18/2016 WORDCAMP OTTAWA 2016
Script - create-pages-in-bluk.sh ( 2 )
wp menu create "Menu" --quiet
export IFS=" "
for pageID in $( wp post list
--order="ASC"
--orderby="ID"
--post_type=page
--post_status=publish
--posts_per_page=-1
--field=ID
--format=ids ); do
wp menu item add-post menu $pageID --quiet
done
wp menu location assign menu primary
6/18/2016 WORDCAMP OTTAWA 2016
Now to the real
timesavers!
6/18/2016 WORDCAMP OTTAWA 2016
Resulting git log ā€“ 14 commits
123438b 2016-06-16 Jonathan Perlman Adding plugin: WordPress Importer at version 0.6.2
449e092 2016-06-16 Jonathan Perlman Updating plugin: Print Friendly and PDF to version 3.4.6
b1d983a 2016-06-16 Jonathan Perlman Updating plugin: WooThemes Helper to version 1.6.2
8d2d7e3 2016-06-16 Jonathan Perlman Updating plugin: WP Migrate DB Pro Media Files to version 1.4.4
ce0181e 2016-06-16 Jonathan Perlman Updating plugin: WP Migrate DB Pro to version 1.6
3a37bd6 2016-06-16 Jonathan Perlman Updating plugin: Gravity Forms + Custom Post Types to version 3.1.3
91e2560 2016-06-16 Jonathan Perlman Updating plugin: jQuery Responsive Select Menu to version 1.5.0
83af679 2016-06-16 Jonathan Perlman Updating plugin: Gravity Forms to version 1.9.19
bbaa123 2016-06-16 Jonathan Perlman Adding plugin: Gravity Forms Advanced File Uploader at version 1.4
41b2ae1 2016-06-16 Jonathan Perlman Updating plugin: Google Analytics by MonsterInsights to version 5.5
81eac9d 2016-06-16 Jonathan Perlman Updating plugin: Custom Post Type UI to version 1.3.5
fbcc677 2016-06-16 Jonathan Perlman Updating plugin: Basic Google Maps Placemarks to version 1.10.6
c5bdb6c 2016-06-16 Jonathan Perlman Updating plugin: Advanced Custom Fields to version 4.4.7
476c404 2016-06-16 Jonathan Perlman Updating plugin: Accordion Shortcodes to version 2.3.0
6/18/2016 WORDCAMP OTTAWA 2016
.bashrc ā€“ git-wp-commit-object ( 1 )
Go into a plugin or theme folder
Get the current directory name
Check to see if we're in a plugin or theme folder
Convert "plugins" to plugin or "themes" to theme
Get details about the WordPress object we want to commit
Get the title of the plugin or theme we're committing
Get the version of the plugin or theme we're committing
6/18/2016 WORDCAMP OTTAWA 2016
.bashrc ā€“ git-wp-commit-object ( 2 )
Check to see if it's in the repo already or not
Create parts of the commit message conditionally
Add all files to git that have been added or modified
Add all files to git that have been deleted or moved
Git commit! with appropriate message
Print that message
6/18/2016 WORDCAMP OTTAWA 2016
Script ā€“ wp-install.sh
If we're going to remove sites
Do mysql stuff to drop the db, revoke all and remove the user
Destroy the file system folder of the site
If weā€™re going to add sites
Loop proposed sites and make sure we don't overwrite any folder
Mysql stuff, drop db if exists, create database, grant privileges
Delete and Create the directory of the install path
Go into the install path
Download the WordPress core files
Create the wp-config file with our standard setup
Generate random 8 character password
Create database tables, and install WordPress
Dump out information to a text file for the teacher
Dump out information for the specific student
discourage search engines
delete sample page, and create homepage
set homepage as front page
set pretty urls
delete akismet and hello dolly
create a navigation bar
disable file edit in wordpress config
create .htaccess file
create the .htpasswd file
change ownership of the folder to apache
change file permissions
Calculate and send percent done to whiptail
Convert text file of info for teacher to pdf
Convert many student one page documents into one pdf
6/18/2016 WORDCAMP OTTAWA 2016
Resources
https://www.maketecheasier.com/write-linux-shell-scripts/
https://www.ltconsulting.co.uk/automated-wordpress-installation-with-bash-wp-cli/
https://deliciousbrains.com/automating-local-wordpress-site-setup-scripts/
https://www.smashingmagazine.com/2015/09/wordpress-management-with-wp-cli/
6/18/2016 WORDCAMP OTTAWA 2016
Thank you! Questions?
JONATHAN PERLMAN
@JPURPLEMAN
WWW.JPURPLEMAN.CA/WCOTTAWA2016

More Related Content

What's hot

Robust WordPress Installation using L2MP Stack
Robust WordPress Installation using L2MP StackRobust WordPress Installation using L2MP Stack
Robust WordPress Installation using L2MP Stack
Alex Bertens
Ā 
Tipping the scale - Eyal Eizenberg - Wix
Tipping the scale - Eyal Eizenberg - WixTipping the scale - Eyal Eizenberg - Wix
Tipping the scale - Eyal Eizenberg - Wix
Eyal Eizenberg
Ā 
Tipping the Scale - Eyal Eizenberg
Tipping the Scale - Eyal EizenbergTipping the Scale - Eyal Eizenberg
Tipping the Scale - Eyal Eizenberg
Wix Engineering
Ā 
PHP, LAMP Stack & WordPress
PHP, LAMP Stack & WordPressPHP, LAMP Stack & WordPress
PHP, LAMP Stack & WordPress
Suman Srinivasan
Ā 
Challenges Building The New Joomla! Demo & Free Hosting Platform
Challenges Building The New Joomla! Demo & Free Hosting PlatformChallenges Building The New Joomla! Demo & Free Hosting Platform
Challenges Building The New Joomla! Demo & Free Hosting Platform
Daniel Kanchev
Ā 
Scalable Web Architectures - Common Patterns & Approaches
Scalable Web Architectures - Common Patterns & ApproachesScalable Web Architectures - Common Patterns & Approaches
Scalable Web Architectures - Common Patterns & Approaches
Cal Henderson
Ā 
My Website is Old Enough to Vote - My Website Can Vote - Building Sites That ...
My Website is Old Enough to Vote - My Website Can Vote - Building Sites That ...My Website is Old Enough to Vote - My Website Can Vote - Building Sites That ...
My Website is Old Enough to Vote - My Website Can Vote - Building Sites That ...
Kristine Howard
Ā 
PDF Generation in Rails with Prawn and Prawn-to: John McCaffrey
PDF Generation in Rails with Prawn and Prawn-to: John McCaffreyPDF Generation in Rails with Prawn and Prawn-to: John McCaffrey
PDF Generation in Rails with Prawn and Prawn-to: John McCaffrey
John McCaffrey
Ā 
Scaling High Traffic Web Applications
Scaling High Traffic Web ApplicationsScaling High Traffic Web Applications
Scaling High Traffic Web Applications
Achievers Tech
Ā 
The Characteristics of a Successful SPA
The Characteristics of a Successful SPAThe Characteristics of a Successful SPA
The Characteristics of a Successful SPA
Gil Fink
Ā 
Web performance
Web performanceWeb performance
Web performance
Delchina Angelova
Ā 
Presentation1
Presentation1Presentation1
Presentation1
Rosie brown
Ā 
Modern web application devlopment workflow
Modern web application devlopment workflowModern web application devlopment workflow
Modern web application devlopment workflow
Hamdi Hmidi
Ā 
20130714 php matsuri - highly available php
20130714   php matsuri - highly available php20130714   php matsuri - highly available php
20130714 php matsuri - highly available php
Graham Weldon
Ā 
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
John McCaffrey
Ā 
MEAN Stack
MEAN StackMEAN Stack
MEAN Stack
Krishnaprasad k
Ā 
Javascript - Getting started | DevCom ISITCom
Javascript - Getting started | DevCom ISITComJavascript - Getting started | DevCom ISITCom
Javascript - Getting started | DevCom ISITCom
Hamdi Hmidi
Ā 
10 step guide to convert HTML to Wordpress
10 step guide to convert HTML to Wordpress10 step guide to convert HTML to Wordpress
10 step guide to convert HTML to Wordpress
WordPrax Ltd.
Ā 
Les Basiques - Web DĆ©veloppement HTML5, CSS3, JS et PHP
Les Basiques - Web  DĆ©veloppement HTML5, CSS3, JS et PHPLes Basiques - Web  DĆ©veloppement HTML5, CSS3, JS et PHP
Les Basiques - Web DĆ©veloppement HTML5, CSS3, JS et PHP
Hamdi Hmidi
Ā 

What's hot (19)

Robust WordPress Installation using L2MP Stack
Robust WordPress Installation using L2MP StackRobust WordPress Installation using L2MP Stack
Robust WordPress Installation using L2MP Stack
Ā 
Tipping the scale - Eyal Eizenberg - Wix
Tipping the scale - Eyal Eizenberg - WixTipping the scale - Eyal Eizenberg - Wix
Tipping the scale - Eyal Eizenberg - Wix
Ā 
Tipping the Scale - Eyal Eizenberg
Tipping the Scale - Eyal EizenbergTipping the Scale - Eyal Eizenberg
Tipping the Scale - Eyal Eizenberg
Ā 
PHP, LAMP Stack & WordPress
PHP, LAMP Stack & WordPressPHP, LAMP Stack & WordPress
PHP, LAMP Stack & WordPress
Ā 
Challenges Building The New Joomla! Demo & Free Hosting Platform
Challenges Building The New Joomla! Demo & Free Hosting PlatformChallenges Building The New Joomla! Demo & Free Hosting Platform
Challenges Building The New Joomla! Demo & Free Hosting Platform
Ā 
Scalable Web Architectures - Common Patterns & Approaches
Scalable Web Architectures - Common Patterns & ApproachesScalable Web Architectures - Common Patterns & Approaches
Scalable Web Architectures - Common Patterns & Approaches
Ā 
My Website is Old Enough to Vote - My Website Can Vote - Building Sites That ...
My Website is Old Enough to Vote - My Website Can Vote - Building Sites That ...My Website is Old Enough to Vote - My Website Can Vote - Building Sites That ...
My Website is Old Enough to Vote - My Website Can Vote - Building Sites That ...
Ā 
PDF Generation in Rails with Prawn and Prawn-to: John McCaffrey
PDF Generation in Rails with Prawn and Prawn-to: John McCaffreyPDF Generation in Rails with Prawn and Prawn-to: John McCaffrey
PDF Generation in Rails with Prawn and Prawn-to: John McCaffrey
Ā 
Scaling High Traffic Web Applications
Scaling High Traffic Web ApplicationsScaling High Traffic Web Applications
Scaling High Traffic Web Applications
Ā 
The Characteristics of a Successful SPA
The Characteristics of a Successful SPAThe Characteristics of a Successful SPA
The Characteristics of a Successful SPA
Ā 
Web performance
Web performanceWeb performance
Web performance
Ā 
Presentation1
Presentation1Presentation1
Presentation1
Ā 
Modern web application devlopment workflow
Modern web application devlopment workflowModern web application devlopment workflow
Modern web application devlopment workflow
Ā 
20130714 php matsuri - highly available php
20130714   php matsuri - highly available php20130714   php matsuri - highly available php
20130714 php matsuri - highly available php
Ā 
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Ā 
MEAN Stack
MEAN StackMEAN Stack
MEAN Stack
Ā 
Javascript - Getting started | DevCom ISITCom
Javascript - Getting started | DevCom ISITComJavascript - Getting started | DevCom ISITCom
Javascript - Getting started | DevCom ISITCom
Ā 
10 step guide to convert HTML to Wordpress
10 step guide to convert HTML to Wordpress10 step guide to convert HTML to Wordpress
10 step guide to convert HTML to Wordpress
Ā 
Les Basiques - Web DĆ©veloppement HTML5, CSS3, JS et PHP
Les Basiques - Web  DĆ©veloppement HTML5, CSS3, JS et PHPLes Basiques - Web  DĆ©veloppement HTML5, CSS3, JS et PHP
Les Basiques - Web DĆ©veloppement HTML5, CSS3, JS et PHP
Ā 

Similar to WP-CLI - Super Admin Tips and Tricks

Making the Most of Plug-ins - WordCamp Toronto 2008
Making the Most of Plug-ins - WordCamp Toronto 2008Making the Most of Plug-ins - WordCamp Toronto 2008
Making the Most of Plug-ins - WordCamp Toronto 2008
Brendan Sera-Shriar
Ā 
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
Ā 
Old WP REST API, New Tricks
Old WP REST API, New TricksOld WP REST API, New Tricks
Old WP REST API, New Tricks
WordPress Community Montreal
Ā 
5 幓後還ę˜Æꖰꉋ - WordPress Plugin 開ē™¼å¤§å†’éšŖ - GOTY
5 幓後還ę˜Æꖰꉋ - WordPress Plugin 開ē™¼å¤§å†’éšŖ - GOTY5 幓後還ę˜Æꖰꉋ - WordPress Plugin 開ē™¼å¤§å†’éšŖ - GOTY
5 幓後還ę˜Æꖰꉋ - WordPress Plugin 開ē™¼å¤§å†’éšŖ - GOTY
William Chong
Ā 
Installing hadoop on ubuntu 16
Installing hadoop on ubuntu 16Installing hadoop on ubuntu 16
Installing hadoop on ubuntu 16
Enrique Davila
Ā 
Installing hadoop on ubuntu 16
Installing hadoop on ubuntu 16Installing hadoop on ubuntu 16
Installing hadoop on ubuntu 16
Enrique Davila
Ā 
å®‰č£…Apache Hadoopēš„č½»ę¾
å®‰č£…Apache Hadoopēš„č½»ę¾å®‰č£…Apache Hadoopēš„č½»ę¾
å®‰č£…Apache Hadoopēš„č½»ę¾
Enrique Davila
Ā 
ē°”å˜ć«Apache Hadoopć®ć‚¤ćƒ³ć‚¹ćƒˆćƒ¼ćƒ«
 ē°”å˜ć«Apache Hadoopć®ć‚¤ćƒ³ć‚¹ćƒˆćƒ¼ćƒ« ē°”å˜ć«Apache Hadoopć®ć‚¤ćƒ³ć‚¹ćƒˆćƒ¼ćƒ«
ē°”å˜ć«Apache Hadoopć®ć‚¤ćƒ³ć‚¹ćƒˆćƒ¼ćƒ«
Enrique Davila
Ā 
WordPress Plugin Development- Rich Media Institute Workshop
WordPress Plugin Development- Rich Media Institute WorkshopWordPress Plugin Development- Rich Media Institute Workshop
WordPress Plugin Development- Rich Media Institute Workshop
Brendan Sera-Shriar
Ā 
Docker for Developers - PNWPHP 2016 Workshop
Docker for Developers - PNWPHP 2016 WorkshopDocker for Developers - PNWPHP 2016 Workshop
Docker for Developers - PNWPHP 2016 Workshop
Chris Tankersley
Ā 
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
Ā 
The GiveCamp Guide to WordPress
The GiveCamp Guide to WordPressThe GiveCamp Guide to WordPress
The GiveCamp Guide to WordPress
Sarah Dutkiewicz
Ā 
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
Ā 
Behaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalBehaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & Drupal
sparkfabrik
Ā 
Behaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalBehaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & Drupal
DrupalDay
Ā 
[HKDUG] #20161210 - BarCamp Hong Kong 2016 - What's News in PHP?
[HKDUG] #20161210 - BarCamp Hong Kong 2016 - What's News in PHP?[HKDUG] #20161210 - BarCamp Hong Kong 2016 - What's News in PHP?
[HKDUG] #20161210 - BarCamp Hong Kong 2016 - What's News in PHP?
Wong Hoi Sing Edison
Ā 
Cms drupal installation & configuration anil mishra
Cms drupal installation & configuration   anil mishraCms drupal installation & configuration   anil mishra
Cms drupal installation & configuration anil mishra
Anil Mishra
Ā 
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
Diana Thompson
Ā 
Hyper v replication on windows server 2016 step by step
Hyper v replication on windows server 2016 step by stepHyper v replication on windows server 2016 step by step
Hyper v replication on windows server 2016 step by step
Ahmed Abdelwahed
Ā 
Get Started With Drupal
Get Started With DrupalGet Started With Drupal
Get Started With Drupal
Kartik Singhal
Ā 

Similar to WP-CLI - Super Admin Tips and Tricks (20)

Making the Most of Plug-ins - WordCamp Toronto 2008
Making the Most of Plug-ins - WordCamp Toronto 2008Making the Most of Plug-ins - WordCamp Toronto 2008
Making the Most of Plug-ins - WordCamp Toronto 2008
Ā 
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
Ā 
Old WP REST API, New Tricks
Old WP REST API, New TricksOld WP REST API, New Tricks
Old WP REST API, New Tricks
Ā 
5 幓後還ę˜Æꖰꉋ - WordPress Plugin 開ē™¼å¤§å†’éšŖ - GOTY
5 幓後還ę˜Æꖰꉋ - WordPress Plugin 開ē™¼å¤§å†’éšŖ - GOTY5 幓後還ę˜Æꖰꉋ - WordPress Plugin 開ē™¼å¤§å†’éšŖ - GOTY
5 幓後還ę˜Æꖰꉋ - WordPress Plugin 開ē™¼å¤§å†’éšŖ - GOTY
Ā 
Installing hadoop on ubuntu 16
Installing hadoop on ubuntu 16Installing hadoop on ubuntu 16
Installing hadoop on ubuntu 16
Ā 
Installing hadoop on ubuntu 16
Installing hadoop on ubuntu 16Installing hadoop on ubuntu 16
Installing hadoop on ubuntu 16
Ā 
å®‰č£…Apache Hadoopēš„č½»ę¾
å®‰č£…Apache Hadoopēš„č½»ę¾å®‰č£…Apache Hadoopēš„č½»ę¾
å®‰č£…Apache Hadoopēš„č½»ę¾
Ā 
ē°”å˜ć«Apache Hadoopć®ć‚¤ćƒ³ć‚¹ćƒˆćƒ¼ćƒ«
 ē°”å˜ć«Apache Hadoopć®ć‚¤ćƒ³ć‚¹ćƒˆćƒ¼ćƒ« ē°”å˜ć«Apache Hadoopć®ć‚¤ćƒ³ć‚¹ćƒˆćƒ¼ćƒ«
ē°”å˜ć«Apache Hadoopć®ć‚¤ćƒ³ć‚¹ćƒˆćƒ¼ćƒ«
Ā 
WordPress Plugin Development- Rich Media Institute Workshop
WordPress Plugin Development- Rich Media Institute WorkshopWordPress Plugin Development- Rich Media Institute Workshop
WordPress Plugin Development- Rich Media Institute Workshop
Ā 
Docker for Developers - PNWPHP 2016 Workshop
Docker for Developers - PNWPHP 2016 WorkshopDocker for Developers - PNWPHP 2016 Workshop
Docker for Developers - PNWPHP 2016 Workshop
Ā 
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
Ā 
The GiveCamp Guide to WordPress
The GiveCamp Guide to WordPressThe GiveCamp Guide to WordPress
The GiveCamp Guide to WordPress
Ā 
Advanced WordPress Tooling: By InstaWP.com
Advanced WordPress Tooling: By InstaWP.comAdvanced WordPress Tooling: By InstaWP.com
Advanced WordPress Tooling: By InstaWP.com
Ā 
Behaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalBehaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & Drupal
Ā 
Behaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalBehaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & Drupal
Ā 
[HKDUG] #20161210 - BarCamp Hong Kong 2016 - What's News in PHP?
[HKDUG] #20161210 - BarCamp Hong Kong 2016 - What's News in PHP?[HKDUG] #20161210 - BarCamp Hong Kong 2016 - What's News in PHP?
[HKDUG] #20161210 - BarCamp Hong Kong 2016 - What's News in PHP?
Ā 
Cms drupal installation & configuration anil mishra
Cms drupal installation & configuration   anil mishraCms drupal installation & configuration   anil mishra
Cms drupal installation & configuration anil mishra
Ā 
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
Ā 
Hyper v replication on windows server 2016 step by step
Hyper v replication on windows server 2016 step by stepHyper v replication on windows server 2016 step by step
Hyper v replication on windows server 2016 step by step
Ā 
Get Started With Drupal
Get Started With DrupalGet Started With Drupal
Get Started With Drupal
Ā 

More from Jonathan Perlman

Leveling Upon Building Forms.pdf
Leveling Upon Building Forms.pdfLeveling Upon Building Forms.pdf
Leveling Upon Building Forms.pdf
Jonathan Perlman
Ā 
WooCommerce Fundamentals
WooCommerce FundamentalsWooCommerce Fundamentals
WooCommerce Fundamentals
Jonathan Perlman
Ā 
Leveling up on Building Forms
Leveling up on Building FormsLeveling up on Building Forms
Leveling up on Building Forms
Jonathan Perlman
Ā 
The Dawson Way of Doing Things: A Study of Our Path Using WordPress
The Dawson Way of Doing Things: A Study of Our Path Using WordPressThe Dawson Way of Doing Things: A Study of Our Path Using WordPress
The Dawson Way of Doing Things: A Study of Our Path Using WordPress
Jonathan Perlman
Ā 
WooCommerce Fundamentals
WooCommerce FundamentalsWooCommerce Fundamentals
WooCommerce Fundamentals
Jonathan Perlman
Ā 
On the Move, Migrations Made Simple
On the Move, Migrations Made SimpleOn the Move, Migrations Made Simple
On the Move, Migrations Made Simple
Jonathan Perlman
Ā 
10 things you need to know about leaving shared hosting
10 things you need to know about leaving shared hosting10 things you need to know about leaving shared hosting
10 things you need to know about leaving shared hosting
Jonathan Perlman
Ā 

More from Jonathan Perlman (7)

Leveling Upon Building Forms.pdf
Leveling Upon Building Forms.pdfLeveling Upon Building Forms.pdf
Leveling Upon Building Forms.pdf
Ā 
WooCommerce Fundamentals
WooCommerce FundamentalsWooCommerce Fundamentals
WooCommerce Fundamentals
Ā 
Leveling up on Building Forms
Leveling up on Building FormsLeveling up on Building Forms
Leveling up on Building Forms
Ā 
The Dawson Way of Doing Things: A Study of Our Path Using WordPress
The Dawson Way of Doing Things: A Study of Our Path Using WordPressThe Dawson Way of Doing Things: A Study of Our Path Using WordPress
The Dawson Way of Doing Things: A Study of Our Path Using WordPress
Ā 
WooCommerce Fundamentals
WooCommerce FundamentalsWooCommerce Fundamentals
WooCommerce Fundamentals
Ā 
On the Move, Migrations Made Simple
On the Move, Migrations Made SimpleOn the Move, Migrations Made Simple
On the Move, Migrations Made Simple
Ā 
10 things you need to know about leaving shared hosting
10 things you need to know about leaving shared hosting10 things you need to know about leaving shared hosting
10 things you need to know about leaving shared hosting
Ā 

Recently uploaded

Large Language Model (LLM) and itā€™s Geospatial Applications
Large Language Model (LLM) and itā€™s Geospatial ApplicationsLarge Language Model (LLM) and itā€™s Geospatial Applications
Large Language Model (LLM) and itā€™s Geospatial Applications
Rohit Gautam
Ā 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
Ā 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
Ā 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
Ā 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
Ā 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
Ā 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
Ā 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
Ā 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
Ā 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
Ā 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
Ā 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
Ā 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Zilliz
Ā 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
Ā 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
Ā 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
Ā 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
Ā 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
Ā 
ā€œIā€™m still / Iā€™m still / Chaining from the Blockā€
ā€œIā€™m still / Iā€™m still / Chaining from the Blockā€ā€œIā€™m still / Iā€™m still / Chaining from the Blockā€
ā€œIā€™m still / Iā€™m still / Chaining from the Blockā€
Claudio Di Ciccio
Ā 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
Ā 

Recently uploaded (20)

Large Language Model (LLM) and itā€™s Geospatial Applications
Large Language Model (LLM) and itā€™s Geospatial ApplicationsLarge Language Model (LLM) and itā€™s Geospatial Applications
Large Language Model (LLM) and itā€™s Geospatial Applications
Ā 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Ā 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Ā 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Ā 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Ā 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Ā 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
Ā 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Ā 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
Ā 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Ā 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
Ā 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Ā 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Ā 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
Ā 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
Ā 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Ā 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Ā 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Ā 
ā€œIā€™m still / Iā€™m still / Chaining from the Blockā€
ā€œIā€™m still / Iā€™m still / Chaining from the Blockā€ā€œIā€™m still / Iā€™m still / Chaining from the Blockā€
ā€œIā€™m still / Iā€™m still / Chaining from the Blockā€
Ā 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Ā 

WP-CLI - Super Admin Tips and Tricks

  • 1. WP-CLI ā€“ Super Admin Level Tips and Tricks JONATHAN PERLMAN @JPURPLEMAN WWW.JPURPLEMAN.CA/WCOTTAWA2016
  • 2. Jonathan Perlman 14 years using PHP & MySql as a web developer at Dawson College 9 years teaching the web and Microsoft Office for Dawson College 6 years using WordPress 2 WordCamp talks Iā€™m not a Linux unicorn 6/18/2016 WORDCAMP OTTAWA 2016
  • 3. What you need to knowā€¦ This works on Linux computers / servers. Might work on Mac. Not tested on Mac. Won't work on Windows. Shared and managed hosts don't allow you to install WP-CLI We won't be talking about WP-CLI "Packagesā€œ All WordPress code samples are located in the repo https://github.com/jpurpleman/WordPress-Stuff 6/18/2016 WORDCAMP OTTAWA 2016
  • 4. WP-CLI Requirements UNIX-like environment (OS X, Linux, FreeBSD, Cygwin); limited support in Windows environment PHP 5.3.29 or later WordPress 3.7 or later WordPress 4.5 or later requires WP-CLI version 0.23.0 6/18/2016 WORDCAMP OTTAWA 2016
  • 5. The way to level up ā€¦ Learn bash! 6/18/2016 WORDCAMP OTTAWA 2016
  • 6. hello-world.sh #!/bin/bash echo 'Hello World!' bash hello-world.sh chmod +x hello-world.sh ./hello-world.sh 6/18/2016 WORDCAMP OTTAWA 2016
  • 7. variables.sh #!/bin/bash error X=hello world X = "hello world" OK X="hello world" #output echo $X 6/18/2016 WORDCAMP OTTAWA 2016
  • 8. conditionals.sh #!/bin/bash city=$1 if [ "$city" == "Ottawa" ] then echo "What a great city" else echo "Hello, you're in WordCamp $city!" fi 6/18/2016 WORDCAMP OTTAWA 2016
  • 9. loops-and-arrays.sh #!/bin/bash servers=( 'web1.example.com' 'web2.example.com' ) for server in "${servers[@]}"; do echo $server done 6/18/2016 WORDCAMP OTTAWA 2016
  • 11. .bashrc & scripts You can run the custom command in any folder Will work for only your user account Better if you have more than one server You have to copy it to work in a specific directory You can create reusable scripts You can create scripts the run scripts 6/18/2016 WORDCAMP OTTAWA 2016
  • 12. Script ā€“ wp-cli-install.sh #!/bin/bash servers=( 'web1.example.com' 'web2.example.comā€˜ ) curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar for server in "${servers[@]}"; do echo $server scp ./wp-cli.phar user@$server: ssh user@$server "chmod +x wp-cli.phar" ssh user@$server "sudo mv wp-cli.phar /usr/local/bin/wp" ssh user@$server "/usr/local/bin/wp --info" done rm ./wp-cli.phar 6/18/2016 WORDCAMP OTTAWA 2016
  • 13. .bashrc - Get WordPress Salts alias wordpress-salt='wget https://api.wordpress.org/secret-key/1.1/salt/ -qO-' Normally one line, not multipleā€¦ 6/18/2016 WORDCAMP OTTAWA 2016
  • 14. .bashrc - Update WordPress alias wordpress-update-all='wp core update && wp core update-db --network && wp plugin update --all && wp theme update --all ' Normally one line, not multipleā€¦ 6/18/2016 WORDCAMP OTTAWA 2016
  • 15. .bashrc ā€“ Delete Sample Page alias wordpress-delete-sample-page=ā€˜wp post delete $( wp post list --post_type=page --posts_per_page=1 --post_status=publish --pagename="sample-page" --field=ID --format=ids )ā€™ 6/18/2016 WORDCAMP OTTAWA 2016
  • 16. .bashrc - Remove Default Widgets alias wordpress-remove-default-widgets=' wp widget delete search-2 && wp widget delete recent-posts-2 && wp widget delete recent-comments-2 && wp widget delete archives-2 && wp widget delete categories-2 && wp widget delete meta-2' Normally one line, not multipleā€¦ 6/18/2016 WORDCAMP OTTAWA 2016
  • 17. Script - see-option-on-all-sites.sh #!/bin/bash for url in $( wp site list --field=url --url=http://site.com | sort ā€“u ) do echo $url wp option get blogname done 6/18/2016 WORDCAMP OTTAWA 2016
  • 18. see-all-sites-with-gravity-forms.sh #!/bin/bash for blog_id in $(wp site list --field=blog_id --url=http://site.com | sort -u ) do echo $blog_id wp db query "select count(id) from wp_${blog_id}_rg_form" done 6/18/2016 WORDCAMP OTTAWA 2016
  • 19. Script - create-pages-in-bluk.sh ( 1 ) userID=1 pages=( 'Home' 'About' 'Contact Us' ) for page in "${pages[@]}"; do wp post create --post_type=page --post_title="$page" --post_status=publish --post_author=$userID --porcelain echo "wp post create $page" done 6/18/2016 WORDCAMP OTTAWA 2016
  • 20. Script - create-pages-in-bluk.sh ( 2 ) wp menu create "Menu" --quiet export IFS=" " for pageID in $( wp post list --order="ASC" --orderby="ID" --post_type=page --post_status=publish --posts_per_page=-1 --field=ID --format=ids ); do wp menu item add-post menu $pageID --quiet done wp menu location assign menu primary 6/18/2016 WORDCAMP OTTAWA 2016
  • 21. Now to the real timesavers! 6/18/2016 WORDCAMP OTTAWA 2016
  • 22. Resulting git log ā€“ 14 commits 123438b 2016-06-16 Jonathan Perlman Adding plugin: WordPress Importer at version 0.6.2 449e092 2016-06-16 Jonathan Perlman Updating plugin: Print Friendly and PDF to version 3.4.6 b1d983a 2016-06-16 Jonathan Perlman Updating plugin: WooThemes Helper to version 1.6.2 8d2d7e3 2016-06-16 Jonathan Perlman Updating plugin: WP Migrate DB Pro Media Files to version 1.4.4 ce0181e 2016-06-16 Jonathan Perlman Updating plugin: WP Migrate DB Pro to version 1.6 3a37bd6 2016-06-16 Jonathan Perlman Updating plugin: Gravity Forms + Custom Post Types to version 3.1.3 91e2560 2016-06-16 Jonathan Perlman Updating plugin: jQuery Responsive Select Menu to version 1.5.0 83af679 2016-06-16 Jonathan Perlman Updating plugin: Gravity Forms to version 1.9.19 bbaa123 2016-06-16 Jonathan Perlman Adding plugin: Gravity Forms Advanced File Uploader at version 1.4 41b2ae1 2016-06-16 Jonathan Perlman Updating plugin: Google Analytics by MonsterInsights to version 5.5 81eac9d 2016-06-16 Jonathan Perlman Updating plugin: Custom Post Type UI to version 1.3.5 fbcc677 2016-06-16 Jonathan Perlman Updating plugin: Basic Google Maps Placemarks to version 1.10.6 c5bdb6c 2016-06-16 Jonathan Perlman Updating plugin: Advanced Custom Fields to version 4.4.7 476c404 2016-06-16 Jonathan Perlman Updating plugin: Accordion Shortcodes to version 2.3.0 6/18/2016 WORDCAMP OTTAWA 2016
  • 23. .bashrc ā€“ git-wp-commit-object ( 1 ) Go into a plugin or theme folder Get the current directory name Check to see if we're in a plugin or theme folder Convert "plugins" to plugin or "themes" to theme Get details about the WordPress object we want to commit Get the title of the plugin or theme we're committing Get the version of the plugin or theme we're committing 6/18/2016 WORDCAMP OTTAWA 2016
  • 24. .bashrc ā€“ git-wp-commit-object ( 2 ) Check to see if it's in the repo already or not Create parts of the commit message conditionally Add all files to git that have been added or modified Add all files to git that have been deleted or moved Git commit! with appropriate message Print that message 6/18/2016 WORDCAMP OTTAWA 2016
  • 25. Script ā€“ wp-install.sh If we're going to remove sites Do mysql stuff to drop the db, revoke all and remove the user Destroy the file system folder of the site If weā€™re going to add sites Loop proposed sites and make sure we don't overwrite any folder Mysql stuff, drop db if exists, create database, grant privileges Delete and Create the directory of the install path Go into the install path Download the WordPress core files Create the wp-config file with our standard setup Generate random 8 character password Create database tables, and install WordPress Dump out information to a text file for the teacher Dump out information for the specific student discourage search engines delete sample page, and create homepage set homepage as front page set pretty urls delete akismet and hello dolly create a navigation bar disable file edit in wordpress config create .htaccess file create the .htpasswd file change ownership of the folder to apache change file permissions Calculate and send percent done to whiptail Convert text file of info for teacher to pdf Convert many student one page documents into one pdf 6/18/2016 WORDCAMP OTTAWA 2016
  • 27. Thank you! Questions? JONATHAN PERLMAN @JPURPLEMAN WWW.JPURPLEMAN.CA/WCOTTAWA2016