#59279 closed enhancement (fixed)
Unnecessarily check to see site is using a child theme in the theme functions.
Reported by: | spacedmonkey | Owned by: | spacedmonkey |
---|---|---|---|
Milestone: | 6.4 | Priority: | normal |
Severity: | normal | Version: | 4.7 |
Component: | Themes | Keywords: | has-patch |
Focuses: | performance | Cc: |
Description
Follow on from #58576 / [56357].
There are a number of functions methods that check to see if file exists in a child theme before falling back to parent theme. However these functions do not check to see if current theme. These functions include.
The function is_child_theme
can not be used, as TEMPLATEPATH
and STYLESHEETPATH
, might be different from the result of get_stylesheet_directory()
and get_template_directory()
. These functions have filters.
Attachments (1)
Change History (9)
This ticket was mentioned in PR #5133 on WordPress/wordpress-develop by @spacedmonkey.
13 months ago
#1
- Keywords has-patch added
#3
@
13 months ago
Brenchmark data.
PHP 7.4.33, WordPress develop docker env. Trunk - [56512].
Theme - 2021
Trunk | PR | |
Response Time (median) | 54.37 | 54.08 |
wp-load-alloptions-query (median) | 0.56 | 0.55 |
wp-before-template (median) | 20.24 | 20.1 |
wp-template (median) | 29.57 | 29.29 |
wp-total (median) | 49.86 | 49.56 |
Theme 2022
Trunk | PR | |
Response Time (median) | 131.74 | 128.89 |
wp-load-alloptions-query (median) | 0.59 | 0.58 |
wp-before-template (median) | 82.09 | 79.87 |
wp-template (median) | 44.99 | 44.79 |
wp-total (median) | 127.35 | 124.57 |
Blackfire see a 6% improvement ( on 2022 theme )
https://blackfire.io/profiles/compare/3caa6f25-0dea-4cd7-a545-4fef945deb0f/graph
This ticket was mentioned in Slack in #core-performance by spacedmonkey. View the logs.
13 months ago
This ticket was mentioned in PR #5153 on WordPress/wordpress-develop by @spacedmonkey.
13 months ago
#5
Trac ticket: https://core.trac.wordpress.org/ticket/59279
Only check to see if file exists if the current theme is a child theme.
is_child_theme
can not be used asget_stylesheet_directory
has a filter.Trac ticket: https://core.trac.wordpress.org/ticket/59279#ticket