Skip to content

Closes #8084 Free Rocket Insights#8089

Open
remyperona wants to merge 16 commits intodevelopfrom
enhancement/8084-free-rocket-insights
Open

Closes #8084 Free Rocket Insights#8089
remyperona wants to merge 16 commits intodevelopfrom
enhancement/8084-free-rocket-insights

Conversation

@remyperona
Copy link
Contributor

@remyperona remyperona commented Feb 24, 2026

Description

Fixes #8084

Type of change

  • Enhancement (non-breaking change which improves an existing functionality).

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

  • Rocket Insights

Technical description

Documentation

TBD

Mandatory Checklist

Code validation

  • I validated all the Acceptance Criteria. If possible, provide screenshots or videos.
  • I triggered all changed lines of code at least once without new errors/warnings/notices.
  • I implemented built-in tests to cover the new/changed code.

Code style

  • I wrote a self-explanatory code about what it does.
  • I protected entry points against unexpected inputs.
  • I did not introduce unnecessary complexity.
  • Output messages (errors, notices, logs) are explicit enough for users to understand the issue and are actionnable.

@remyperona remyperona self-assigned this Feb 24, 2026
@codacy-production
Copy link

codacy-production bot commented Feb 24, 2026

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 6f8a7051 66.67% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (6f8a705) Report Missing Report Missing Report Missing
Head commit (da7a989) 42365 19171 45.25%

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 (#8089) 18 12 66.67%

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%

See your quality gate settings    Change summary preferences

Footnotes

  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.

@remyperona remyperona requested review from a team and Copilot February 26, 2026 16:07
@remyperona remyperona marked this pull request as ready for review February 26, 2026 16:07
Copy link
Contributor

Copilot AI left a 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 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_blurred plus CSS/tooltip branches that will never run (the variable is always false). 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;

@hanna-meda
Copy link
Contributor

Thank you, @remyperona, for this PR.

[WIP] Please find the exploratory notes below:

  • Page limit for non-premium users is still 3 URLs. Expected: Should be a limit of 10 URLs for everyone.
  • We should reduce the free space on the dashboard now that we're without RI subscription section (to be confirmed by PO here)
Screenshot 2026-02-27 at 08 16 54

* @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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we rename the function as we are only checking if this is a live site ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@remyperona
Copy link
Contributor Author

Dashboard layout is updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Free Rocket Insights

4 participants