jetpack
Last commit date
3rd-party
1 week ago
_inc
2 days ago
css
2 weeks ago
extensions
2 days ago
images
1 month ago
jetpack_vendor
2 days ago
json-endpoints
1 week ago
modules
2 days ago
sal
1 week ago
src
2 days ago
vendor
2 days ago
views
1 month ago
CHANGELOG.md
2 days ago
LICENSE.txt
5 months ago
SECURITY.md
2 days ago
class-jetpack-connection-status.php
2 years ago
class-jetpack-gallery-settings.php
6 months ago
class-jetpack-newsletter-dashboard-widget.php
6 months ago
class-jetpack-pre-connection-jitms.php
2 years ago
class-jetpack-stats-dashboard-widget.php
3 months ago
class-jetpack-xmlrpc-methods.php
1 week ago
class.frame-nonce-preview.php
6 months ago
class.jetpack-admin.php
2 days ago
class.jetpack-autoupdate.php
6 months ago
class.jetpack-cli.php
2 days ago
class.jetpack-client-server.php
2 years ago
class.jetpack-gutenberg.php
1 week ago
class.jetpack-heartbeat.php
3 months ago
class.jetpack-modules-list-table.php
6 months ago
class.jetpack-network-sites-list-table.php
6 months ago
class.jetpack-network.php
1 month ago
class.jetpack-plan.php
2 years ago
class.jetpack-post-images.php
2 months ago
class.jetpack-twitter-cards.php
3 months ago
class.jetpack-user-agent.php
2 years ago
class.jetpack.php
2 days ago
class.json-api-endpoints.php
1 week ago
class.json-api.php
2 weeks ago
class.photon.php
3 years ago
composer.json
2 days ago
enhanced-open-graph.php
1 week ago
functions.compat.php
3 months ago
functions.cookies.php
2 years ago
functions.global.php
2 days ago
functions.is-mobile.php
2 years ago
functions.opengraph.php
2 months ago
functions.photon.php
2 years ago
jetpack.php
2 days ago
json-api-config.php
3 years ago
json-endpoints.php
2 years ago
load-jetpack.php
1 week ago
locales.php
6 months ago
readme.txt
2 days ago
unauth-file-upload.php
6 months ago
uninstall.php
6 months ago
wpml-config.xml
3 years ago
uninstall.php
63 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Functionality that is executed when Jetpack is uninstalled via built-in WordPress commands. |
| 4 | * |
| 5 | * @package automattic/jetpack |
| 6 | */ |
| 7 | |
| 8 | use Automattic\Jetpack\Backup\V0005\Helper_Script_Manager; |
| 9 | use Automattic\Jetpack\Connection\Manager as Connection_Manager; |
| 10 | use Automattic\Jetpack\Sync\Sender; |
| 11 | |
| 12 | if ( ! defined( 'ABSPATH' ) ) { |
| 13 | exit( 0 ); |
| 14 | } |
| 15 | |
| 16 | /** |
| 17 | * Uninstall script for Jetpack. |
| 18 | */ |
| 19 | function jetpack_uninstall() { |
| 20 | if ( |
| 21 | ! defined( 'WP_UNINSTALL_PLUGIN' ) || |
| 22 | ! WP_UNINSTALL_PLUGIN || |
| 23 | dirname( WP_UNINSTALL_PLUGIN ) !== dirname( plugin_basename( __FILE__ ) ) |
| 24 | ) { |
| 25 | status_header( 404 ); |
| 26 | exit( 0 ); |
| 27 | } |
| 28 | |
| 29 | if ( ! defined( 'JETPACK__PLUGIN_DIR' ) ) { |
| 30 | define( 'JETPACK__PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); |
| 31 | } |
| 32 | |
| 33 | require JETPACK__PLUGIN_DIR . 'vendor/autoload_packages.php'; |
| 34 | |
| 35 | if ( method_exists( Connection_Manager::class, 'is_ready_for_cleanup' ) && ! Connection_Manager::is_ready_for_cleanup( dirname( plugin_basename( __FILE__ ) ) ) ) { |
| 36 | // There are other active Jetpack plugins, no need for cleanup. |
| 37 | return; |
| 38 | } |
| 39 | |
| 40 | Jetpack_Options::delete_all_known_options(); |
| 41 | |
| 42 | // Delete all legacy options. |
| 43 | delete_option( 'jetpack_was_activated' ); |
| 44 | delete_option( 'jetpack_auto_installed' ); |
| 45 | delete_option( 'jetpack_register' ); |
| 46 | delete_transient( 'jetpack_register' ); |
| 47 | |
| 48 | // Delete sync options |
| 49 | // |
| 50 | // Do not initialize any listeners. |
| 51 | // Since all the files will be deleted. |
| 52 | // No need to try to sync anything. |
| 53 | add_filter( 'jetpack_sync_modules', '__return_empty_array', 100 ); |
| 54 | |
| 55 | // Jetpack Sync. |
| 56 | Sender::get_instance()->uninstall(); |
| 57 | |
| 58 | // Jetpack Backup: Cleanup any leftover Helper Scripts. |
| 59 | Helper_Script_Manager::delete_all_helper_scripts(); |
| 60 | } |
| 61 | |
| 62 | jetpack_uninstall(); |
| 63 |