diff --git a/wp-content/plugins/akismet/akismet.php b/wp-content/plugins/akismet/akismet.php index 2175a91372..6158872aff 100644 --- a/wp-content/plugins/akismet/akismet.php +++ b/wp-content/plugins/akismet/akismet.php @@ -6,7 +6,7 @@ Plugin Name: Akismet Anti-Spam Plugin URI: https://akismet.com/ Description: Used by millions, Akismet is quite possibly the best way in the world to protect your blog from spam. It keeps your site protected even while you sleep. To get started: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key. -Version: 4.2.1 +Version: 4.2.2 Author: Automattic Author URI: https://automattic.com/wordpress-plugins/ License: GPLv2 or later @@ -37,10 +37,10 @@ exit; } -define( 'AKISMET_VERSION', '4.2.1' ); +define( 'AKISMET_VERSION', '4.2.2' ); define( 'AKISMET__MINIMUM_WP_VERSION', '5.0' ); define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); -define( 'AKISMET_DELETE_LIMIT', 100000 ); +define( 'AKISMET_DELETE_LIMIT', 10000 ); register_activation_hook( __FILE__, array( 'Akismet', 'plugin_activation' ) ); register_deactivation_hook( __FILE__, array( 'Akismet', 'plugin_deactivation' ) ); diff --git a/wp-content/plugins/akismet/class.akismet.php b/wp-content/plugins/akismet/class.akismet.php index 1681d0e1bc..8e6ab21386 100644 --- a/wp-content/plugins/akismet/class.akismet.php +++ b/wp-content/plugins/akismet/class.akismet.php @@ -64,6 +64,10 @@ private static function init_hooks() { add_filter( 'wpcf7_form_elements', array( 'Akismet', 'append_custom_form_fields' ) ); add_filter( 'wpcf7_akismet_parameters', array( 'Akismet', 'prepare_custom_form_values' ) ); + // Formidable Forms + add_filter( 'frm_filter_final_form', array( 'Akismet', 'inject_custom_form_fields' ) ); + add_filter( 'frm_akismet_values', array( 'Akismet', 'prepare_custom_form_values' ) ); + add_action( 'update_option_wordpress_api_key', array( 'Akismet', 'updated_option' ), 10, 2 ); add_action( 'add_option_wordpress_api_key', array( 'Akismet', 'added_option' ), 10, 2 ); @@ -410,8 +414,12 @@ public static function delete_old_comments() { $wpdb->queries = array(); + $comments = array(); + foreach ( $comment_ids as $comment_id ) { - do_action( 'delete_comment', $comment_id ); + $comments[ $comment_id ] = get_comment( $comment_id ); + + do_action( 'delete_comment', $comment_id, $comments[ $comment_id ] ); do_action( 'akismet_batch_delete_count', __FUNCTION__ ); } @@ -421,12 +429,13 @@ public static function delete_old_comments() { $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->comments} WHERE comment_id IN ( " . $format_string . " )", $comment_ids ) ); $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->commentmeta} WHERE comment_id IN ( " . $format_string . " )", $comment_ids ) ); - clean_comment_cache( $comment_ids ); - do_action( 'akismet_delete_comment_batch', count( $comment_ids ) ); - foreach ( $comment_ids as $comment_id ) { - do_action( 'deleted_comment', $comment_id ); + do_action( 'deleted_comment', $comment_id, $comments[ $comment_id ] ); + unset( $comments[ $comment_id ] ); } + + clean_comment_cache( $comment_ids ); + do_action( 'akismet_delete_comment_batch', count( $comment_ids ) ); } if ( apply_filters( 'akismet_optimize_table', ( mt_rand(1, 5000) == 11), $wpdb->comments ) ) // lucky number @@ -504,11 +513,38 @@ public static function delete_orphaned_commentmeta() { public static function get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url ) { global $wpdb; - if ( !empty( $user_id ) ) - return (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->comments} WHERE user_id = %d AND comment_approved = 1", $user_id ) ); + /** + * Which comment types should be ignored when counting a user's approved comments? + * + * Some plugins add entries to the comments table that are not actual + * comments that could have been checked by Akismet. Allow these comments + * to be excluded from the "approved comment count" query in order to + * avoid artificially inflating the approved comment count. + * + * @param array $comment_types An array of comment types that won't be considered + * when counting a user's approved comments. + * + * @since 4.2.2 + */ + $excluded_comment_types = apply_filters( 'akismet_excluded_comment_types', array() ); + + $comment_type_where = ''; + + if ( is_array( $excluded_comment_types ) && ! empty( $excluded_comment_types ) ) { + $excluded_comment_types = array_unique( $excluded_comment_types ); + + foreach ( $excluded_comment_types as $excluded_comment_type ) { + $comment_type_where .= $wpdb->prepare( ' AND comment_type <> %s ', $excluded_comment_type ); + } + } + + if ( ! empty( $user_id ) ) { + return (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->comments} WHERE user_id = %d AND comment_approved = 1" . $comment_type_where, $user_id ) ); + } - if ( !empty( $comment_author_email ) ) - return (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->comments} WHERE comment_author_email = %s AND comment_author = %s AND comment_author_url = %s AND comment_approved = 1", $comment_author_email, $comment_author, $comment_author_url ) ); + if ( ! empty( $comment_author_email ) ) { + return (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->comments} WHERE comment_author_email = %s AND comment_author = %s AND comment_author_url = %s AND comment_approved = 1" . $comment_type_where, $comment_author_email, $comment_author, $comment_author_url ) ); + } return 0; } @@ -1327,8 +1363,14 @@ public static function get_akismet_form_fields() { $fields .= ''; if ( ! function_exists( 'amp_is_request' ) || ! amp_is_request() ) { - $fields .= ''; - $fields .= ''; + // Keep track of how many ak_js fields are in this page so that we don't re-use + // the same ID. + static $field_count = 0; + + $field_count++; + + $fields .= ''; + $fields .= ''; } $fields .= '

'; diff --git a/wp-content/plugins/akismet/readme.txt b/wp-content/plugins/akismet/readme.txt index 0058c338c2..89cc764a72 100644 --- a/wp-content/plugins/akismet/readme.txt +++ b/wp-content/plugins/akismet/readme.txt @@ -2,8 +2,8 @@ Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eoigal, cfinke, automattic, jgs, procifer, stephdau Tags: comments, spam, antispam, anti-spam, contact form, anti spam, comment moderation, comment spam, contact form spam, spam comments Requires at least: 5.0 -Tested up to: 5.8 -Stable tag: 4.2.1 +Tested up to: 5.9 +Stable tag: 4.2.2 License: GPLv2 or later The best anti-spam protection to block spam comments and spam in a contact form. The most trusted antispam solution for WordPress and WooCommerce. @@ -30,6 +30,14 @@ Upload the Akismet plugin to your blog, activate it, and then enter your Akismet == Changelog == += 4.2.2 = +*Release Date - 24 January 2022* + +* Improved compatibility with Formidable Forms +* Fixed a bug that could cause issues when multiple contact forms appear on one page. +* Updated delete_comment and deleted_comment actions to pass two arguments to match WordPress core since 4.9.0. +* Add a filter that allows comment types to be excluded when counting users' approved comments. + = 4.2.1 = *Release Date - 1 October 2021* diff --git a/wp-content/plugins/w3-total-cache/Base_Page_Settings.php b/wp-content/plugins/w3-total-cache/Base_Page_Settings.php new file mode 100644 index 0000000000..375bf8d191 --- /dev/null +++ b/wp-content/plugins/w3-total-cache/Base_Page_Settings.php @@ -0,0 +1,215 @@ +_config = Dispatcher::config(); + $this->_config_master = Dispatcher::config_master(); + + $this->_page = Util_Admin::get_current_page(); + } + + function options() { + $this->view(); + } + + public function render_footer() { + include W3TC_INC_OPTIONS_DIR . '/common/footer.php'; + } + + /** + * Returns true if config section is sealed + * + * @param string $section + * @return boolean + */ + protected function is_sealed( $section ) { + return true; + } + + /** + * Returns true if we edit master config + * + * @return boolean + */ + protected function is_master() { + return $this->_config->is_master(); + } + + /** + * Prints checkbox with config option value + * + * @param string $option_id + * @param bool $disabled + * @param string $class_prefix + * @param bool $label + */ + protected function checkbox( $option_id, $disabled = false, + $class_prefix = '', $label = true, $force_value = null ) { + $disabled = $disabled || $this->_config->is_sealed( $option_id ); + $name = Util_Ui::config_key_to_http_name( $option_id ); + + if ( !$disabled ) + echo ''; + + if ( $label ) + echo '