Skip to content

Commit ec4956e

Browse files
chore: review
1 parent f142cf5 commit ec4956e

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

inc/admin.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function __construct() {
113113
}
114114

115115
add_filter( 'themeisle-sdk/survey/' . OPTML_PRODUCT_SLUG, [ $this, 'get_survey_metadata' ], 10, 2 );
116-
add_action( 'admin_init', [ $this, 'mark_free_user_with_offload' ] );
116+
add_action( 'admin_init', [ $this, 'mark_user_with_offload' ] );
117117
}
118118

119119
/**
@@ -1399,7 +1399,7 @@ private function localize_dashboard_app() {
13991399
'bf_notices' => $this->get_bf_notices(),
14001400
'spc_banner' => $this->get_spc_banner(),
14011401
'show_exceed_plan_quota_notice' => $this->should_show_exceed_quota_warning(),
1402-
'show_free_user_with_offload_notice' => get_option( 'optml_free_user_with_offload', 'no' ),
1402+
'show_free_user_with_offload_notice' => get_option( 'optml_has_offloading_enabled_on_upgrade', 'no' ),
14031403
'report_issue_url' => add_query_arg(
14041404
[
14051405
'utm_source' => 'plugin',
@@ -1637,7 +1637,7 @@ private function get_dashboard_strings() {
16371637
' <a href="' . esc_url( tsdk_translate_link( 'https://dashboard.optimole.com/register', 'query' ) ) . '" target="_blank">optimole.com</a>'
16381638
),
16391639
'account_needed_subtitle_1' => sprintf(
1640-
/* translators: 1 is starting bold tag, 2 is ending bold tag, 3 is the starting bold tag, 4 is the limit number, 5 is ending bold tag, 6 is the starting anchor tag for the docs link on how we count visits, 7 is the ending anchor tag. */
1640+
/* translators: 1 is the starting bold tag, 2 is the ending bold tag, 3 is the starting bold tag, 4 is the limit number, 5 is ending bold tag, 6 is the starting anchor tag for the docs link on how we count visits, 7 is the ending anchor tag. */
16411641
__( '%1$sOptimize unlimited images%2$s for up to %3$s monthly %4$svisitors%5$s - completely FREE.', 'optimole-wp' ),
16421642
'<strong>',
16431643
'</strong>',
@@ -2097,7 +2097,7 @@ private function get_dashboard_strings() {
20972097
'exceed_plan_quota_notice_start_action' => __( 'Yes, Transfer to Optimole Cloud', 'optimole-wp' ),
20982098
'exceed_plan_quota_notice_secondary_action' => __( 'No, keep images on my website', 'optimole-wp' ),
20992099
'plan_update_notice_title' => __( 'Plan Update', 'optimole-wp' ),
2100-
'plan_update_notice_desc' => __( 'We\'ve changed how plans work. Users on Optimole Free plan can not offload new image. Existing images that are already offloaded will remain offloaded.', 'optimole-wp' ),
2100+
'plan_update_notice_desc' => __( 'We\'ve changed how plans work. Users on the Optimole Free plan cannot offload new images. Existing images that are already offloaded will remain offloaded.', 'optimole-wp' ),
21012101
'upgrade_to_use_offloading_notice_desc' => __( 'Offloading images is a PRO feature. Please upgrade your plan to enable image transfer to Optimole Cloud.', 'optimole-wp' ),
21022102
'visual_settings' => __( 'Visual Settings', 'optimole-wp' ),
21032103
'extended_features' => __( 'Extended Features', 'optimole-wp' ),
@@ -2392,21 +2392,21 @@ private function get_active_notices_count() {
23922392
}
23932393

23942394
/**
2395-
* Mark the users that are on free plan and have offload enabled.
2395+
* Mark if the user had offloading enabled on first run.
23962396
*
2397-
* Used for displaying a notice after plugin update about offload restrictions.
2397+
* If it is an old free user that had offloading enabled, we will use the mark to show a notice about the plan changes.
23982398
*
23992399
* @return void
24002400
*/
2401-
public function mark_free_user_with_offload() {
2401+
public function mark_user_with_offload() {
24022402
if ( ! $this->settings->is_connected() ) {
24032403
return;
24042404
}
24052405

2406-
if ( false !== get_option( 'optml_free_user_with_offload', false ) ) {
2406+
if ( false !== get_option( 'optml_has_offloading_enabled_on_upgrade', false ) ) {
24072407
return;
24082408
}
24092409

2410-
update_option( 'optml_free_user_with_offload', $this->settings->is_offload_enabled() ? 'yes' : 'no' );
2410+
update_option( 'optml_has_offloading_enabled_on_upgrade', $this->settings->is_offload_enabled() ? 'yes' : 'no' );
24112411
}
24122412
}

0 commit comments

Comments
 (0)