From bdce0b81743ea4ed2c23008204b9f08c79f054de Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 26 Sep 2015 06:00:09 +0000 Subject: [PATCH] Recent Comments Widget: a la [34464], this widget has the same mixed content issues. Remove the fragment caching. The comment queries are now split to scale. This was the only remaining widget with an HTML fragment cache. Fixes #25556. git-svn-id: https://develop.svn.wordpress.org/trunk@34581 602fd350-edb4-49c9-b593-d223f7449a82 --- .../class-wp-widget-recent-comments.php | 35 ------------------- 1 file changed, 35 deletions(-) diff --git a/src/wp-includes/widgets/class-wp-widget-recent-comments.php b/src/wp-includes/widgets/class-wp-widget-recent-comments.php index a9d07303a1..7bf5c6fb96 100644 --- a/src/wp-includes/widgets/class-wp-widget-recent-comments.php +++ b/src/wp-includes/widgets/class-wp-widget-recent-comments.php @@ -23,10 +23,6 @@ class WP_Widget_Recent_Comments extends WP_Widget { if ( is_active_widget(false, false, $this->id_base) ) add_action( 'wp_head', array($this, 'recent_comments_style') ); - - add_action( 'comment_post', array($this, 'flush_widget_cache') ); - add_action( 'edit_comment', array($this, 'flush_widget_cache') ); - add_action( 'transition_comment_status', array($this, 'flush_widget_cache') ); } /** @@ -49,34 +45,14 @@ class WP_Widget_Recent_Comments extends WP_Widget { is_preview() ) { - $cache = wp_cache_get('widget_recent_comments', 'widget'); - } - if ( ! is_array( $cache ) ) { - $cache = array(); - } - if ( ! isset( $args['widget_id'] ) ) $args['widget_id'] = $this->id; - if ( isset( $cache[ $args['widget_id'] ] ) ) { - echo $cache[ $args['widget_id'] ]; - return; - } - $output = ''; $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Recent Comments' ); @@ -128,11 +104,6 @@ class WP_Widget_Recent_Comments extends WP_Widget { $output .= $args['after_widget']; echo $output; - - if ( ! $this->is_preview() ) { - $cache[ $args['widget_id'] ] = $output; - wp_cache_set( 'widget_recent_comments', $cache, 'widget' ); - } } /** @@ -144,12 +115,6 @@ class WP_Widget_Recent_Comments extends WP_Widget { $instance = $old_instance; $instance['title'] = sanitize_text_field( $new_instance['title'] ); $instance['number'] = absint( $new_instance['number'] ); - $this->flush_widget_cache(); - - $alloptions = wp_cache_get( 'alloptions', 'options' ); - if ( isset($alloptions['widget_recent_comments']) ) - delete_option('widget_recent_comments'); - return $instance; }