Skip to content

Instantly share code, notes, and snippets.

View jadonn's full-sized avatar
🦥

Jadon N jadonn

🦥
View GitHub Profile
@jadonn
jadonn / editor-test.js
Created February 14, 2018 19:42
Really simple script to login to WordPress admin dashboard, navigate to the page editor, change the title, and submit the page. Records a screenshot at the end.
const webdriverio = require('webdriverio');
const options = {
desiredCapabilities: {
browserName: 'chrome',
},
protocol: 'http',
host: 'selenium-host',
logLevel: 'verbose'
};
@jadonn
jadonn / wp-auto-update-cpanel.sh
Created March 9, 2018 20:42
Start of a shell script to check for WordPress updates for a site and to make a backup of the site if there are updates.
#1/bin/bash
create_subdomain()
{
cpapi2 SubDomain addsubdomain domain=$BUILD_NUMBER rootdomain=$HOME_DOMAIN dir=$HOME/$BUILD_NUMBER.$HOME_DOMAIN disallowdot=1
}
copy_files()
{
mkdir $HOME/$BUILD_NUMBER.$HOME_DOMAIN