PluginProbe
Plus WebP or AVIF / 5.21
Plus WebP or AVIF v5.21
5.21 5.20 5.12 5.11 trunk 1.00 1.01 1.02 1.03 1.04 1.05 1.06 1.07 1.08 1.09 1.10 1.11 1.12 1.13 2.00 2.01 2.02 2.03 2.04 2.05 All 47 releases
plus-webp / uninstall.php

uninstall.php in Plus WebP or AVIF 5.21, at uninstall.php

47 lines 973 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Uninstall
4 *
5 * @package Plus WebP or AVIF
6 */
7
8 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
9 exit();
10 }
11
12 global $wpdb;
13 /* Option name */
14 $option_names = array();
15 $wp_options = $wpdb->get_results(
16 "
17 SELECT option_name
18 FROM {$wpdb->prefix}options
19 WHERE option_name LIKE '%%pluswebp%%'
20 "
21 );
22 foreach ( $wp_options as $wp_option ) {
23 $option_names[] = $wp_option->option_name;
24 }
25
26 /* For Single site */
27 if ( ! is_multisite() ) {
28 foreach ( $option_names as $option_name ) {
29 delete_option( $option_name );
30 }
31 } else {
32 /* For Multisite */
33 $blog_ids = $wpdb->get_col( "SELECT blog_id FROM {$wpdb->prefix}blogs" );
34 $original_blog_id = get_current_blog_id();
35 foreach ( $blog_ids as $blogid ) {
36 switch_to_blog( $blogid );
37 foreach ( $option_names as $option_name ) {
38 delete_option( $option_name );
39 }
40 }
41 switch_to_blog( $original_blog_id );
42 /* For site options. */
43 foreach ( $option_names as $option_name ) {
44 delete_site_option( $option_name );
45 }
46 }
47