| Server IP : 146.59.209.152 / Your IP : 216.73.216.46 Web Server : Apache System : Linux webm005.cluster131.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 User : infrafs ( 43850) PHP Version : 8.2.29 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/infrafs/www/wp-content/plugins/yith-woocommerce-wishlist/ |
Upload File : |
<?php
/**
* Uninstall plugin
*
* @author YITH
* @package YITH\Wishlist
* @version 2.0.16
*/
// If uninstall not called from WordPress exit.
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit;
}
/**
* Uninstall completely wishlist from the site
*
* @return void
* @since 3.0.0
*/
function yith_wcwl_uninstall() {
global $wpdb;
if ( defined( 'YITH_WCWL_REMOVE_ALL_DATA' ) && true === YITH_WCWL_REMOVE_ALL_DATA && ! defined( 'YITH_WCWL_PREMIUM' ) ) {
// define local private attribute.
$wpdb->yith_wcwl_items = $wpdb->prefix . 'yith_wcwl';
$wpdb->yith_wcwl_wishlists = $wpdb->prefix . 'yith_wcwl_lists';
// Delete option from options table.
delete_option( 'yith_wcwl_version' );
delete_option( 'yith_wcwl_db_version' );
$wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s", 'yith_wcwl_%' ) );
// delete pages created for this plugin.
wp_delete_post( get_option( 'yith-wcwl-pageid' ), true );
// remove any additional options and custom table.
// phpcs:disable WordPress.DB.DirectDatabaseQuery, WordPress.DB.PreparedSQL.NotPrepared
$sql = "DROP TABLE IF EXISTS `{$wpdb->yith_wcwl_items}`";
$wpdb->query( $sql );
$sql = "DROP TABLE IF EXISTS `{$wpdb->yith_wcwl_wishlists}`";
$wpdb->query( $sql );
// phpcs:enable WordPress.DB.DirectDatabaseQuery, WordPress.DB.PreparedSQL.NotPrepared
}
}
if ( ! is_multisite() ) {
yith_wcwl_uninstall();
} else {
global $wpdb;
$blog_ids = $wpdb->get_col( "SELECT blog_id FROM {$wpdb->blogs}" );
$original_blog_id = get_current_blog_id();
foreach ( $blog_ids as $blog_to_process ) {
switch_to_blog( $blog_to_process );
yith_wcwl_uninstall();
}
switch_to_blog( $original_blog_id );
}