Open marcingminski opened 1 year ago
I've gone back and forth with creating inline vs static CSS and the upside is inline CSS is less problematic on a wider variety of servers, including WordPress VIP hosts.
How about having both options so people can chose what works best for them?
FWIW generate_css()
is cached for about 4 weeks. It shouldn't cause any slowdown after generated.
Thanks. I get lots of these in the php slow log. Perhaps they aren’t being cached then? Any way to debug this?
I'm not familiar with a PHP Slow log. Where is it generated from?
PHP itself:
request_slowlog_timeout
https://www.php.net/manual/en/install.fpm.configuration.php
When you say slow, what are the actual times running the function? once, ten times, etc.
It's a separate issue but I'm also observing that the recent changes to this plugin are causing an update_option
call on every page view, which shouldn't be necessary -- 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 by load_categories
, which is hooked to init
, which runs every time WP spins up to serve a request)
It's not a significant performance impact on its own, but I'd think we shouldn't have to update any content on a normal frontend page view.
@afragen I can make a new issue for this if you'd prefer to keep this isolated to the originally described issue
Might be best to create a new issue.
@afragen Great, moved that piece to https://github.com/the-events-calendar/the-events-calendar-category-colors/issues/153
When you say slow, what are the actual times running the function? once, ten times, etc.
sorry missed this - constantly over 2 seconds execution time. I commented out the above lines and the issue (mostly) went away.
Plugin constantly triggers the PHP slow log:
The line 189 being:
line 189 looks like its part of a function that should have been removed:
and line 159 being:
I understand this is because the plugin creates inline CSS every time the page loads. Is there a way to generate static CSS in the file and embed it in HEAD?