uninstall.php 909 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. if (
  3. !defined( 'WP_UNINSTALL_PLUGIN' )
  4. ||
  5. !WP_UNINSTALL_PLUGIN
  6. ||
  7. dirname( WP_UNINSTALL_PLUGIN ) != dirname( plugin_basename( __FILE__ ) )
  8. ) {
  9. status_header( 404 );
  10. exit;
  11. }
  12. define( 'JETPACK__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
  13. require_once JETPACK__PLUGIN_DIR . 'class.jetpack-options.php';
  14. Jetpack_Options::delete_all_known_options();
  15. // Delete all legacy options
  16. delete_option( 'jetpack_was_activated' );
  17. delete_option( 'jetpack_auto_installed' );
  18. delete_option( 'jetpack_register' );
  19. delete_transient( 'jetpack_register' );
  20. // Delete sync options
  21. //
  22. // Do not initialize any listeners.
  23. // Since all the files will be deleted.
  24. // No need to try to sync anything.
  25. add_filter( 'jetpack_sync_modules', '__return_empty_array', 100 );
  26. // Jetpack Sync
  27. require_once JETPACK__PLUGIN_DIR . 'sync/class.jetpack-sync-sender.php';
  28. Jetpack_Sync_Sender::get_instance()->uninstall();