How do I add indexes to WordPress Database?

The WordPress database is already indexed. See this codex article for a detailed list of indexes per table: http://codex.wordpress.org/Database_Description And even if it weren’t, you’d need to know what queries are being run in order to effectively add indexes. Meaning, there would be no quick fix–you’d have to learn how indexing works, figure out what … Read more

High CPU & Memory Spikes?

I think I found what the problem was. WP-Postviews. I deactivated the plugin and removed all code from it on the site and now everything is running smoothly (at least for the last 3 hours).

Using Global Variables Expensive for PHP

Here is a basic class which you can create once: if ( ! class_exists(‘my_class’) ) : class my_class { public $my_var; // This variable is for a single instance static $instance; function __construct () { // Call other methods like this $this->initialize(); } function initialize () { // Populate your variables here $this->my_var=”any value you … Read more

What are best practices for configuring a server for WordPress sites?

It’s a very loaded question, I’ll try my best here, keep in mind it’s 4am, so I’m just giving you highlights, not detailed explanations. Linux I’m assuming you’re using a recent version of Ubuntu Change the default SSH port from 22, to something else (/etc/ssh/sshd_config). Either enable AllowGroups or AllowUser in the sshd_config, Install fail2ban … Read more

Stress testing WordPress

WordPress should behave the same, only dependent on your server resources. I hope you have a dedicated server because if not then you will experience severe outages and possibly cancellation of your hosting service. WordPress is merely databases and PHP, so amount of files will not affect its use. It is stable. You could have … Read more

Are there server performance benefits to fetching only specific fields when querying the REST API?

I understand that having less data being downloaded improves the experience to the end user, but my question is related to the actual server performance, would the response be faster? Would adding _fields[]=id&_fields[]=title, etc… to the above url improve server performance? No it would not, and for several reasons. When you ask for a post … Read more

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