Friday, 27 January 2017

How to Include Unstage Files to Previous Commit in Git

Source : How to Include Unstage Files to Previous Commit in Git
Published On : January 27, 2017 at 09:14PM
By : Collins Agbonghama

While working today, i forgot to stage some unstaged files before creating a commit. After staging with git add -A, I wanted the staged files to be included to the previous commit.

git commit --amend --no-edit to the rescue.…



For More Go to : W3Guy

Labels:

Monday, 23 January 2017

Automated WordPress PHPUnit Testing on GitLab CI

Source : Automated WordPress PHPUnit Testing on GitLab CI
Published On : January 23, 2017 at 01:57PM
By : Collins Agbonghama

In a previous post, i showed us how to set up automated PHP testing on GitLab CI.

If you are a WordPress developer and has a test suite already for your plugin, theme or WordPress powered web application and would love to use the GitLab CI to run it; my .gitlab-ci.yml below will come in handy.

# Select what we should cache
cache:
  paths:
  - vendor/

services:
- mysql

before_script:
# Install git, the php image doesn't have installed
- apt-get update -yqq
- apt-get install git -yqq

# instll the required packages for the running CI tests
- apt-get -yqqf install vim wget zip unzip subversion mysql-client libmcrypt-dev libmysqlclient-dev --fix-missing

# Install mysql driver
- docker-php-ext-install mysqli pdo_mysql mbstring

# Install Xdebug
- pecl install xdebug

# PHP extensions
- docker-php-ext-enable mysqli pdo_mysql mbstring xdebug

# Install composer
- curl -sS http://ift.tt/SI3ujS | php

# Install all project dependencies
- php composer.phar install

- bash bin/install-wp-tests.sh wordpress_test root mysql mysql $WP_VERSION

variables:
  # Configure mysql service (http://ift.tt/1ILGo6v)
  MYSQL_DATABASE: wordpress_tests
  MYSQL_ROOT_PASSWORD: mysql
  WP_VERSION: latest
  WP_MULTISITE: "0"

# We test PHP5.6
test:php5.6:
  image: php:5.6
  script:
  - vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clove --colors=never

# We test PHP5.6 with multisite
test:php5.6:multisite:
  variables:
   WP_VERSION: latest
   WP_MULTISITE: "1"
  image: php:5.6
  script:
  - vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clove --colors=never

# We test PHP7
test:php7:
  image: php:7
  script:
  - vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover --colors=never


# We test PHP7 with multisite
test:php7:multisite:
  variables:
   WP_VERSION: latest
   WP_MULTISITE: "1"
  image: php:7
  script:
  - vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clove --colors=never

Note

The YAML configuration above assume you have your WordPress unit test created with WP CLI hence the bash bin/install-wp-tests.sh wordpress_test root mysql mysql $WP_VERSION.…



For More Go to : W3Guy

Labels:

Tuesday, 10 January 2017

Splitting a Subfolder out into Its Own Repository with Git Subtree

Source : Splitting a Subfolder out into Its Own Repository with Git Subtree
Published On : January 10, 2017 at 01:02PM
By : Collins Agbonghama

I have secretly been working on a project for a number of months now. It got a point where I decided it will be best to split some folders in the project out into their own Git repositories. Previously, the project was a large monolithic application.

I didn’t want to just split them out on a blank slate but have their Git histories maintained.…



For More Go to : W3Guy – Diary of a Programmer, Writer & Geek

Labels:

Wednesday, 4 January 2017

Migrating WordPress to HTTPS / SSL the Easy Way

Source : Migrating WordPress to HTTPS / SSL the Easy Way
Published On : January 04, 2017 at 10:26AM
By : Collins Agbonghama

I recently migrated this blog to HTTPS/SSL in light of Google announcement of using https as a ranking signal.

Chrome (the most popular web browser) currently indicates HTTP connections with a neutral indicator. This doesn’t reflect the true lack of security for HTTP connections. Starting January 2017, Chrome 56 will label HTTP pages with password or credit card form fields as “not secure,” given their particularly sensitive nature.…



For More Go to : W3Guy – Diary of a Programmer, Writer & Geek

Labels: