disable WordPress.DB.PreparedSQL.NotPrepared $sql = 'delete from `' . $wpdb->commentmeta . '` where `meta_key` IN ("antispam_bee_iphash")'; $wpdb->query( $sql ); //phpcs:enable WordPress.DB.PreparedSQL.NotPrepared } // DB version was raised in ASB 2.10.0 to 1.02. if ( $version_from_db < 1.02 ) { // Update option names. $options = self::get_options(); if ( isset( $options['country_black'] ) ) { $options['country_denied'] = $options['country_black']; unset( $options['country_black'] ); } if ( isset( $options['country_white'] ) ) { $options['country_allowed'] = $options['country_white']; unset( $options['country_white'] ); } update_option( 'antispam_bee', $options ); wp_cache_set( 'antispam_bee', $options ); } update_option( 'antispambee_db_version', self::$db_version ); } /** * Whether the database structure is up to date. * * @since 2.10.0 Return a float instead of int * * @return bool */ private static function db_version_is_current() { $current_version = floatval( get_option( 'antispambee_db_version', 0 ) ); return $current_version === self::$db_version; } /** * Runs after upgrades are completed. * * @since 2.10.0 * * @param \WP_Upgrader $wp_upgrader WP_Upgrader instance. * @param array $hook_extra Array of bulk item update data. */ public static function upgrades_completed( $wp_upgrader, $hook_extra ) { if ( ! $wp_upgrader instanceof Plugin_Upgrader || ! isset( $hook_extra['plugins'] ) ) { return; } $updated_plugins = $hook_extra['plugins']; $asb_updated = false; foreach ( $updated_plugins as $updated_plugin ) { if ( $updated_plugin !== self::$_base ) { continue; } $asb_updated = true; } if ( false === $asb_updated ) { return; } self::asb_updated(); } /** * Runs after an upgrade via an uploaded ZIP package was completed. * * @since 2.10.0 * * @param string $package The package file. * @param array $data The new plugin or theme data. * @param string $package_type The package type. */ public static function uploaded_upgrade_completed( $package, $data, $package_type ) { if ( 'plugin' !== $package_type ) { return; } $text_domain = isset( $data['TextDomain'] ) ? $data['TextDomain'] : ''; if ( 'antispam-bee' !== $text_domain ) { return; } self::asb_updated(); } /** * Runs after ASB was updated. * * @since 2.10.0 * * @return void */ private static function asb_updated() { self::update_database(); } } // Fire. add_action( 'plugins_loaded', array( 'Antispam_Bee', 'init', ) ); // Activation. register_activation_hook( __FILE__, array( 'Antispam_Bee', 'activate', ) ); // Deactivation. register_deactivation_hook( __FILE__, array( 'Antispam_Bee', 'deactivate', ) ); // Uninstall. register_uninstall_hook( __FILE__, array( 'Antispam_Bee', 'uninstall', ) ); // Upgrade notice. add_action( 'in_plugin_update_message-' . __FILE__, array( 'Antispam_Bee', 'upgrade_notice', ) ); https://rainerhank.de/wp-sitemap-posts-post-1.xmlhttps://rainerhank.de/wp-sitemap-posts-page-1.xmlhttps://rainerhank.de/wp-sitemap-taxonomies-category-1.xmlhttps://rainerhank.de/wp-sitemap-users-1.xml