#59279 closed enhancement (fixed)
Unnecessarily check to see site is using a child theme in the theme functions.
Reported by: |
|
Owned by: |
|
---|---|---|---|
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 (14)
This ticket was mentioned in PR #5133 on WordPress/wordpress-develop by @spacedmonkey.
20 months ago
#1
- Keywords has-patch added
#3
@
20 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.
20 months ago
This ticket was mentioned in PR #5153 on WordPress/wordpress-develop by @spacedmonkey.
20 months ago
#5
Trac ticket: https://core.trac.wordpress.org/ticket/59279
@spacedmonkey commented on PR #5153:
20 months ago
#6
#7
@
20 months ago
- Owner set to spacedmonkey
- Resolution set to fixed
- Status changed from new to closed
In 56523:
@spacedmonkey commented on PR #5133:
20 months ago
#8
This ticket was mentioned in PR #7626 on WordPress/wordpress-develop by @desrosj.
6 months ago
#9
After the changes in Core-59279, Compose files are manually passed to the Docker commands. If a docker-compose.override.yml
file is present, it won't be utilized. This attempts to detect that and include the file in the list that is passed.
Trac ticket:
6 months ago
#10
@xknown env variable for which part? Do you mean for the additional value of volumes
in the old-php-mysql-84.override.yml
file?
I just did some testing, and it seems that Docker fails when an empty value for a volume
is supplied. The new override file is needed _in addition_ to the other two supplied in the default docker-compose.yml
file, not instead of. So I'm not sure how to get it working with an environment variable with the limited variable substitution available.
6 months ago
#11
@xknown env variable for which part? Do you mean for the additional value of
volumes
in theold-php-mysql-84.override.yml
file?
I just did some testing, and it seems that Docker fails when an empty value for a
volume
is supplied. The new override file is needed _in addition_ to the other two supplied in the defaultdocker-compose.yml
file, not instead of. So I'm not sure how to get it working with an environment variable with the limited variable substitution available.
No, I was just wondering if it'd make sense to add something like the snippet below to utils.js
if ( typeof process.env.DOCKER_COMPOSE_CONFIG_OVERRIDE !== 'undefined' ) { composeFiles = composeFiles + process.env.DOCKER_COMPOSE_CONFIG_OVERRIDE }
6 months ago
#12
No, I was just wondering if it'd make sense to add something like the snippet below to
utils.js
if ( typeof process.env.DOCKER_COMPOSE_CONFIG_OVERRIDE !== 'undefined' ) { composeFiles = composeFiles + process.env.DOCKER_COMPOSE_CONFIG_OVERRIDE }
Ah, I see! I think if we find out that people are supplying custom override files we could consider that. But I don't know that is likely to be the case.
We also currently recommend using that file name in the README file for working with MySQL < 8.0 on Apple silicon chips. An env variable would also require an additional step (create the file, update the variable). So I think I prefer trying this approach first.
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