├── .bowerrc ├── .gitignore ├── .travis.yml ├── .yo-rc.json ├── Dockunit.json ├── Gruntfile.js ├── README.md ├── assets └── README.md ├── bin └── install-wp-tests.sh ├── bower.json ├── composer.json ├── composer.lock ├── cool-shortcode.php ├── includes ├── README.md ├── class-admin.php └── class-run.php ├── languages └── cool-shortcode.pot ├── package.json ├── phpunit.xml ├── screenshot-1.png ├── screenshot-2.png ├── screenshot-3.png ├── screenshot-4.png ├── screenshot-5.png └── tests ├── bootstrap.php ├── test-admin.php ├── test-base.php └── test-run.php /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "assets/bower" 3 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### OSX ### 2 | .DS_Store 3 | .AppleDouble 4 | .LSOverride 5 | 6 | # Icon must end with two \r 7 | Icon 8 | 9 | 10 | # Thumbnails 11 | ._* 12 | 13 | # Files that might appear on external disk 14 | .Spotlight-V100 15 | .Trashes 16 | 17 | # Directories potentially created on remote AFP share 18 | .AppleDB 19 | .AppleDesktop 20 | Network Trash Folder 21 | Temporary Items 22 | .apdisk 23 | 24 | 25 | ### Bower ### 26 | bower_components 27 | .bower-cache 28 | .bower-registry 29 | .bower-tmp 30 | 31 | 32 | ### Node ### 33 | # Logs 34 | logs 35 | *.log 36 | 37 | # Runtime data 38 | pids 39 | *.pid 40 | *.seed 41 | 42 | # Directory for instrumented libs generated by jscoverage/JSCover 43 | lib-cov 44 | 45 | # Coverage directory used by tools like istanbul 46 | coverage 47 | 48 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 49 | .grunt 50 | 51 | # node-waf configuration 52 | .lock-wscript 53 | 54 | # Compiled binary addons (http://nodejs.org/api/addons.html) 55 | build/Release 56 | 57 | # Dependency directory 58 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 59 | node_modules 60 | 61 | 62 | ### Composer ### 63 | composer.phar 64 | vendor/ 65 | 66 | 67 | # Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file 68 | # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file 69 | # composer.lock 70 | 71 | ### Sass ### 72 | .sass-cache 73 | 74 | release 75 | 76 | 77 | # Created by https://www.gitignore.io/api/composer,osx,node,grunt 78 | 79 | ### Composer ### 80 | composer.phar 81 | /vendor/ 82 | 83 | # Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file 84 | # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file 85 | # composer.lock 86 | 87 | 88 | ### OSX ### 89 | .DS_Store 90 | .AppleDouble 91 | .LSOverride 92 | 93 | # Icon must end with two \r 94 | Icon 95 | 96 | # Thumbnails 97 | ._* 98 | 99 | # Files that might appear in the root of a volume 100 | .DocumentRevisions-V100 101 | .fseventsd 102 | .Spotlight-V100 103 | .TemporaryItems 104 | .Trashes 105 | .VolumeIcon.icns 106 | 107 | # Directories potentially created on remote AFP share 108 | .AppleDB 109 | .AppleDesktop 110 | Network Trash Folder 111 | Temporary Items 112 | .apdisk 113 | 114 | 115 | ### Node ### 116 | # Logs 117 | logs 118 | *.log 119 | npm-debug.log* 120 | 121 | # Runtime data 122 | pids 123 | *.pid 124 | *.seed 125 | 126 | # Directory for instrumented libs generated by jscoverage/JSCover 127 | lib-cov 128 | 129 | # Coverage directory used by tools like istanbul 130 | coverage 131 | 132 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 133 | .grunt 134 | 135 | # node-waf configuration 136 | .lock-wscript 137 | 138 | # Compiled binary addons (http://nodejs.org/api/addons.html) 139 | build/Release 140 | 141 | # Dependency directories 142 | node_modules 143 | jspm_packages 144 | 145 | # Optional npm cache directory 146 | .npm 147 | 148 | # Optional REPL history 149 | .node_repl_history 150 | 151 | 152 | ### grunt ### 153 | # Grunt usually compiles files inside this directory 154 | dist/ 155 | 156 | # Grunt usually preprocesses files such as coffeescript, compass... inside the .tmp directory 157 | .tmp/ 158 | 159 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | notifications: 4 | email: 5 | on_success: never 6 | on_failure: change 7 | 8 | php: 9 | - 5.3 10 | - 5.5 11 | 12 | env: 13 | - WP_VERSION=latest WP_MULTISITE=0 14 | 15 | matrix: 16 | include: 17 | - php: 5.3 18 | env: WP_VERSION=latest WP_MULTISITE=1 19 | 20 | before_script: 21 | - bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION 22 | 23 | script: phpunit 24 | -------------------------------------------------------------------------------- /.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-plugin-wp": { 3 | "name": "Cool Shortcode", 4 | "homepage": "http://webdevstudios.com", 5 | "description": "Built with WDS-Shortcodes (and Shortcode_Button), this plugin demonstrates the capabilites of those libraries.", 6 | "version": "0.0.0", 7 | "author": "WebDevStudios", 8 | "authoremail": "contact@webdevstudios.com", 9 | "authorurl": "http://webdevstudios.com", 10 | "license": "GPLv2", 11 | "slug": "cool-shortcode", 12 | "classname": "Cool_Shortcode", 13 | "classprefix": "CS_", 14 | "prefix": "cool_shortcode", 15 | "year": 2016 16 | } 17 | } -------------------------------------------------------------------------------- /Dockunit.json: -------------------------------------------------------------------------------- 1 | { 2 | "containers": [ 3 | { 4 | "prettyName": "PHP 5.2 FPM WordPress 4.3", 5 | "image": "dockunit/prebuilt-images:php-mysql-phpunit-wordpress-5.2-fpm", 6 | "beforeScripts": [ 7 | "service mysql start", 8 | "bash bin/install-wp-tests.sh wordpress_test root '' localhost 4.3" 9 | ], 10 | "testCommand": "phpunit" 11 | }, 12 | { 13 | "prettyName": "PHP 5.6 FPM WordPress 4.2", 14 | "image": "dockunit/prebuilt-images:php-mysql-phpunit-wordpress-5.6-fpm", 15 | "beforeScripts": [ 16 | "service mysql start", 17 | "bash bin/install-wp-tests.sh wordpress_test2 root '' localhost 4.2" 18 | ], 19 | "testCommand": "phpunit" 20 | }, 21 | { 22 | "prettyName": "PHP 7.0 FPM Latest WordPress", 23 | "image": "dockunit/prebuilt-images:php-mysql-phpunit-wordpress-7.0-fpm", 24 | "beforeScripts": [ 25 | "service mysql start", 26 | "bash bin/install-wp-tests.sh wordpress_test3 root '' localhost" 27 | ], 28 | "testCommand": "phpunit" 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function( grunt ) { 2 | 3 | require('load-grunt-tasks')(grunt); 4 | 5 | var pkg = grunt.file.readJSON( 'package.json' ); 6 | 7 | var bannerTemplate = '/**\n' + 8 | ' * <%= pkg.title %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' + 9 | ' * <%= pkg.author.url %>\n' + 10 | ' *\n' + 11 | ' * Copyright (c) <%= grunt.template.today("yyyy") %>;\n' + 12 | ' * Licensed GPLv2+\n' + 13 | ' */\n'; 14 | 15 | var compactBannerTemplate = '/** ' + 16 | '<%= pkg.title %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> | <%= pkg.author.url %> | Copyright (c) <%= grunt.template.today("yyyy") %>; | Licensed GPLv2+' + 17 | ' **/\n'; 18 | 19 | // Project configuration 20 | grunt.initConfig( { 21 | 22 | pkg: pkg, 23 | 24 | 25 | watch: { 26 | styles: { 27 | files: ['assets/**/*.css','assets/**/*.scss'], 28 | tasks: ['styles'], 29 | options: { 30 | spawn: false, 31 | livereload: true, 32 | debounceDelay: 500 33 | } 34 | }, 35 | scripts: { 36 | files: ['assets/**/*.js'], 37 | tasks: ['scripts'], 38 | options: { 39 | spawn: false, 40 | livereload: true, 41 | debounceDelay: 500 42 | } 43 | }, 44 | php: { 45 | files: ['**/*.php', '!vendor/**.*.php'], 46 | tasks: ['php'], 47 | options: { 48 | spawn: false, 49 | debounceDelay: 500 50 | } 51 | } 52 | }, 53 | 54 | makepot: { 55 | dist: { 56 | options: { 57 | domainPath: '/languages/', 58 | potFilename: pkg.name + '.pot', 59 | type: 'wp-plugin' 60 | } 61 | } 62 | }, 63 | 64 | addtextdomain: { 65 | dist: { 66 | options: { 67 | textdomain: pkg.name 68 | }, 69 | target: { 70 | files: { 71 | src: ['**/*.php'] 72 | } 73 | } 74 | } 75 | }, 76 | 77 | replace: { 78 | version_php: { 79 | src: [ 80 | '**/*.php', 81 | '!vendor/**', 82 | ], 83 | overwrite: true, 84 | replacements: [ { 85 | from: /Version:(\s*?)[a-zA-Z0-9\.\-\+]+$/m, 86 | to: 'Version:$1' + pkg.version 87 | }, { 88 | from: /@version(\s*?)[a-zA-Z0-9\.\-\+]+$/m, 89 | to: '@version$1' + pkg.version 90 | }, { 91 | from: /@since(.*?)NEXT/mg, 92 | to: '@since$1' + pkg.version 93 | }, { 94 | from: /VERSION(\s*?)=(\s*?['"])[a-zA-Z0-9\.\-\+]+/mg, 95 | to: 'VERSION$1=$2' + pkg.version 96 | } ] 97 | }, 98 | version_readme: { 99 | src: 'README.md', 100 | overwrite: true, 101 | replacements: [ { 102 | from: /^\*\*Stable tag:\*\*(\s*?)[a-zA-Z0-9.-]+(\s*?)$/mi, 103 | to: '**Stable tag:**$1<%= pkg.version %>$2' 104 | } ] 105 | }, 106 | readme_txt: { 107 | src: 'README.md', 108 | dest: 'release/' + pkg.version + '/readme.txt', 109 | replacements: [ { 110 | from: /^# (.*?)( #+)?$/mg, 111 | to: '=== $1 ===' 112 | }, { 113 | from: /^## (.*?)( #+)?$/mg, 114 | to: '== $1 ==' 115 | }, { 116 | from: /^### (.*?)( #+)?$/mg, 117 | to: '= $1 =' 118 | }, { 119 | from: /^\*\*(.*?):\*\*/mg, 120 | to: '$1:' 121 | } ] 122 | } 123 | }, 124 | 125 | copy: { 126 | release: { 127 | src: [ 128 | '**', 129 | '!assets/js/components/**', 130 | '!assets/css/sass/**', 131 | '!bin/**', 132 | '!release/**', 133 | '!tests/**', 134 | '!node_modules/**', 135 | '!**/*.md', 136 | '!.travis.yml', 137 | '!.bowerrc', 138 | '!.gitignore', 139 | '!bower.json', 140 | '!Dockunit.json', 141 | '!Gruntfile.js', 142 | '!package.json', 143 | '!phpunit.xml', 144 | ], 145 | dest: 'release/' + pkg.version + '/' 146 | } 147 | } 148 | 149 | } ); 150 | 151 | grunt.registerTask( 'scripts', [] ); 152 | grunt.registerTask( 'styles', [] ); 153 | grunt.registerTask( 'php', [ 'addtextdomain', 'makepot' ] ); 154 | grunt.registerTask( 'default', ['styles', 'scripts', 'php'] ); 155 | 156 | grunt.registerTask( 'version', [ 'default', 'replace:version_php', 'replace:version_readme' ] ); 157 | grunt.registerTask( 'release', [ 'default', 'replace', 'copy' ] ); 158 | 159 | grunt.util.linefeed = '\n'; 160 | }; 161 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Cool Shortcode # 2 | **Contributors:** WebDevStudios 3 | **Donate link:** http://webdevstudios.com 4 | **Tags:** 5 | **Requires at least:** 4.4 6 | **Tested up to:** 4.4 7 | **Stable tag:** 0.1.0 8 | **License:** GPLv2 9 | **License URI:** http://www.gnu.org/licenses/gpl-2.0.html 10 | 11 | ## Description ## 12 | 13 | Built on top of [WDS-Shortcodes](https://github.com/WebDevStudios/WDS-Shortcodes) (which is built on top of [Shortcode_Button](https://github.com/jtsternberg/Shortcode_Button)), this plugin demonstrates the capabilites of those libraries. 14 | 15 | For more info, [check out the wiki](https://github.com/WebDevStudios/WDS-Shortcodes/wiki) for the WDS-Shortcodes library. 16 | 17 | (I also ought to mention, this plugin is built with the [WDS plugin generator](https://github.com/WebDevStudios/generator-plugin-wp/)) 18 | 19 | ## Installation ## 20 | 21 | ### Manual Installation ### 22 | 23 | 1. Upload the entire `/cool-shortcode` directory to the `/wp-content/plugins/` directory. 24 | 2. Activate Cool Shortcode through the 'Plugins' menu in WordPress. 25 | 26 | ## Frequently Asked Questions ## 27 | 28 | 29 | ## Screenshots ## 30 | 31 | ![button](https://raw.githubusercontent.com/jtsternberg/Cool-Shortcode/master/screenshot-1.png) 32 | *Button* 33 | 34 | ![button-click-show-modal](https://raw.githubusercontent.com/jtsternberg/Cool-Shortcode/master/screenshot-2.png) 35 | *Click button and open modal* 36 | 37 | ![button-click-show-modal](https://raw.githubusercontent.com/jtsternberg/Cool-Shortcode/master/screenshot-3.png) 38 | *Submitted form inserts shortcode, and we show a live preview* 39 | 40 | ![Click on preview to get edit controls](https://raw.githubusercontent.com/jtsternberg/Cool-Shortcode/master/screenshot-4.png) 41 | *Click on preview to get edit controls* 42 | 43 | ![Generated shortcode in html mode (the html mode button is visible also)](https://raw.githubusercontent.com/jtsternberg/Cool-Shortcode/master/screenshot-5.png) 44 | *Generated shortcode in html mode (the html mode button is visible also)* 45 | 46 | ## Changelog ## 47 | 48 | ### 0.1.0 ### 49 | * Update to work with new WDS-Shortcodes structure (can not extend the `WDS_Shortcode_Admin` class before the `'init'` hook). 50 | 51 | ### 0.0.0 ### 52 | * First release 53 | 54 | ## Upgrade Notice ## 55 | 56 | ### 0.0.0 ### 57 | First Release 58 | -------------------------------------------------------------------------------- /assets/README.md: -------------------------------------------------------------------------------- 1 | # Cool Shortcode Assets # 2 | http://webdevstudios.com 3 | Copyright (c) 2016 WebDevStudios 4 | Licensed under the GPLv2 license. 5 | 6 | Assets such as styles, javascript, and images. -------------------------------------------------------------------------------- /bin/install-wp-tests.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # bash bin/install-wp-tests.sh wordpress_test root '' localhost latest 3 | 4 | if [ $# -lt 3 ]; then 5 | echo "usage: $0 [db-host] [wp-version]" 6 | exit 1 7 | fi 8 | 9 | DB_NAME=$1 10 | DB_USER=$2 11 | DB_PASS=$3 12 | DB_HOST=${4-localhost} 13 | WP_VERSION=${5-latest} 14 | 15 | WP_TESTS_DIR=${WP_TESTS_DIR-/tmp/wordpress-tests-lib} 16 | WP_CORE_DIR=${WP_CORE_DIR-/tmp/wordpress/} 17 | 18 | download() { 19 | if [ `which curl` ]; then 20 | curl -s "$1" > "$2"; 21 | elif [ `which wget` ]; then 22 | wget -nv -O "$2" "$1" 23 | fi 24 | } 25 | 26 | if [[ $WP_VERSION =~ [0-9]+\.[0-9]+(\.[0-9]+)? ]]; then 27 | WP_TESTS_TAG="tags/$WP_VERSION" 28 | else 29 | # http serves a single offer, whereas https serves multiple. we only want one 30 | download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json 31 | grep '[0-9]+\.[0-9]+(\.[0-9]+)?' /tmp/wp-latest.json 32 | LATEST_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//') 33 | if [[ -z "$LATEST_VERSION" ]]; then 34 | echo "Latest WordPress version could not be found" 35 | exit 1 36 | fi 37 | WP_TESTS_TAG="tags/$LATEST_VERSION" 38 | fi 39 | 40 | set -ex 41 | 42 | install_wp() { 43 | 44 | if [ -d $WP_CORE_DIR ]; then 45 | return; 46 | fi 47 | 48 | mkdir -p $WP_CORE_DIR 49 | 50 | if [ $WP_VERSION == 'latest' ]; then 51 | local ARCHIVE_NAME='latest' 52 | else 53 | local ARCHIVE_NAME="wordpress-$WP_VERSION" 54 | fi 55 | 56 | download https://wordpress.org/${ARCHIVE_NAME}.tar.gz /tmp/wordpress.tar.gz 57 | tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C $WP_CORE_DIR 58 | 59 | download https://raw.github.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php 60 | } 61 | 62 | install_test_suite() { 63 | # portable in-place argument for both GNU sed and Mac OSX sed 64 | if [[ $(uname -s) == 'Darwin' ]]; then 65 | local ioption='-i .bak' 66 | else 67 | local ioption='-i' 68 | fi 69 | 70 | # set up testing suite if it doesn't yet exist 71 | if [ ! -d $WP_TESTS_DIR ]; then 72 | # set up testing suite 73 | mkdir -p $WP_TESTS_DIR 74 | svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes 75 | fi 76 | 77 | cd $WP_TESTS_DIR 78 | 79 | if [ ! -f wp-tests-config.php ]; then 80 | download https://develop.svn.wordpress.org/${WP_TESTS_TAG}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php 81 | sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR':" "$WP_TESTS_DIR"/wp-tests-config.php 82 | sed $ioption "s:define( 'WP_DEBUG', true );:define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true );:" "$WP_TESTS_DIR"/wp-tests-config.php 83 | sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php 84 | sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php 85 | sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php 86 | sed $ioption "s|localhost|${DB_HOST}|" "$WP_TESTS_DIR"/wp-tests-config.php 87 | fi 88 | 89 | } 90 | 91 | install_required_plugins() { 92 | download https://raw.githubusercontent.com/WebDevStudios/WDS-Shortcodes/master/wds-shortcodes.zip /tmp/wds-shortcodes.zip 93 | unzip /tmp/wds-shortcodes.zip -d $WP_CORE_DIR/wp-content/plugins/wds-shortcodes 94 | } 95 | 96 | install_db() { 97 | # parse DB_HOST for port or socket references 98 | local PARTS=(${DB_HOST//\:/ }) 99 | local DB_HOSTNAME=${PARTS[0]}; 100 | local DB_SOCK_OR_PORT=${PARTS[1]}; 101 | local EXTRA="" 102 | 103 | if ! [ -z $DB_HOSTNAME ] ; then 104 | if [ $(echo $DB_SOCK_OR_PORT | grep -e '^[0-9]\{1,\}$') ]; then 105 | EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp" 106 | elif ! [ -z $DB_SOCK_OR_PORT ] ; then 107 | EXTRA=" --socket=$DB_SOCK_OR_PORT" 108 | elif ! [ -z $DB_HOSTNAME ] ; then 109 | EXTRA=" --host=$DB_HOSTNAME --protocol=tcp" 110 | fi 111 | fi 112 | 113 | # create database 114 | mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA 115 | } 116 | 117 | install_wp 118 | install_test_suite 119 | install_required_plugins 120 | install_db 121 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cool-shortcode", 3 | "description": "Built with WDS-Shortcodes (and Shortcode_Button), this plugin demonstrates the capabilites of those libraries.", 4 | "license": "GPLv2", 5 | "authors": [ 6 | "WebDevStudios" 7 | ], 8 | "private": true, 9 | "ignore": [ 10 | "**/.*", 11 | "node_modules", 12 | "bower_components", 13 | "test", 14 | "tests" 15 | ], 16 | "dependencies": { 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cool-shortcode", 3 | "description": "Built with WDS-Shortcodes (and Shortcode_Button), this plugin demonstrates the capabilites of those libraries.", 4 | "keywords": ["wordpress", "plugin", "generator-plugin-wp"], 5 | "homepage": "http://webdevstudios.com", 6 | "license": "GPLv2", 7 | "authors": [ 8 | { 9 | "name": "WebDevStudios", 10 | "homepage": "http://webdevstudios.com" 11 | } 12 | ], 13 | "minimum-stability": "dev", 14 | "type": "wordpress-plugin", 15 | "autoload": { 16 | "classmap": ["cool-shortcode.php", "includes/"] 17 | }, 18 | "require": { 19 | "php": ">=5.2", 20 | "xrstf/composer-php52": "1.*", 21 | "TGMPA/TGM-Plugin-Activation": "^2.5.2" 22 | }, 23 | "scripts": { 24 | "post-install-cmd": [ 25 | "xrstf\\Composer52\\Generator::onPostInstallCmd" 26 | ], 27 | "post-update-cmd": [ 28 | "xrstf\\Composer52\\Generator::onPostInstallCmd" 29 | ], 30 | "post-autoload-dump": [ 31 | "xrstf\\Composer52\\Generator::onPostInstallCmd" 32 | ] 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", 5 | "This file is @generated automatically" 6 | ], 7 | "hash": "28de1c696cddb932c65f35906854a3f8", 8 | "content-hash": "23767a53ea28b4e7269c30061b15fb95", 9 | "packages": [ 10 | { 11 | "name": "tgmpa/tgm-plugin-activation", 12 | "version": "2.5.2", 13 | "source": { 14 | "type": "git", 15 | "url": "https://github.com/TGMPA/TGM-Plugin-Activation.git", 16 | "reference": "ba41c10e821a10d3d6c3b8e468a16716bb03f125" 17 | }, 18 | "dist": { 19 | "type": "zip", 20 | "url": "https://api.github.com/repos/TGMPA/TGM-Plugin-Activation/zipball/ba41c10e821a10d3d6c3b8e468a16716bb03f125", 21 | "reference": "ba41c10e821a10d3d6c3b8e468a16716bb03f125", 22 | "shasum": "" 23 | }, 24 | "require": { 25 | "php": ">=5.2" 26 | }, 27 | "type": "library", 28 | "autoload": { 29 | "files": [ 30 | "class-tgm-plugin-activation.php" 31 | ] 32 | }, 33 | "notification-url": "https://packagist.org/downloads/", 34 | "license": [ 35 | "GPL-2.0+" 36 | ], 37 | "authors": [ 38 | { 39 | "name": "Thomas Griffin", 40 | "homepage": "http://thomasgriffinmedia.com", 41 | "role": "Developer" 42 | }, 43 | { 44 | "name": "Gary Jones", 45 | "homepage": "https://github.com/GaryJones", 46 | "role": "Developer" 47 | }, 48 | { 49 | "name": "Juliette Reinders Folmer", 50 | "homepage": "https://github.com/jrfnl", 51 | "role": "Developer" 52 | } 53 | ], 54 | "description": "TGM Plugin Activation is a PHP library that allows you to easily require or recommend plugins for your WordPress themes (and plugins).", 55 | "homepage": "http://tgmpluginactivation.com", 56 | "keywords": [ 57 | "activation", 58 | "library", 59 | "plugins", 60 | "theme", 61 | "wordpress" 62 | ], 63 | "time": "2015-07-16 08:59:11" 64 | }, 65 | { 66 | "name": "xrstf/composer-php52", 67 | "version": "dev-default", 68 | "source": { 69 | "type": "hg", 70 | "url": "https://bitbucket.org/xrstf/composer-php52", 71 | "reference": "724d62b7fdcf102a6c4097f5f1c2026f124583a5" 72 | }, 73 | "dist": { 74 | "type": "zip", 75 | "url": "https://bitbucket.org/xrstf/composer-php52/get/724d62b7fdcf102a6c4097f5f1c2026f124583a5.zip", 76 | "reference": "724d62b7fdcf102a6c4097f5f1c2026f124583a5", 77 | "shasum": "" 78 | }, 79 | "type": "library", 80 | "extra": { 81 | "branch-alias": { 82 | "dev-default": "1.x-dev" 83 | } 84 | }, 85 | "autoload": { 86 | "psr-0": { 87 | "xrstf\\Composer52": "lib/" 88 | } 89 | }, 90 | "notification-url": "https://packagist.org/downloads/", 91 | "license": [ 92 | "MIT" 93 | ], 94 | "homepage": "http://www.xrstf.de/", 95 | "time": "2015-10-01 14:12:30" 96 | } 97 | ], 98 | "packages-dev": [], 99 | "aliases": [], 100 | "minimum-stability": "dev", 101 | "stability-flags": [], 102 | "prefer-stable": false, 103 | "prefer-lowest": false, 104 | "platform": { 105 | "php": ">=5.2" 106 | }, 107 | "platform-dev": [] 108 | } 109 | -------------------------------------------------------------------------------- /cool-shortcode.php: -------------------------------------------------------------------------------- 1 | basename = plugin_basename( __FILE__ ); 129 | $this->url = plugin_dir_url( __FILE__ ); 130 | $this->path = plugin_dir_path( __FILE__ ); 131 | } 132 | 133 | /** 134 | * Attach other plugin classes to the base plugin class. 135 | * 136 | * @since 0.0.0 137 | * @return void 138 | */ 139 | public function plugin_classes() { 140 | // Attach other plugin classes to the base plugin class. 141 | $this->run = new CS_Run(); 142 | } // END OF PLUGIN CLASSES FUNCTION 143 | 144 | /** 145 | * Add hooks and filters 146 | * 147 | * @since 0.0.0 148 | * @return void 149 | */ 150 | public function hooks() { 151 | 152 | $this->plugin_classes(); 153 | 154 | add_action( 'init', array( $this, 'init' ) ); 155 | 156 | if ( ! defined( 'WDS_SHORTCODES_LOADED' ) ) { 157 | add_action( 'tgmpa_register', array( $this, 'register_required_plugin' ) ); 158 | } 159 | 160 | $this->run->hooks(); 161 | } 162 | 163 | /** 164 | * Requires WDS Shortcodes to be installed 165 | */ 166 | public function register_required_plugin() { 167 | 168 | $plugins = array( 169 | array( 170 | 'name' => 'WDS Shortcodes', 171 | 'slug' => 'wds-shortcodes', 172 | 'source' => 'https://github.com/WebDevStudios/WDS-Shortcodes/blob/master/wds-shortcodes.zip?raw=true', 173 | 'required' => true, 174 | 'external_url' => 'https://github.com/WebDevStudios/WDS-Shortcodes', 175 | ), 176 | ); 177 | 178 | $config = array( 179 | 'domain' => 'cool-shortcode', 180 | 'default_path' => '', 181 | 'parent_slug' => 'plugins.php', 182 | 'capability' => 'install_plugins', 183 | 'menu' => 'install-required-plugins', 184 | 'has_notices' => true, 185 | 'is_automatic' => true, 186 | 'message' => '', 187 | 'strings' => array( 188 | 'page_title' => __( 'Install Required Plugins', 'cool-shortcode' ), 189 | 'menu_title' => __( 'Install Plugins', 'cool-shortcode' ), 190 | 'installing' => __( 'Installing Plugin: %s', 'cool-shortcode' ), 191 | // %1$s = plugin name 192 | 'oops' => __( 'Something went wrong with the plugin API.', 'cool-shortcode' ), 193 | 'notice_can_install_required' => _n_noop( 'The "WDS Shortcodes" plugin requires the following plugin: %1$s.', 'This plugin requires the following plugins: %1$s.' ), 194 | // %1$s = plugin name(s) 195 | 'notice_can_install_recommended' => _n_noop( 'This plugin recommends the following plugin: %1$s.', 'This plugin recommends the following plugins: %1$s.' ), 196 | // %1$s = plugin name(s) 197 | 'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ), 198 | // %1$s = plugin name(s) 199 | 'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ), 200 | // %1$s = plugin name(s) 201 | 'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ), 202 | // %1$s = plugin name(s) 203 | 'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ), 204 | // %1$s = plugin name(s) 205 | 'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this plugin: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this plugin: %1$s.' ), 206 | // %1$s = plugin name(s) 207 | 'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ), 208 | // %1$s = plugin name(s) 209 | 'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ), 210 | 'activate_link' => _n_noop( 'Activate installed plugin', 'Activate installed plugins' ), 211 | 'return' => __( 'Return to Required Plugins Installer', 'cool-shortcode' ), 212 | 'plugin_activated' => __( 'Plugin activated successfully.', 'cool-shortcode' ), 213 | 'complete' => __( 'All plugins installed and activated successfully. %s', 'cool-shortcode' ), 214 | // %1$s = dashboard link 215 | ), 216 | ); 217 | 218 | tgmpa( $plugins, $config ); 219 | } 220 | 221 | /** 222 | * Activate the plugin 223 | * 224 | * @since 0.0.0 225 | * @return void 226 | */ 227 | public function _activate() { 228 | // Make sure any rewrite functionality has been loaded. 229 | flush_rewrite_rules(); 230 | } 231 | 232 | /** 233 | * Deactivate the plugin 234 | * Uninstall routines should be in uninstall.php 235 | * 236 | * @since 0.0.0 237 | * @return void 238 | */ 239 | public function _deactivate() {} 240 | 241 | /** 242 | * Init hooks 243 | * 244 | * @since 0.0.0 245 | * @return void 246 | */ 247 | public function init() { 248 | load_plugin_textdomain( 'cool-shortcode', false, dirname( $this->basename ) . '/languages/' ); 249 | 250 | $this->admin = new CS_Admin( 251 | $this->run->shortcode, 252 | self::VERSION, 253 | $this->run->atts_defaults 254 | ); 255 | $this->admin->hooks(); 256 | } 257 | 258 | /** 259 | * Magic getter for our object. 260 | * 261 | * @since 0.0.0 262 | * @param string $field Field to get. 263 | * @throws Exception Throws an exception if the field is invalid. 264 | * @return mixed 265 | */ 266 | public function __get( $field ) { 267 | switch ( $field ) { 268 | case 'version': 269 | return self::VERSION; 270 | case 'basename': 271 | case 'url': 272 | case 'path': 273 | case 'run': 274 | case 'admin': 275 | return $this->$field; 276 | default: 277 | throw new Exception( 'Invalid '. __CLASS__ .' property: ' . $field ); 278 | } 279 | } 280 | } 281 | 282 | /** 283 | * Grab the Cool_Shortcode object and return it. 284 | * Wrapper for Cool_Shortcode::get_instance() 285 | * 286 | * @since 0.0.0 287 | * @return Cool_Shortcode Singleton instance of plugin class. 288 | */ 289 | function cool_shortcode() { 290 | return Cool_Shortcode::get_instance(); 291 | } 292 | 293 | // Kick it off. 294 | add_action( 'wds_shortcodes_loaded', array( cool_shortcode(), 'hooks' ) ); 295 | 296 | register_activation_hook( __FILE__, array( 'Cool_Shortcode', '_activate' ) ); 297 | register_deactivation_hook( __FILE__, array( 'Cool_Shortcode', '_deactivate' ) ); 298 | -------------------------------------------------------------------------------- /includes/README.md: -------------------------------------------------------------------------------- 1 | # Cool Shortcode Includes # 2 | http://webdevstudios.com 3 | Copyright (c) 2016 WebDevStudios 4 | Licensed under the GPLv2 license. 5 | 6 | Additional PHP functionality goes here. -------------------------------------------------------------------------------- /includes/class-admin.php: -------------------------------------------------------------------------------- 1 | __( 'Be Cool!', 'cool-shortcode' ), 18 | 'button_tooltip' => __( 'Be Cool!', 'cool-shortcode' ), 19 | 'icon' => 'dashicons-thumbs-up', 20 | // 'include_close' => true, 21 | 'mceView' => true, // The future 22 | ); 23 | } 24 | 25 | /** 26 | * Adds fields to the button modal using CMB2 27 | * 28 | * @param $fields 29 | * @param $button_data 30 | * 31 | * @return array 32 | */ 33 | function fields( $fields, $button_data ) { 34 | $fields[] = array( 35 | 'name' => __( 'Say something cool', 'cool-shortcode' ), 36 | 'type' => 'text', 37 | 'id' => 'cool_text', 38 | 'default' => $this->atts_defaults['cool_text'], 39 | ); 40 | 41 | $fields[] = array( 42 | 'name' => __( 'Background Color', 'cool-shortcode' ), 43 | 'desc' => __( 'Background color for "be cool" box.', 'cool-shortcode' ), 44 | 'type' => 'colorpicker', 45 | 'id' => 'background_color', 46 | 'default' => $this->atts_defaults['background_color'], 47 | ); 48 | 49 | $fields[] = array( 50 | 'name' => __( 'Text Color', 'cool-shortcode' ), 51 | 'desc' => __( 'Text color for "be cool" box.', 'cool-shortcode' ), 52 | 'type' => 'colorpicker', 53 | 'id' => 'text_color', 54 | 'default' => $this->atts_defaults['text_color'], 55 | ); 56 | 57 | $fields[] = array( 58 | 'name' => __( 'Extra CSS Classes', 'cool-shortcode' ), 59 | 'desc' => __( 'Enter classes separated by spaces (e.g. "class1 class2")', 'cool-shortcode' ), 60 | 'type' => 'text', 61 | 'id' => 'extra_class', 62 | 'default' => $this->atts_defaults['extra_class'], 63 | ); 64 | 65 | $fields[] = array( 66 | 'name' => __( 'Add a cool blogroll', 'cool-shortcode' ), 67 | 'id' => 'linkslist', 68 | 'type' => 'group', 69 | 'options' => array( 70 | 'group_title' => __( 'Link {#}', 'cool-shortcode' ), 71 | 'add_button' => __( 'Add Another Link', 'cool-shortcode' ), 72 | 'remove_button' => __( 'Remove Link', 'cool-shortcode' ), 73 | 'closed' => true, // true to keep the groups closed by default 74 | ), 75 | 'fields' => array( 76 | array( 77 | 'name' => __( 'Link text', 'cool-shortcode' ), 78 | 'id' => 'text', 79 | 'type' => 'text', 80 | ), 81 | array( 82 | 'name' => __( 'Link URL', 'cool-shortcode' ), 83 | 'id' => 'url', 84 | 'type' => 'text_url', 85 | ), 86 | ), 87 | ); 88 | 89 | return $fields; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /includes/class-run.php: -------------------------------------------------------------------------------- 1 | 'Your cool text', 22 | 'background_color' => '#bada55', 23 | 'text_color' => '#555555', 24 | 'extra_class' => 'large', 25 | 'linkslist' => '', 26 | ); 27 | 28 | /** 29 | * Whether css has been output yet. 30 | * @var bool 31 | */ 32 | protected static $css_done = false; 33 | 34 | /** 35 | * Shortcode Output 36 | */ 37 | public function shortcode() { 38 | 39 | $style = ''; 40 | 41 | if ( $this->att( 'background_color' ) || $this->att( 'text_color' ) ) { 42 | $style = ' style="'; 43 | // Get/check our background_color attribute 44 | if ( $this->att( 'background_color' ) ) { 45 | $bg_color = sanitize_text_field( $this->att( 'background_color' ) ); 46 | $style .= 'background-color: ' . $bg_color .';'; 47 | } 48 | 49 | // Get/check our text_color attribute 50 | if ( $this->att( 'text_color' ) ) { 51 | $text_color = sanitize_text_field( $this->att( 'text_color' ) ); 52 | $style .= 'color: ' . $text_color .';'; 53 | } 54 | $style .= '"'; 55 | } 56 | 57 | // Get our extra_class attribute 58 | $extra_class = $this->get_extra_classes(); 59 | 60 | $output = ''; 61 | $output .= $this->css(); 62 | $output .= '
'; 63 | $output .= wp_kses_post( $this->att( 'cool_text' ) ); 64 | 65 | if ( $this->att( 'linkslist' ) ) { 66 | $output .= '
    '; 67 | foreach ( (array) $this->att( 'linkslist' ) as $link ) { 68 | $output .= sprintf( 69 | '
  • %s
  • ', 70 | $link['url'], 71 | $link['text'] 72 | ); 73 | } 74 | $output .= '
'; 75 | } 76 | 77 | // if include_close was true in CS_Admin::js_button_data, we could use $this->content() 78 | // to get contents between shortcode open/close 79 | // $this->content(); 80 | $output .= '
'; 81 | 82 | return $output; 83 | } 84 | 85 | public function get_extra_classes() { 86 | return ' ' . implode( ' ', array_map( 'sanitize_html_class', explode( ' ', $this->att( 'extra_class' ) ) ) ); 87 | } 88 | 89 | public function css() { 90 | // Only output once, not once per shortcode. 91 | if ( self::$css_done ) { 92 | return ''; 93 | } 94 | 95 | ob_start(); 96 | ?> 97 | 109 | \n" 13 | "Language-Team: LANGUAGE \n" 14 | "X-Generator: grunt-wp-i18n 0.5.4\n" 15 | 16 | #: cool-shortcode.php:188 17 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:333 18 | msgid "Install Required Plugins" 19 | msgstr "" 20 | 21 | #: cool-shortcode.php:189 22 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:334 23 | msgid "Install Plugins" 24 | msgstr "" 25 | 26 | #: cool-shortcode.php:190 27 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:335 28 | msgid "Installing Plugin: %s" 29 | msgstr "" 30 | 31 | #: cool-shortcode.php:192 32 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:336 33 | msgid "Something went wrong with the plugin API." 34 | msgstr "" 35 | 36 | #: cool-shortcode.php:193 37 | msgid "The \"WDS Shortcodes\" plugin requires the following plugin: %1$s." 38 | msgid_plural "This plugin requires the following plugins: %1$s." 39 | msgstr[0] "" 40 | msgstr[1] "" 41 | 42 | #: cool-shortcode.php:195 43 | msgid "This plugin recommends the following plugin: %1$s." 44 | msgid_plural "This plugin recommends the following plugins: %1$s." 45 | msgstr[0] "" 46 | msgstr[1] "" 47 | 48 | #: cool-shortcode.php:197 49 | msgid "" 50 | "Sorry, but you do not have the correct permissions to install the %s " 51 | "plugin. Contact the administrator of this site for help on getting the " 52 | "plugin installed." 53 | msgid_plural "" 54 | "Sorry, but you do not have the correct permissions to install the %s " 55 | "plugins. Contact the administrator of this site for help on getting the " 56 | "plugins installed." 57 | msgstr[0] "" 58 | msgstr[1] "" 59 | 60 | #: cool-shortcode.php:199 61 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:367 62 | msgid "The following required plugin is currently inactive: %1$s." 63 | msgid_plural "The following required plugins are currently inactive: %1$s." 64 | msgstr[0] "" 65 | msgstr[1] "" 66 | 67 | #: cool-shortcode.php:201 68 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:372 69 | msgid "The following recommended plugin is currently inactive: %1$s." 70 | msgid_plural "The following recommended plugins are currently inactive: %1$s." 71 | msgstr[0] "" 72 | msgstr[1] "" 73 | 74 | #: cool-shortcode.php:203 75 | msgid "" 76 | "Sorry, but you do not have the correct permissions to activate the %s " 77 | "plugin. Contact the administrator of this site for help on getting the " 78 | "plugin activated." 79 | msgid_plural "" 80 | "Sorry, but you do not have the correct permissions to activate the %s " 81 | "plugins. Contact the administrator of this site for help on getting the " 82 | "plugins activated." 83 | msgstr[0] "" 84 | msgstr[1] "" 85 | 86 | #: cool-shortcode.php:205 87 | msgid "" 88 | "The following plugin needs to be updated to its latest version to ensure " 89 | "maximum compatibility with this plugin: %1$s." 90 | msgid_plural "" 91 | "The following plugins need to be updated to their latest version to ensure " 92 | "maximum compatibility with this plugin: %1$s." 93 | msgstr[0] "" 94 | msgstr[1] "" 95 | 96 | #: cool-shortcode.php:207 97 | msgid "" 98 | "Sorry, but you do not have the correct permissions to update the %s plugin. " 99 | "Contact the administrator of this site for help on getting the plugin " 100 | "updated." 101 | msgid_plural "" 102 | "Sorry, but you do not have the correct permissions to update the %s " 103 | "plugins. Contact the administrator of this site for help on getting the " 104 | "plugins updated." 105 | msgstr[0] "" 106 | msgstr[1] "" 107 | 108 | #: cool-shortcode.php:209 109 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:382 110 | msgid "Begin installing plugin" 111 | msgid_plural "Begin installing plugins" 112 | msgstr[0] "" 113 | msgstr[1] "" 114 | 115 | #: cool-shortcode.php:210 116 | msgid "Activate installed plugin" 117 | msgid_plural "Activate installed plugins" 118 | msgstr[0] "" 119 | msgstr[1] "" 120 | 121 | #: cool-shortcode.php:211 122 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:397 123 | msgid "Return to Required Plugins Installer" 124 | msgstr "" 125 | 126 | #: cool-shortcode.php:212 127 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:399 128 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:3029 129 | msgid "Plugin activated successfully." 130 | msgstr "" 131 | 132 | #: cool-shortcode.php:213 133 | msgid "All plugins installed and activated successfully. %s" 134 | msgstr "" 135 | 136 | #: includes/class-admin.php:17 includes/class-admin.php:18 137 | msgid "Be Cool!" 138 | msgstr "" 139 | 140 | #: includes/class-admin.php:35 141 | msgid "Say something cool" 142 | msgstr "" 143 | 144 | #: includes/class-admin.php:42 145 | msgid "Background Color" 146 | msgstr "" 147 | 148 | #: includes/class-admin.php:43 149 | msgid "Background color for \"be cool\" box." 150 | msgstr "" 151 | 152 | #: includes/class-admin.php:50 153 | msgid "Text Color" 154 | msgstr "" 155 | 156 | #: includes/class-admin.php:51 157 | msgid "Text color for \"be cool\" box." 158 | msgstr "" 159 | 160 | #: includes/class-admin.php:58 161 | msgid "Extra CSS Classes" 162 | msgstr "" 163 | 164 | #: includes/class-admin.php:59 165 | msgid "Enter classes separated by spaces (e.g. \"class1 class2\")" 166 | msgstr "" 167 | 168 | #: includes/class-admin.php:66 169 | msgid "Add a cool blogroll" 170 | msgstr "" 171 | 172 | #: includes/class-admin.php:70 173 | msgid "Link {#}" 174 | msgstr "" 175 | 176 | #: includes/class-admin.php:71 177 | msgid "Add Another Link" 178 | msgstr "" 179 | 180 | #: includes/class-admin.php:72 181 | msgid "Remove Link" 182 | msgstr "" 183 | 184 | #: includes/class-admin.php:77 185 | msgid "Link text" 186 | msgstr "" 187 | 188 | #: includes/class-admin.php:82 189 | msgid "Link URL" 190 | msgstr "" 191 | 192 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:337 193 | msgid "This theme requires the following plugin: %1$s." 194 | msgid_plural "This theme requires the following plugins: %1$s." 195 | msgstr[0] "" 196 | msgstr[1] "" 197 | 198 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:342 199 | msgid "This theme recommends the following plugin: %1$s." 200 | msgid_plural "This theme recommends the following plugins: %1$s." 201 | msgstr[0] "" 202 | msgstr[1] "" 203 | 204 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:347 205 | msgid "" 206 | "Sorry, but you do not have the correct permissions to install the %1$s " 207 | "plugin." 208 | msgid_plural "" 209 | "Sorry, but you do not have the correct permissions to install the %1$s " 210 | "plugins." 211 | msgstr[0] "" 212 | msgstr[1] "" 213 | 214 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:352 215 | msgid "" 216 | "The following plugin needs to be updated to its latest version to ensure " 217 | "maximum compatibility with this theme: %1$s." 218 | msgid_plural "" 219 | "The following plugins need to be updated to their latest version to ensure " 220 | "maximum compatibility with this theme: %1$s." 221 | msgstr[0] "" 222 | msgstr[1] "" 223 | 224 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:357 225 | msgid "There is an update available for: %1$s." 226 | msgid_plural "There are updates available for the following plugins: %1$s." 227 | msgstr[0] "" 228 | msgstr[1] "" 229 | 230 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:362 231 | msgid "" 232 | "Sorry, but you do not have the correct permissions to update the %1$s " 233 | "plugin." 234 | msgid_plural "" 235 | "Sorry, but you do not have the correct permissions to update the %1$s " 236 | "plugins." 237 | msgstr[0] "" 238 | msgstr[1] "" 239 | 240 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:377 241 | msgid "" 242 | "Sorry, but you do not have the correct permissions to activate the %1$s " 243 | "plugin." 244 | msgid_plural "" 245 | "Sorry, but you do not have the correct permissions to activate the %1$s " 246 | "plugins." 247 | msgstr[0] "" 248 | msgstr[1] "" 249 | 250 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:387 251 | msgid "Begin updating plugin" 252 | msgid_plural "Begin updating plugins" 253 | msgstr[0] "" 254 | msgstr[1] "" 255 | 256 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:392 257 | msgid "Begin activating plugin" 258 | msgid_plural "Begin activating plugins" 259 | msgstr[0] "" 260 | msgstr[1] "" 261 | 262 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:398 263 | msgid "Return to the dashboard" 264 | msgstr "" 265 | 266 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:400 267 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2832 268 | msgid "The following plugin was activated successfully:" 269 | msgstr "" 270 | 271 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:401 272 | msgid "No action taken. Plugin %1$s was already active." 273 | msgstr "" 274 | 275 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:402 276 | msgid "" 277 | "Plugin not activated. A higher version of %s is needed for this theme. " 278 | "Please update the plugin." 279 | msgstr "" 280 | 281 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:403 282 | msgid "All plugins installed and activated successfully. %1$s" 283 | msgstr "" 284 | 285 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:404 286 | msgid "Dismiss this notice" 287 | msgstr "" 288 | 289 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:405 290 | msgid "Please contact the administrator of this site for help." 291 | msgstr "" 292 | 293 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:520 294 | msgid "This plugin needs to be updated to be compatible with your theme." 295 | msgstr "" 296 | 297 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:521 298 | msgid "Update Required" 299 | msgstr "" 300 | 301 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:635 302 | msgid "Set the parent_slug config variable instead." 303 | msgstr "" 304 | 305 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:828 306 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:3438 307 | msgid "Return to the Dashboard" 308 | msgstr "" 309 | 310 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:935 311 | msgid "" 312 | "The remote plugin package does not contain a folder with the desired slug " 313 | "and renaming did not work." 314 | msgstr "" 315 | 316 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:935 317 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:938 318 | msgid "" 319 | "Please contact the plugin provider and ask them to package their plugin " 320 | "according to the WordPress guidelines." 321 | msgstr "" 322 | 323 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:938 324 | msgid "" 325 | "The remote plugin package consists of more than one file, but the files are " 326 | "not packaged in a folder." 327 | msgstr "" 328 | 329 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2167 330 | msgid "Required" 331 | msgstr "" 332 | 333 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2170 334 | msgid "Recommended" 335 | msgstr "" 336 | 337 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2186 338 | msgid "WordPress Repository" 339 | msgstr "" 340 | 341 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2189 342 | msgid "External Source" 343 | msgstr "" 344 | 345 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2192 346 | msgid "Pre-Packaged" 347 | msgstr "" 348 | 349 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2209 350 | msgid "Not Installed" 351 | msgstr "" 352 | 353 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2213 354 | msgid "Installed But Not Activated" 355 | msgstr "" 356 | 357 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2215 358 | msgid "Active" 359 | msgstr "" 360 | 361 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2221 362 | msgid "Required Update not Available" 363 | msgstr "" 364 | 365 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2224 366 | msgid "Requires Update" 367 | msgstr "" 368 | 369 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2227 370 | msgid "Update recommended" 371 | msgstr "" 372 | 373 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2283 374 | msgid "To Install (%s)" 375 | msgid_plural "To Install (%s)" 376 | msgstr[0] "" 377 | msgstr[1] "" 378 | 379 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2286 380 | msgid "Update Available (%s)" 381 | msgid_plural "Update Available (%s)" 382 | msgstr[0] "" 383 | msgstr[1] "" 384 | 385 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2289 386 | msgid "To Activate (%s)" 387 | msgid_plural "To Activate (%s)" 388 | msgstr[0] "" 389 | msgstr[1] "" 390 | 391 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2379 392 | msgid "Installed version:" 393 | msgstr "" 394 | 395 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2387 396 | msgid "Minimum required version:" 397 | msgstr "" 398 | 399 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2399 400 | msgid "Available version:" 401 | msgstr "" 402 | 403 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2422 404 | msgid "" 405 | "No plugins to install, update or activate. Return to the " 406 | "Dashboard" 407 | msgstr "" 408 | 409 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2436 410 | msgid "Plugin" 411 | msgstr "" 412 | 413 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2437 414 | msgid "Source" 415 | msgstr "" 416 | 417 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2438 418 | msgid "Type" 419 | msgstr "" 420 | 421 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2442 422 | msgid "Version" 423 | msgstr "" 424 | 425 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2443 426 | msgid "Status" 427 | msgstr "" 428 | 429 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2570 430 | msgid "Upgrade message from the plugin author:" 431 | msgstr "" 432 | 433 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2603 434 | msgid "Install" 435 | msgstr "" 436 | 437 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2609 438 | msgid "Update" 439 | msgstr "" 440 | 441 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2612 442 | msgid "Activate" 443 | msgstr "" 444 | 445 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2643 446 | msgid "No plugins were selected to be installed. No action taken." 447 | msgstr "" 448 | 449 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2645 450 | msgid "No plugins were selected to be updated. No action taken." 451 | msgstr "" 452 | 453 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2681 454 | msgid "No plugins are available to be installed at this time." 455 | msgstr "" 456 | 457 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2683 458 | msgid "No plugins are available to be updated at this time." 459 | msgstr "" 460 | 461 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2788 462 | msgid "No plugins were selected to be activated. No action taken." 463 | msgstr "" 464 | 465 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2814 466 | msgid "No plugins are available to be activated at this time." 467 | msgstr "" 468 | 469 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:3028 470 | msgid "Plugin activation failed." 471 | msgstr "" 472 | 473 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:3362 474 | msgid "Updating Plugin %1$s (%2$d/%3$d)" 475 | msgstr "" 476 | 477 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:3364 478 | msgid "An error occurred while installing %1$s: %2$s." 479 | msgstr "" 480 | 481 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:3365 482 | msgid "The installation of %1$s failed." 483 | msgstr "" 484 | 485 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:3369 486 | msgid "" 487 | "The installation and activation process is starting. This process may take " 488 | "a while on some hosts, so please be patient." 489 | msgstr "" 490 | 491 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:3370 492 | msgid "%1$s installed and activated successfully." 493 | msgstr "" 494 | 495 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:3370 496 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:3376 497 | msgid "Show Details" 498 | msgstr "" 499 | 500 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:3370 501 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:3376 502 | msgid "Hide Details" 503 | msgstr "" 504 | 505 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:3371 506 | msgid "All installations and activations have been completed." 507 | msgstr "" 508 | 509 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:3372 510 | msgid "Installing and Activating Plugin %1$s (%2$d/%3$d)" 511 | msgstr "" 512 | 513 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:3375 514 | msgid "" 515 | "The installation process is starting. This process may take a while on some " 516 | "hosts, so please be patient." 517 | msgstr "" 518 | 519 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:3376 520 | msgid "%1$s installed successfully." 521 | msgstr "" 522 | 523 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:3377 524 | msgid "All installations have been completed." 525 | msgstr "" 526 | 527 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:3378 528 | msgid "Installing Plugin %1$s (%2$d/%3$d)" 529 | msgstr "" 530 | 531 | #. Plugin Name of the plugin/theme 532 | msgid "Cool Shortcode" 533 | msgstr "" 534 | 535 | #. Author URI of the plugin/theme 536 | msgid "http://webdevstudios.com" 537 | msgstr "" 538 | 539 | #. Description of the plugin/theme 540 | msgid "" 541 | "Built with WDS-Shortcodes (and Shortcode_Button), this plugin demonstrates " 542 | "the capabilites of those libraries." 543 | msgstr "" 544 | 545 | #. Author of the plugin/theme 546 | msgid "WebDevStudios" 547 | msgstr "" 548 | 549 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:1116 550 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2828 551 | msgctxt "plugin A *and* plugin B" 552 | msgid "and" 553 | msgstr "" 554 | 555 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:1881 556 | msgctxt "%s = version number" 557 | msgid "TGMPA v%s" 558 | msgstr "" 559 | 560 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2235 561 | msgctxt "%1$s = install status, %2$s = update status" 562 | msgid "%1$s, %2$s" 563 | msgstr "" 564 | 565 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2280 566 | msgctxt "plugins" 567 | msgid "All (%s)" 568 | msgid_plural "All (%s)" 569 | msgstr[0] "" 570 | msgstr[1] "" 571 | 572 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2371 573 | msgctxt "as in: \"version nr unknown\"" 574 | msgid "unknown" 575 | msgstr "" 576 | 577 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2491 578 | msgctxt "%2$s = plugin name in screen reader markup" 579 | msgid "Install %2$s" 580 | msgstr "" 581 | 582 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2495 583 | msgctxt "%2$s = plugin name in screen reader markup" 584 | msgid "Update %2$s" 585 | msgstr "" 586 | 587 | #: vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2500 588 | msgctxt "%2$s = plugin name in screen reader markup" 589 | msgid "Activate %2$s" 590 | msgstr "" -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cool-shortcode", 3 | "title": "Cool Shortcode", 4 | "version": "0.1.0", 5 | "description": "Built with WDS-Shortcodes (and Shortcode_Button), this plugin demonstrates the capabilites of those libraries.", 6 | "author": { 7 | "name": "WebDevStudios", 8 | "url": "http://webdevstudios.com" 9 | }, 10 | "license": "GPLv2", 11 | "devDependencies": { 12 | "grunt": "latest", 13 | "grunt-contrib-watch": "latest", 14 | "grunt-wp-i18n": "latest", 15 | "grunt-contrib-copy": "latest", 16 | "grunt-text-replace": "latest", 17 | "load-grunt-tasks": "latest" 18 | }, 19 | "scripts": { 20 | "test": "dockunit", 21 | "preversion": "npm test", 22 | "version": "grunt version && git add ." 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | ./tests/ 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /screenshot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jtsternberg/Cool-Shortcode/135096c42a3ffb08567f214494ca932905bd421e/screenshot-1.png -------------------------------------------------------------------------------- /screenshot-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jtsternberg/Cool-Shortcode/135096c42a3ffb08567f214494ca932905bd421e/screenshot-2.png -------------------------------------------------------------------------------- /screenshot-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jtsternberg/Cool-Shortcode/135096c42a3ffb08567f214494ca932905bd421e/screenshot-3.png -------------------------------------------------------------------------------- /screenshot-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jtsternberg/Cool-Shortcode/135096c42a3ffb08567f214494ca932905bd421e/screenshot-4.png -------------------------------------------------------------------------------- /screenshot-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jtsternberg/Cool-Shortcode/135096c42a3ffb08567f214494ca932905bd421e/screenshot-5.png -------------------------------------------------------------------------------- /tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | assertTrue( true ); 8 | } 9 | 10 | function test_class_exists() { 11 | $this->assertTrue( class_exists( 'CS_Admin') ); 12 | } 13 | 14 | function test_class_access() { 15 | $this->assertTrue( cool_shortcode()->admin instanceof CS_Admin ); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tests/test-base.php: -------------------------------------------------------------------------------- 1 | assertTrue( true ); 8 | } 9 | 10 | function test_class_exists() { 11 | $this->assertTrue( class_exists( 'Cool_Shortcode') ); 12 | } 13 | 14 | function test_get_instance() { 15 | $this->assertTrue( cool_shortcode() instanceof Cool_Shortcode ); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tests/test-run.php: -------------------------------------------------------------------------------- 1 | assertTrue( true ); 8 | } 9 | 10 | function test_class_exists() { 11 | $this->assertTrue( class_exists( 'CS_Run') ); 12 | } 13 | 14 | function test_class_access() { 15 | $this->assertTrue( cool_shortcode()->run instanceof CS_Run ); 16 | } 17 | } 18 | --------------------------------------------------------------------------------