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
|
There was a problem hiding this comment.
Pull request overview
This PR updates the Rocket Insights feature to be available without “free vs paid” gating in the UI and REST responses, removing blurred/quota/credit restrictions and related upgrade messaging while adjusting default limits.
Changes:
- Removes blurred/quota/credit-gating in Rocket Insights rendering and REST payloads (credits treated as always available; blurred states removed).
- Simplifies Rocket Insights subscribers/services by dropping now-unused dependencies/hooks and removing reseller blocking in context.
- Updates and prunes unit/integration tests + fixtures to match the new “free” behavior, and increases the default addon limit fallback to 10.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| views/settings/partials/rocket-insights/table-row.php | Removes blurred-class computation for RI table rows. |
| views/settings/partials/rocket-insights/performance-score.php | Removes blurred-state detection for the score indicator template. |
| tests/Unit/inc/Engine/Admin/RocketInsights/Subscriber/RenderPerformanceUrlsTableTest.php | Updates unit expectations for subscriber dependencies/call counts after removing free/quota logic. |
| tests/Integration/inc/Engine/Admin/RocketInsights/Subscriber/RenderLicenseBannerSectionTest.php | Removes integration coverage for the license banner section. |
| tests/Fixtures/inc/Engine/Admin/RocketInsights/Subscriber/RenderPerformanceUrlsTableTest.php | Updates fixtures to reflect non-free/quota-banner behavior. |
| tests/Fixtures/inc/Engine/Admin/RocketInsights/Subscriber/RenderLicenseBannerSectionTest.php | Removes fixtures for the deleted integration test. |
| tests/Fixtures/inc/Engine/Admin/RocketInsights/Settings/Subscriber/DisplayAddonStatusTest.php | Removes fixture coverage for “active” addon license status output. |
| tests/Fixtures/inc/Engine/Admin/RocketInsights/Rest/UpdateItemTest.php | Removes “no credit” failure scenario fixture for update/retest. |
| tests/Fixtures/inc/Engine/Admin/RocketInsights/Rest/CreateItemTest.php | Updates expected page-limit error message text. |
| tests/Fixtures/inc/Engine/Admin/RocketInsights/PostListing/Subscriber/renderRocketInsightsColumn.php | Removes blurred-state column fixture and normalizes URL key formatting. |
| tests/Fixtures/inc/Engine/Admin/RocketInsights/PostListing/Subscriber/enqueuePostListingAssets.php | Removes reseller-related “should not enqueue” fixture. |
| tests/Fixtures/inc/Engine/Admin/RocketInsights/PostListing/Subscriber/addRocketInsightsColumn.php | Removes reseller-related “should not add column” fixture. |
| inc/Engine/License/API/User.php | Changes the fallback RI addon URL limit from 3 to 10 when no plan limit is available. |
| inc/Engine/Admin/RocketInsights/Subscriber.php | Removes multiple paid/free hooks and hardcodes “free”/quota flags for rendering/localized data. |
| inc/Engine/Admin/RocketInsights/Settings/Subscriber.php | Disables all hooks by returning an empty subscribed-events list. |
| inc/Engine/Admin/RocketInsights/ServiceProvider.php | Removes ri_plan injection into Render and removes options injection into RI Subscriber. |
| inc/Engine/Admin/RocketInsights/Rest.php | Removes credit enforcement on retest and hardcodes has_credit in REST responses; simplifies page-limit messaging. |
| inc/Engine/Admin/RocketInsights/Render.php | Removes Plan dependency and hardcodes has_credit/blurred-related template data. |
| inc/Engine/Admin/RocketInsights/GlobalScore.php | Drops “blurred” status calculation in global score status. |
| inc/Engine/Admin/RocketInsights/Database/Rows/RocketInsights.php | Allows report/retest access without checking is_blurred. |
| inc/Engine/Admin/RocketInsights/Context/SaasContext.php | Updates inline comment to reflect non-live-only blocking. |
| inc/Engine/Admin/RocketInsights/Context/Context.php | Removes reseller blocking inside is_reseller_or_non_live() (now non-live only) and updates docblock accordingly. |
Comments suppressed due to low confidence (2)
views/settings/partials/rocket-insights/performance-score.php:35
- Blurred state is effectively removed, but this view still keeps
$rocket_insights_item_is_blurredplus CSS/tooltip branches that will never run (the variable is alwaysfalse). To avoid dead logic and outdated upgrade messaging, simplify the template by removing the blurred-specific conditions (or reintroduce setting the flag if blurred is still a supported status).
$rocket_insights_item_is_blurred = false;
$rocket_opening_anchor_tag = $data['is_dashboard'] ? '<a href="' . esc_url( admin_url( 'options-general.php?page=' . WP_ROCKET_PLUGIN_SLUG ) . '#rocket_insights' ) . '">' : '';
$rocket_closing_anchor_tag = $data['is_dashboard'] ? '</a>' : '';
?>
<div class="wpr-percentage-indicator">
<?php if ( ( isset( $data['status'] ) && 'in-progress' === $data['status'] ) || ! empty( $data['is_running'] ) ) : ?>
<div class="wpr-loading-container">
<img class="wpr-loading-img" src="<?php echo esc_url( rocket_get_constant( 'WP_ROCKET_ASSETS_IMG_URL', '' ) . 'orange-loading.svg' ); ?>"/>
</div>
<?php elseif ( isset( $data['status'] ) && 'failed' === $data['status'] ) : ?>
<?php echo $rocket_opening_anchor_tag; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<div class="wpr-percentage-circle status-red <?php echo $rocket_insights_item_is_blurred ? 'blurred' : ''; ?>">
<span class="wpr-failed-score wpr-icon-exclamation"></span>
</div>
<?php echo $rocket_closing_anchor_tag; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php else : ?>
<?php echo $rocket_opening_anchor_tag; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<div class="wpr-percentage-circle <?php echo esc_html( $data['status-color'] ?? '' ); ?> <?php echo $rocket_insights_item_is_blurred ? 'blurred' : ''; ?> <?php echo 100 === $data['score'] ? 'wpr-centralize-100-score' : ''; ?>">
<?php echo esc_html( $data['score'] ); ?>
</div>
<?php echo $rocket_closing_anchor_tag; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php endif; ?>
<?php if ( ( isset( $data['status'] ) && 'failed' === $data['status'] ) || $rocket_insights_item_is_blurred ) : ?>
<div class="wpr-tooltip">
<div class="wpr-tooltip-content">
<?php echo 'failed' === $data['status'] ? esc_html__( 'Something went wrong with this URL', 'rocket' ) : esc_html__( 'Upgrade your plan to see your score', 'rocket' ); ?>
</div>
inc/Engine/Admin/RocketInsights/Context/Context.php:118
is_reseller_or_non_live()no longer checks reseller accounts and now only detects non-live sites, but the method name (and callers) still implies it includes reseller logic. This makes the API misleading and easy to misuse later. Consider introducing a correctly named method (e.g.is_non_live_site()), keeping the old name as a deprecated wrapper for backward compatibility, and updating call sites accordingly.
/**
* Check if current installation is a non-live site.
*
* This will block Rocket Insights functionality for localhost installations.
*
* @since 3.20
*
* @return bool True if is non-live installation, false otherwise.
*/
public function is_reseller_or_non_live(): bool {
// Hide for non-live installations.
if ( ! rocket_is_live_site() ) {
return true;
}
return false;
|
Thank you, @remyperona, for this PR. [WIP] Please find the exploratory notes below:
|
| * @return bool True if is reseller account or non-live installation, false otherwise. | ||
| * @return bool True if is non-live installation, false otherwise. | ||
| */ | ||
| public function is_reseller_or_non_live(): bool { |
There was a problem hiding this comment.
Should we rename the function as we are only checking if this is a live site ?
There was a problem hiding this comment.
Since it's a public function that we might re-use later, I didn't modify the name. We could create a new method, use it instead, and keep the old one as a deprecated wrapper, if we feel it's necessary. What do you think?
|
Dashboard layout is updated |

Description
Fixes #8084
Type of change
Detailed scenario
What was tested
Tested Rocket Insights is fully available for free, following the acceptance criteria defined in the epic.
Note: The URL limit is not yet updated on the API, so it's currently still using 3 instead of 10
How to test
All cases to test are defined in the epic.
Affected Features & Quality Assurance Scope
Technical description
Documentation
TBD
Mandatory Checklist
Code validation
Code style