WordPress.org

Ready to get started?Download WordPress

Forums

Recent Posts Widget Extended
[resolved] Plugin does not dynamically update (11 posts)

  1. einfohound
    Member
    Posted 1 year ago #

    I have installed plugin and set it up, but when I publish a new post, what is displayed in the widget does not update. If I go into the widget are and just "Save" the widget again, the new post will show.

    The same applies to any changes that might have been made to existing posts. The updates do not show in the widget area unless I go save it again.

    http://wordpress.org/extend/plugins/recent-posts-widget-extended/

  2. Satrya
    Member
    Plugin Author

    Posted 1 year ago #

    Hello,

    Yes it's normal because the plugin uses custom cache, it will expired in 12 hours :)

  3. bwhontwerpers
    Member
    Posted 1 year ago #

    Is there any way we can modify this cache expiration timeout?

  4. Satrya
    Member
    Plugin Author

    Posted 1 year ago #

    @bwhontwerpers please open new thread. Actually you can't change the cache time, you only need to re-save the widget and the cache will removed

  5. alby270
    Member
    Posted 1 year ago #

    That's kind of tedious to have to re-save the widget every time in order for it to refresh itself just so it shows the most recent post...

  6. einfohound
    Member
    Posted 1 year ago #

    You don't have to...it will dynamically update itself every 12 hours. It is not a big deal.

  7. artgeek
    Member
    Posted 1 year ago #

    Running into this same issue; a 12-hour cache is actually a big deal for sites that update periodically throughout the day.

  8. Satrya
    Member
    Plugin Author

    Posted 1 year ago #

    I'm sorry, but please read the descriptions once again.

    The recent posts widget extended uses Transients API for delivering cached to optimize your site performance when used the widget.

    The cache is just to optimize your site. Maybe in the next release, I'll provide an input box to set up the cache time.

  9. ACarlsson
    Member
    Posted 1 year ago #

    If anyone want to skip the cache thing you can do like me.

    In the plugin folder on line 52 in the file includes/widget-recent-posts-extended.php

    replace this

    if ( false === ( $rpwewidget = get_transient( 'rpwewidget_' . $widget_id ) ) ) {
    
    			$args = array(
    				'numberposts' => $limit,
    				'cat' => $cat,
    				'post_type' => $post_type
    			);
    
    		    $rpwewidget = get_posts( $args );
    
    		    set_transient( 'rpwewidget_' . $widget_id, $rpwewidget, 60*60*12 );
    
    		} ?>

    with this

    /*
    		if ( false === ( $rpwewidget = get_transient( 'rpwewidget_' . $widget_id ) ) ) {
    		*/
    			$args = array(
    				'numberposts' => $limit,
    				'cat' => $cat,
    				'post_type' => $post_type
    			);
    
    		    $rpwewidget = get_posts( $args );
    		/*
    		    set_transient( 'rpwewidget_' . $widget_id, $rpwewidget, 60*60*12 );
    
    		}
    		*/
    		?>
  10. carrie@wack.co.za
    Member
    Posted 1 year ago #

    Thank you ACarlsson! Just what I needed. :)

  11. artgeek
    Member
    Posted 1 year ago #

    Brava, ACarlsson. I had actually just edited down the time of the cache, but I think this is actually a better solution.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.