-
Notifications
You must be signed in to change notification settings - Fork 12
feat: add offload restrictions #968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
cb007f7 to
bc58c04
Compare
There was a problem hiding this 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'] ) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
e848295 to
7ed2e10
Compare
There was a problem hiding this 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.
ae297e3 to
ec4956e
Compare
|
@rodica-andronache, you can test this PR to check the Offloading restriction for old & new free users |
|
@Soare-Robert-Daniel the new Offloading restrictions are working well for new/old free users |
|
🎉 This PR is included in version 4.1.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
Important
The server changes are available on https://github.com/Codeinwp/optimole-service/pull/1584
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
Other information: