qobo / project-template-wordpress
Template for new WordPress projects
Installs: 204
Dependents: 0
Suggesters: 0
Security: 0
Stars: 18
Watchers: 18
Forks: 7
Open Issues: 5
Language:JavaScript
Type:project
Requires
- aws/aws-sdk-php: ^3.52
- brainmaestro/composer-git-hooks: ^2.4
- fancyguy/webroot-installer: 1.1.0
- johnpbloch/wordpress-core: 5.7.1
- johnpbloch/wordpress-core-installer: 2.0.0
- josegonzalez/dotenv: ^3.2
- pyrech/composer-changelogs: ^1.4
- qobo/qobo-robo: ^2.0
- qobo/qobo-wp-brand: 2.0.2
- qobo/qobo-wp-generic-theme: 1.1.3
- qobo/qobo-wp-shortcodes: 1.0.1
- wp-cli/wp-cli-bundle: ^2.4
- wpackagist-plugin/akismet: 4.1.9
- wpackagist-plugin/amp: 2.0.11
- wpackagist-plugin/bad-behavior: 2.2.24
- wpackagist-plugin/bootstrap-for-contact-form-7: 1.4.8
- wpackagist-plugin/classic-editor: 1.6
- wpackagist-plugin/contact-form-7: 5.4.1
- wpackagist-plugin/contact-form-7-honeypot: 2.1
- wpackagist-plugin/custom-upload-dir: 3.4.6
- wpackagist-plugin/disable-comments: 2.1.1
- wpackagist-plugin/disable-wordpress-updates: 1.6.7
- wpackagist-plugin/fast-velocity-minify: 3.2.2
- wpackagist-plugin/gdpr-cookie-compliance: 4.5.6
- wpackagist-plugin/google-analytics-for-wordpress: 7.17.0
- wpackagist-plugin/google-sitemap-generator: 4.1.1
- wpackagist-plugin/jetpack: 9.8.1
- wpackagist-plugin/listo: 1.3
- wpackagist-plugin/multiple-post-thumbnails: 1.7
- wpackagist-plugin/page-links-to: 3.3.5
- wpackagist-plugin/pubsubhubbub: 3.0.3
- wpackagist-plugin/resize-image-after-upload: 1.8.6
- wpackagist-plugin/restricted-site-access: ^7.0.1
- wpackagist-plugin/shortcodes-ultimate: 5.9.8
- wpackagist-plugin/tiny-compress-images: 3.2.1
- wpackagist-plugin/wordpress-seo: 16.4
- wpackagist-plugin/wp-mail-smtp: 2.8.0
- wpackagist-plugin/wp-media-library-categories: 1.9.9
- wpackagist-plugin/wp-super-cache: 1.7.3
- wpackagist-plugin/wp-theme-plugin-editor-disable: 1.0.0
- wpackagist-plugin/yoast-test-helper: 1.14
Requires (Dev)
- brianium/paratest: *
- phpstan/phpstan: ^0.10.3
- phpstan/phpstan-phpunit: ^0.10.0
- phpunit/phpunit: *
- squizlabs/php_codesniffer: *
- thecodingmachine/phpstan-strict-rules: ^0.11.0
- wp-coding-standards/wpcs: 0.11.0
- wpackagist-plugin/debug-bar: 1.1.2
- wpackagist-plugin/debug-bar-console: 0.3
- wpackagist-plugin/p3-profiler: 1.5.4
- wpackagist-plugin/theme-check: *
- wpackagist-plugin/user-switching: 1.5.6
Suggests
- ext-xdebug: Allows code coverage reports and advanced debugging
- qobo/qobo-wp-custom-admin-theme: it fixes WP admin styles where widget input, select overlap their container
- wpackagist-plugin/regenerate-thumbnails: Regenerate Thumbnails allows you to regenerate the thumbnails for your image attachments.
- dev-master
- v12.2.0
- v12.1.0
- v12.0.0
- v11.4.0
- v11.3.0
- v11.2.0
- v11.1.0
- v11.0.0
- v10.20.0
- v10.19.2
- v10.19.1
- v10.19.0
- v10.18.3
- v10.18.2
- v10.18.1
- v10.18.0
- v10.17.0
- v10.16.0
- v10.15.0
- v10.14.1
- v10.14.0
- v10.13.0
- v10.12.2
- v10.12.1
- v10.12.0
- v10.11.0
- v10.10.0
- v10.9.0
- v10.8.0
- v10.7.0
- v10.6.0
- v10.5.0
- v10.4.1
- v10.4.0
- v10.3.0
- v10.2.0
- v10.1.0
- v10.0.0
- v9.7.0
- v9.6.1
- v9.6.0
- v9.5.1
- v9.5.0
- v9.4.0
- v9.3.1
- v9.3.0
- v9.2.1
- v9.2.0
- v9.1.1
- v9.1.0
- v9.0.1
- v9.0.0
- v8.0.0
- v7.0.0
- v6.8.0
- v6.7.0
- v6.6.4
- v6.6.3
- v6.6.2
- v6.6.1
- v6.6.0
- v6.5.1
- v6.5.0
- v6.4.0
- v6.3.2
- v6.3.1
- v6.3.0
- v6.2.0
- v6.1.2
- v6.1.1
- v6.1.0
- v6.0.0
- v5.4.2
- v5.4.1
- v5.4.0
- v5.3.1
- v5.3.0
- v5.2.0
- v5.1.2
- v5.1.1
- v5.1.0
- v5.0.0
- v4.4.0
- v4.3.0
- v4.2.0
- v4.1.1
- v4.1.0
- v4.0.6
- v4.0.5
- v4.0.4
- v4.0.3
- v4.0.2
- v4.0.1
- v4.0.0
- v3.8.1
- v3.8.0
- v3.7.0
- v3.6.0
- v3.5.4
- v3.5.3
- v3.5.2
- v3.5.1
- v3.5.0
- v3.4.0
- v3.3.0
- v3.2.0
- v3.1.1
- v3.1.0
- v3.0.0
- v2.4.0
- v2.3.5
- v2.3.4
- v2.3.3
- v2.3.2
- v2.3.1
- v2.3.0
- v2.2.0
- v2.1.0
- v2.0.0
- v1.0.14
- v1.0.13
- v1.0.12
- v1.0.11
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-update-wordpress-6
- dev-dependabot/composer/wpackagist-plugin/amp-2.1.3
- dev-dependabot/composer/wpackagist-plugin/wp-mail-smtp-2.9.0
- dev-dependabot/add-v2-config-file
- dev-dependabot/composer/wp-coding-standards/wpcs-2.3.0
- dev-test-travis
- dev-10539_google_maps_api_key_env
- dev-phpstan-task-7726
- dev-add-cron-install-task6673
This package is auto-updated.
Last update: 2023-04-29 01:01:06 UTC
README
About
This is a template for the new WordPress projects.
Developed by Qobo, used in Qobrix.
Install
There are two ways to install and start using this project template.
Composer
You can create a new project from this template using composer.
composer create-project qobo/project-template-wordpress example.com cd example.com ./bin/build app:install DB_NAME="app",PROJECT_NAME="My Project",PROJECT_VERSION="v1.0.0"
Git
Alternatively, if you want to be able to update your project to the latest version of the template, you can install the template with git.
mkdir example.com cd example.com git init # Pull the latest version from https://github.com/QoboLtd/project-template-wordpress/releases git pull git@github.com:QoboLtd/project-template-wordpress.git vX.Y.Z composer update ./bin/build app:install DB_NAME="app",PROJECT_NAME="My Project",PROJECT_VERSION="v1.0.0" # Add your own remote repository git remote add origin git@github.com/USER/REPO # Push git push origin master
With the above approach, you have the full history of the template development. You can do your own development now, and upgrade to the latest template at any point in the future.
Update
If you installed the project template using git, you can easily upgrade your application to the latest template with the following:
cd exmample.com # Make sure you are on the master branch and have a clean and up-to-date workspace git checkout master git pull origin master # Create a new branch git checkout -b project-template-update # Pull the latest version from https://github.com/QoboLtd/project-template-wordpress/releases git pull git@github.com:QoboLtd/project-template-wordpress.git vX.Y.Z composer update ./bin/build app:update # Check for conflicts, resolve if any, commit, and then push git push origin project-template-update # Create a pull request, review, and merge
Usage
Now that you have the project template installed, check that it works before you start working on your changes. Fire up the PHP web server:
./bin/phpserv
Or run it on the alternative port:
./bin/phpserv -S localhost:9000
In your browser navigate to http://localhost:8000.
You should see the standard phpinfo()
page. If you do, all parts
are in place.
Now you can develop your PHP project as per usual, but with the following advantages:
- Support for PHP built-in web server
- Per-environment configuration using
.env
file, which is ignored by git - Powerful build system (Robo) integrated
- Composer integrated with
vendor/
folder added to.gitignore
. - PHPUnit integrated with
tests/
folder and example unit tests. - Sensible defaults for best practices - favicon.ico, robots.txt, MySQL dump, Nginx configuration, GPL, etc.
For example, you can easily automate the build process of your application
by modifying the included Robo files in build/
folder. Run the following
command to examine available targets:
./bin/build
As you can see, there are already some placeholders for your application's build process. By default, it is suggested that you have these:
app:install
- for installation process of your application,app:update
- for the update process of the already installed application, andapp:remove
- for the application removal process and cleanup.
You can, of course, add your own, remove these, or change them any way you want. Have a look at Robo documentation for more information on how to use these targets and pass runtime configuration parameters.
Test
PHPUnit and PHP CodeSniffer
The fastest and simplest way to run PHPUnit and PHP CodeSniffer is via a composer script:
./bin/composer test
Alternatively, you can run the test with code coverage reports:
Code coverage reports in HTML format will be placed in ./build/test-coverage/
folder.
Travis CI
Continious Integration is a tool that helps to run your tests whenever you do any changes on your code base (commit, merge, etc). There are many tools that you can use, but project-template-wordpress provides an example integration with Travis CI.
Have a look at .travis.yml
file, which describes the environment matrix, project installation
steps and ways to run the test suite. For your real project, based on project-template-wordpress, you'd probably
want to remove the example tests from the file.
Examples
project-template-wordpress provides a few examples of how to write and organize unit tests. Have a look
in the tests/
folder. Now you have NO EXCUSE for not testing your applications!
Configurations
Plugin - Compress PNG for WP (Using TinyPNG API)
This plugin requires an API key from TinyPNG. You can set your key in .env.example file using parameter TINYPNG_API_KEY. A default valid API key has already been added to the template but due to a limited number of requests allowed per key, each project should be using its own key. You can get an API key at https://tinypng.com/developers (one key per email address).