Skip to content

Commit 1b4d89f

Browse files
refactor: update Black Friday labels (#1076)
1 parent b822d00 commit 1b4d89f

File tree

1 file changed

+39
-11
lines changed

1 file changed

+39
-11
lines changed

includes/admin/class-rop-admin.php

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,6 +1852,12 @@ public function get_survey_metadata() {
18521852
* @return array
18531853
*/
18541854
public function rop_upgrade_to_pro_plugin_action( $actions, $plugin_file ) {
1855+
1856+
$is_black_friday = apply_filters( 'themeisle_sdk_is_black_friday_sale', false );
1857+
if ( $is_black_friday ) {
1858+
return $actions;
1859+
}
1860+
18551861
$global_settings = new \Rop_Global_Settings();
18561862
$actions['settings'] = '<a href="' . admin_url( 'admin.php?page=TweetOldPost' ) . '">' . __( 'Settings', 'tweet-old-post' ) . '</a>';
18571863
if ( $global_settings->license_type() < 1 ) {
@@ -1908,29 +1914,51 @@ public function get_languages() {
19081914
public static function add_black_friday_data( $configs ) {
19091915
$config = $configs['default'];
19101916

1911-
// translators: %1$s - HTML tag, %2$s - discount, %3$s - HTML tag, %4$s - product name.
1912-
$message_template = __( 'Our biggest sale of the year: %1$sup to %2$s OFF%3$s on %4$s. Don\'t miss this limited-time offer.', 'tweet-old-post' );
1913-
$product_label = __( 'Revive Social', 'tweet-old-post' );
1914-
$discount = '50%';
1917+
$message = __( 'Custom schedules, multiple accounts, analytics. Automate your social sharing properly. Exclusively for existing Revive Social users.', 'tweet-old-post' );
1918+
$cta_label = __( 'Get Revive Social Pro', 'tweet-old-post' );
19151919

19161920
$plan = apply_filters( 'product_rop_license_plan', 0 );
19171921
$license = apply_filters( 'product_rop_license_key', false );
1918-
$is_pro = 0 < $plan;
1922+
$status = apply_filters( 'product_rop_license_status', false );
1923+
$is_pro = 'valid' === $status;
1924+
$is_expired = 'expired' === $status || 'active-expired' === $status;
1925+
1926+
$pro_product_slug = defined( 'ROP_PRO_BASEFILE' ) ? basename( dirname( ROP_PRO_BASEFILE ) ) : '';
1927+
1928+
if ( $is_pro || $is_expired ) {
1929+
$config['plugin_meta_targets'] = array( $pro_product_slug );
1930+
}
19191931

19201932
if ( $is_pro ) {
1921-
// translators: %1$s - HTML tag, %2$s - discount, %3$s - HTML tag, %4$s - product name.
1922-
$message_template = __( 'Get %1$sup to %2$s off%3$s when you upgrade your %4$s plan or renew early.', 'tweet-old-post' );
1923-
$product_label = __( 'Revive Social Pro', 'tweet-old-post' );
1924-
$discount = '20%';
1933+
// translators: %s is the discount percentage.
1934+
$config['plugin_meta_message'] = sprintf( __( 'Black Friday Sale - up to %s off', 'tweet-old-post' ), '30%' );
1935+
// translators: %1$s - discount, %2$s - discount.
1936+
$message = sprintf( __( 'Upgrade your Revive Social Pro plan: %1$s off this week. Already on the plan you need? Renew early and save up to %2$s.', 'tweet-old-post' ), '30%', '20%' );
1937+
$cta_label = __( 'See your options', 'tweet-old-post' );
1938+
} elseif ( $is_expired ) {
1939+
// translators: %s is the discount percentage.
1940+
$config['plugin_meta_message'] = sprintf( __( 'Black Friday Sale - %s off', 'tweet-old-post' ), '50%' );
1941+
// translators: %s - discount.
1942+
$config['upgrade_menu_text'] = sprintf( __( 'BF Sale - %s off', 'tweet-old-post' ), '50%' );
1943+
$message = __( 'Your Revive Social Pro features are still here, just locked. Renew at a reduced rate this week.', 'tweet-old-post' );
1944+
$cta_label = __( 'Reactivate now', 'tweet-old-post' );
1945+
} else {
1946+
// translators: %s is the discount percentage.
1947+
$config['plugin_meta_message'] = sprintf( __( 'Black Friday Sale - %s off', 'tweet-old-post' ), '50%' );
1948+
// translators: %s - discount.
1949+
$config['title'] = sprintf( __( 'Revive Social Pro: %s off this week', 'tweet-old-post' ), '60%' );
1950+
// translators: %s - discount.
1951+
$config['upgrade_menu_text'] = sprintf( __( 'BF Sale - %s off', 'tweet-old-post' ), '60%' );
19251952
}
19261953

1927-
$product_label = sprintf( '<strong>%s</strong>', $product_label );
19281954
$url_params = array(
19291955
'utm_term' => $is_pro ? 'plan-' . $plan : 'free',
19301956
'lkey' => ! empty( $license ) ? $license : false,
1957+
'expired' => $is_expired ? '1' : false,
19311958
);
19321959

1933-
$config['message'] = sprintf( $message_template, '<strong>', $discount, '</strong>', $product_label );
1960+
$config['message'] = $message;
1961+
$config['cta_label'] = $cta_label;
19341962
$config['sale_url'] = add_query_arg(
19351963
$url_params,
19361964
tsdk_translate_link( tsdk_utmify( 'https://themeisle.link/rs-bf', 'bfcm', 'revive' ) )

0 commit comments

Comments
 (0)