Support » Plugin: Recent Posts Widget Extended » Plugin does not dynamically update

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Ga Satrya

    (@satrya)

    Hello,

    Yes it’s normal because the plugin uses custom cache, it will expired in 12 hours 🙂

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

    Plugin Author Ga Satrya

    (@satrya)

    @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

    alby270

    (@alby270)

    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…

    Thread Starter einfohound

    (@einfohound)

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

    artgeek

    (@artgeek)

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

    Plugin Author Ga Satrya

    (@satrya)

    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.

    ACarlsson

    (@acarlsson)

    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 );
    
    		}
    		*/
    		?>
    carrie@wack.co.za

    (@carriewackcoza)

    Thank you ACarlsson! Just what I needed. 🙂

    artgeek

    (@artgeek)

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

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Plugin does not dynamically update’ is closed to new replies.