One of our clients started to use Birchpress a few months ago. They like the functionality, but performance – not so much.
Particular the waiting time of sometimes 10-20 seconds to fetch the calendar in the backend or get a list of available time slots for a particular day.
So to figure our what is going on, we did some profiling. At first, we thought the data model was the culprit. After all the WordPress postmetadata table is not the most efficient way to store and query structured data.
However, it looks like the main reason is to find elsewhere: The way Birchpress deals with WordPress hooks (filters and actions). It wraps all functions in the hook framework and makes many, many, many invocations of it.
Lets look a specific example. We are looking at the calendar for future appointments at the admin interface and are fetching 193 of those via this ajax call:
/wp-admin/admin-ajax.php?action= &birs_time_start=2017-06-26+00%3A00%3A00&birs_time_end=2017-08-03+00%3A00%3A00&birs_location_id=-1&birs_staff_id=-1
The ajax request takes 24.8 sec on a server without traffic. 19 sec. of those are spent in the “has_filter” function that is invoked more than 60.000 times (!) — almost all of them triggered by Birchpress.
We measured this with the xhprof profiler (we can provide more details).
I realize this might be difficult to fix as this is part of the core design, but do really hope the Birchpress team will work on it to make Birchpress more useful for sites with more then a few appointments.