Commit ef82da26 authored by Erick Hitter's avatar Erick Hitter

Merge branch 'add/wp-org-deploy' into 'master'

Automate deploys

See merge request !1
parents ec8cd92f df798a4b
Pipeline #782 passed with stages
in 3 minutes and 10 seconds
# A set of files you probably don't want in your distribution
# This file is for unifying the coding style for different editors and IDEs
# WordPress Coding Standards
root = true
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab
indent_size = 4
indent_style = space
indent_size = 2
end_of_line = crlf
# A set of files you probably don't want in your distribution
/.distignore export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.gitlab-ci.yml export-ignore
/.travis.yml export-ignore
/.DS_Store export-ignore
/Thumbs.db export-ignore
/behat.yml export-ignore
/bitbucket-pipelines.yml export-ignore
/bin export-ignore
/.circleci/config.yml export-ignore
/composer.json export-ignore
/composer.lock export-ignore
/Gruntfile.js export-ignore
/package.json export-ignore
/package-lock.json export-ignore
/phpunit.xml export-ignore
/phpunit.xml.dist export-ignore
/multisite.xml export-ignore
/multisite.xml.dist export-ignore
/.phpcs.xml export-ignore
/phpcs.xml export-ignore
/.phpcs.xml.dist export-ignore
/phpcs.xml.dist export-ignore
/ export-ignore
/wp-cli.local.yml export-ignore
/yarn.lock export-ignore
/tests export-ignore
/vendor export-ignore
/node_modules export-ignore
/*.sql export-ignore
/*.tar.gz export-ignore
/*.zip export-ignore
# Configure mysql service (
MYSQL_DATABASE: wordpress_tests
- $HOME/.composer
- /root/.composer
# Set up WordPress tests
- bash bin/ $MYSQL_DATABASE root $MYSQL_ROOT_PASSWORD mysql latest true
# PHPUnit
- |
if [[ $(php -v) =~ "PHP 7." ]]; then
composer global require "phpunit/phpunit=6.1.*"
composer global require "phpunit/phpunit=4.8.*"
# Install PHPCS and WPCS
- composer global require automattic/vipwpcs
- composer global require phpcompatibility/phpcompatibility-wp
- phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs,$HOME/.composer/vendor/automattic/vipwpcs,$HOME/.composer/vendor/phpcompatibility/php-compatibility,$HOME/.composer/vendor/phpcompatibility/phpcompatibility-paragonie,$HOME/.composer/vendor/phpcompatibility/phpcompatibility-wp
- mysql:5.6
- find . -type "f" -iname "*.php" | xargs -L "1" php -l
- phpcs -n
- phpunit
allow_failure: true
- mysql:5.6
- find . -type "f" -iname "*.php" | xargs -L "1" php -l
- phpcs -n
- phpunit
allow_failure: true
stage: deploy
- apt-get update
- apt-get install -y rsync
- curl -o ./bin/
- chmod +x ./bin/
script: ./bin/
when: on_success
<?xml version="1.0"?>
<ruleset name="Taxonomy List Widget">
<description>Generally-applicable sniffs for WordPress plugins.</description>
<!-- What to scan -->
<!-- How to scan -->
<!-- Usage instructions: -->
<!-- Annotated ruleset: -->
<arg value="sp"/> <!-- Show sniff and progress -->
<arg name="basepath" value="./"/><!-- Strip the file paths down to the relevant bit -->
<arg name="colors"/>
<arg name="extensions" value="php"/>
<arg name="parallel" value="8"/><!-- Enables parallel processing when available for faster results. -->
<!-- Rules: Check PHP version compatibility -->
<!-- -->
<config name="testVersion" value="7.2-"/>
<!-- -->
<rule ref="PHPCompatibilityWP"/>
<!-- Rules: WordPress Coding Standards -->
<!-- -->
<!-- -->
<config name="minimum_supported_wp_version" value="2.8"/>
<rule ref="WordPress" />
<rule ref="WordPressVIPMinimum" />
<rule ref="WordPress-VIP-Go" />
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<!-- Value: replace the function, class, and variable prefixes used. Separate multiple prefixes with a comma. -->
<property name="prefixes" type="array" value="taxonomy_list_"/>
<rule ref="WordPress.WP.I18n">
<!-- Value: replace the text domain used. -->
<property name="text_domain" type="array" value="taxonomy_list_widget"/>
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing">
<property name="blank_line_check" value="true"/>
module.exports = function( grunt ) {
'use strict';
// Project configuration
grunt.initConfig( {
pkg: grunt.file.readJSON( 'package.json' ),
addtextdomain: {
options: {
textdomain: 'taxonomy_list_widget',
update_all_domains: {
options: {
updateDomains: true
src: [ '*.php', '**/*.php', '!\.git/**/*', '!bin/**/*', '!node_modules/**/*', '!tests/**/*' ]
wp_readme_to_markdown: {
your_target: {
files: {
'': 'readme.txt'
makepot: {
target: {
options: {
domainPath: '/languages',
exclude: [ '\.git/*', 'bin/*', 'node_modules/*', 'tests/*' ],
mainFile: 'tag-list-widget.php',
potFilename: 'tag-list-widget.pot',
potHeaders: {
poedit: true,
'x-poedit-keywordslist': true
type: 'wp-plugin',
updateTimestamp: true
} );
grunt.loadNpmTasks( 'grunt-wp-i18n' );
grunt.loadNpmTasks( 'grunt-wp-readme-to-markdown' );
grunt.registerTask( 'default', [ 'i18n','readme' ] );
grunt.registerTask( 'i18n', ['addtextdomain', 'makepot'] );
grunt.registerTask( 'readme', ['wp_readme_to_markdown'] );
grunt.util.linefeed = '\n';
# Taxonomy List Widget #
**Contributors:** ethitter
**Donate link:**
**Tags:** tag, tags, taxonomy, sidebar, widget, widgets, list
**Requires at least:** 2.8
**Tested up to:** 5.2
**Stable tag:** 1.3.1
**License:** GPLv2 or later
**License URI:**
Creates a list (bulleted, number, or custom) of non-hierarchical taxonomies as an alternative to the term (tag) cloud. Formerly known as Tag List Widget.
## Description ##
Creates lists of non-hierarchical taxonomies (such as `post tags`) as an alternative to term (tag) clouds. Multiple widgets can be used, each with its own set of options.
Numerous formatting options are provided, including maximum numbers of terms, term order, truncating of term names, and more. List styles are fully customizable, with built-in support for bulleted lists and numbered lists.
Using the `taxonomy_list_widget` function, users can generate lists for use outside of the included widget.
**Only use version 1.2 or higher with WordPress 4.2 and later releases.** WordPress 4.2 changed how taxonomy information is stored in the database, which directly impacts this plugin's include/exclude term functionality.
This plugin was formerly known as the `Tag List Widget`. It was completely rewritten for version 1.0.
## Installation ##
1. Upload taxonomy-list-widget.php to /wp-content/plugins/.
2. Activate plugin through the WordPress Plugins menu.
3. Activate widget from the Appearance > Widgets menu in WordPress.
4. Set display options from the widget's administration panel.
## Frequently Asked Questions ##
### What happened to the Tag List Widget plugin? ###
Since I first wrote the Tag Dropdown Widget plugin upon which this plugin is based (in November 2009), WordPress introduced custom taxonomies and, as more-fully discussed below, saw a new widgets API overtake its predecessor. As part of the widgets-API-related rewrite, I expanded the plugin to support non-hierarchical custom taxonomies, which necessitated a new name for the plugin.
### Why did you rewrite the plugin? ###
When I first wrote the Tag Dropdown Widget plugin, which I later forked to create the Tag List Widget plugin, WordPress was amidst a change in how widgets were managed. I decided to utilize the old widget methods to ensure the greatest compatibility at the time. In the nearly two years since I released the first version of this plugin, the new widget system has been widely adopted, putting this plugin at a disadvantage. So, I rewrote the plugin to use the new widget API and added support for non-hierarchical taxonomies other than just post tags.
### I upgraded to version 1.0 and all of my widgets disappeared. What happened? ###
As discussed above, WordPress' widget system has changed drastically since I first released this plugin. To facilitate multiple uses of the same widget while allowing each to maintain its own set of options, the manner for storing widget options changed. As a result, there is no practical way to transition a widget's options from version 0.3.1 to 1.0.
### If my theme does not support widgets, or I would like to include the list outside of the sidebar, can I still use the plugin? ###
Insert the function `<?php if( function_exists( 'taxonomy_list_widget' ) ) echo taxonomy_list_widget( $args, $id ); ?>` where the list should appear, specifying `$args` as an array of arguments and, optionally, `$id` as a string uniquely identifying this list.
* taxonomy - slug of taxonomy for list. Defaults to `post_tag`.
* select_name - name of first (default) option in the list. Defaults to `Select Tag`.
* max_name_length - integer representing maximum length of term name to display. Set to `0` to show full names. Defaults to `0`.
* cutoff - string indicating that a term name has been cutoff based on the `max_name_length` setting. Defaults to an ellipsis (`&hellip;`).
* limit - integer specifying maximum number of terms to retrieve. Set to `0` for no limit. Defaults to `0`.
* orderby - either `name` to order by term name or `count` to order by the number of posts associated with the given term. Defaults to `name`.
* order - either `ASC` for ascending order or `DESC` for descending order. Defaults to `ASC`.
* threshold - integer specifying the minimum number of posts to which a term must be assigned to be included in the list. Set to `0` for now threshold. Defaults to `0`.
* incexc - `include` or `exclude` to either include or exclude the terms whose IDs are included in `incexc_ids`. By default, this restriction is not enabled.
* incexc_ids - comma-separated list of term IDs to either include or exclude based on the `incexc` setting.
* hide_empty - set to `false` to include in the list any terms that haven't been assigned to any objects (i.e. unused tags). Defaults to `true`.
* post_counts - set to `true` to include post counts after term names. Defaults to `false`.
* delimiter - sets list style. Native options are `ul`, `ol`, and `nl` for bulleted list, numbered list, and line breaks, respectively. By passing an array with keys `before_list`, `after_list`, `before_item`, and `after_item`, you can completely customize the list style.
* rel - either `dofollow` or `nofollow`. Can still use `taxonomy_list_widget_link_rel` filter to specify link relationship.
### Why is the TLW_direct() function deprecated? ###
Version 1.0 represents a complete rewrite of the original Tag List Widget plugin. As part of the rewrite, all prior functions for generating tag lists were deprecated, or marked as obsolete, because they are unable to access the full complement of features introduced in version 1.0. While the functions still exist, their capabilities are extremely limited and they should not be replaced with `taxonomy_list_widget()`.
### Where do I obtain a term's ID for use with the inclusion or exclusion options? ###
Term IDs can be obtained in a variety of ways. The easiest is to visit the taxonomy term editor (Post Tags, found under Posts, for example) and, while hovering over the term's name, looking at your browser's status bar. At the very end of the address shown in the status bar, the term ID will follow the text "tag_ID."
You can also obtain the term ID by clicking the edit link below any term's name in the Post Tags page. Next, look at your browser's address bar. At the very end of the address, the term ID will follow the text "tag_ID."
### I'd like more control over the tags shown in the list. Is this possible? ###
This plugin relies on WordPress' `get_terms` function ( To modify the arguments passed to this function, use the `taxonomy_list_widget_options` filter to specify any of the arguments discussed in the Codex page for `get_terms`.
To make targeting a specific filter reference possible should you use multiple instances of the list (multiple widgets, use of the `taxonomy_list_widget` function, or some combination thereof), the filter provides a second argument, `$id`, that is either the numeric ID of the widget's instance or the string provided as the second argument to `taxonomy_list_widget`.
## Changelog ##
### 1.3.1 ###
* PHP 7.3 compatibility
### 1.3 ###
* Update for WordPress 4.3 by removing PHP4-style widget constructor usage (
### 1.2 ###
* Update for WordPress 4.2 to handle term splitting in the plugin's include/exclude functionality. Details at
### 1.1.2 ###
* Correct problem in WordPress 3.3 and higher that resulted in an empty taxonomy dropdown.
* Remove all uses of PHP short tags.
### 1.1.1 ###
* Allow empty title in widget options. If empty, the `taxonomy_list_widget_title` filter isn't run.
### 1.1 ###
* Provide control over link relationship (`dofollow` and `nofollow`) in widget. This capability is still available via the `taxonomy_list_widget_link_rel` filter.
### 1.0.1 ###
* Fix fatal error in older WordPress versions resulting from PHP4 and PHP5 constructors existing in widget class.
### ###
* Fix bug in post count threshold that resulted in no terms being listed.
### ###
* Fix fatal error
### 1.0 ###
* Completely rewritten plugin to use WordPress' newer Widgets API.
* Drop support for WordPress 2.7 and earlier.
* Add support for all public, non-hierarchical custom taxonomies, in addition to Post Tags.
* Introduce new, more flexible function for manually generating lists.
* Fixed persistent bugs in the include/exclude functionality.
* Widget admin is translation-ready.
### 0.3.1 ###
* Replace id on list items with class.
### 0.3 ###
* Reduced variables stored in database to two.
### 0.2 ###
* Added function `TLW_direct`
## Upgrade Notice ##
### 1.3.1 ###
Now compatible with PHP 7.3.
### 1.3 ###
Updated for WordPress 4.3. Removed PHP4-style widget constructor usage (
### 1.2 ###
Updated for WordPress 4.2. Only version 2.2 or higher should be used with WordPress 4.2 or higher, otherwise included/excluded terms may reappear in dropdowns. This is due to WordPress splitting shared terms, as detailed at
### 1.1.2 ###
Corrects a problem in WordPress 3.3 and higher that resulted in an empty taxonomy dropdown. Also removes all uses of PHP short tags.
### 1.1.1 ###
Allows empty title in widget options. If empty, the `taxonomy_list_widget_title` filter isn't run.
### 1.1 ###
Adds control over link relationship (`dofollow` and `nofollow`) in the widgets' options. This capability is still available via the `taxonomy_list_widget_link_rel` filter.
### 1.0.1 ###
Fixes a backwards-compatibility problem in the widget class that generated fatal errors in WordPress 3.0 and earlier.
### ###
Fixes a minor bug in the post count threshold setting.
### ###
Corrects fatal error in plugin.
### 1.0 ###
The plugin was renamed, completely rewritten, and drops support for WordPress 2.7 and earlier. Upgrading will delete all of your existing widgets; see the FAQ for an explanation. Review the changelog and FAQ for more information.
#!/usr/bin/env bash
if [ $# -lt 3 ]; then
echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version] [skip-database-creation]"
exit 1
TMPDIR=$(echo $TMPDIR | sed -e "s/\/$//")
download() {
if [ `which curl` ]; then
curl -s "$1" > "$2";
elif [ `which wget` ]; then
wget -nv -O "$2" "$1"
if [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+\-(beta|RC)[0-9]+$ ]]; then
elif [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+$ ]]; then
elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then
# version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x
elif [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then
# http serves a single offer, whereas https serves multiple. we only want one
download /tmp/wp-latest.json
grep '[0-9]+\.[0-9]+(\.[0-9]+)?' /tmp/wp-latest.json
LATEST_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//')
if [[ -z "$LATEST_VERSION" ]]; then
echo "Latest WordPress version could not be found"
exit 1
set -ex
install_wp() {
if [ -d $WP_CORE_DIR ]; then
mkdir -p $WP_CORE_DIR
if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then
mkdir -p $TMPDIR/wordpress-nightly
download $TMPDIR/wordpress-nightly/
unzip -q $TMPDIR/wordpress-nightly/ -d $TMPDIR/wordpress-nightly/
mv $TMPDIR/wordpress-nightly/wordpress/* $WP_CORE_DIR
if [ $WP_VERSION == 'latest' ]; then
local ARCHIVE_NAME='latest'
elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+ ]]; then
# https serves multiple offers, whereas http serves single.
download $TMPDIR/wp-latest.json
if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then
# version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x
# otherwise, scan the releases and get the most up to date minor version of the major release
local VERSION_ESCAPED=`echo $WP_VERSION | sed 's/\./\\\\./g'`
LATEST_VERSION=$(grep -o '"version":"'$VERSION_ESCAPED'[^"]*' $TMPDIR/wp-latest.json | sed 's/"version":"//' | head -1)
if [[ -z "$LATEST_VERSION" ]]; then
local ARCHIVE_NAME="wordpress-$WP_VERSION"
local ARCHIVE_NAME="wordpress-$WP_VERSION"
download${ARCHIVE_NAME}.tar.gz $TMPDIR/wordpress.tar.gz
tar --strip-components=1 -zxmf $TMPDIR/wordpress.tar.gz -C $WP_CORE_DIR
download $WP_CORE_DIR/wp-content/db.php
install_test_suite() {
# portable in-place argument for both GNU sed and Mac OSX sed
if [[ $(uname -s) == 'Darwin' ]]; then
local ioption='-i.bak'
local ioption='-i'
# set up testing suite if it doesn't yet exist
if [ ! -d $WP_TESTS_DIR ]; then
# set up testing suite
mkdir -p $WP_TESTS_DIR
svn co --quiet${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes
svn co --quiet${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data
if [ ! -f wp-tests-config.php ]; then
download${WP_TESTS_TAG}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php
# remove all forward slashes in the end
WP_CORE_DIR=$(echo $WP_CORE_DIR | sed "s:/\+$::")
sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR/':" "$WP_TESTS_DIR"/wp-tests-config.php
sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php
sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php
sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php
sed $ioption "s|localhost|${DB_HOST}|" "$WP_TESTS_DIR"/wp-tests-config.php
install_db() {
if [ ${SKIP_DB_CREATE} = "true" ]; then
return 0
# parse DB_HOST for port or socket references
local PARTS=(${DB_HOST//\:/ })
local DB_HOSTNAME=${PARTS[0]};
local DB_SOCK_OR_PORT=${PARTS[1]};
local EXTRA=""
if ! [ -z $DB_HOSTNAME ] ; then
if [ $(echo $DB_SOCK_OR_PORT | grep -e '^[0-9]\{1,\}$') ]; 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"
# create database
mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA
# Copyright (C) 2019
# This file is distributed under the same license as the package.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2019-04-14 02:46:43+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <>\n"
"X-Generator: grunt-wp-i18n 0.5.4\n"
"X-Poedit-KeywordsList: "
"Language: en\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-Country: United States\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-Basepath: ../\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-Bookmarks: \n"
"X-Textdomain-Support: yes\n"
#: taxonomy-list-widget.php:526
msgid "Basic Settings"
msgstr ""
#: taxonomy-list-widget.php:529
msgid "Taxonomy"
msgstr ""
#: taxonomy-list-widget.php:538
msgid "Title:"
msgstr ""
#: taxonomy-list-widget.php:542
msgid "List Style"
msgstr ""
#: taxonomy-list-widget.php:545