Skip to content

Conversation

@CrochetFeve0251
Copy link
Contributor

@CrochetFeve0251 CrochetFeve0251 commented Sep 29, 2025

Description

This PR adds support for distinguishing between canceled and active subscriptions for Rocket Insights (Performance Monitoring Addon). When a subscription is canceled but still active until the end of the billing period, the interface will now show "Expires at" instead of "Next Billing Date" to avoid confusion for users.

Type of change

  • Bug fix (non-breaking change which fixes an issue).

Detailed scenario

What was tested

  • Tested with an account that has an active Rocket Insights subscription
  • Tested with an account that has a canceled Rocket Insights subscription that is still valid until the end of the billing period

How to test

  1. Create a test account with an active Rocket Insights subscription
    • Verify that the label shows "Next Billing Date" with the appropriate date
  2. Create a test account with a canceled Rocket Insights subscription
    • Verify that the label shows "Expires at" with the appropriate date
  3. Verify the display is consistent in the dashboard addon status section

Technical description

Documentation

This PR utilizes the cancelled_at field from the Performance Monitoring Addon (PMA) data to display appropriate labels in the dashboard. The conditional logic checks if the subscription has been canceled:

$label = $cancelled_at ? __( 'Expires at', 'rocket' ) : __( 'Next Billing Date', 'rocket' );

This change:

  1. When cancelled_at is populated (subscription is canceled): Display "Expires at"
  2. When cancelled_at is not set (subscription is active): Display "Next Billing Date"

This provides clearer information to users about the status of their subscription.
image

New dependencies

No new dependencies were added for this change.

Risks

No performance or security risks identified. This change only affects the display of text labels based on existing data.

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.

Unticked items justification

All mandatory items are relevant and have been checked.

Additional Checks

  • In the case of complex code, I wrote comments to explain it.
  • When possible, I prepared ways to observe the implemented system (logs, data, etc.).
  • I added error handling logic when using functions that could throw errors (HTTP/API request, filesystem, etc.)

wordpressfan and others added 30 commits August 7, 2025 12:11
# Conflicts:
#	wp-rocket.php
…o add a new page to be monitored (PR #7577)

Co-authored-by: WordPressFan <[email protected]>
…ore in the WP Rocket dashboard (PR #7631)

Co-authored-by: WordPressFan <[email protected]>
Co-authored-by: mostafa-hisham <[email protected]>
Co-authored-by: WordPress Fan <[email protected]>
Co-authored-by: Gaël Robin <[email protected]>
# Conflicts:
#	assets/css/wpr-admin.min.css
#	inc/Engine/Admin/PerformanceMonitoring/Controller.php
#	inc/Engine/Admin/PerformanceMonitoring/Render.php
#	inc/Engine/Admin/PerformanceMonitoring/Subscriber.php
Co-authored-by: WordPressFan <[email protected]>
Co-authored-by: Gaël Robin <[email protected]>
Co-authored-by: COQUARD Cyrille <[email protected]>
Co-authored-by: WordPressFan <[email protected]>
# Conflicts:
#	inc/Engine/Admin/PerformanceMonitoring/Subscriber.php
#	views/settings/partials/performance-monitoring/global-score-widget.php
wordpressfan and others added 24 commits September 24, 2025 12:26
…s-reseller

# Conflicts:
#	inc/Engine/Admin/PerformanceMonitoring/Subscriber.php
#	tests/Unit/inc/Engine/Admin/PerformanceMonitoring/Subscriber/renderPerformanceUrlsTable.php
…redit in certain scenario (#7704)

Co-authored-by: WordPress Fan <[email protected]>
…ding depending on Performance Monitoring status (#7679)

Co-authored-by: WordPressFan <[email protected]>
- Added 'remaining_urls' and 'can_add_pages' fields to the JSON error response when the maximum number of URLs is reached.
- Updated the AJAX error handling in the JavaScript to clear the input field, disable URL addition elements, and show a quota banner when the URL limit is reached.
# Conflicts:
#	assets/js/wpr-admin.js
#	assets/js/wpr-admin.min.js
#	assets/js/wpr-admin.min.js.map
Co-authored-by: mostafa-hisham <[email protected]>
Co-authored-by: WordPressFan <[email protected]>
Co-authored-by: WordPress Fan <[email protected]>
Co-authored-by: Michael Lee <[email protected]>
@codacy-production
Copy link

codacy-production bot commented Sep 29, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 0e978c81 50.73% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (0e978c8) Report Missing Report Missing Report Missing
Head commit (2947f74) 41295 18384 44.52%

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 (#7736) 1376 698 50.73%

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.

@CrochetFeve0251 CrochetFeve0251 changed the base branch from develop to feature/3.20 September 29, 2025 11:51
@CrochetFeve0251 CrochetFeve0251 self-assigned this Sep 29, 2025
@CrochetFeve0251 CrochetFeve0251 requested a review from a team September 29, 2025 11:52
Base automatically changed from feature/3.20 to develop October 6, 2025 10:48
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.

8 participants