NSP - content does not appear after refresh

November 2012 WordPress Theme
GK User
Sun Dec 16, 2012 1:59 pm
Hello,

I realized something annoying. When I post a new article in either of the NSP widgets, it does not refresh and appear on the site automatically. I set cache to 0 (original parameter 60). Even if I press CtrlF5 in Firefox, even if I delete cache on the page, it does not show.

It only appears if I go to the widget settings, and save it again.

Any idea what's wrong?

Thanks
User avatar
Senior Boarder

GK User
Sun Dec 16, 2012 2:33 pm
hi,

That's strange, because the widget uses the transient API and it should refresh correctly if the cache time is set to 0.

But I can suggest another solution. In the file widgets.nsp.php file please change line:

Code: Select all
add_action('comment_post', array(&$this, 'refresh_cache'));


to:

Code: Select all
add_action('edit_post', array(&$this, 'refresh_cache'));
add_action('delete_post', array(&$this, 'refresh_cache'));
add_action('trashed_post', array(&$this, 'refresh_cache'));
add_action('save_post', array(&$this, 'refresh_cache'));


then the widget should refresh on every post change.
User avatar
Administrator

GK User
Mon Dec 17, 2012 2:01 pm
I'm sorry, but it still does not work. :(

I replaced the code and still refreshes only if I open widget settings, and save.
User avatar
Senior Boarder

GK User
Tue Dec 18, 2012 10:59 am
I've checked it on my test installation and it is working fine - it displays new post after adding new post and come back to the previous state after moving this post to the trash. Please check again the widgets.nsp.php file or use the one from the newest Meet GavernWP theme.
User avatar
Administrator

GK User
Tue Dec 18, 2012 9:14 pm
I double checked it, the code is OK in the file, but still does not work. If I give you acces to the backend in a PM, could you please check what is wrong?

I'd appreciate it. Without NSP working properly, I cannot use the theme on my site. :S

Thanks
User avatar
Senior Boarder

GK User
Tue Dec 18, 2012 9:27 pm
Please provide me also an FTP access - without it I won't be able to help :/
User avatar
Administrator

GK User
Tue Dec 18, 2012 10:16 pm
Please check your page now - I found a reason of the problem - when there is more than one instance, then the cache was refreshed only for the last instance. I've modified a code in your page and now it should looks correctly :) I'll check this implementation in few other cases and installations and then I'll add it to the official release :)
User avatar
Administrator

GK User
Wed Dec 19, 2012 6:37 pm
dziudek wrote:Please check your page now - I found a reason of the problem - when there is more than one instance, then the cache was refreshed only for the last instance. I've modified a code in your page and now it should looks correctly :) I'll check this implementation in few other cases and installations and then I'll add it to the official release :)


I've checked it, and it is working perfectly :D :D :D

Thank you very much for the personalized support, I really appreciate it! Nice job, dziudek, thank you!
User avatar
Senior Boarder


cron