Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use WordPress plugin dependency feature #73

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/standards-and-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
matrix:
php: [ 8.1, 8.2 ]
os: [ubuntu-20.04]
wordpress: [6.2, latest]
wordpress: ['6.5', latest]
include:
- experimental: true
- experimental: false
php: 8.1
wordpress: 6.2
wordpress: '6.5'
name: Tests - PHP ${{ matrix.php }} - WP ${{ matrix.wordpress }}

steps:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"require-dev": {
"phpcompatibility/php-compatibility": "^9.3",
"pressbooks/coding-standards": "^1.1",
"yoast/phpunit-polyfills": "^1.0.1"
"yoast/phpunit-polyfills": "^1.1"
},
"scripts": {
"test": [
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 2 additions & 13 deletions excalibur.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
Plugin URI: https://github.com/pressbooks/excalibur/
GitHub Plugin URI: pressbooks/excalibur
Release Asset: true
Requires at least: 6.5
Requires Plugins: pressbooks
Description: Excalibur is a SWORD protocol client for Pressbooks.
Version: 0.7.0
Author: Pressbooks (Book Oven Inc.)
Expand All @@ -14,19 +16,6 @@
Network: True
*/

// -------------------------------------------------------------------------------------------------------------------
// Check minimum requirements
// -------------------------------------------------------------------------------------------------------------------

if ( ! function_exists( 'pb_meets_minimum_requirements' ) && ! @include_once( WP_PLUGIN_DIR . '/pressbooks/compatibility.php' ) ) { // @codingStandardsIgnoreLine
add_action('admin_notices', function () {
echo '<div id="message" role="alert" class="error fade"><p>' . __( 'Cannot find Pressbooks install.', 'excalibur' ) . '</p></div>';
});
return;
} elseif ( ! pb_meets_minimum_requirements() ) {
return;
}

// -------------------------------------------------------------------------------------------------------------------
// Class autoloader
// -------------------------------------------------------------------------------------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
* Manually load the plugin being tested.
*/
function _manually_load_plugin() {
require_once( __DIR__ . '/../../pressbooks/hm-autoloader.php' );
require_once( __DIR__ . '/../../pressbooks/pressbooks.php' );
require_once( __DIR__ . '/../../pressbooks/requires.php' );
require_once( __DIR__ . '/../../pressbooks/requires-admin.php' );
require_once( __DIR__ . '/../excalibur.php' );
}

Expand Down
Loading