PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.7
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.7
16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 All 506 releases
jetpack / jetpack_vendor / automattic / jetpack-backup / src / class-jetpack-backup-upgrades.php

class-jetpack-backup-upgrades.php in Jetpack – WP Security, Backup, Speed, & Growth 16.3-a.7, at jetpack_vendor/automattic/jetpack-backup/src/class-jetpack-backup-upgrades.php

49 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Handle Backup plugin upgrades
4 *
5 * @package automattic/jetpack-backup-plugin
6 */
7
8 // After changing this file, consider increasing the version number ("VXXX") in all the files using this namespace, in
9 // order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
10 // to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
11 // are installed, or in some other cases).
12 namespace Automattic\Jetpack\Backup\V0005;
13
14 use function get_option;
15 use function update_option;
16
17 /**
18 * The Upgrades class.
19 */
20 class Jetpack_Backup_Upgrades {
21
22 /**
23 * Run all methods only once and store an option to make sure it never runs again
24 */
25 public static function upgrade() {
26
27 $upgrades = get_class_methods( __CLASS__ );
28
29 foreach ( $upgrades as $upgrade ) {
30 $option_name = '_upgrade_' . $upgrade;
31 if ( 'upgrade' === $upgrade || get_option( $option_name ) ) {
32 continue;
33 }
34
35 update_option( $option_name, 1 );
36
37 call_user_func( array( __CLASS__, $upgrade ) );
38
39 }
40 }
41
42 /**
43 * The plugin is not checking if it was disabled and reactivating it when we reconnect, therefore we need to clear this information from DB so other plugins know we are still using the connection
44 *
45 * @deprecated since 1.7.0 No longer required after removing soft disconnect functionality.
46 */
47 public static function clear_disabled_plugin() {}
48 }
49