diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8be219f..5e7617a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['8.0', '8.1', '8.2', '8.3'] + php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] wp: ['6.5', '6.6', '6.7', '6.8', '6.9'] steps: diff --git a/.phpcs.xml.dist b/.phpcs.xml.dist index ab5e57d..33a8326 100644 --- a/.phpcs.xml.dist +++ b/.phpcs.xml.dist @@ -29,4 +29,9 @@ + + + + + diff --git a/README.md b/README.md index 5950059..bde6b1f 100755 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ This plugin uses the OAuth 2 protocol to allow delegated authorization; that is, This plugin only supports WordPress >= 4.8. +Requires PHP 7.4 or higher. + ## Contributors Welcome! This plugin works and is in use in several production environments, but the user experience and documentation could be substantially improved. We welcome input and contributions to make this tool better! diff --git a/bin/readme.txt b/bin/readme.txt index 17b0d27..97db4bd 100644 --- a/bin/readme.txt +++ b/bin/readme.txt @@ -2,6 +2,7 @@ Contributors: rmccue, rachelbaker, danielbachhuber, joehoyle Tags: json, rest, api, rest-api Requires at least: 4.8 +Requires PHP: 7.4 Tested up to: 4.8 Stable tag: {{TAG}} License: GPLv2 or later diff --git a/composer.json b/composer.json index c94b27d..90087d2 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ ], "require": { "composer/installers": "^1 || ^2", - "php": ">=7.4" + "php": "^7.4 || ^8.0" }, "require-dev": { "squizlabs/php_codesniffer": "^3.13.1", diff --git a/inc/admin/namespace.php b/inc/admin/namespace.php index f72af1b..c1d0518 100644 --- a/inc/admin/namespace.php +++ b/inc/admin/namespace.php @@ -191,7 +191,7 @@ function validate_parameters( $params ) { * * @return array|null List of errors. Issues a redirect and exits on success. */ -function handle_edit_submit( Client $consumer = null ) { +function handle_edit_submit( ?Client $consumer = null ) { $messages = []; if ( empty( $consumer ) ) { $did_action = 'add'; diff --git a/inc/class-scopes.php b/inc/class-scopes.php index 36e8f75..087c1d3 100644 --- a/inc/class-scopes.php +++ b/inc/class-scopes.php @@ -9,6 +9,7 @@ class Scopes { protected $capabilities; + protected $scopes = []; public function __construct() { $this->capabilities = []; diff --git a/inc/types/class-base.php b/inc/types/class-base.php index d04031f..3c675b0 100644 --- a/inc/types/class-base.php +++ b/inc/types/class-base.php @@ -144,7 +144,7 @@ protected function validate_redirect_uri( Client $client, $redirect_uri = null ) * @param Client $client Client being authorised. * @param WP_Error $errors Errors to display, if any. */ - protected function render_form( Client $client, WP_Error $errors = null ) { + protected function render_form( Client $client, ?WP_Error $errors = null ) { $file = locate_template( 'oauth2-authorize.php' ); if ( empty( $file ) ) { $file = dirname( dirname( __DIR__ ) ) . '/theme/oauth2-authorize.php'; diff --git a/plugin.php b/plugin.php index 0d85d37..dfdc2d6 100644 --- a/plugin.php +++ b/plugin.php @@ -20,7 +20,7 @@ * Text Domain: oauth2 * Domain Path: /languages * Requires at least: 4.8 - * Requires PHP: 5.6 + * Requires PHP: 7.4 */ namespace WP\OAuth2;