PluginProbe
Elementor Website Builder – more than just a page builder / 3.22.0-beta1
Elementor Website Builder – more than just a page builder v3.22.0-beta1
4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 All 457 releases
← All changes | core/upgrade/manager.php +5 -39 4.3.4 → 3.22.0-beta1 View file →
@@ -3,9 +3,9 @@
3 3
4 4 use Elementor\Core\Base\DB_Upgrades_Manager;
5 5
6 6 if ( ! defined( 'ABSPATH' ) ) {
7 - exit; // Exit if accessed directly.
7 + exit; // Exit if accessed directly
8 8 }
9 9
10 10 class Manager extends DB_Upgrades_Manager {
11 11
@@ -13,19 +13,13 @@
13 13 * @deprecated 3.17.0
14 14 */
15 15 const INSTALLS_HISTORY_META = 'elementor_install_history';
16 16
17 - const VERSION_OPTION_NAME = 'elementor_version';
18 -
19 17 public static function get_install_history_meta() {
20 18 return 'elementor_install_history';
21 19 }
22 20
23 - /**
24 - * TODO: Remove in future releases
25 - *
26 - * @deprecated 3.1.0
27 - */
21 + // todo: remove in future releases
28 22 public function should_upgrade() {
29 23 if ( ( 'elementor' === $this->get_plugin_name() ) && version_compare( get_option( $this->get_version_option_name() ), '2.4.2', '<' ) ) {
30 24 delete_option( 'elementor_log' );
31 25 }
@@ -57,9 +51,9 @@
57 51 return ELEMENTOR_VERSION;
58 52 }
59 53
60 54 public function get_version_option_name() {
61 - return self::VERSION_OPTION_NAME;
55 + return 'elementor_version';
62 56 }
63 57
64 58 public function get_upgrades_class() {
65 59 return 'Elementor\Core\Upgrade\Upgrades';
@@ -85,46 +79,18 @@
85 79 $installs_history = self::get_installs_history();
86 80
87 81 $time = time();
88 82
89 - $installs_history[ $this->get_new_version() ] = $time;
83 + $installs_history[ ELEMENTOR_VERSION ] = $time;
90 84
91 85 $old_version = $this->get_current_version();
92 86
93 87 // If there was an old version of Elementor, and there's no record for that install yet
94 88 if ( $old_version && empty( $installs_history[ $old_version ] ) ) {
95 - $installs_history[ $old_version ] = $installs_history[ $this->get_new_version() ] - 1;
89 + $installs_history[ $old_version ] = $installs_history[ ELEMENTOR_VERSION ] - 1;
96 90 }
97 91
98 92 uksort( $installs_history, 'version_compare' );
99 93
100 94 update_option( static::get_install_history_meta(), $installs_history );
101 - }
102 -
103 - public static function is_new_installation(): bool {
104 - $installs_history = self::get_installs_history();
105 -
106 - return empty( $installs_history ) || static::install_compare( ELEMENTOR_VERSION, '>=' );
107 - }
108 -
109 - public static function had_install_prior_to( string $version ): bool {
110 - if ( ! $version ) {
111 - return false;
112 - }
113 -
114 - $installs_history = self::get_installs_history();
115 -
116 - if ( empty( $installs_history ) ) {
117 - return false;
118 - }
119 -
120 - uksort( $installs_history, 'version_compare' );
121 -
122 - $first_version = array_key_first( $installs_history );
123 -
124 - if ( ! $first_version ) {
125 - return false;
126 - }
127 -
128 - return version_compare( $first_version, $version, '<' );
129 95 }
130 96 }