├── .gitignore ├── CHANGELOG.md ├── LICENSE.md ├── README.md ├── composer.json ├── index.php ├── plugin.php └── src ├── sandbox.php └── support └── exceptions.php /.gitignore: -------------------------------------------------------------------------------- 1 | # Unit tests config 2 | phpunit.xml 3 | .travis.yml 4 | /bin 5 | tests/mocks/env/ 6 | 7 | 8 | # Sass cache 9 | .sass-cache/ 10 | 11 | # Development files 12 | /node_modules 13 | /assets/vendor/ 14 | 15 | .idea/ -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | Initial release. -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | GNU General Public License 2.0+ 2 | 3 | Copyright (c) 2015 WP Developers Club, https://wpdevelopersclub.com 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WordPress Starter Plugin 2 | 3 | This repo is the starter plugin for [KnowTheCode.io](https://knowthecode.io). Come check out the [Let’s Build a WordPress Starter Plugin](https://knowthecode.io/labs/lets-build-wordpress-starter-plugin) lab, where you will build this custom plugin with [Tonya](https://knowthecode.io/about) as she explains each step. 4 | 5 | You will use this plugin to build labs with us and test constructs in the [Docx](https://KnowTheCode.io/docx). 6 | 7 | ## Features 8 | 9 | This plugin includes the following features: 10 | 11 | 1. [Composer](https://getcomposer.org/) - Dependency Manager for PHP 12 | 2. [Kint](http://kint-php.github.io/kint/) - Awesome package that helps you to debug - forget `var_dump` and `print_r`. You are going to love Kint. 13 | 3. [Whoops](https://github.com/filp/whoops) - Oh man, you will wonder why this isn't built into PHP. When an error occurs, this displayer replaces out the PHP orange table and gives you information you can actually use. 14 | 15 | ## Installation 16 | 17 | 1. Download it. 18 | 2. Put into your `wp-content/plugins/` folder 19 | 3. Extract it 20 | 4. Go into the new folder 21 | 5. Run `composer install` in terminal or Git Bash to bring in the dependencies and install Composer locally. 22 | 23 | Installation from GitHub is as simple as cloning the repo onto your local machine. To clone the repo, do the following: 24 | 25 | 1. Using PhpStorm, open your project and navigate to `wp-content/plugins/`. (Or open terminal and navigate there). 26 | 2. Then type: `git clone https://github.com/KnowTheCode/WordPress-Starter-Plugin-Lab`. 27 | 3. Go into the new folder 28 | 4. Run `composer install` in terminal to bring in the dependencies and install Composer locally. 29 | 30 | ### Updating to New Kint 31 | 32 | If you have the old version of Kint, do the following: 33 | 34 | 1. Change the dependency in your `composer.json` file to `"kint-php/kint" : "^1.0",` 35 | 2. Run `composer update` in terminal or Git Bash to update all of the dependencies to the latest versions, including Kint. 36 | 37 | That's it. 38 | 39 | ## Contributions 40 | 41 | All feedback, bug reports, and pull requests are welcome. 42 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "knowthecode/wordpress-starter-plugin", 3 | "description" : "Know the Code Starter Sandbox plugin. Use this plugin for all of the Know the Code demo Labs and Docx.", 4 | "type" : "project", 5 | "keywords" : ["wordpress", "wp", "plugin"], 6 | "homepage" : "https://knowthecode.io", 7 | "license" : "GPL-2.0+", 8 | "authors": [ 9 | { 10 | "name" : "hellofromTonya", 11 | "email" : "hellofromtonya@knowthecode.io" 12 | } 13 | ], 14 | "require": { 15 | "php" : ">=5.4.0" 16 | }, 17 | "require-dev": { 18 | "kint-php/kint" : "^1.0", 19 | "filp/whoops": "~2.0" 20 | }, 21 | "autoload" : { 22 | "classmap": [], 23 | "files": [ 24 | "src/support/exceptions.php", 25 | "src/sandbox.php" 26 | ] 27 | }, 28 | "extra": { 29 | "branch-alias": { 30 | "dev-master": "1.0-dev" 31 | } 32 | }, 33 | "config": { 34 | "vendor-dir": "assets/vendor" 35 | }, 36 | "minimum-stability": "dev" 37 | } 38 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | setEditor( 'sublime' ); 37 | $whoops->pushHandler( $error_page ); 38 | $whoops->register(); 39 | } 40 | 41 | load_whoops(); 42 | --------------------------------------------------------------------------------