| @@ -2,16 +2,16 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * Plugin Name: Content Control |
| 4 | 4 | * Plugin URI: https://contentcontrolplugin.com/?utm_campaign=plugin-info&utm_source=php-file-header&utm_medium=plugin-ui&utm_content=plugin-uri |
| 5 | 5 | * Description: Restrict content to logged in/out users or specific user roles. Restrict access to certain parts of a page/post. Control the visibility of widgets. |
| 6 | - * Version: 2.0.2 | |
| 6 | + * Version: 2.6.1 | |
| 7 | 7 | * Author: Code Atlantic |
| 8 | 8 | * Author URI: https://code-atlantic.com/?utm_campaign=plugin-info&utm_source=php-file-header&utm_medium=plugin-ui&utm_content=author-uri |
| 9 | 9 | * Donate link: https://code-atlantic.com/donate/?utm_campaign=donations&utm_source=php-file-header&utm_medium=plugin-ui&utm_content=donate-link |
| 10 | 10 | * Text Domain: content-control |
| 11 | 11 | * |
| 12 | - * Minimum PHP: 5.6 | |
| 13 | - * Minimum WP: 5.6 | |
| 12 | + * Minimum PHP: 7.4 | |
| 13 | + * Minimum WP: 6.2 | |
| 14 | 14 | * |
| 15 | 15 | * @package Content Control |
| 16 | 16 | * @author Code Atlantic |
| 17 | 17 | * @copyright Copyright (c) 2023, Code Atlantic LLC. |
| @@ -22,26 +22,27 @@ | ||
| 22 | 22 | defined( 'ABSPATH' ) || exit; |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * Define plugin's global configuration. |
| 26 | + * | |
| 27 | + * @return array<string,string|bool> | |
| 26 | 28 | */ |
| 27 | 29 | function get_plugin_config() { |
| 28 | 30 | return [ |
| 29 | - 'name' => \__( 'Content Control', 'content-control' ), | |
| 31 | + 'name' => 'Content Control', | |
| 30 | 32 | 'slug' => 'content-control', |
| 31 | - 'version' => '2.0.2', | |
| 33 | + 'version' => '2.6.1', | |
| 32 | 34 | 'option_prefix' => 'content_control', |
| 33 | 35 | // Maybe remove this and simply prefix `name` with `'Popup Maker'`. |
| 34 | 36 | 'text_domain' => 'content-control', |
| 35 | - 'fullname' => \__( 'Content Control', 'content-control' ), | |
| 36 | - 'min_php_ver' => '5.6.0', | |
| 37 | - 'min_wp_ver' => '5.6.0', | |
| 37 | + 'fullname' => 'Content Control', | |
| 38 | + 'min_php_ver' => '7.4.0', | |
| 39 | + 'min_wp_ver' => '6.2.0', | |
| 38 | 40 | 'file' => __FILE__, |
| 39 | 41 | 'basename' => \plugin_basename( __FILE__ ), |
| 40 | 42 | 'url' => \plugin_dir_url( __FILE__ ), |
| 41 | - 'path' => \realpath( \plugin_dir_path( __FILE__ ) ) . \DIRECTORY_SEPARATOR, | |
| 43 | + 'path' => __DIR__ . \DIRECTORY_SEPARATOR, | |
| 42 | 44 | 'api_url' => 'https://contentcontrolplugin.com/', |
| 43 | - 'is_pro' => class_exists( 'ContentControlPro\Plugin\Core' ), | |
| 44 | 45 | ]; |
| 45 | 46 | } |
| 46 | 47 | |
| 47 | 48 | /** |
| @@ -71,8 +72,10 @@ | ||
| 71 | 72 | } |
| 72 | 73 | |
| 73 | 74 | /** |
| 74 | 75 | * Check plugin prerequisites. |
| 76 | + * | |
| 77 | + * @return bool | |
| 75 | 78 | */ |
| 76 | 79 | function check_prerequisites() { |
| 77 | 80 | |
| 78 | 81 | // 1.a Check Prerequisites. |
| @@ -100,13 +103,18 @@ | ||
| 100 | 103 | |
| 101 | 104 | return true; |
| 102 | 105 | } |
| 103 | 106 | |
| 104 | -add_action( 'plugins_loaded', function () { | |
| 105 | - if ( check_prerequisites() ) { | |
| 106 | - plugin_instance(); | |
| 107 | - } | |
| 108 | -}, 11 ); | |
| 107 | +add_action( | |
| 108 | + 'plugins_loaded', | |
| 109 | + function () { | |
| 110 | + if ( check_prerequisites() ) { | |
| 111 | + plugin_instance(); | |
| 112 | + } | |
| 113 | + }, | |
| 114 | + // Core plugin loads at 11, Pro loads at 12 & addons load at 13. | |
| 115 | + 11 | |
| 116 | +); | |
| 109 | 117 | |
| 110 | 118 | /** |
| 111 | 119 | * Initiates and/or retrieves an encapsulated container for the plugin. |
| 112 | 120 | * |
| @@ -118,8 +126,9 @@ | ||
| 118 | 126 | static $plugin; |
| 119 | 127 | |
| 120 | 128 | if ( ! $plugin instanceof \ContentControl\Plugin\Core ) { |
| 121 | 129 | require_once __DIR__ . '/inc/functions.php'; |
| 130 | + require_once __DIR__ . '/inc/deprecated.php'; | |
| 122 | 131 | $plugin = new Plugin\Core( get_plugin_config() ); |
| 123 | 132 | } |
| 124 | 133 | |
| 125 | 134 | return $plugin; |