| @@ -2,13 +2,15 @@ | ||
| 2 | 2 | /* |
| 3 | 3 | * Plugin Name: Plugin Groups |
| 4 | 4 | * Plugin URI: https://cramer.co.za |
| 5 | 5 | * Description: Organize Plugins in groups |
| 6 | - * Version: 2.0.6 | |
| 6 | + * Version: 3.0.0 | |
| 7 | 7 | * Author: David Cramer |
| 8 | 8 | * Author URI: https://cramer.co.za |
| 9 | 9 | * Text Domain: plugin-groups |
| 10 | 10 | * License: GPL2+ |
| 11 | + * Requires PHP: 7.4 | |
| 12 | + * Requires at least: 6.7 | |
| 11 | 13 | */ |
| 12 | 14 | |
| 13 | 15 | // If this file is called directly, abort. |
| 14 | 16 | if ( ! defined( 'WPINC' ) ) { |
| @@ -19,10 +21,20 @@ | ||
| 19 | 21 | define( 'PLGGRP_PATH', plugin_dir_path( __FILE__ ) ); |
| 20 | 22 | define( 'PLGGRP_CORE', __FILE__ ); |
| 21 | 23 | define( 'PLGGRP_URL', plugin_dir_url( __FILE__ ) ); |
| 22 | 24 | define( 'PLGGRP_SLUG', basename( __DIR__ ) . '/' . basename( __FILE__ ) ); |
| 23 | - | |
| 24 | -if ( ! version_compare( PHP_VERSION, '5.6', '>=' ) ) { | |
| 25 | +define( 'PLGGRP_VERSION', '3.0.0' ); | |
| 26 | +/** | |
| 27 | + * Check if we're running dev mode. | |
| 28 | + */ | |
| 29 | +if ( file_exists( PLGGRP_PATH . '/.dev-server-running' ) ) { | |
| 30 | + $domain = filter_var( $_SERVER['HTTP_HOST'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME ); | |
| 31 | + if ( str_ends_with( $domain, '.local' ) ) { | |
| 32 | + $port = trim( file_get_contents( PLGGRP_PATH . '.dev-server-running' ) ); | |
| 33 | + define( 'PLGGRP_DEV_MODE', $port ); | |
| 34 | + } | |
| 35 | +} | |
| 36 | +if ( ! version_compare( PHP_VERSION, '7.4', '>=' ) ) { | |
| 25 | 37 | if ( is_admin() ) { |
| 26 | 38 | add_action( 'admin_notices', 'plugin_groups_php_ver' ); |
| 27 | 39 | } |
| 28 | 40 | } else { |
| @@ -31,8 +43,7 @@ | ||
| 31 | 43 | } |
| 32 | 44 | |
| 33 | 45 | function plugin_groups_php_ver() { |
| 34 | 46 | |
| 35 | - $message = __( 'Plugin Groups requires PHP version 5.6 or later. We strongly recommend PHP 5.6 or later for security and performance reasons.', 'plugin-groups' ); | |
| 47 | + $message = __( 'Plugin Groups requires PHP version 7.4 or later. We strongly recommend PHP 7.4 or later for security and performance reasons.', 'plugin-groups' ); | |
| 36 | 48 | echo sprintf( '<div id="plugin_groups_error" class="error notice notice-error"><p>%s</p></div>', esc_html( $message ) ); |
| 37 | 49 | } |
| 38 | - | |