Transients API conditional

You could use a sanitized version of the URL as part of the name of the transient … but transient names are limited in their size. I would store the transient as an array with the URL and the HTML as two parts. Then check if the URL is the same. If it is, use … Read more

How to make use of Transient API as cookie

In almost all circumstances, a cookie would be preferable to a transient. WP has a really bad habit of not cleaning up transients properly, so unless your code cleans up after itself (Kills useless transients) they will just sit forever in your DB. Even transients that are set to expire sometimes don’t. In terms of … Read more

Transient not behaving as expected

rule of thumb is probably to use transients for simple objects (strings integers, array) as the result of unserialization of objects might be surprising and side effect might happen unless the object is fully static. IIRC, when unserializing an object PHP will also run its default constructor, which in your case will do the query … Read more

is_wp_error() and handling errors

WordPress can be inconsistent as to when is returns a WP_Error object and when it just returns false or string(0) when actually there was an error. I am not sure exactly what feedburner is returning that is not triggering a WP_Error from wp_remote_get() – but if you know wp_remote_get() will return an WP_Error, I would … Read more

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