typisttech / wp-better-settings
A simplified OOP implementation of the WP Settings API
Fund package maintenance!
tangrufus
typist.tech/donation
www.paypal.me/iAmTangRufus/30usd
Installs: 33 935
Dependents: 4
Suggesters: 4
Security: 0
Stars: 14
Watchers: 4
Forks: 3
Open Issues: 5
Requires
- php: >7.0
- bupy7/php-html-form: ^1.0
- typisttech/wp-kses-view: ^0.4.0
- typisttech/wp-option-store: ^0.1.1
Requires (Dev)
- codeception/aspect-mock: ^2.1
- lucatume/wp-browser: ^2.0.5
- neronmoon/scriptsdev: ^0.1.1
- wp-coding-standards/wpcs: ^0.13.1
Suggests
- typisttech/imposter-plugin: Wrap all composer vendor packages inside your own namespace, to prevent collisions when multiple plugins use this library
- typisttech/wp-contained-hook: Lazily instantiate objects from dependency injection container to WordPress hooks (actions and filters)
- typisttech/wp-tabbed-admin-pages: Create WordPress admin pages with tabbed navigations, the OOP way
README
A simplified OOP implementation of the WP Settings API.
- Install
- Usage
- Frequently Asked Questions
- Is this a plugin?
- What to do when wp.org plugin team tell me to clean up the
vendor
folder? - Can two different plugins use this package at the same time?
- Do you have a demo plugin that use this package?
- Do you have real life examples that use this package?
- It looks awesome. Where can I find some more goodies like this?
- Support
- Developing
- Running the Tests
- Feedback
- Change log
- Security
- Contributing
- Credits
- License
Install
Installation should be done via composer, details of how to install composer can be found at https://getcomposer.org/.
$ composer require typisttech/wp-better-settings
You should put all WP Better Settings
classes under your own namespace to avoid class name conflicts.
Usage
Example
Coming soon... Use the source...
Frequently Asked Questions
Is this a plugin?
No, this is a package that should be part of your plugin.
What to do when wp.org plugin team tell me to clean up the vendor
folder?
Re-install packages via the following command. This package exports only necessary files to dist
.
$ composer install --no-dev --prefer-dist --optimize-autoloader
Can two different plugins use this package at the same time?
Yes, if put all WP Better Settings
classes under your own namespace to avoid class name conflicts.
Do you have a demo plugin that use this package?
You can install this demo plugin by
$ wp plugin install https://github.com/TypistTech/wp-better-settings/archive/nightly.zip --activate
Check out wp-better-settings.php
. We use it for acceptance tests.
Do you have real life examples that use this package?
Here you go:
Add your own plugin here
It looks awesome. Where can I find some more goodies like this?
- Articles on Typist Tech's blog
- Tang Rufus' WordPress plugins on wp.org
- More projects on Typist Tech's GitHub profile
- Stay tuned on Typist Tech's newsletter
- Follow Tang Rufus' Twitter account
- Hire Tang Rufus to build your next awesome site
Support
Love wp-better-settings
? Help me maintain it, a donation here can help with it.
Why don't you hire me?
Ready to take freelance WordPress jobs. Contact me via the contact form here or, via email info@typist.tech
Want to help in other way? Want to be a sponsor?
Contact: Tang Rufus
Developing
To setup a developer workable version you should run these commands:
$ composer create-project --keep-vcs --no-install typisttech/wp-better-settings:dev-master
$ cd wp-better-settings
$ composer install
Running the Tests
WP Better Settings run tests on Codeception and relies wp-browser to provide WordPress integration. Before testing, you have to install WordPress locally and add a codeception.yml file. See *.suite.example.yml for Local by Flywheel configuration examples.
Actually run the tests:
$ composer test
We also test all PHP files against PSR-2: Coding Style Guide and part of the WordPress coding standard.
Check the code style with $ composer check-style
.
Feedback
Please provide feedback! We want to make this package useful in as many projects as possible. Please submit an issue and point out what you do and don't like, or fork the project and make suggestions. No issue is too small.
Change log
Please see CHANGELOG for more information on what has changed recently.
Security
If you discover any security related issues, please email wp-better-settings@typist.tech instead of using the issue tracker.
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Credits
WP Better Settings is a Typist Tech project and maintained by Tang Rufus, freelance developer for hire.
Full list of contributors can be found here.
Special thanks to Alain Schlesser whose Using A Config To Write Reusable Code Series makes the first versions of this package.
License
WP Better Settings is licensed under the GPLv2 (or later) from the Free Software Foundation. Please see License File for more information.