deep-web-solutions / wp-framework-bootstrapper
A set of related functions that help bootstrap and version the other DWS WordPress Framework packages.
Installs: 3 773
Dependents: 6
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 3
Requires
- php: >=7.4
Requires (Dev)
- codeception/module-asserts: ^1.3
- codeception/module-cli: ^1.1
- codeception/module-db: ^1.1
- codeception/module-filesystem: ^1.0
- codeception/module-phpbrowser: ^1.0
- codeception/module-webdriver: ^1.4
- codeception/stub: <4.0
- codeception/util-universalframework: ^1.0
- dealerdirect/phpcodesniffer-composer-installer: *
- deep-web-solutions/wordpress-configs: master@dev
- hoa/console: ^3.17
- johnpbloch/wordpress-core: 5.5.*
- lucatume/wp-browser: 3.*
- php-stubs/wordpress-stubs: 5.5.*
- phpcompatibility/php-compatibility: *
- phpcompatibility/phpcompatibility-wp: *
- phpmd/phpmd: 2.*
- squizlabs/php_codesniffer: 3.*
- vlucas/phpdotenv: ^5.4
- wp-coding-standards/wpcs: *
This package is auto-updated.
Last update: 2024-11-19 23:20:50 UTC
README
Contributors: Antonius Hegyes, Deep Web Solutions GmbH
Requires at least: 5.5
Tested up to: 5.9
Requires PHP: 7.4
Stable tag: 1.3.0
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Description
A set of related functions that help bootstrap and version the other DWS WordPress Framework components.
The bootstrap.php file is designed to be one of the very first things that Composer will autoload when calling require vendor/autoload.php
because it is mentioned specifically as a file to autoload in composer.json. Composer autoloads files on every request, immediately after setting up
the autoloader.
Upon loading, the file will define the necessary functions and validate its own minimum requirements. Moreover, it will set the constant DWS_WP_FRAMEWORK_BOOTSTRAPPER_INIT to either true or false depending on whether the self-check was successful or not.
The end-plugin can now make use of the same functions to check for minimum WP and PHP requirements, and also use the same functions for outputting an error message.
Documentation
Documentation for this module and the rest of the DWS WP Framework can be found here.
Installation
The package is designed to be installed via Composer. It may work as a stand-alone but that is not officially supported.
The package's name is deep-web-solutions/wp-framework-bootstrapper
.
If the package will be used outside a composer-based installation, e.g. inside a regular WP plugin, you should install
using the --ignore-platform-reqs
option. If you don't do that, the package will only be able to perform checks for the
WordPress version because composer will throw an error in case of an incompatible PHP version.
Contributing
Contributions both in the form of bug-reports and pull requests are more than welcome!
Frequently Asked Questions
- What is the purpose of this package?
It is a good idea for every WordPress plugin to first check the PHP and WP versions present before running, and, if minimum requirements are not fulfilled, to stop execution and display an error message. This package provides an easy way of doing just that!
- Can this be used outside the DWS framework?
While this package was built to be used by the DWS WordPress Framework, it does come with a whitelabel functionality.
If you define the constants in bootstrap-whitelabel.php before calling require vendor/autoload.php
you can customize
quite a lot of things.
- Will you support earlier versions of WordPress and PHP?
The bootstrapper module itself will run on any PHP version back to 5.3 -- however, it will do so only to let the user know that they should update to at least PHP 7.4. As of this writing (March 2021), PHP 7.3 is close to EOL, and we consider 7.4 to provide a few features that are absolutely amazing. Moreover, WP 5.5 introduced a few new features that we really want to use as well, and we consider it to be one of the first versions of WordPress to have packed a more-or-less mature version of Gutenberg.
If you're using older versions of either one, you should really consider upgrading at least for security reasons.
- Is this bug-free?
Hopefully yes, probably not. If you found any problems, please raise an issue on Github!
Changelog
1.3.0 (January 13th, 2022)
- Updated hooks to conform to new format in the rest of the framework.
- Replaced
wp_kses
withwp_kses_post
in therequirements-error.php
template file. - Replaced usage of
DIRECTORY_SEPARATOR
with calls towp_normalize_path
. - Improved automated testing.
1.2.0 (May 27th, 2021)
- Replaced all references to
sprintf
withwp_sprintf
.
1.1.6 (April 23rd, 2021)
- Changed the default support URL.
- Migrated from Travis CI to Github Actions.
1.1.5 (April 9th, 2021)
- Development tools updates.
1.1.4 (March 19th, 2021)
- Created an export of all used WP functions and classes.
- Tweaked development tools configurations.
1.1.3 (March 16th, 2021)
- Tweaked the
dws_wp_framework_get_bootstrapper_init_status
function.
1.1.2 (March 16th, 2021)
- Added
declare( strict_types = 1 )
to test files. - Fixed minor tweaks and typos in tests.
1.1.1 (March 15th, 2021)
- Prefixed all functions from the global namespace to clear ambiguity.
- Fixed some typos in the documentation.
1.1.0 (March 14th, 2021)
- Moved module-specific functions to their own non-autoloaded file.
- Added automated testing via Codeception
- Improved Travis-CI pipeline
1.0.0 (February 28th, 2021)
- First official release.