Skip to content

Conversation

@Soare-Robert-Daniel
Copy link
Contributor

@Soare-Robert-Daniel Soare-Robert-Daniel commented Sep 25, 2025

All Submissions:

Changes proposed in this Pull Request:

Important

The server changes are available on https://github.com/Codeinwp/optimole-service/pull/1584

  • Start the revert process if the grace period has ended for people who are now in a plan that does not support offloading.
  • Show notice for older free users about the change in Offloading if they have it enabled.
  • Show upgrade message in Offloading modal on plans without Offloading.

Closes https://github.com/Codeinwp/optimole-service/issues/1543

How to test the changes in this Pull Request:

Important

All the backend changes are on https://staging-dashboard.optimole.com/, use this ZIP to connect to it
optimole-test (1).zip to test this PR

  1. If you have a Free account (older or new) without Offloading, you should not be able to activate offloading with the build from this PR (you will see a notice to upgrade your plan)
CleanShot 2025-09-25 at 14 24 25@2x
  1. If you have a Free account with Offloading active and you install the build from this PR, you will see a notice about the plan changes. (So activate Offloading first with an older version before checking).
CleanShot 2025-10-01 at 16 11 12@2x

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@Soare-Robert-Daniel Soare-Robert-Daniel self-assigned this Sep 25, 2025
@Soare-Robert-Daniel Soare-Robert-Daniel marked this pull request as ready for review September 26, 2025 12:23
@pirate-bot
Copy link
Collaborator

pirate-bot commented Sep 26, 2025

Plugin build for ec4956e is ready 🛎️!

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 adds offload restrictions for free users, implementing a grace period system and UI notifications. The changes prevent new free users from accessing image offloading while maintaining existing offloaded images for users who had the feature enabled before the restriction.

  • Added server-side logic to detect when offloading should be reverted based on account status or grace period expiration
  • Implemented UI notices for free users about plan changes and offloading restrictions
  • Added upgrade prompts in the offloading modal for users without offloading permissions

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
inc/main.php Updated PHPDoc type annotation for better type safety
inc/admin.php Added core logic for offload restrictions, user marking, and revert conditions
assets/src/dashboard/store/selectors.js Added selector for free user offload notice display
assets/src/dashboard/store/reducer.js Added state management for free user offload notice
assets/src/dashboard/parts/connected/settings/OffloadMedia.js Updated UI to show notices and handle restricted offloading
assets/src/dashboard/parts/components/Modal.js Extended modal component to support additional content

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

inc/admin.php Outdated
}

$service_data = $this->settings->get( 'service_data' );
if ( isset( $service_data['plan'] ) && 'free' !== $service_data['plan'] ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

here I dont see using the hosting status to mark this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By 'hosting status,' do you mean the 'status' property?

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

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Soare-Robert-Daniel Soare-Robert-Daniel force-pushed the feat/revert-offload-check branch from ae297e3 to ec4956e Compare October 2, 2025 07:48
@Soare-Robert-Daniel
Copy link
Contributor Author

@rodica-andronache, you can test this PR to check the Offloading restriction for old & new free users

@rodica-andronache
Copy link

@Soare-Robert-Daniel the new Offloading restrictions are working well for new/old free users

@Soare-Robert-Daniel Soare-Robert-Daniel merged commit 3bc227f into development Oct 8, 2025
11 checks passed
@Soare-Robert-Daniel Soare-Robert-Daniel deleted the feat/revert-offload-check branch October 8, 2025 07:49
@pirate-bot
Copy link
Collaborator

🎉 This PR is included in version 4.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Indicate that an issue has been resolved and released in a particular version of the product.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants