Repository navigation
Fix #1044: update the WP Rocket banner copy on the bulk page - #1267
Conversation
Copy confirmed with Marketing by @raahulbasu on the issue: Main copy: "Discover the best performance optimization plugin at 20% off. Make your site even faster." CTA: "Get WP Rocket Now" The banner is `views/notice-wp-rocket.php`, the full-width admin notice rendered on the bulk optimization page - `Notices.php:91` maps 'wp-rocket' to the 'bulk-optimize' screen. It is not the WP Rocket block in the settings sidebar (`views/part-rocket-ad.php`), which is a different placement and is left alone. The percentage is interpolated from a `$discount_percent` variable rather than written into the sentence, mirroring what part-rocket-ad.php already does, so the figure has one place to change and a new offer does not require rewriting a translated string.
`views/part-rocket-ad.php:26` passed 'corporate' as the text domain instead of 'imagify', so "We recommend for you" never matched a translation and always rendered in English regardless of locale. Unrelated to the banner copy in #1044 - different file, different placement - but found while tracing which WP Rocket banner the ticket meant, and it is a one-word fix in the same area.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Duplication | 0 |
🟢 Coverage ∅ diff coverage
Metric Results Coverage variation Report missing for 51937131 Diff coverage ✅ ∅ diff coverage (50.00%) Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (5193713) Report Missing Report Missing Report Missing Head commit (cad9f05) 20485 1622 7.92% Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#1267) 0 0 ∅ (not applicable) Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
7f622cd to
cad9f05
Compare
Description
Fixes #1044
Updates the WP Rocket banner copy on the bulk optimization page to the wording @raahulbasu confirmed with Marketing:
Copy only. No logic, no display conditions changed.
Type of change
Detailed scenario
What was tested
Verified in the browser on the real bulk optimization page, not by reading the diff. Read back from the rendered DOM:
Rendered banner measures 1593x92, against the 1656x95 in the issue screenshot, which confirms this is the element the ticket is about.
Screenshot of the rendered banner is attached in a comment below.
Integration suite: 149 tests / 403 assertions. PHPCS clean.
How to test
wp-rocketnotice must not be dismissed for your user. If you have dismissed it, clear it from the_imagify_ignore_noticesuser meta.Affected Features & Quality Assurance Scope
views/notice-wp-rocket.php).views/part-rocket-ad.php), see below.Technical description
Documentation
The banner is
views/notice-wp-rocket.php, the full-width admin notice rendered on the bulk page.Notices.php:91maps'wp-rocket'to the'bulk-optimize'screen.Worth recording, since it is an easy trap: there is a second WP Rocket block,
views/part-rocket-ad.php, in the settings-page sidebar. I initially changed that one. It is a different placement with different copy, and the ticket is not about it, so it is untouched here apart from the text-domain fix below.The percentage is interpolated from a
$discount_percentvariable rather than written into the sentence, mirroring whatpart-rocket-ad.phpalready does. That keeps one place to change the figure, and a future offer change does not require rewriting a translated string.Second commit: text domain fix
views/part-rocket-ad.php:26passed'corporate'as the text domain instead of'imagify', so "We recommend for you" never matched a translation and always rendered in English regardless of locale.Unrelated to the copy change and in the other file, but it is a one-word defect found while tracing which banner the ticket meant, and folding it in was agreed rather than opening a separate ticket for it.
New dependencies
None.
Risks
20%figure is now stated in the message rather than the button. If the offer changes, update$discount_percentinviews/notice-wp-rocket.php; the sentence adapts automatically.Mandatory Checklist
Code validation
Code style
Unticked items justification
No automated test added: the change is static translatable text in a view, with no branching to cover. It was verified by rendering the real page and reading the strings back from the DOM, which is stronger evidence here than asserting a string constant against itself.
Additional Checks
Not applicable: static copy in a view template, no I/O and nothing that can throw.