Plugin Directory

source: jetpack/tags/7.5.1/uninstall.php @ 2116537

Last change on this file since 2116537 was 2116537, checked in by dsmart, 5 years ago

New 7.5.1 tag

  • Property svn:eol-style set to native
File size: 906 bytes
Line 
1<?php
2
3use Automattic\Jetpack\Sync\Sender;
4
5if (
6        !defined( 'WP_UNINSTALL_PLUGIN' )
7        ||
8        !WP_UNINSTALL_PLUGIN
9        ||
10        dirname( WP_UNINSTALL_PLUGIN ) != dirname( plugin_basename( __FILE__ ) )
11) {
12        status_header( 404 );
13        exit;
14}
15
16if ( ! defined( 'JETPACK__PLUGIN_DIR' ) ) {
17        define( 'JETPACK__PLUGIN_DIR', plugin_dir_path( __FILE__ )  );
18}
19
20require JETPACK__PLUGIN_DIR . 'vendor/autoload_packages.php';
21
22Jetpack_Options::delete_all_known_options();
23
24// Delete all legacy options
25delete_option( 'jetpack_was_activated'  );
26delete_option( 'jetpack_auto_installed' );
27delete_option( 'jetpack_register'       );
28delete_transient( 'jetpack_register'    );
29
30// Delete sync options
31//
32// Do not initialize any listeners.
33// Since all the files will be deleted.
34// No need to try to sync anything.
35add_filter( 'jetpack_sync_modules', '__return_empty_array', 100 );
36
37// Jetpack Sync
38Sender::get_instance()->uninstall();
Note: See TracBrowser for help on using the repository browser.