baxtian / wp_requirements
Library to set a list of plugins required to be installed.
0.3.15
2026-10-18 13:09 UTC
Requires
- php: >=7.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Object to define the Requirements for a theme or plugin.
Usage:
<?php
use Baxtian\WP_Requirements as WP_Requirements;
// Do we miss a requirement
if (WP_Requirements::requirements(
'Theme or Plugin Name',
[
[
'name' => 'Timber',
'slug' => 'timber-library/timber.php',
'zip'=> 'https://downloads.wordpress.org/plugin/timber-library.latest-stable.zip',
'check' => ['self::has_timber', ''], // To detect if your theme has timber.
],
[
'name' => 'SCSS-Library',
'slug' => 'scss-library/scss-library.php',
'zip'=> 'https://downloads.wordpress.org/plugin/scss-library.latest-stable.zip',
'check' => ['class_exists', 'ScssLibrary\ScssLibrary'], // You can use here also 'function_exists'.
],
[
'name' => 'Font Awesome',
'slug' => 'font-awesome/font-awesome.php',
'zip'=> 'https://downloads.wordpress.org/plugin/font-awesome.latest-stable.zip',
'check' => ['class_exists', 'FortAwesome\FontAwesome_Loader'],
],
]
)) {
// Code to be displayed if there are missing requirements
...
// Finish your theme execution? It's up to you.
return;
}
Mantainers
Juan Sebastián Echeverry baxtian.echeverry@gmail.com
Changelog
See CHANGELOG.md.