WordPress as framework

To run a plugin only when it is needed the plugin author has to identify the pages where the code actually does something. WordPress offers a surprisingly simple way to do that: the global variable $pagenow. It is set before a plugin is called in wp-includes/vars.php. In a spam block plugin I have written recently … Read more

How accurate is P3 Plugin profiler

Checkout this page from GoDaddy: http://support.godaddy.com/help/article/7360/using-the-wordpress-plugin-performance-profiler-p3 It gives a pretty good overview of the P3 Plugin Profiler and should be able to answer your questions. There’s definitely error involved, and it should really just be used as a guideline.

How to get DEFER or ASYNC attribute to appear when I add a stylesheet with wp_enqueue_style from a plugin? [duplicate]

As per WP Code Snippet blog, it looks like this is one way: Add this code snippet to your functions.php file. // add async and defer to javascripts function wcs_defer_javascripts ($url) { if (strpos($url, ‘.js’) === FALSE) { return $url; } if (strpos($url, ‘jquery.js’)) { return $url; } return “$url’ async onload=’myinit()”; } add_filter(‘clean_url’, ‘wcs_defer_javascripts’, … Read more

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