New answers tagged

0

But if the single post page is cached in Varnish, wouldn't the count stay the same? Yes, if the whole page is cached then the PHP will never get run to update the view count. You'd need an ESI block to call an uncached URL that will increment the view count. Or even an Ajax script would work. Just make sure your VCL doesn't cache the the ESI block request ...


0

This is probably not the most optimal solution, but you could store static metadata as an array in the theme options. The options table is loaded in memory by default, giving you fast access.


0

Add the below code in your active theme's functions.php file. function wpse_delete_query_transient( $post ) { // Deletes the transient when a new post is published delete_transient( 'd_results' ); } add_action( 'new_to_publish', 'wpse_delete_query_transient' ); This will delete the transient every time when a new post is published. If you want to ...


1

There are different approaches to this, depending on specific requirements. For example in your case you seem more worried about plugin picking up ghost data than that data being left behind. Such case might be easier handled by generating unique key prefix to use and just flushing that on uninstall. No prefix = no data access. I would say the general case ...


0

Yes, they should be, especially since cache might contain sensitive information the user might wish to be removed with the plugin. Best thing is to design your system in a way in which it is easy to delete all persistent information - for example place all your cache files under one directory. As for your example, cache in theory should not be part of an ...


0

Sounds like you might already have your answer but I strongly recommand you to use DBSR (db search replace) to replace ALL occurrences of domain1 by domain2. There are tools for that. This one is pretty clean : https://github.com/interconnectit/Search-Replace-DB The whole process is described. There is a good UI. This way you'll be sure everything is ok ...



Top 50 recent answers are included