| @@ -1,12 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -namespace PXLBSAdminify\Inc\Classes; | |
| 3 | +namespace WPAdminify\Inc\Classes; | |
| 4 | 4 | |
| 5 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 6 | - exit; // Exit if accessed directly. | |
| 7 | -} | |
| 8 | - | |
| 9 | 5 | class Upgrade |
| 10 | 6 | { |
| 11 | 7 | |
| 12 | 8 | /** |
| @@ -13,9 +9,9 @@ | ||
| 13 | 9 | * Plugin version option key |
| 14 | 10 | * |
| 15 | 11 | * @var string $option_name |
| 16 | 12 | */ |
| 17 | - protected $option_name = 'pxlbsadminify_version'; | |
| 13 | + protected $option_name = 'wp_adminify_version'; | |
| 18 | 14 | |
| 19 | 15 | /** |
| 20 | 16 | * Lists of upgrades |
| 21 | 17 | * |
| @@ -24,10 +20,9 @@ | ||
| 24 | 20 | protected $upgrades = [ |
| 25 | 21 | '3.0.2' => 'Upgrades/upgrade-3.0.2.php', |
| 26 | 22 | '3.0.9' => 'Upgrades/upgrade-3.0.9.php', |
| 27 | 23 | '3.2.4.4' => 'Upgrades/upgrade-3.2.4.4.php', |
| 28 | - '4.0.1' => 'Upgrades/upgrade-4.0.php', | |
| 29 | - '4.2.0' => 'Upgrades/upgrade-4.2.0.php' | |
| 24 | + '4.0' => 'Upgrades/upgrade-4.0.php', | |
| 30 | 25 | ]; |
| 31 | 26 | |
| 32 | 27 | /** |
| 33 | 28 | * Get plugin installed version |
| @@ -35,17 +30,9 @@ | ||
| 35 | 30 | * @return string |
| 36 | 31 | */ |
| 37 | 32 | protected function get_installed_version() |
| 38 | 33 | { |
| 39 | - $version = get_option($this->option_name, false); | |
| 40 | - | |
| 41 | - // Fall back to the legacy version option (renamed in v4.2.0) so existing | |
| 42 | - // installs report their real version and historical upgrades don't re-run. | |
| 43 | - if (false === $version) { | |
| 44 | - $version = get_option('wp_adminify_version', '1.0.0'); | |
| 45 | - } | |
| 46 | - | |
| 47 | - return $version; | |
| 34 | + return get_option($this->option_name, '1.0.0'); | |
| 48 | 35 | } |
| 49 | 36 | |
| 50 | 37 | /** |
| 51 | 38 | * Check if plugin's update is available |
| @@ -53,9 +40,9 @@ | ||
| 53 | 40 | * @return bool |
| 54 | 41 | */ |
| 55 | 42 | public function if_updates_available() |
| 56 | 43 | { |
| 57 | - if (version_compare($this->get_installed_version(), PXLBSADMINIFY_VER, '<')) { | |
| 44 | + if (version_compare($this->get_installed_version(), WP_ADMINIFY_VER, '<')) { | |
| 58 | 45 | return true; |
| 59 | 46 | } |
| 60 | 47 | |
| 61 | 48 | return false; |
| @@ -76,7 +63,7 @@ | ||
| 76 | 63 | include $path . $file; |
| 77 | 64 | } |
| 78 | 65 | } |
| 79 | 66 | |
| 80 | - // update_option( $this->option_name, PXLBSADMINIFY_VER ); | |
| 67 | + // update_option( $this->option_name, WP_ADMINIFY_VER ); | |
| 81 | 68 | } |
| 82 | 69 | } |