Performance-wise, is it better to enqueue a (small) script on every page or test to see if it’s needed?

What happens on the user’s side is off topic as @bungeshea said already. Once the user has loaded the file it will stay in the browser cache for a while, so you don’t have to worry about double loaded files anyway. But let’s look at the server side and how WordPress handles this. If you … Read more

Image sizes and order of operations

wp_get_attachment_image_src will always return a URL to a file if the image exists in some size. If the size you ask for doesn’t exist then you get the URL for the full size image as uploaded. (This isn’t the “large” image size.) So, for a valid image ID, your conditional if(wp_get_attachment_image_src($id, array($preferred_size, $preferred_size))) will always … Read more

Using Multiple Queries of “home_url” vs. Calling a Variable Multiple Times

If you look at the source for the home_url() function, you’ll note a small series of function calls eventually invoking get_option(). As explained in this WPSE Answer, the get_option() function is cached, meaning that if an option’s value is already in memory, get_option() returns that value instead of querying the database again. As a result, … Read more

If I consider changing my WordPress DB tables to InnoDB, will it have an effect on the way WordPress works?

There’s quite a lot of information on here about switching to InnoDB https://wordpress.stackexchange.com/search?q=innodb There are a number of things to think about: InnoDB is helpful with you’re faced with contention – ie when you have tables that are being written to as well as being read InnoDB does not support FULLTEXT indexes so plugins that … Read more

Speed up WordPress

I was in a similar situation recently and started using W3 Total Cache too. I’m not sure what settings you have at the moment, but it’s worth experimenting a bit if you can to see that you’re really using W3 Total Cache to the max For example, I originally only had Page Cache and Browser … Read more

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