Open kadamwhite opened 1 year ago
Interesting that the blame shows this line has been present for 9 years.
I do agree that this shouldn't happen.
FYI, I've given the plugin the The Events Calendar folks for maintenance and support. I'll still be helping where I can.
I've observed that the recent changes to this plugin are causing an
update_option
call on every page view. This causes performance issues on high-traffic sites, because frontend site views cause a database write in addition to reading all of their normal content out of the database.I'm looking at this line: https://github.com/the-events-calendar/the-events-calendar-category-colors/blob/develop/src/Category_Colors/Main.php#L247
get_category_terms
is called byload_categories
, which is hooked toinit
, which runs every time WP spins up to serve a request.It feels like we shouldn't have to update any content on a normal frontend page view. I'd only expect an option to get written if the user has taken some action which could change the contents of the option, or possibly if a cache has expired.