| @@ -9,9 +9,11 @@ | ||
| 9 | 9 | * @wordpress-plugin |
| 10 | 10 | * Plugin Name: WPIDE - File Manager & Code Editor |
| 11 | 11 | * Plugin URI: https://wpide.com |
| 12 | 12 | * Description: WordPress file manager with an advanced code editor / file editor featuring auto-completion of both WordPress and PHP functions with reference, syntax highlighting, line numbers, tabbed editing, automatic backup, image editor & much more! |
| 13 | - * Version: 3.2 | |
| 13 | + * Version: 3.5.8 | |
| 14 | + * Requires PHP: 7.4.0 | |
| 15 | + * Requires at least: 5.0 | |
| 14 | 16 | * Author: XplodedThemes |
| 15 | 17 | * Author URI: https://xplodedthemes.com |
| 16 | 18 | * Text Domain: wpide |
| 17 | 19 | * Domain Path: /languages/ |
| @@ -17,9 +19,9 @@ | ||
| 17 | 19 | * Domain Path: /languages/ |
| 18 | 20 | * License: GPL-2.0+ |
| 19 | 21 | * License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 20 | 22 | * |
| 21 | - */ | |
| 23 | + */ | |
| 22 | 24 | namespace WPIDE; |
| 23 | 25 | |
| 24 | 26 | use WPIDE\App\App; |
| 25 | 27 | use WPIDE\App\Classes\Freemius; |
| @@ -25,20 +27,44 @@ | ||
| 25 | 27 | use WPIDE\App\Classes\Freemius; |
| 26 | 28 | |
| 27 | 29 | defined( 'ABSPATH' ) || exit; |
| 28 | 30 | |
| 29 | -define('WPIDE_FILE', __FILE__); | |
| 30 | -define('WPIDE_DIR', __DIR__); | |
| 31 | +$required_php_version = '7.4.0'; | |
| 31 | 32 | |
| 32 | -require_once __DIR__ . '/vendor/autoload.php'; | |
| 33 | +if (version_compare(PHP_VERSION, $required_php_version, '<')) { | |
| 33 | 34 | |
| 34 | -if(Freemius::loaded()) { | |
| 35 | + $class = 'notice notice-error'; | |
| 35 | 36 | |
| 36 | - Freemius::sdk()->set_basename( false, __FILE__ ); | |
| 37 | + $message = sprintf( | |
| 38 | + __('%s minimum PHP version requirement is %s. The current PHP version is: %s. Either update the PHP version, or use %s %s or below.', 'wpide'), | |
| 39 | + '<strong>WPIDE</strong>', | |
| 40 | + '<strong>v' . $required_php_version . '</strong>', | |
| 41 | + '<strong>v' . PHP_VERSION . '</strong>', | |
| 42 | + '<strong>WPIDE</strong>', | |
| 43 | + '<strong>v2.6</strong>' | |
| 44 | + ); | |
| 37 | 45 | |
| 46 | + add_action('admin_notices', function () use ($message, $class) { | |
| 47 | + echo sprintf('<div class="%1$s"><p>%2$s</p></div>', esc_attr($class), $message); | |
| 48 | + | |
| 49 | + deactivate_plugins( __FILE__ ); | |
| 50 | + }); | |
| 51 | + | |
| 38 | 52 | }else { |
| 39 | 53 | |
| 40 | - Freemius::init(); | |
| 41 | - App::instance(); | |
| 42 | -} | |
| 54 | + define('WPIDE_FILE', __FILE__); | |
| 55 | + define('WPIDE_DIR', __DIR__); | |
| 43 | 56 | |
| 57 | + global $wpide_fs; | |
| 44 | 58 | |
| 59 | + if (!empty($wpide_fs)) { | |
| 60 | + | |
| 61 | + $wpide_fs->set_basename(true, __FILE__); | |
| 62 | + | |
| 63 | + } else { | |
| 64 | + | |
| 65 | + require_once __DIR__ . '/vendor/autoload.php'; | |
| 66 | + | |
| 67 | + Freemius::init(); | |
| 68 | + App::instance(); | |
| 69 | + } | |
| 70 | +} | |