Skip to content

Commit b4f5e38

Browse files
Fix: Removes initializing entire plugin class structure on delete (#293)
* Fix: Removes initializing entire plugin class structure to remove a few options. * removes un needed includes and object
1 parent e954e54 commit b4f5e38

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

uninstall.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,23 @@
1111
die;
1212
}
1313

14-
require_once dirname( __FILE__ ) . '/load-files.php';
14+
delete_option( 'wpephpcompat.lock' );
15+
delete_option( 'wpephpcompat.status' );
16+
delete_option( 'wpephpcompat.numdirs' );
17+
18+
// Clear scheduled cron.
19+
wp_clear_scheduled_hook( 'wpephpcompat_start_test_cron' );
20+
21+
// Make sure all directories are removed from the queue.
22+
$args = array(
23+
'posts_per_page' => -1,
24+
'post_type' => 'wpephpcompat_jobs',
25+
);
26+
27+
$directories = get_posts( $args );
28+
29+
foreach ( $directories as $directory ) {
30+
wp_delete_post( $directory->ID );
31+
}
1532

16-
$wpephpc = new WPEPHPCompat( dirname( __FILE__ ) );
17-
$wpephpc->clean_after_scan();
1833
delete_option( 'wpephpcompat.scan_results' );

0 commit comments

Comments
 (0)