Read the tutorial if you want to learn how this plugin was developed and how to build your own plugin using React and Webpack.
If you want to run this locally, I've included a docker-compose config for Wordpress + MySQL completely configured. Start it with:
docker-compose up
It will help speed up development to either mount the Docker Wordpress container so you can directly modify the files, or use this command/path to copy the files after saving (adjust for your local path, container ID):
docker cp [local-repo-location]/ghost-inspector.php [your-wordpress-container-id]:/var/www/html/wp-content/plugins/ghost-inspector/ghost-inspector.php
Get the frontend dependencies and start the app:
cd frontend
npm install
npm start
Note: The plugin code (PHP) looks for $_SERVER['REMOTE_ADDR']
equal to '10.255.0.2' or '::1' to detect if WordPress is running locally. You may need to modify that to use your Docker (or M/W/LAMP setup) IP address. In local mode, it expects the Ghost Inspector API to be running on localhost:5021 and the React app in this repo to be on localhost:3000.
Note: Both the development and production build expect a single .js
and a single .css
file. Create React App has code splitting enabled by default, so there are two scripts which override the Webpack config.
To get a .zip
file for manual plugin installation, run (from /frontend):
npm run export
Install the WordPress Beta Tester plugin to update your version of WordPress running in Docker to a nightly or bleeding edge build.
You can install manually using the instructions above. Download the latest version from the WordPress.org plugin directory. Or you can install from your WordPress admin by searching for the plugin "ghost inspector". In either case, follow these instructions to install and setup the plugin.
- Update version in package.json, readme.txt, and ghost-inspector.php
- Add an entry to changelog in readme.txt
- Merge to
stable
in git - Prepare a release by running
npm run export
from/frontend
. Unzip the contents into the SVN trunk directory (overwriting the existing files). - Commit the changes to SVN
- You will need to install
svn
. On MacOS, this can be done withbrew install svn
- The repository is located at https://plugins.svn.wordpress.org/ghost-inspector/
- The account with permissions is in the Engineering 1Password vault. It's username
ghostinspector
(with email addresstech@ghostinspector.com
)
- Update logo(s) in
assets
folder - Copy to SVN - follow instructions for updating