PluginProbe
Plus WebP or AVIF / 2.03
Plus WebP or AVIF v2.03
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 2.03, at uninstall.php

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