-
Notifications
You must be signed in to change notification settings - Fork 233
Closes #7357: Compatibility between ALR and GeneratePress footer element #7954
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
base: develop
Are you sure you want to change the base?
Closes #7357: Compatibility between ALR and GeneratePress footer element #7954
Conversation
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesFootnotes
|
…ss-footer-element
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.
Pull request overview
This PR adds GeneratePress theme compatibility to fix a footer layout issue with WP Rocket's Above the Fold Lazy Render (ALR) optimization. The fix adds the no-wpr-lazyrender exclusion class to GeneratePress footer elements, preventing them from being lazy-rendered and resolving layout problems.
Key changes:
- New GeneratePress subscriber that hooks into
generate_footer_classfilter to inject exclusion class - Theme registration in ThemeResolver and SubscriberFactory to enable automatic subscriber instantiation
- Integration tests with theme-loading infrastructure for test isolation
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| inc/ThirdParty/Themes/GeneratePress.php | New subscriber implementing the exclusion class injection via the generate_footer_class filter |
| inc/ThirdParty/Themes/ThemeResolver.php | Adds 'generatepress' to compatibilities array and fixes 'minimalistblogger' naming consistency |
| inc/ThirdParty/Themes/SubscriberFactory.php | Registers GeneratePress subscriber in factory pattern and fixes 'minimalistblogger' case consistency |
| tests/Integration/inc/ThirdParty/Themes/GeneratePress/injectExclusionsClass.php | Integration test validating the filter adds exclusion class to footer classes |
| tests/Fixtures/inc/ThirdParty/Themes/GeneratePress/injectExclusionsClass.php | Test fixture data defining expected behavior |
| tests/Fixtures/inc/ThirdParty/Themes/themes.php | New fixture mapping test groups to theme slugs for automated theme switching |
| tests/Integration/bootstrap.php | Adds theme-loading logic based on test groups and removes unrelated blank line |
| composer.json | Adds GeneratePress to excluded test groups and creates dedicated test command |
tests/Integration/inc/ThirdParty/Themes/GeneratePress/injectExclusionsClass.php
Outdated
Show resolved
Hide resolved
- Add declare(strict_types=1) to GeneratePress.php as required by WP Rocket coding standards for new PHP files - Rename test class from Test_injectExclusionsClass to Test_InjectExclusionsClass to follow PEAR naming conventions - Add comprehensive PHPDoc with parameter documentation to test method - Add phpcs:ignore comment for third-party hook name from GeneratePress theme Addresses Copilot review feedback from PR #7954
Review Feedback AddressedAll Copilot review comments have been addressed in commit a17b774: 1. Missing
|
|
Hi @jeawhanlee, Thanks for the PR. I tested it and noticed this: GeneratePress now adds Adding <div data-wpr-lazyrender="1" class="no-wpr-lazyrender site-footer">Should the generic exclusion |


Description
Fixes #7357
Fix footer layout issue for Generate Press theme by adding a generic exclusion class to exclude from ALR
Type of change
Detailed scenario
What was tested
site-footerno-wpr-lazyrenderis also added to the classNB: We need to add
no-wpr-lazyrenderto the lists of exclusions for ALR in the backend to see the exclusion take effect.How to test
Same as what was tested.
Technical description
Documentation
Add a 3rd party compatibility class to cater for adding generic class to exclude element from ALR.
New dependencies
N/A
Risks
N/A
Mandatory Checklist
Code validation
Code style
Unticked items justification
Not applicable to the changes in this PR.
Additional Checks