| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | -* | |
| 3 | +* | |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | 6 | // Disallow direct access. |
| 7 | 7 | defined('ABSPATH') or die("Access denied"); |
| @@ -6,22 +6,22 @@ | ||
| 6 | 6 | // Disallow direct access. |
| 7 | 7 | defined('ABSPATH') or die("Access denied"); |
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | -* | |
| 10 | +* | |
| 11 | 11 | */ |
| 12 | 12 | class CJTInstallerAccessPoint extends CJTAccessPoint { |
| 13 | - | |
| 13 | + | |
| 14 | 14 | /** |
| 15 | 15 | * put your comment there... |
| 16 | - * | |
| 16 | + * | |
| 17 | 17 | * @var mixed |
| 18 | 18 | */ |
| 19 | 19 | protected $stopNotices = false; |
| 20 | - | |
| 20 | + | |
| 21 | 21 | /** |
| 22 | 22 | * put your comment there... |
| 23 | - * | |
| 23 | + * | |
| 24 | 24 | */ |
| 25 | 25 | public function __construct() { |
| 26 | 26 | // Initialize parent. |
| 27 | 27 | parent::__construct(); |
| @@ -29,9 +29,9 @@ | ||
| 29 | 29 | $this->name = 'installer'; |
| 30 | 30 | } |
| 31 | 31 | /** |
| 32 | 32 | * put your comment there... |
| 33 | - * | |
| 33 | + * | |
| 34 | 34 | */ |
| 35 | 35 | protected function doListen() { |
| 36 | 36 | // If not installed and not in manage page display admin notice! |
| 37 | 37 | if (!CJTPlugin::getInstance()->isInstalled() && $this->hasAccess()) { |
| @@ -36,39 +36,13 @@ | ||
| 36 | 36 | // If not installed and not in manage page display admin notice! |
| 37 | 37 | if (!CJTPlugin::getInstance()->isInstalled() && $this->hasAccess()) { |
| 38 | 38 | add_action('admin_notices', array(&$this, 'notInstalledAdminNotice')); |
| 39 | 39 | } |
| 40 | - | |
| 41 | - //if ( class_exists( 'CJTPlus' ) && $this->isOldCJTPlus()) add_action( 'admin_notices', [ $this, '_oldCJTPlusDetected' ] ); | |
| 42 | 40 | } |
| 43 | - | |
| 44 | - protected function isOldCJTPlus() | |
| 45 | - { | |
| 46 | - if ( ! function_exists( 'get_plugin_data' ) ) require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); | |
| 47 | - | |
| 48 | - $reflector = new \ReflectionClass( 'CJTPlus' ); | |
| 49 | - $CJTPlusVersion = get_plugin_data( str_replace( 'plus.class', 'plus', $reflector->getFileName() ) )['Version']; | |
| 50 | - | |
| 51 | - if ( version_compare( $CJTPlusVersion, '8.4', '<=' ) ) return true; | |
| 52 | - return false; | |
| 53 | - } | |
| 54 | - | |
| 55 | - public function _oldCJTPlusDetected() | |
| 56 | - { | |
| 57 | - $class = 'notice notice-error'; | |
| 58 | - $message = __( 'You are currently using CJT PLUS version 8.4 or under. Unfortunately, this version is not optimized for the new Gutenberg Editor. | |
| 59 | - <br> | |
| 60 | - <br> | |
| 61 | - Please make sure you have added your license key and update CJT PLUS with the latest version. If your license has expired, please click to: <a target="_blank" href="https://css-javascript-toolbox.com/pricing">purchase a new subscription</a>. | |
| 62 | - <br> | |
| 63 | - If you wish to continue using your current version, it may be best to roll back to: <a target="_blank" href="https://downloads.wordpress.org/plugin/css-javascript-toolbox.8.4.2.zip">CJT Free - version 8.4.2</a>' ); | |
| 64 | - | |
| 65 | - printf( '<div class="%1$s"><p>%2$s</p></div>', esc_html( $class ), $message ); | |
| 66 | - } | |
| 67 | - | |
| 41 | + | |
| 68 | 42 | /** |
| 69 | 43 | * put your comment there... |
| 70 | - * | |
| 44 | + * | |
| 71 | 45 | */ |
| 72 | 46 | public function installationPage() { |
| 73 | 47 | if ($this->hasAccess()) { |
| 74 | 48 | // Set as connected object! |
| @@ -78,15 +52,15 @@ | ||
| 78 | 52 | // Set Action |
| 79 | 53 | ->setAction('install'); |
| 80 | 54 | } |
| 81 | 55 | } |
| 82 | - | |
| 56 | + | |
| 83 | 57 | /** |
| 84 | 58 | * put your comment there... |
| 85 | - * | |
| 59 | + * | |
| 86 | 60 | */ |
| 87 | 61 | public function notInstalledAdminNotice() { |
| 88 | - // Show Not installed admin notice only | |
| 62 | + // Show Not installed admin notice only | |
| 89 | 63 | // if there is no access point processed/connected the request |
| 90 | 64 | if (!$this->stopNotices) { |
| 91 | 65 | // Set MVC request parameters. |
| 92 | 66 | $this->route(null , array('view' => 'installer/notice')) |
| @@ -95,18 +69,18 @@ | ||
| 95 | 69 | // Fire action! |
| 96 | 70 | ->_doAction(); |
| 97 | 71 | } |
| 98 | 72 | } |
| 99 | - | |
| 73 | + | |
| 100 | 74 | /** |
| 101 | 75 | * put your comment there... |
| 102 | - * | |
| 76 | + * | |
| 103 | 77 | */ |
| 104 | 78 | public function stopNotices() { |
| 105 | 79 | // Do not show admin notcies! |
| 106 | - $this->stopNotices = true; | |
| 80 | + $this->stopNotices = true; | |
| 107 | 81 | } |
| 108 | - | |
| 82 | + | |
| 109 | 83 | } // End class. |
| 110 | 84 | |
| 111 | 85 | // Hookable! |
| 112 | -CJTInstallerAccessPoint::define('CJTInstallerAccessPoint', array('hookType' => CJTWordpressEvents::HOOK_FILTER)); | |
| 86 | +CJTInstallerAccessPoint::define('CJTInstallerAccessPoint', array('hookType' => CJTWordpressEvents::HOOK_FILTER)); | |