YOU ARE DOWNLOADING DOCUMENT

Please tick the box to continue:

Transcript
Page 1: The WordPress developer's toolkit

@@iv_wp

The WordPress Developer's Toolkit

Technical Tool Guide

Page 2: The WordPress developer's toolkit
Page 3: The WordPress developer's toolkit

Issues to solve

➢ Local installs automation

➢ Testing

➢ Deployment

Page 4: The WordPress developer's toolkit

Flying Start

Page 5: The WordPress developer's toolkit
Page 6: The WordPress developer's toolkit

➢ Ruby >= 1.9.3 (JRuby and C-Ruby/YARV are supported)

➢ Capistrano support these source code version control systems out of the box:○ Git 1.8 or higher○ Mercurial○ SVN

Requirements

Page 7: The WordPress developer's toolkit
Page 8: The WordPress developer's toolkit

Setup a New Project

Page 9: The WordPress developer's toolkit

Switch between WordPress Versions

Page 10: The WordPress developer's toolkit

Mercury Vagrant

“Mercury project is meant to allow people in the

WordPress community to run a single Vagrant for developing, debugging, and deploying HHVM

based code.”

Page 11: The WordPress developer's toolkit

Requirements

➢ Git➢ Virtual machine software (VMware or VirtualBox are

recommended)➢ Vagrant➢ Node➢ Vagrant Ghost plugin - for automation of hosts file updates

Page 12: The WordPress developer's toolkit

Local Install Set-Up

New project folder in hgv/sites provisioning/default-install.yml → hgv_data/config/sites/default.ymlConfig the yml file

Run vagrant provision.

Page 13: The WordPress developer's toolkit

What do you get?

➢ Fresh WordPress install with some useful plugins

➢ All config files set up➢ DB set up ➢ Debug tools➢ ssh access to the vagrant files➢ caching if needed – Memcache / Varnish

Page 14: The WordPress developer's toolkit

WP CLI

WP-CLI is a set of command-line tools for managing WordPress installations. You can update plugins, set up

multisite installs and much more, without using a web

browser.

Page 15: The WordPress developer's toolkit
Page 16: The WordPress developer's toolkit

The DB problem

Page 17: The WordPress developer's toolkit

Next Step

Page 18: The WordPress developer's toolkit
Page 19: The WordPress developer's toolkit

<?php

$I = new AcceptanceTester($scenario);

$I->wantTo('sign in');

$I->amOnPage('/login');

$I->fillField('username', 'davert');

$I->fillField('password', 'qwerty');

$I->click('LOGIN');

$I->see('Welcome, Davert!');

?>

Page 20: The WordPress developer's toolkit

What we can test?

➢ Forms

➢ Clicks

➢ Check Elements

➢ Grabbers

➢ Cookies, Urls, Title

Page 21: The WordPress developer's toolkit

Selenium WebDriver

Selenium-WebDriver was developed to better support dynamic web pages

where elements of a page may change without the page itself being reloaded.

WebDriver’s goal is to supply a well-designed object-oriented API that provides

improved support for modern advanced web-app testing problems.

Selenium-WebDriver makes direct calls to the browser using each browser’s

native support for automation.

Page 22: The WordPress developer's toolkit

Web Browser and Selenium

Page 23: The WordPress developer's toolkit

wp-browsermodules:

enabled:

- WPBrowser

config:

WPBrowser:

url: 'http://example.local'

adminUsername: 'root'

adminPassword: 'root'

adminUrl: '/wp-core/wp-admin'

Page 24: The WordPress developer's toolkit

Usage// login as administrator using username and password

public function loginAsAdmin();

// login as user

public function loginAs($username, $password);

// go the plugins page

public function amOnPluginsPage();

// activate a plugin from the plugin page

public function activatePlugin($pluginSlug);

// deactivate a plugin from the plugin page

public function deactivatePlugin($pluginSlug);

Page 25: The WordPress developer's toolkit

Deployment

Page 26: The WordPress developer's toolkit

Capistrano

As a deployment tool

Page 27: The WordPress developer's toolkit

Features

➢ Different stages of deployment

➢ Secure deployment via SSH

➢ Sets different WordPress versions on server

➢ Symlinks to protect not deployed folders

➢ Backups

➢ Roll Back

Page 28: The WordPress developer's toolkit

git push

Add remote locally

- check remotes – git remote -v

- add remote – git remote add <your repo ssh link>

git push <branch name needed>

Page 29: The WordPress developer's toolkit

Features

➢ Easy to use

➢ No need of additional setup

➢ Easy to revert

➢ Supported by many hosts

Page 30: The WordPress developer's toolkit

What to pick?

Page 31: The WordPress developer's toolkit

Thank you!


Related Documents