diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..72cf9d0 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "dev-lib"] + path = dev-lib + url = https://github.com/xwp/wp-plugin-dev-lib.git + branch = vip-themes diff --git a/.travis.yml b/.travis.yml deleted file mode 120000 index 948a887..0000000 --- a/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -bin/.travis.yml \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..b0ba908 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,27 @@ +language: + - php + - node_js + +php: + - 5.4 + - 5.5 + +node_js: + - 0.10 + +env: + - WP_VERSION=latest WP_MULTISITE=0 + - WP_VERSION=latest WP_MULTISITE=1 + - WP_VERSION=4.0 WP_MULTISITE=0 + - WP_VERSION=4.0 WP_MULTISITE=1 + +before_script: + - export DEV_LIB_PATH=dev-lib + - if [ ! -e "$DEV_LIB_PATH" ] && [ -L .travis.yml ]; then export DEV_LIB_PATH=$( dirname $( readlink .travis.yml ) ); fi + - source $DEV_LIB_PATH/travis.before_script.sh + +script: + - $DEV_LIB_PATH/travis.script.sh + +after_script: + - $DEV_LIB_PATH/travis.after_script.sh diff --git a/bin/.jshintrc b/bin/.jshintrc deleted file mode 100644 index bf11264..0000000 --- a/bin/.jshintrc +++ /dev/null @@ -1,20 +0,0 @@ -{ - "boss": true, - "curly": true, - "eqeqeq": true, - "eqnull": true, - "expr": true, - "immed": true, - "noarg": true, - "quotmark": "single", - "trailing": true, - "undef": true, - "unused": true, - - "browser": true, - - "globals": { - "jQuery": false, - "wp": false - } -} diff --git a/bin/.travis.yml b/bin/.travis.yml deleted file mode 100644 index ae1da44..0000000 --- a/bin/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ -language: - - php - - node_js - -php: - - 5.3 - - 5.4 - -node_js: - - 0.10 - -env: - - WP_VERSION=master WP_MULTISITE=0 - - WP_VERSION=master WP_MULTISITE=1 - - WP_VERSION=latest WP_MULTISITE=0 - - WP_VERSION=latest WP_MULTISITE=1 - -before_script: - - export WP_TESTS_DIR=/tmp/wordpress-tests/ - - export PLUGIN_DIR=$(pwd) - - export PLUGIN_SLUG=$(basename $(pwd) | sed 's/^wp-//') - - if [ -e phpunit.xml ] || [ -e phpunit.xml.dist ]; then bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION; cd /tmp/wordpress/wp-content/plugins; ln -s $PLUGIN_DIR $PLUGIN_SLUG; cd $PLUGIN_DIR; fi - - pear config-set auto_discover 1 - - pear install PHP_CodeSniffer - - git clone git://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $(pear config-get php_dir)/PHP/CodeSniffer/Standards/WordPress - - phpenv rehash - - npm install -g jshint - -script: - - find . -path ./bin -prune -o \( -name '*.php' -o -name '*.inc' \) -exec php -lf {} \; - - if [ -e phpunit.xml ] || [ -e phpunit.xml.dist ]; then phpunit; fi - - phpcs --standard=$(if [ -e ruleset.xml ]; then echo ruleset.xml; else echo WordPress; fi) $(find . -name '*.php') - - jshint . diff --git a/bin/class-wordpress-readme-parser.php b/bin/class-wordpress-readme-parser.php deleted file mode 100644 index 784b219..0000000 --- a/bin/class-wordpress-readme-parser.php +++ /dev/null @@ -1,203 +0,0 @@ - (@westonruter) - * @copyright Copyright (c) 2013, X-Team - * @license GPLv2+ - */ - -class WordPress_Readme_Parser { - public $path; - public $source; - public $title = ''; - public $short_description = ''; - public $metadata = array(); - public $sections = array(); - - function __construct( $args = array() ) { - $args = array_merge( get_object_vars( $this ), $args ); - foreach ( $args as $key => $value ) { - $this->$key = $value; - } - - $this->source = file_get_contents( $this->path ); - if ( ! $this->source ) { - throw new Exception( 'readme.txt was empty or unreadable' ); - } - - // Parse metadata - $syntax_ok = preg_match( '/^=== (.+?) ===\n(.+?)\n\n(.+?)\n(.+)/s', $this->source, $matches ); - if ( ! $syntax_ok ) { - throw new Exception( 'Malformed metadata block' ); - } - $this->title = $matches[1]; - $this->short_description = $matches[3]; - $readme_txt_rest = $matches[4]; - $this->metadata = array_fill_keys( array( 'Contributors', 'Tags', 'Requires at least', 'Tested up to', 'Stable tag', 'License', 'License URI' ), null ); - foreach ( explode( "\n", $matches[2] ) as $metadatum ) { - if ( ! preg_match( '/^(.+?):\s+(.+)$/', $metadatum, $metadataum_matches ) ) { - throw new Exception( "Parse error in $metadatum" ); - } - list( $name, $value ) = array_slice( $metadataum_matches, 1, 2 ); - $this->metadata[$name] = $value; - } - $this->metadata['Contributors'] = preg_split( '/\s*,\s*/', $this->metadata['Contributors'] ); - $this->metadata['Tags'] = preg_split( '/\s*,\s*/', $this->metadata['Tags'] ); - - $syntax_ok = preg_match_all( '/(?:^|\n)== (.+?) ==\n(.+?)(?=\n== |$)/s', $readme_txt_rest, $section_matches, PREG_SET_ORDER ); - if ( ! $syntax_ok ) { - throw new Exception( 'Failed to parse sections from readme.txt' ); - } - foreach ( $section_matches as $section_match ) { - array_shift( $section_match ); - - $heading = array_shift( $section_match ); - $body = trim( array_shift( $section_match ) ); - $subsections = array(); - - // @todo Parse out front matter /(.+?)(\n=\s+.+$)/s - - // Parse subsections - if ( preg_match_all( '/(?:^|\n)= (.+?) =\n(.+?)(?=\n= |$)/s', $body, $subsection_matches, PREG_SET_ORDER ) ) { - $body = null; - foreach ( $subsection_matches as $subsection_match ) { - array_shift( $subsection_match ); - $subsections[] = array( - 'heading' => array_shift( $subsection_match ), - 'body' => trim( array_shift( $subsection_match ) ), - ); - } - } - - $this->sections[] = compact( 'heading', 'body', 'subsections' ); - } - } - - /** - * Convert the parsed readme.txt into Markdown - * @param array|string [$params] - * @return string - */ - function to_markdown( $params = array() ) { - - $general_section_formatter = function ( $body ) use ( $params ) { - $body = preg_replace( - '#\[youtube\s+(?:http://www\.youtube\.com/watch\?v=|http://youtu\.be/)(.+?)\]#', - '[![Play video on YouTube](http://i1.ytimg.com/vi/$1/hqdefault.jpg)](http://www.youtube.com/watch?v=$1)', - $body - ); - return $body; - }; - - // Parse sections - $section_formatters = array( - 'Description' => function ( $body ) use ( $params ) { - if ( isset( $params['travis_ci_url'] ) ) { - $body .= sprintf( "\n\n[![Build Status](%s.png?branch=master)](%s)", $params['travis_ci_url'], $params['travis_ci_url'] ); - } - return $body; - }, - 'Screenshots' => function ( $body ) { - $body = trim( $body ); - $new_body = ''; - if ( ! preg_match_all( '/^\d+\. (.+?)$/m', $body, $screenshot_matches, PREG_SET_ORDER ) ) { - throw new Exception( 'Malformed screenshot section' ); - } - foreach ( $screenshot_matches as $i => $screenshot_match ) { - $img_extensions = array( 'jpg', 'gif', 'png' ); - foreach ( $img_extensions as $ext ) { - $filepath = sprintf( 'assets/screenshot-%d.%s', $i + 1, $ext ); - if ( file_exists( dirname( $this->path ) . DIRECTORY_SEPARATOR . $filepath ) ) { - break; - } - else { - $filepath = null; - } - } - if ( empty( $filepath ) ) { - continue; - } - - $screenshot_name = $screenshot_match[1]; - $new_body .= sprintf( "### %s\n", $screenshot_name ); - $new_body .= "\n"; - $new_body .= sprintf( "![%s](%s)\n", $screenshot_name, $filepath ); - $new_body .= "\n"; - } - return $new_body; - }, - ); - - // Format metadata - $formatted_metadata = $this->metadata; - $formatted_metadata['Contributors'] = join( - ', ', - array_map( - function ( $contributor ) { - $contributor = strtolower( $contributor ); - // @todo Map to GitHub account - return sprintf( '[%1$s](http://profiles.wordpress.org/%1$s)', $contributor ); - }, - $this->metadata['Contributors'] - ) - ); - $formatted_metadata['Tags'] = join( - ', ', - array_map( - function ( $tag ) { - return sprintf( '[%1$s](http://wordpress.org/plugins/tags/%1$s)', $tag ); - }, - $this->metadata['Tags'] - ) - ); - $formatted_metadata['License'] = sprintf( '[%s](%s)', $formatted_metadata['License'], $formatted_metadata['License URI'] ); - unset( $formatted_metadata['License URI'] ); - if ( $this->metadata['Stable tag'] === 'trunk' ) { - $formatted_metadata['Stable tag'] .= ' (master)'; - } - - // Render metadata - $markdown = "\n"; - $markdown .= sprintf( "# %s\n", $this->title ); - $markdown .= "\n"; - if ( file_exists( 'assets/banner-1544x500.png' ) ) { - $markdown .= '![Banner](assets/banner-1544x500.png)'; - $markdown .= "\n"; - } - $markdown .= sprintf( "%s\n", $this->short_description ); - $markdown .= "\n"; - foreach ( $formatted_metadata as $name => $value ) { - $markdown .= sprintf( "**%s:** %s \n", $name, $value ); - } - $markdown .= "\n"; - - foreach ( $this->sections as $section ) { - $markdown .= sprintf( "## %s ##\n", $section['heading'] ); - $markdown .= "\n"; - - $body = $section['body']; - - $body = call_user_func( $general_section_formatter, $body ); - if ( isset( $section_formatters[$section['heading']] ) ) { - $body = trim( call_user_func( $section_formatters[$section['heading']], $body ) ); - } - - if ( $body ) { - $markdown .= sprintf( "%s\n", $body ); - } - foreach ( $section['subsections'] as $subsection ) { - $markdown .= sprintf( "### %s ###\n", $subsection['heading'] ); - $markdown .= sprintf( "%s\n", $subsection['body'] ); - $markdown .= "\n"; - } - - $markdown .= "\n"; - } - - return $markdown; - } - -} diff --git a/bin/contributing.md b/bin/contributing.md deleted file mode 100644 index 8d23e4b..0000000 --- a/bin/contributing.md +++ /dev/null @@ -1,3 +0,0 @@ -Pull requests should be opened with the `develop` branch as the base. Do not -open pull requests into the `master` branch, as this branch contains the latest -stable release. diff --git a/bin/generate-markdown-readme b/bin/generate-markdown-readme deleted file mode 100755 index d819a0e..0000000 --- a/bin/generate-markdown-readme +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env php - (@westonruter) - * @copyright Copyright (c) 2013, X-Team - * @license GPLv2+ - */ - -try { - if ( php_sapi_name() !== 'cli' ) { - throw new Exception( 'Only allowed in CLI mode.' ); - } - - $readme_txt_path = null; - while ( true ) { - foreach ( array( 'readme.txt', 'README.txt' ) as $readme_filename ) { - if ( file_exists( $readme_filename ) ) { - $readme_txt_path = realpath( $readme_filename ); - break; - } - } - - $old_cwd = getcwd(); - if ( ! empty( $readme_txt_path ) || ! chdir( '..' ) || getcwd() === $old_cwd ) { - break; - } - } - if ( empty( $readme_txt_path ) ) { - throw new Exception( 'Failed to find a readme.txt or README.txt above the current working directory.' ); - } - - $readme_root = dirname( $readme_txt_path ); - $readme_md_path = preg_replace( '/txt$/', 'md', $readme_txt_path ); - - require_once __DIR__ . '/class-wordpress-readme-parser.php'; - - $readme = new WordPress_Readme_Parser( array( 'path' => $readme_txt_path ) ); - - $md_args = array(); - if ( file_exists( $readme_root . '/.travis.yml' ) ) { - $md_args['travis_ci_url'] = preg_replace( '/^.+?:(.+)\.git$/', 'https://travis-ci.org/$1', trim( `git config --get remote.origin.url` ) ); - } - $markdown = $readme->to_markdown( $md_args ); - - $is_written = file_put_contents( $readme_md_path, $markdown ); - if ( ! $is_written ) { - throw new Exception( sprintf( 'Failed to write to %s', $readme_md_path ) ); - } - fwrite( STDERR, 'Successfully converted WordPress README to Markdown' . PHP_EOL ); - fwrite( STDOUT, $readme_md_path . PHP_EOL ); -} -catch( Exception $e ) { - fwrite( STDERR, $e->getMessage() . PHP_EOL ); - exit( 1 ); -} diff --git a/bin/install-wp-tests.sh b/bin/install-wp-tests.sh deleted file mode 100755 index 464772b..0000000 --- a/bin/install-wp-tests.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env bash - -if [ $# -lt 3 ]; then - echo "usage: $0 [db-host] [wp-version]" - exit 1 -fi - -DB_NAME=$1 -DB_USER=$2 -DB_PASS=$3 -DB_HOST=${4-localhost} -WP_VERSION=${5-master} - -set -ex - -# set up a WP install -WP_CORE_DIR=/tmp/wordpress/ -mkdir -p $WP_CORE_DIR - -if [ $WP_VERSION == 'latest' ]; then - ARCHIVE_URL='http://wordpress.org/latest.tar.gz' -else - ARCHIVE_URL="https://github.com/WordPress/WordPress/tarball/$WP_VERSION" -fi - -wget -nv -O /tmp/wordpress.tar.gz $ARCHIVE_URL -tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C $WP_CORE_DIR - -# set up testing suite -svn co --ignore-externals --quiet http://unit-tests.svn.wordpress.org/trunk/ $WP_TESTS_DIR - -# portable in-place argument for both GNU sed and Mac OSX sed -if [[ $(uname -s) == 'Darwin' ]]; then - ioption='-i ""' -else - ioption='-i' -fi - -# generate testing config file -cd $WP_TESTS_DIR -cp wp-tests-config-sample.php wp-tests-config.php -sed $ioption "s:dirname( __FILE__ ) . '/wordpress/':'$WP_CORE_DIR':" wp-tests-config.php -sed $ioption "s/yourdbnamehere/$DB_NAME/" wp-tests-config.php -sed $ioption "s/yourusernamehere/$DB_USER/" wp-tests-config.php -sed $ioption "s/yourpasswordhere/$DB_PASS/" wp-tests-config.php -sed $ioption "s|localhost|${DB_HOST}|" wp-tests-config.php - -# parse DB_HOST for port or socket references -PARTS=(${DB_HOST//\:/ }) -DB_HOSTNAME=${PARTS[0]}; -DB_SOCK_OR_PORT=${PARTS[1]}; -EXTRA="" - -if ! [ -z $DB_HOSTNAME ] ; then - if [[ "$DB_SOCK_OR_PORT" =~ ^[0-9]+$ ]] ; then - EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp" - elif ! [ -z $DB_SOCK_OR_PORT ] ; then - EXTRA=" --socket=$DB_SOCK_OR_PORT" - elif ! [ -z $DB_HOSTNAME ] ; then - EXTRA=" --host=$DB_HOSTNAME --protocol=tcp" - fi -fi - -# create database -mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA diff --git a/bin/phpcs.ruleset.xml b/bin/phpcs.ruleset.xml deleted file mode 100644 index aeb1d34..0000000 --- a/bin/phpcs.ruleset.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - Generally-applicable sniffs for WordPress plugins - - - - - - - - /tests/* - - - - - - - - - - - - - - - - diff --git a/bin/pre-commit b/bin/pre-commit deleted file mode 100755 index b755ec1..0000000 --- a/bin/pre-commit +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash -# WordPress Plugin pre-commit hook - -set -e - -message="Checking staged changes..." -git_status_egrep='^[MARC].+' - -for i; do - case "$i" - in - -m) - message="Checking any uncommitted changes..." - git_status_egrep='^.?[MARC].+' - shift;; - esac -done - -echo $message - -# Check for staged JS files -IFS=$'\n' staged_js_files=( $(git status --porcelain | sed 's/[^ ]* -> *//g' | egrep $git_status_egrep'\.js$' | cut -c4-) ) -if [ ${#staged_js_files[@]} != 0 ]; then - # JSHint - if [ -e .jshintrc ]; then - echo "## jslint" - if command -v jshint >/dev/null 2>&1; then - jshint "${staged_js_files[@]}" - else - echo "Skipping jshint since not installed" - fi - fi - -fi - -# Check for staged PHP files -IFS=$'\n' staged_php_files=( $(git status --porcelain | sed 's/[^ ]* -> *//g' | egrep $git_status_egrep'\.php$' | cut -c4-) ) -if [ ${#staged_php_files[@]} != 0 ]; then - # PHP Syntax Check - for php_file in "${staged_php_files[@]}"; do - php -lf $php_file - done - - # PHPUnit - if [ -e phpunit.xml ] || [ -e phpunit.xml.dist ]; then - echo "## phpunit" - if [ "$USER" != 'vagrant' ] && command -v vagrant >/dev/null 2>&1 && command -v vassh >/dev/null 2>&1; then - echo "Running phpunit in vagrant..." - vassh phpunit - elif ! command -v phpunit >/dev/null 2>&1;then - echo "Skipping phpunit since not installed" - elif [ -z "$WP_TESTS_DIR" ]; then - echo "Skipping phpunit since WP_TESTS_DIR env missing" - else - phpunit - fi - fi - - # PHP_CodeSniffer WordPress Coding Standards - echo "## phpcs" - if command -v phpcs >/dev/null 2>&1; then - phpcs_standard=$(if [ -e ruleset.xml ]; then echo ruleset.xml; else echo WordPress; fi) - phpcs -p -s -v --standard=$phpcs_standard "${staged_php_files[@]}" - else - echo "Skipping phpcs since not installed" - fi -fi - -# Make sure the readme.md never gets out of sync with the readme.txt -generate_markdown_readme=$(find . -name generate-markdown-readme -print -quit) -if [ -n "$generate_markdown_readme" ]; then - markdown_readme_path=$($generate_markdown_readme) - git add $markdown_readme_path -fi diff --git a/bin/readme.md b/bin/readme.md deleted file mode 100644 index 38c5812..0000000 --- a/bin/readme.md +++ /dev/null @@ -1,54 +0,0 @@ -wp-plugin-dev-lib -================= - -**Common code used during development of WordPress plugins** - -It is intended that this repo be included in plugin repo via git-subtree/submodule in a `bin/` directory. - -To **add** it to your repo, do: - -```bash -git subtree add --prefix bin \ - git@github.com:x-team/wp-plugin-dev-lib.git master --squash -``` - -To **update** the library with the latest changes: - -```bash -git subtree pull --prefix bin \ - git@github.com:x-team/wp-plugin-dev-lib.git master --squash -``` - -And if you have changes you want to **upstream**, do: - -```bash -git subtree push --prefix bin \ - git@github.com:x-team/wp-plugin-dev-lib.git master -``` - -Symlink to the `.travis.yml`, `.jshintrc`, and `phpcs.ruleset.xml` inside of the `bin/` directory you added: - -```bash -ln -s bin/.travis.yml . && git add .travis.yml -ln -s bin/.jshintrc . && git add .jshintrc -ln -s bin/phpcs.ruleset.xml . && git add phpcs.ruleset.xml -``` - -Symlink to `pre-commit` from your project's `.git/hooks/pre-commit`: - -```bash -cd .git/hooks -ln -s ../../bin/pre-commit . -``` - -The library includes a WordPress README [parser](class-wordpress-readme-parser.php) and [converter](generate-markdown-readme) to Markdown, -so you don't have to manually keep your `readme.txt` on WordPress.org in sync with the `readme.md` you have on GitHub. The -converter will also automatically recognize the presence of projects with Travis CI and include the status image -in the markdown. Screenshots and banner images for WordPress.org are also automatically incorporated into the `readme.md`. - -What is also included in this repo is an [`svn-push`](svn-push) to push commits from a GitHub repo to the WordPress.org SVN repo for the plugin. -The `/assets/` directory in the root of the project will get automatically moved one directory above in the SVN repo (alongside -`trunk`, `branches`, and `tags`). To use, include an `svn-url` file in the root of your repo and let this file contains he full root URL -to the WordPress.org repo for plugin (don't include `trunk`). - -The utilities in this project were first developed to facilitate development of [X-Team](http://x-team.com/wordpress/)'s [plugins](http://profiles.wordpress.org/x-team/). diff --git a/bin/svn-push b/bin/svn-push deleted file mode 100755 index c573756..0000000 --- a/bin/svn-push +++ /dev/null @@ -1,157 +0,0 @@ -#!/bin/bash -# Given a svn-url file one directory up, export the latest git commits to the specified SVN repo. -# Create a git release tag from the version specified in the plugin file. -# Author: Weston Ruter (@westonruter) - -set -e - -cd $(dirname $0)/.. - -if [ ! -e svn-url ]; then - echo "Error: Missing svn-url file" >&2 - exit 1 -fi - -force= -while getopts 'f' option; do - case $option in - f) - force=1 - ;; - esac -done - -if [ -n "$(git status -s -uno)" ] && [ -z "$force" ]; then - git status - echo "Error: Git state has modified or staged files. Commit or reset, or supply -f" >&2 - exit 1 -fi - -git_root=$(pwd) - -current_branch=$(git rev-parse --abbrev-ref HEAD) -if [ $current_branch != 'master' ]; then - git checkout master -fi - -bin/generate-markdown-readme -git add readme.md -if [ -n "$(git status --porcelain readme.md)" ]; then - echo "Please commit (--amend?) the updated readme.md" - exit 1 -fi - -git pull origin master -git push origin master -svn_url=$(cat svn-url) -svn_repo_dir=/tmp/svn-$(basename $git_root)-$(md5sum <<< $git_root | cut -c1-32) - -for php in *.php; do - if grep -q 'Plugin Name:' $php && grep -q 'Version:' $php; then - plugin_version=$(cat $php | grep 'Version:' | sed 's/.*Version: *//') - fi -done - -if [ -z "$plugin_version" ]; then - echo "Unable to find plugin version" - exit 1 -fi - -if ! grep -q "$plugin_version" readme.txt; then - echo "Please update readme.txt to include $plugin_version in changelog" - exit 1 -fi - -if git show-ref --tags --quiet --verify -- "refs/tags/$plugin_version"; then - has_tag=1 -fi - -if [ -n "$has_tag" ] && [ -z "$force" ]; then - echo "Plugin version $plugin_version already tagged. Please bump version and try again, or supply -f" - exit 1 -fi - -if [ -z "$has_tag" ]; then - echo "Tagging plugin version $plugin_version" - git tag "$plugin_version" master - git push origin "$plugin_version" -else - echo "Skipping plugin tag $plugin_version since already exists" -fi - -if [ -e $svn_repo_dir ] && [ ! -e $svn_repo_dir/.svn ]; then - rm -rf $svn_repo_dir -fi -if [ ! -e $svn_repo_dir ]; then - svn checkout $svn_url $svn_repo_dir - cd $svn_repo_dir -else - cd $svn_repo_dir - svn up -fi - -cd $git_root - -# rsync all cached files and their directories -cat <( - git ls-files --cached --full-name $git_root \ - & - git ls-files --cached --full-name $git_root | xargs -I {} dirname {} | sort | uniq -) | sort | rsync -avz --delete --delete-excluded --include-from=- --exclude='*' ./ $svn_repo_dir/trunk/ - -cd $svn_repo_dir/trunk - -# move assets directory to proper location in SVN -if [ -d assets ]; then - rsync -avz --delete ./assets/ ../assets/ - rm -r ./assets/ -fi - -# convert .gitignores to svn:ignore -for gitignore in $(find . -name .gitignore); do - echo "Convert $gitignore to svn:global-ignores" - svn propset svn:global-ignores -F $gitignore $(dirname $gitignore) - svn rm --force $gitignore -done - -cd $svn_repo_dir - -# Delete any files from SVN that are no longer there -svn status . | grep "^\!" | sed 's/^\! *//g' | xargs svn rm - -# Add everything left to commit -if [ -d assets ]; then - svn add --force assets -fi -svn add --force trunk - -# Do SVN commit -svn_commit_file=$svn_repo_dir/COMMIT_MSG -last_pushed_commit=$(svn log -l 1 | grep -E -o '^commit ([0-9a-f]{5,})' | head -n 1 | cut -c8-) - -cd $git_root - -git log -1 --format="Update to commit %h from $(git config --get remote.origin.url)" > $svn_commit_file -echo >> $svn_commit_file -echo 'Includes the following commit(s):' >> $svn_commit_file -echo >> $svn_commit_file - -echo -n 'Obtaining last commit pushed to SVN...' -git_log_args='--pretty=short --name-status --color=never' -if [ -z "$last_pushed_commit" ]; then - echo "none; starting from beginning" - git log $git_log_args >> $svn_commit_file -else - echo "$last_pushed_commit" - git log $git_log_args $last_pushed_commit..HEAD >> $svn_commit_file -fi - -cd $svn_repo_dir - -svn commit -F $svn_commit_file -rm $svn_commit_file - -# Restore branch -if [ $current_branch != 'master' ]; then - git checkout $current_branch -fi diff --git a/dependency-minification.php b/dependency-minification.php index bd2e385..55397eb 100644 --- a/dependency-minification.php +++ b/dependency-minification.php @@ -3,15 +3,15 @@ * Plugin Name: Dependency Minification * Description: Concatenates and minifies scripts and stylesheets. Please install and activate scribu's Proper Network Activation plugin before activating this plugin network-wide. * Version: 0.9.8 - * Author: X-Team - * Author URI: http://x-team.com/wordpress/ + * Author: XWP + * Author URI: https://xwp.co/ * Text Domain: dependency-minification * License: GPLv2+ * Domain Path: /languages */ /** - * Copyright (c) 2013 X-Team (http://x-team.com/) + * Copyright (c) 2013 XWP (https://xwp.co/) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2 or, at diff --git a/dev-lib b/dev-lib new file mode 160000 index 0000000..e4e1607 --- /dev/null +++ b/dev-lib @@ -0,0 +1 @@ +Subproject commit e4e16073493f6c27bb181bb78e3bfe1826088de8 diff --git a/readme.md b/readme.md index 52d467d..6600a8b 100644 --- a/readme.md +++ b/readme.md @@ -3,13 +3,15 @@ Automatically concatenates and minifies any scripts and stylesheets enqueued using the standard dependency system. -**Contributors:** [x-team](http://profiles.wordpress.org/x-team), [westonruter](http://profiles.wordpress.org/westonruter), [fjarrett](http://profiles.wordpress.org/fjarrett), [kucrut](http://profiles.wordpress.org/kucrut), [shadyvb](http://profiles.wordpress.org/shadyvb), [alex-ye](http://profiles.wordpress.org/alex-ye), [c3mdigital](http://profiles.wordpress.org/c3mdigital), [lkraav](http://profiles.wordpress.org/lkraav) +**Contributors:** [xwp](http://profiles.wordpress.org/xwp), [westonruter](http://profiles.wordpress.org/westonruter), [fjarrett](http://profiles.wordpress.org/fjarrett), [kucrut](http://profiles.wordpress.org/kucrut), [shadyvb](http://profiles.wordpress.org/shadyvb), [alex-ye](http://profiles.wordpress.org/alex-ye), [c3mdigital](http://profiles.wordpress.org/c3mdigital), [lkraav](http://profiles.wordpress.org/lkraav) **Tags:** [performance](http://wordpress.org/plugins/tags/performance), [dependencies](http://wordpress.org/plugins/tags/dependencies), [minify](http://wordpress.org/plugins/tags/minify), [concatenate](http://wordpress.org/plugins/tags/concatenate), [compress](http://wordpress.org/plugins/tags/compress), [js](http://wordpress.org/plugins/tags/js), [javascript](http://wordpress.org/plugins/tags/javascript), [scripts](http://wordpress.org/plugins/tags/scripts), [css](http://wordpress.org/plugins/tags/css), [styles](http://wordpress.org/plugins/tags/styles), [stylesheets](http://wordpress.org/plugins/tags/stylesheets), [gzip](http://wordpress.org/plugins/tags/gzip), [yslow](http://wordpress.org/plugins/tags/yslow), [pagespeed](http://wordpress.org/plugins/tags/pagespeed), [caching](http://wordpress.org/plugins/tags/caching) **Requires at least:** 3.5 **Tested up to:** 3.8 **Stable tag:** trunk (master) **License:** [GPLv2 or later](http://www.gnu.org/licenses/gpl-2.0.html) +[![Build Status](https://travis-ci.org/xwp/wp-dependency-minification.png?branch=master)](https://travis-ci.org/xwp/wp-dependency-minification) + ## Description ## This plugin takes all scripts and stylesheets that have been added via `wp_enqueue_script` and `wp_enqueue_style` @@ -39,7 +41,7 @@ which this plugin now supersedes. * Can serve compressed responses with `gzip` or `deflate`. * Transforms relatives paths in stylesheets (e.g. background-images) to absolute ones, so that they don't 404. -**Development of this plugin is done [on GitHub](https://github.com/x-team/wp-dependency-minification). Pull requests welcome. Please see [issues](https://github.com/x-team/wp-dependency-minification/issues) reported there before going to the plugin forum.** +**Development of this plugin is done [on GitHub](https://github.com/xwp/wp-dependency-minification). Pull requests welcome. Please see [issues](https://github.com/xwp/wp-dependency-minification/issues) reported there before going to the plugin forum.** If you are using Nginx with the default Varying Vagrant Vagrants config, you'll want to remove `css|js` from this rule in `nginx-wp-common.conf` (or remove the rule altogether): @@ -50,36 +52,34 @@ If you are using Nginx with the default Varying Vagrant Vagrants config, you'll log_not_found off; } -[![Build Status](https://travis-ci.org/x-team/wp-dependency-minification.png?branch=master)](https://travis-ci.org/x-team/wp-dependency-minification) - ## Changelog ## ### 0.9.8 ### -* Fix rewrite rule broken by filtering home_url ([#49](https://github.com/x-team/wp-dependency-minification/pull/49)). Props [c3mdigital](http://profiles.wordpress.org/c3mdigital/). +* Fix rewrite rule broken by filtering home_url ([#49](https://github.com/xwp/wp-dependency-minification/pull/49)). Props [c3mdigital](http://profiles.wordpress.org/c3mdigital/). * Switch from JSMin to JSMinPlus due to repeated issues with JSMin causing execution timeouts. * Update plugin to indicate WordPress 3.8 compatibility. * Fix expire and purge links. ### 0.9.7 ### -Improve how the plugin guesses the sources' absolute paths ([#34](https://github.com/x-team/wp-dependency-minification/pull/34)). Props [alex-ye](http://profiles.wordpress.org/alex-ye/). +Improve how the plugin guesses the sources' absolute paths ([#34](https://github.com/xwp/wp-dependency-minification/pull/34)). Props [alex-ye](http://profiles.wordpress.org/alex-ye/). ### 0.9.6 ### -Improve network activation and deactivation ([#37](https://github.com/x-team/wp-dependency-minification/pull/37)). Props [kucrut](http://profiles.wordpress.org/kucrut/). +Improve network activation and deactivation ([#37](https://github.com/xwp/wp-dependency-minification/pull/37)). Props [kucrut](http://profiles.wordpress.org/kucrut/). ### 0.9.5 ### -Fix wp_localize_script data lost in minification ([#28](https://github.com/x-team/wp-dependency-minification/issues/28)). Props [lkraav](http://profiles.wordpress.org/lkraav/). +Fix wp_localize_script data lost in minification ([#28](https://github.com/xwp/wp-dependency-minification/issues/28)). Props [lkraav](http://profiles.wordpress.org/lkraav/). ### 0.9.4 ### -Issue warning if pretty permalinks are not enabled ([#16](https://github.com/x-team/wp-dependency-minification/issues/16)). Props [shadyvb](http://profiles.wordpress.org/shadyvb/). +Issue warning if pretty permalinks are not enabled ([#16](https://github.com/xwp/wp-dependency-minification/issues/16)). Props [shadyvb](http://profiles.wordpress.org/shadyvb/). ### 0.9.3 ### -Prevent default built-in scripts from breaking minification groups ([#9](https://github.com/x-team/wp-dependency-minification/issues/9)). Props [shadyvb](http://profiles.wordpress.org/shadyvb/). +Prevent default built-in scripts from breaking minification groups ([#9](https://github.com/xwp/wp-dependency-minification/issues/9)). Props [shadyvb](http://profiles.wordpress.org/shadyvb/). ### 0.9.2 ### -Show alert if WP_DEBUG is disabling dependency minification ([#12](https://github.com/x-team/wp-dependency-minification/issues/12)). Props [c3mdigital](http://profiles.wordpress.org/c3mdigital/). +Show alert if WP_DEBUG is disabling dependency minification ([#12](https://github.com/xwp/wp-dependency-minification/issues/12)). Props [c3mdigital](http://profiles.wordpress.org/c3mdigital/). ### 0.9.1 ### -Add a settings link to the list of plugin action links ([#13](https://github.com/x-team/wp-dependency-minification/issues/13)). Props [fjarrett](http://profiles.wordpress.org/fjarrett/). +Add a settings link to the list of plugin action links ([#13](https://github.com/xwp/wp-dependency-minification/issues/13)). Props [fjarrett](http://profiles.wordpress.org/fjarrett/). ### 0.9 beta ### First Release diff --git a/readme.txt b/readme.txt index c7a394b..c329f7b 100644 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,5 @@ === Dependency Minification === -Contributors: X-team, westonruter, fjarrett, kucrut, shadyvb, alex-ye, c3mdigital, lkraav +Contributors: xwp, westonruter, fjarrett, kucrut, shadyvb, alex-ye, c3mdigital, lkraav Tags: performance, dependencies, minify, concatenate, compress, js, javascript, scripts, css, styles, stylesheets, gzip, yslow, pagespeed, caching Tested up to: 3.8 Requires at least: 3.5 @@ -38,7 +38,7 @@ which this plugin now supersedes. * Can serve compressed responses with `gzip` or `deflate`. * Transforms relatives paths in stylesheets (e.g. background-images) to absolute ones, so that they don't 404. -**Development of this plugin is done [on GitHub](https://github.com/x-team/wp-dependency-minification). Pull requests welcome. Please see [issues](https://github.com/x-team/wp-dependency-minification/issues) reported there before going to the plugin forum.** +**Development of this plugin is done [on GitHub](https://github.com/xwp/wp-dependency-minification). Pull requests welcome. Please see [issues](https://github.com/xwp/wp-dependency-minification/issues) reported there before going to the plugin forum.** If you are using Nginx with the default Varying Vagrant Vagrants config, you'll want to remove `css|js` from this rule in `nginx-wp-common.conf` (or remove the rule altogether): @@ -53,31 +53,31 @@ If you are using Nginx with the default Varying Vagrant Vagrants config, you'll == Changelog == = 0.9.8 = - * Fix rewrite rule broken by filtering home_url ([#49](https://github.com/x-team/wp-dependency-minification/pull/49)). Props [c3mdigital](http://profiles.wordpress.org/c3mdigital/). + * Fix rewrite rule broken by filtering home_url ([#49](https://github.com/xwp/wp-dependency-minification/pull/49)). Props [c3mdigital](http://profiles.wordpress.org/c3mdigital/). * Switch from JSMin to JSMinPlus due to repeated issues with JSMin causing execution timeouts. * Update plugin to indicate WordPress 3.8 compatibility. * Fix expire and purge links. = 0.9.7 = -Improve how the plugin guesses the sources' absolute paths ([#34](https://github.com/x-team/wp-dependency-minification/pull/34)). Props [alex-ye](http://profiles.wordpress.org/alex-ye/). +Improve how the plugin guesses the sources' absolute paths ([#34](https://github.com/xwp/wp-dependency-minification/pull/34)). Props [alex-ye](http://profiles.wordpress.org/alex-ye/). = 0.9.6 = -Improve network activation and deactivation ([#37](https://github.com/x-team/wp-dependency-minification/pull/37)). Props [kucrut](http://profiles.wordpress.org/kucrut/). +Improve network activation and deactivation ([#37](https://github.com/xwp/wp-dependency-minification/pull/37)). Props [kucrut](http://profiles.wordpress.org/kucrut/). = 0.9.5 = -Fix wp_localize_script data lost in minification ([#28](https://github.com/x-team/wp-dependency-minification/issues/28)). Props [lkraav](http://profiles.wordpress.org/lkraav/). +Fix wp_localize_script data lost in minification ([#28](https://github.com/xwp/wp-dependency-minification/issues/28)). Props [lkraav](http://profiles.wordpress.org/lkraav/). = 0.9.4 = -Issue warning if pretty permalinks are not enabled ([#16](https://github.com/x-team/wp-dependency-minification/issues/16)). Props [shadyvb](http://profiles.wordpress.org/shadyvb/). +Issue warning if pretty permalinks are not enabled ([#16](https://github.com/xwp/wp-dependency-minification/issues/16)). Props [shadyvb](http://profiles.wordpress.org/shadyvb/). = 0.9.3 = -Prevent default built-in scripts from breaking minification groups ([#9](https://github.com/x-team/wp-dependency-minification/issues/9)). Props [shadyvb](http://profiles.wordpress.org/shadyvb/). +Prevent default built-in scripts from breaking minification groups ([#9](https://github.com/xwp/wp-dependency-minification/issues/9)). Props [shadyvb](http://profiles.wordpress.org/shadyvb/). = 0.9.2 = -Show alert if WP_DEBUG is disabling dependency minification ([#12](https://github.com/x-team/wp-dependency-minification/issues/12)). Props [c3mdigital](http://profiles.wordpress.org/c3mdigital/). +Show alert if WP_DEBUG is disabling dependency minification ([#12](https://github.com/xwp/wp-dependency-minification/issues/12)). Props [c3mdigital](http://profiles.wordpress.org/c3mdigital/). = 0.9.1 = -Add a settings link to the list of plugin action links ([#13](https://github.com/x-team/wp-dependency-minification/issues/13)). Props [fjarrett](http://profiles.wordpress.org/fjarrett/). +Add a settings link to the list of plugin action links ([#13](https://github.com/xwp/wp-dependency-minification/issues/13)). Props [fjarrett](http://profiles.wordpress.org/fjarrett/). = 0.9 beta = First Release