Skip to content

Commit

Permalink
Merge pull request #4 from uriweb/release-1.2.0
Browse files Browse the repository at this point in the history
Release 1.2.0
  • Loading branch information
bjcfuller authored May 23, 2018
2 parents 78ae7ed + c456dcd commit 80358a2
Show file tree
Hide file tree
Showing 15 changed files with 1,245 additions and 452 deletions.
46 changes: 46 additions & 0 deletions .codesniffer.ruleset.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0"?>
<ruleset name="WordPress Theme Coding Standards">
<!-- See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
<!-- See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/blob/develop/WordPress-Core/ruleset.xml -->

<!-- Set a description for this ruleset. -->
<description>A custom set of code standard rules to check for WordPress themes.</description>

<!-- Include the WordPress ruleset, with space for exclusions if necessary. -->
<rule ref="WordPress-Core">
<exclude name="WordPress.WP.I18n.MissingTranslatorsComment" />
<exclude name="WordPress.WP.I18n.MissingSingularPlaceholder" />

<exclude name="PEAR.Functions.FunctionCallSignature.Indent" />

<exclude name="Squiz.PHP.DisallowMultipleAssignments.Found" />
<exclude name="Squiz.Commenting.FileComment.Missing" />

<exclude name="Generic.WhiteSpace.ScopeIndent.IncorrectExact" />
<exclude name="Generic.WhiteSpace.ScopeIndent.Incorrect" />

<!-- comment formatting -->
<exclude name="Squiz.Commenting.FileComment.SpacingAfterComment" />
<exclude name="Squiz.Commenting.FunctionComment.MissingParamTag" />
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar" />
<exclude name="Squiz.Commenting.InlineComment.NotCapital" />
</rule>
<rule ref="WordPress-Docs">

</rule>

<rule ref="Squiz.Commenting.FunctionComment.ScalarTypeHintMissing">
<severity>0</severity>
</rule>

<!-- Lowering the severity of non-escaped outputs to below the default threshold -->
<rule ref="WordPress.XSS.EscapeOutput.OutputNotEscaped">
<severity>4</severity>
</rule>

<!-- Lowering the severity of extractions to below the default threshold -->
<rule ref="WordPress.Functions.DontExtract.extract_extract">
<severity>4</severity>
</rule>

</ruleset>
16 changes: 16 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# used to remove files from deployment using `git archive`
# git files
.github export-ignore
.gitattributes export-ignore
.gitignore export-ignore
# test files
.codesniffer.ruleset.xml export-ignore
.jscsrc export-ignore
.jshintignore export-ignore
.sniff export-ignore
.travis.yml export-ignore
# gulp files
gulpfile.js export-ignore
package.json export-ignore
# src files
src export-ignore
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
.jshintignore
node_modules
work_files
8 changes: 8 additions & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"preset": "wordpress",
"fileExtensions": [ ".js" ],
"excludeFiles": [
"gulpfile.js",
"chosen"
]
}
15 changes: 15 additions & 0 deletions .sniff
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

ignore=node_modules,work_files,gulpfile.js,chosen
ruleset=.codesniffer.ruleset.xml
warn=-n

echo Running php code beautifier...
phpcbf --standard=$ruleset --ignore=$ignore $warn .
echo done beautifying.

echo Running php codesniffer...
phpcs --standard=$ruleset --ignore=$ignore $warn .
echo done sniffing.

echo done with sniff.
77 changes: 77 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Declare project language and PHP versions to test against.
language: php

# Declare versions of PHP to use. Use one decimal max.
php:
- "7.0"
- "5.6"

# Ditch sudo and use containers.
# @link http://docs.travis-ci.com/user/migrating-from-legacy/#Why-migrate-to-container-based-infrastructure%3F
# @link http://docs.travis-ci.com/user/workers/container-based-infrastructure/#Routing-your-build-to-container-based-infrastructure
sudo: false

# Declare which branches to build
branches:
only:
- master
- develop
- /^travis-.*$/

# Declare which versions of WordPress to test against.
env:
# Master
# @link https://github.com/WordPress/WordPress
- WP_VERSION=master WP_MULTISITE=1

# Disable XDebug
before_install:
- phpenv config-rm xdebug.ini

# Use this to prepare your build for testing.
before_script:
# Set up WordPress installation.
- export WP_DEVELOP_DIR=/tmp/wordpress/
- mkdir -p $WP_DEVELOP_DIR
# Use the Git mirror of WordPress.
- git clone --depth=1 --branch="$WP_VERSION" git://develop.git.wordpress.org/ $WP_DEVELOP_DIR
# Set up plugin information.
- plugin_slug=$(basename $(pwd))
- plugin_dir=$WP_DEVELOP_DIR/src/wp-content/plugins/$plugin_slug
- cd ..
- mv $plugin_slug $plugin_dir
# Set up WordPress configuration.
- cd $WP_DEVELOP_DIR
- echo $WP_DEVELOP_DIR
- cp wp-tests-config-sample.php wp-tests-config.php
- sed -i "s/youremptytestdbnamehere/wordpress_test/" wp-tests-config.php
- sed -i "s/yourusernamehere/root/" wp-tests-config.php
- sed -i "s/yourpasswordhere//" wp-tests-config.php
# Create WordPress database.
- mysql -e 'CREATE DATABASE wordpress_test;' -uroot
# Install CodeSniffer for WordPress Coding Standards checks.
- mkdir php-codesniffer && curl -L https://github.com/squizlabs/PHP_CodeSniffer/archive/master.tar.gz | tar xz --strip-components=1 -C php-codesniffer
# Install WordPress Coding Standards.
- mkdir wordpress-coding-standards && curl -L https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/archive/master.tar.gz | tar xz --strip-components=1 -C wordpress-coding-standards
# Hop into CodeSniffer directory.
- cd php-codesniffer
# Set install path for WordPress Coding Standards
# @link https://github.com/squizlabs/PHP_CodeSniffer/blob/4237c2fc98cc838730b76ee9cee316f99286a2a7/CodeSniffer.php#L1941
- bin/phpcs --config-set installed_paths ../wordpress-coding-standards
# Hop into plugins directory.
- cd $plugin_dir
# After CodeSniffer install you should refresh your path.
- phpenv rehash
# Install JSCS: JavaScript Code Style checker
- npm install -g jscs

# Run test script commands.
script:
# Search plugin for PHP syntax errors.
- find . \( -name '*.php' \) -exec php -lf {} \;
# Run the plugin through JavaScript Code Style checker
- jscs .
# WordPress Coding Standards
# @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
# @link http://pear.php.net/package/PHP_CodeSniffer/
- $WP_DEVELOP_DIR/php-codesniffer/bin/phpcs -p -s -v -n . --standard=./.codesniffer.ruleset.xml --extensions=php
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# URI AutoUpdater
# URI Program Finder

Add [programs-categories] to a page and a form magically appears.

Expand All @@ -8,4 +8,4 @@ Contributors: John Pennypacker, Brandon Fuller
Tags: plugins
Requires at least: 4.0
Tested up to: 4.9
Stable tag: 1.1.0
Stable tag: 1.2.0
61 changes: 61 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
var gulp = require('gulp');
var pkg = require('./package.json');

// include plug-ins
var jshint = require('gulp-jshint');
var jscs = require('gulp-jscs');
var shell = require('gulp-shell');

// JS code checking
gulp.task('scripts', scripts);

function scripts(done) {

gulp.src('./js/*.js')
.pipe(jshint(done))
.pipe(jshint.reporter('default'));

gulp.src('./js/*.js')
.pipe(jscs(done))
.pipe(jscs.reporter());

done();
// console.log('scripts ran');
}

// run codesniffer
gulp.task('sniffs', sniffs);

function sniffs(done) {

return gulp.src('.', {read:false})
.pipe(shell(['./.sniff']));

done();
//console.log('sniffs ran');
}

// watch
gulp.task('watcher', watcher);

function watcher(done) {

// watch for Theme JS changes
gulp.watch('./js/*.js', scripts);

// watch for PHP change
gulp.watch('./**/*.php', sniffs);

done();
}

gulp.task( 'default',
gulp.parallel('scripts', 'sniffs', 'watcher', function(done){
done();
})
);


function done() {
console.log('done');
}
Loading

0 comments on commit 80358a2

Please sign in to comment.