-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Improve performance in the WP_Theme_JSON class by simplifying calls to array functions #3555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
9ca0b27
WIP
jrfnl 57f0dba
WIP step 2
jrfnl 58b0ff1
WIP - step 3
jrfnl d3bbd20
WIP Step 3b
jrfnl c17341b
WIP - setp 4
jrfnl aa13245
WIP - simplify it a little more
jrfnl 188ce0f
WIP - step 5
jrfnl 194368e
WIP - side step 6
jrfnl 8fed0c1
WIP - side step 7
jrfnl 5fa9aae
CS & cleanup
aristath 979bfef
replace array_key_exists with isset
aristath be50567
replace an array_merge with a foreach loop
aristath 6aa5ede
Add an inline comment to avoid future refactors
aristath 4434b1d
We can use isset() instead of array_key_exists() here (no null values)
aristath 505a4f8
replace array_merge with a foreach loop
aristath 0345837
replace array_merge with foreach loop in the flatten_tree method
aristath 8df441c
replace array_key_exists() with isset()
aristath 8c04874
Replace more array_merge with foreach loops where appropriate
aristath 213e94b
Fix PHP 5.6 errors + added notes for the future
aristath 8923cd8
Merge branch 'trunk' into feature/pp-ari-wp-theme-json
felixarntz 5730ac1
Add comment references pointing to https://core.trac.wordpress.org/ti…
felixarntz 4af0999
Merge branch 'trunk' into feature/pp-ari-wp-theme-json
felixarntz abf51b6
Merge branch 'trunk' into feature/pp-ari-wp-theme-json
felixarntz 4889396
Merge branch 'trunk' into feature/pp-ari-wp-theme-json
felixarntz 7ecd0a8
Clarify variable name.
felixarntz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Replace more array_merge with foreach loops where appropriate
- Loading branch information
commit 8c0487419066ec3634deb55ed924df016343af7a
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aristath @desrosj @felixarntz @spacedmonkey @jrfnl @hellofromtonya
Shouldn't the variable assigned be
$new_feature_declarationinstead of$feature_declaration? This has been reported as problematic by the Gutenberg lint jobs (see conversation).I haven't looked at what regression this introduced but it'd be good to create a follow-up PR fixing it and adding a test case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oandregal I concur. This is a bug which should be fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦 yeah, looks like this was a typo.. Good catch 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happens to the best of us ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar with this code path, so asked folks to provide details for testing at WordPress/gutenberg#46579 (comment) so we can add a new unit test and gauge how severe this is.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICS, this should go in the next 6.1 patch release.
Edit to clarify: I'm basing this assessment on the following: