Skip to content

Commit f2794c7

Browse files
feat: revert offload on plans without offload
1 parent 387be28 commit f2794c7

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

inc/admin.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1070,8 +1070,16 @@ public function daily_sync() {
10701070
if ( isset( $data['extra_visits'] ) ) {
10711071
$this->settings->update_frontend_banner_from_remote( $data['extra_visits'] );
10721072
}
1073+
10731074
// Here the account got deactivated, in this case we check if the user is using offloaded images and we roll them back.
1074-
if ( isset( $data['status'] ) && $data['status'] === 'inactive' ) {
1075+
$should_revert_offloading = isset( $data['status'] ) && $data['status'] === 'inactive';
1076+
1077+
// The user is now on a plan without offloading and the grace period is over.
1078+
if ( isset( $data['should_revert_offload'] ) && $data['should_revert_offload'] === true ) {
1079+
$should_revert_offloading = true;
1080+
}
1081+
1082+
if ( $should_revert_offloading ) {
10751083
// We check if the user has images offloaded.
10761084
if ( $this->settings->get( 'offload_media' ) === 'disabled' ) {
10771085
return;

0 commit comments

Comments
 (0)