From 474a38984cdc7b461df799316343ac54b95d1b10 Mon Sep 17 00:00:00 2001 From: Ned Zimmerman Date: Mon, 8 Apr 2024 14:57:14 -0300 Subject: [PATCH] feat: use WordPress plugin dependency feature (#73) * feat: use WordPress plugin dependency feature * ci: attempt to fix test failures * ci: attempt to fix test failures * Update standards-and-tests.yml --------- Co-authored-by: Ricardo Aragon --- .github/workflows/standards-and-tests.yml | 4 ++-- composer.json | 2 +- composer.lock | 14 +++++++------- excalibur.php | 15 ++------------- tests/bootstrap.php | 3 +++ 5 files changed, 15 insertions(+), 23 deletions(-) diff --git a/.github/workflows/standards-and-tests.yml b/.github/workflows/standards-and-tests.yml index bba3a52..ffd792f 100644 --- a/.github/workflows/standards-and-tests.yml +++ b/.github/workflows/standards-and-tests.yml @@ -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: diff --git a/composer.json b/composer.json index c556e5a..390a50b 100644 --- a/composer.json +++ b/composer.json @@ -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": [ diff --git a/composer.lock b/composer.lock index ba76eb7..f74b2d1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ad4b14b2bc2f57bf9922354c9bc157ae", + "content-hash": "9165a879836980ab6ecc84442cabdc08", "packages": [ { "name": "composer/installers", @@ -2453,16 +2453,16 @@ }, { "name": "yoast/phpunit-polyfills", - "version": "1.0.5", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/Yoast/PHPUnit-Polyfills.git", - "reference": "3b59adeef77fb1c03ff5381dbb9d68b0aaff3171" + "reference": "224e4a1329c03d8bad520e3fc4ec980034a4b212" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/3b59adeef77fb1c03ff5381dbb9d68b0aaff3171", - "reference": "3b59adeef77fb1c03ff5381dbb9d68b0aaff3171", + "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/224e4a1329c03d8bad520e3fc4ec980034a4b212", + "reference": "224e4a1329c03d8bad520e3fc4ec980034a4b212", "shasum": "" }, "require": { @@ -2509,7 +2509,7 @@ "issues": "https://github.com/Yoast/PHPUnit-Polyfills/issues", "source": "https://github.com/Yoast/PHPUnit-Polyfills" }, - "time": "2023-03-30T23:39:05+00:00" + "time": "2023-08-19T14:25:08+00:00" } ], "aliases": [], @@ -2521,5 +2521,5 @@ "php": "^8.1" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/excalibur.php b/excalibur.php index 422caba..aa2c824 100644 --- a/excalibur.php +++ b/excalibur.php @@ -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.) @@ -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 ''; - }); - return; -} elseif ( ! pb_meets_minimum_requirements() ) { - return; -} - // ------------------------------------------------------------------------------------------------------------------- // Class autoloader // ------------------------------------------------------------------------------------------------------------------- diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 699958e..8d5e325 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -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' ); }