Skip to content

Commit 7ed2e10

Browse files
chore: review
1 parent 76db860 commit 7ed2e10

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

assets/src/dashboard/parts/connected/settings/OffloadMedia.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ const OffloadMedia = ({ settings, canSave, setSettings, setCanSave }) => {
195195
if ( canUseMediaOffloadingFlag ) {
196196
onOffloadMedia();
197197
} else {
198-
window.open( optimoleDashboardApp.optimoleHome + 'pricing', '_blank' );
198+
window.open( optimoleDashboardApp?.offload_upgrade_url, '_blank' );
199199
}
200200
setModal( null );
201201
},

inc/admin.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,7 @@ public function daily_sync() {
10761076
$should_revert_offloading = isset( $data['status'] ) && $data['status'] === 'inactive';
10771077

10781078
// The user is now on a plan without offloading and the grace period is over.
1079-
if ( isset( $data['should_revert_offload'] ) && $data['should_revert_offload'] === true ) {
1079+
if ( isset( $data['should_revert_offload'] ) && (bool) $data['should_revert_offload'] ) {
10801080
$should_revert_offloading = true;
10811081
}
10821082

@@ -1377,6 +1377,7 @@ private function localize_dashboard_app() {
13771377
'optimoleHome' => tsdk_translate_link( 'https://optimole.com/' ),
13781378
'optimoleDashHome' => tsdk_translate_link( 'https://dashboard.optimole.com/', 'query' ),
13791379
'optimoleDashBilling' => tsdk_translate_link( 'https://dashboard.optimole.com/settings/billing', 'query' ),
1380+
'offload_upgrade_url' => tsdk_translate_link( tsdk_utmify( 'https://optimole.com/pricing/', 'offload' ) ),
13801381
'days_since_install' => round( ( time() - get_option( 'optimole_wp_install', 0 ) ) / DAY_IN_SECONDS ),
13811382
'is_offload_media_available' => $is_offload_media_available,
13821383
'auto_connect' => $auto_connect,
@@ -2360,11 +2361,6 @@ public function mark_free_user_with_offload() {
23602361
return;
23612362
}
23622363

2363-
$service_data = $this->settings->get( 'service_data' );
2364-
if ( isset( $service_data['plan'] ) && 'free' !== $service_data['plan'] ) {
2365-
return;
2366-
}
2367-
23682364
if ( false !== get_option( 'optml_free_user_with_offload', false ) ) {
23692365
return;
23702366
}

0 commit comments

Comments
 (0)