diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 949a72c..f309a02 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: [ '5.6', '7.4', '8.0', '8.2', '8.4' ] + php: [ '7.4', '8.0', '8.2', '8.4' ] steps: - name: Checkout uses: actions/checkout@v4 diff --git a/README.md b/README.md index 5e9773b..37373ff 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ * Contributors: stklcode * Requires at least: 4.7 * Tested up to: 6.8 -* Requires PHP: 5.5 +* Requires PHP: 7.2 * Stable tag: 1.7.2 * License: GPLv2 or later * License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -55,7 +55,7 @@ The plugin is capable of handling multisite installations. * Goto _Settings_ -> _Statify Filter_ to configure the plugin ### Requirements ### -* PHP 5.5 or above +* PHP 7.2 or above * WordPress 4.7 or above * _Statify_ plugin installed and activated (1.5 or above) diff --git a/composer.json b/composer.json index 065a00c..9304196 100644 --- a/composer.json +++ b/composer.json @@ -18,17 +18,16 @@ ], "type": "wordpress-plugin", "require": { - "php": ">=5.5", - "composer/installers": "~v1.12|~v2.3" + "php": ">=7.2", + "composer/installers": "~v2.3" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^v1.0", - "phpunit/phpunit": "^5|^6|^7|^8|^9", - "phpunit/php-code-coverage": "*", + "dealerdirect/phpcodesniffer-composer-installer": "^v1.1", + "phpunit/phpunit": "^8|^9", "slowprog/composer-copy-file": "~0.3", - "squizlabs/php_codesniffer": "^3.12", + "squizlabs/php_codesniffer": "^3.13", "phpcompatibility/phpcompatibility-wp": "^2.1", - "wp-coding-standards/wpcs": "^3.1" + "wp-coding-standards/wpcs": "^3.2" }, "scripts": { "test-all": [ diff --git a/inc/class-statifyblacklist-admin.php b/inc/class-statifyblacklist-admin.php index 023321b..f257413 100644 --- a/inc/class-statifyblacklist-admin.php +++ b/inc/class-statifyblacklist-admin.php @@ -26,7 +26,7 @@ class StatifyBlacklist_Admin extends StatifyBlacklist { * * @since 1.5.0 */ - public static function init() { + public static function init(): void { // Add actions. add_action( 'wpmu_new_blog', array( 'StatifyBlacklist_System', 'install_site' ) ); add_action( 'delete_blog', array( 'StatifyBlacklist_System', 'uninstall_site' ) ); @@ -55,7 +55,7 @@ public static function init() { * * @since 1.0.0 */ - public static function add_menu_page() { + public static function add_menu_page(): void { $title = __( 'Statify Filter', 'statify-blacklist' ); if ( self::$multisite ) { add_options_page( @@ -86,7 +86,7 @@ public static function add_menu_page() { * * @since 1.0.0 */ - public static function plugin_meta_link( $links, $file ) { + public static function plugin_meta_link( array $links, string $file ): array { if ( STATIFYBLACKLIST_BASE === $file ) { $links[] = 'GitHub'; } @@ -104,7 +104,7 @@ public static function plugin_meta_link( $links, $file ) { * * @since 1.0.0 */ - public static function plugin_actions_links( $links, $file ) { + public static function plugin_actions_links( array $links, string $file ): array { $base = self::$multisite ? network_admin_url( 'settings.php' ) : admin_url( 'options-general.php' ); if ( STATIFYBLACKLIST_BASE === $file && current_user_can( 'manage_options' ) ) { @@ -124,7 +124,7 @@ public static function plugin_actions_links( $links, $file ) { * * @global wpdb $wpdb WordPress database. */ - public static function cleanup_database() { + public static function cleanup_database(): void { // Check user permissions. if ( ! current_user_can( 'manage_options' ) && ! ( defined( 'DOING_CRON' ) && DOING_CRON ) ) { die( esc_html__( 'Are you sure you want to do this?', 'statify-blacklist' ) ); @@ -206,7 +206,7 @@ public static function cleanup_database() { * * @since 1.1.1 */ - private static function sanitize_urls( $urls ) { + private static function sanitize_urls( array $urls ): array { return array_flip( array_filter( array_map( diff --git a/inc/class-statifyblacklist-settings.php b/inc/class-statifyblacklist-settings.php index 3944816..f97bec5 100644 --- a/inc/class-statifyblacklist-settings.php +++ b/inc/class-statifyblacklist-settings.php @@ -20,7 +20,7 @@ class StatifyBlacklist_Settings extends StatifyBlacklist { * * @return void */ - public static function register_settings() { + public static function register_settings(): void { register_setting( 'statify-blacklist', 'statify-blacklist', @@ -166,7 +166,7 @@ public static function register_settings() { * * @return void */ - public static function create_settings_page() { + public static function create_settings_page(): void { ?>

@@ -225,7 +225,7 @@ public static function create_settings_page() { * * @return void */ - public static function option_referer_active() { + public static function option_referer_active(): void { ?>
@@ -245,7 +245,7 @@ public static function option_referer_active() { * * @return void */ - public static function option_referer_cron() { + public static function option_referer_cron(): void { ?>
@@ -265,7 +265,7 @@ public static function option_referer_cron() { * * @return void */ - public static function option_referer_regexp() { + public static function option_referer_regexp(): void { ?>