WordPress’s Query Monitor: slow and duplicate queries?

John Blackbourn’s Query Monitor plugin sometimes reports slow queries and duplicate queries. How can you interpret these reports? What are slow and duplicate queries? Slow queries Query Monitor defines slow queries as those that take more than 50 milliseconds (1/20th of a second). Query Monitor shows query times in seconds in the rightmost column of … Read more

php, Ubuntu, fpm, xdebug, PhpStorm

Here’s an oddity which baffled me and kept me from being able to use xdebug with PhpStorm for a while. I installed a bunch of different versions of php on my Ubuntu VM. I used Ondřej Surý’s repository, rigging my vm to install them like this. To get php5.5, use these commands: Then, I followed … Read more

My thoughts on WordPress these days

This entry is part 1 of 2 in the series WordPress alternatives

I’ve been successfully hacking WordPress more or less regularly since 2008. It’s good software, and it’s aged reasonably gracefully, feature- and bloatware- wise, compared to many enduring software brands. Its developers have been insistent on backward compatibility while they painstakingly built a community of loyal developers and users doing all sorts of amazing things with … Read more

WordPress user roles: how are they stored?

WordPress lets site administrators assign roles to their registered users. These roles are, on a standard WordPress installation, Administrator, Editor, Author, Contributor, and Subscriber. Plugins can add custom roles. For example, WooCommerce adds Customer and Shop Manager roles. The roles assigned to each user are stored in the wp_usermeta table. In an ordinary single-site install … Read more

WooCommerce key improvement

WordPress’s WooCommerce plugin uses a table called wp_woocommerce_order_itemmeta as an extensible key-value storage mechanism for order line items. Its parent table is wp_woocommerce_order_items. These two tables work similarly to wp_postmeta and wp_posts, and have the same performance issues. In large sites with a long history of orders, lookup may be slow. wp_woocommerce_order_itemmeta This DDL, usable … Read more

Elementor Performance

I’m seeing a lot of questions about sites being slow. Anecdotally, it seems like many of those are Elementor sites. So a database performance fanatic like me smells an opportunity to make improvements. Some of the WordPress punditocracy says “don’t use Elementor”. But, they have over ten million downloads. So let’s help those sites if … Read more

Optimizing WordPress Database Servers

It’s common, and frustrating, for WordPress sites to be slow. When a site is slow for visitors, they give up and go elsewhere. When the dashboard is slow for site owners and content editors, it makes it harder to maintain the site, post new stuff, and handle orders (if it’s a store). Database Optimization Plugins … Read more

Database Keys in Scalability Pro

Scalability Pro is a paid plugin for improving backend WordPress and WooCommerce performance. It does multiple things including query rewriting and memoization caching of some time-consuming database queries. One thing it does is add keys (indexes) to some WordPress tables. This article is a table-by-table analysis of some keys it adds, compared with the keys … Read more

Slow searching for WooCommerce orders

Background WooCommerce offers a search box on the WooCommerce -> Orders page. It lets a shop manager search orders, current and historic, for the customer’s name, address, email, and other data. It also searches the names of products and shows orders containing those products. On large sites with many orders, the search is astoundingly slow. … Read more