PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 8.9.4
Jetpack – WP Security, Backup, Speed, & Growth v8.9.4
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 13.9.2 14.0.1 14.1.1 14.2.2 14.3.1 14.4.2 All 500 releases
jetpack / uninstall.php
uninstall.php
48 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Functionality that is executed when Jetpack is uninstalled via built-in WordPress commands.
4 *
5 * @package Jetpack
6 */
7
8 use Automattic\Jetpack\Sync\Sender;
9 use Automattic\Jetpack\Backup\Helper_Script_Manager;
10
11 if (
12 !defined( 'WP_UNINSTALL_PLUGIN' )
13 ||
14 !WP_UNINSTALL_PLUGIN
15 ||
16 dirname( WP_UNINSTALL_PLUGIN ) != dirname( plugin_basename( __FILE__ ) )
17 ) {
18 status_header( 404 );
19 exit;
20 }
21
22 if ( ! defined( 'JETPACK__PLUGIN_DIR' ) ) {
23 define( 'JETPACK__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
24 }
25
26 require JETPACK__PLUGIN_DIR . 'vendor/autoload_packages.php';
27
28 Jetpack_Options::delete_all_known_options();
29
30 // Delete all legacy options
31 delete_option( 'jetpack_was_activated' );
32 delete_option( 'jetpack_auto_installed' );
33 delete_option( 'jetpack_register' );
34 delete_transient( 'jetpack_register' );
35
36 // Delete sync options
37 //
38 // Do not initialize any listeners.
39 // Since all the files will be deleted.
40 // No need to try to sync anything.
41 add_filter( 'jetpack_sync_modules', '__return_empty_array', 100 );
42
43 // Jetpack Sync
44 Sender::get_instance()->uninstall();
45
46 // Jetpack Backup: Cleanup any leftover Helper Scripts
47 Helper_Script_Manager::delete_all_helper_scripts();
48