Exclude certain block from caching using Fragment Caching – doesn’t work [closed]

From the source: Here (source) is the mfunc part in the 0.9.2.9 version of the W3TC plugin where the regular expression is: $buffer = preg_replace_callback(‘~<!–\s*mfunc\s*’ . W3TC_DYNAMIC_SECURITY . ‘(.*)–>(.*)<!–\s*/mfunc\s*’ . W3TC_DYNAMIC_SECURITY . ‘\s*–>~Uis’, array( &$this, ‘_parse_dynamic_mfunc’ ), $buffer); From this it looks like the setup should be <!– mfunc W3TC_DYNAMIC_SECURITY code1–> code2 <!– /mfunc W3TC_DYNAMIC_SECURITY … Read more

Is priming a Transient Cache possible?

Your issue is not as much priming (which only happens first time) but that cache refreshes in solution you are using are synchronous. Transients API is not dealing with updates by itself, it is handled by code that calls it. So it doesn’t implement async updates. On other hand there is nothing that prevents implementing … Read more

Duplicate Queries

Generally speaking, you could use the WP Transients API to save the query. // Get any existing copy of our transient data if ( false === ( $special_query_results = get_transient( ‘special_query_results’ ) ) ) { // It wasn’t there, so regenerate the data and save the transient $special_query_results = new WP_Query( ‘cat=5&order=random&tag=tech&post_meta_key=thumbnail’ ); set_transient( ‘special_query_results’, … Read more

Stale cache handling with a persistent object cache

The object cache is not reliable, in any case. For example, Memcached has its own system to purge items in cache: if it “thinks” that is too full it start purging items in way that is just not predictable. It is (or should be) known that when you have an external object cache system in … Read more

How to purge all transient caches?

Not tested, but if you need a quick and dirty way, you could put a script like this in your WordPress folder and call it each time: define( ‘WP_USE_THEMES’, false ); require(‘wp-blog-header.php’); global $wpdb; $wpdb->query( “DELETE FROM $wpdb->options WHERE option_name LIKE ‘%\_transient\_%'” ); Not to be used on a production server.

Set Session Time Limit for Password Protected Posts

The reason is when you execute this code setcookie(‘wp-postpass_’ . COOKIEHASH, ”, 0, COOKIEPATH); It will reset your post password cookie to blank ”, so it just work once To solve this you need to assign the original cookie and extend the timeout, like this setcookie(‘wp-postpass_’ . COOKIEHASH, $_COOKIE[‘wp-postpass_’ . COOKIEHASH], time() + 60 * … Read more

How to archive a wordpress site (make it read only)

Assuming you have shell access, or access to any Linux/Unix box, you could use wget to download the entire site to static html files: wget –recursive –no-clobber –page-requisites –html-extension –domains domain.com http://domain.com Then either upload or move these files to your web root (after backing up and removing your WP installation). I imagine it’s also … Read more

WP Super Cache separate cache for mobile

There are several ways to handle mobile devices and doing it inside of single theme is builky and hard to maintain (as for me at least). More commonly this seems to be accomplished with separate templates or separate mobile-specific theme. I don’t know about WP Super Cache specifics because I hadn’t used it extensively. Plugin … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)