the wordpress developer's toolkit

32
@@iv_wp The WordPress Developer's Toolkit Technical Tool Guide

Upload: ivelina-dimova

Post on 18-Jan-2017

237 views

Category:

Technology


0 download

TRANSCRIPT

@@iv_wp

The WordPress Developer's Toolkit

Technical Tool Guide

Issues to solve

➢ Local installs automation

➢ Testing

➢ Deployment

Flying Start

➢ 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

Setup a New Project

Switch between WordPress Versions

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.”

Requirements

➢ Git➢ Virtual machine software (VMware or VirtualBox are

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

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.

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

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.

The DB problem

Next Step

<?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!');

?>

What we can test?

➢ Forms

➢ Clicks

➢ Check Elements

➢ Grabbers

➢ Cookies, Urls, Title

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.

Web Browser and Selenium

wp-browsermodules:

enabled:

- WPBrowser

config:

WPBrowser:

url: 'http://example.local'

adminUsername: 'root'

adminPassword: 'root'

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

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);

Deployment

Capistrano

As a deployment tool

Features

➢ Different stages of deployment

➢ Secure deployment via SSH

➢ Sets different WordPress versions on server

➢ Symlinks to protect not deployed folders

➢ Backups

➢ Roll Back

git push

Add remote locally

- check remotes – git remote -v

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

git push <branch name needed>

Features

➢ Easy to use

➢ No need of additional setup

➢ Easy to revert

➢ Supported by many hosts

What to pick?

Thank you!