| Server IP : 94.16.115.136 / Your IP : 216.73.217.165 Web Server : Apache/2.4.52 (Ubuntu) System : Linux rogerrabbit 5.15.0-185-generic #195-Ubuntu SMP Fri Jun 19 17:11:50 UTC 2026 x86_64 User : bkillingseder ( 1001) PHP Version : 8.1.2-1ubuntu2.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /srv/web/www/sites/silentroots/html/wp-content/plugins/sassy-social-share/ |
Upload File : |
<?php
/**
* Fired when the plugin is deleted.
*
* Works in single as well as in Multisite/Network installs.
*
* @since 1.0
*/
defined( 'ABSPATH' ) or die( "Cheating........Uh!!" );
//if uninstall not called from WordPress, exit
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit();
}
// check if current user is eligible to perform uninstall
if ( ! current_user_can( 'activate_plugins' ) ) {
return;
}
$heateor_sss_options = get_option( 'heateor_sss' );
$heateor_sss_options_to_delete = array(
'heateor_sss',
'heateor_sss_feedback_submitted',
'heateor_sss_version',
'heateor_sss_custom_url_shares',
'heateor_sss_homepage_shares',
'widget_heateor_sss_sharing',
'widget_heateor_sss_floating_sharing',
'heateor_sss_fb_access_token'
);
if ( isset( $heateor_sss_options['delete_options'] ) ) {
global $wpdb;
// For Multisite
if ( function_exists( 'is_multisite' ) && is_multisite() ) {
$heateor_sss_blog_ids = heateor_sss_get_blog_ids();
$heateor_sss_original_blog_id = get_current_blog_id();
foreach ( $heateor_sss_blog_ids as $blog_id ) {
switch_to_blog( $blog_id );
foreach ( $heateor_sss_options_to_delete as $option ) {
delete_site_option( $option );
}
}
switch_to_blog( $heateor_sss_original_blog_id ); // should use "restore_current_blog"?
} else {
foreach ( $heateor_sss_options_to_delete as $option ) {
delete_option( $option );
}
}
}
/**
* Get all blog IDs of blogs in the current network that are not:
* archived, spam, deleted
*
* @since 1.0
* @return array|boolean The blog IDs, (bool) FALSE if: no matches.
*/
function heateor_sss_get_blog_ids() {
global $wpdb;
$sql = <<<SQL
SELECT blog_id
FROM {$wpdb->blogs}
WHERE archived = '0'
AND spam = '0'
AND deleted = '0'
SQL;
return $wpdb->get_col( esc_sql( $sql ) );
}