| @@ -1406,18 +1406,21 @@ | ||
| 1406 | 1406 | } |
| 1407 | 1407 | } |
| 1408 | 1408 | |
| 1409 | 1409 | if ( $plugin_file === plugin_basename( VISUALIZER_BASEFILE ) ) { |
| 1410 | + $is_black_friday = apply_filters( 'themeisle_sdk_is_black_friday_sale', false ); | |
| 1410 | 1411 | // knowledge base link |
| 1411 | 1412 | $plugin_meta[] = sprintf( |
| 1412 | 1413 | '<a href="' . VISUALIZER_MAIN_DOC . '" target="_blank">%s</a>', |
| 1413 | 1414 | esc_html__( 'Docs', 'visualizer' ) |
| 1414 | 1415 | ); |
| 1415 | - // flattr link | |
| 1416 | - $plugin_meta[] = sprintf( | |
| 1417 | - '<a style="color:red" href="' . tsdk_utmify( Visualizer_Plugin::PRO_TEASER_URL, 'pluginrow' ) . '" target="_blank">%s</a>', | |
| 1418 | - esc_html__( 'Get Visualizer Pro', 'visualizer' ) | |
| 1419 | - ); | |
| 1416 | + if ( ! $is_black_friday ) { | |
| 1417 | + // flattr link | |
| 1418 | + $plugin_meta[] = sprintf( | |
| 1419 | + '<a style="color:red" href="' . tsdk_utmify( Visualizer_Plugin::PRO_TEASER_URL, 'pluginrow' ) . '" target="_blank">%s</a>', | |
| 1420 | + esc_html__( 'Get Visualizer Pro', 'visualizer' ) | |
| 1421 | + ); | |
| 1422 | + } | |
| 1420 | 1423 | } |
| 1421 | 1424 | |
| 1422 | 1425 | return $plugin_meta; |
| 1423 | 1426 | } |
| @@ -1597,31 +1600,53 @@ | ||
| 1597 | 1600 | */ |
| 1598 | 1601 | public function add_black_friday_data( $configs ) { |
| 1599 | 1602 | $config = $configs['default']; |
| 1600 | 1603 | |
| 1601 | - // translators: %1$s - HTML tag, %2$s - discount, %3$s - HTML tag, %4$s - product name. | |
| 1602 | - $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.', 'visualizer' ); | |
| 1603 | - $product_label = 'Visualizer'; | |
| 1604 | - $discount = '70%'; | |
| 1604 | + $message = __( 'Database queries, private charts, auto-sync. Go beyond basic charts. Exclusively for existing Visualizer users.', 'visualizer' ); | |
| 1605 | + $cta_label = __( 'Get Visualizer Pro', 'visualizer' ); | |
| 1605 | 1606 | |
| 1606 | 1607 | $plan = apply_filters( 'product_visualizer_license_plan', 0 ); |
| 1607 | 1608 | $license = apply_filters( 'product_visualizer_license_key', false ); |
| 1608 | - $is_pro = 0 < $plan; | |
| 1609 | + $status = apply_filters( 'product_visualizer_license_status', false ); | |
| 1610 | + $pro_product_slug = defined( 'VISUALIZER_PRO_BASEFILE' ) ? basename( dirname( VISUALIZER_PRO_BASEFILE ) ) : ''; | |
| 1609 | 1611 | |
| 1612 | + $is_pro = 'valid' === $status; | |
| 1613 | + $is_expired = 'expired' === $status || 'active-expired' === $status; | |
| 1614 | + | |
| 1610 | 1615 | if ( $is_pro ) { |
| 1611 | - // translators: %1$s - HTML tag, %2$s - discount, %3$s - HTML tag, %4$s - product name. | |
| 1612 | - $message_template = __( 'Get %1$sup to %2$s off%3$s when you upgrade your %4$s plan or renew early.', 'visualizer' ); | |
| 1613 | - $product_label = 'Visualizer Pro'; | |
| 1614 | - $discount = '30%'; | |
| 1616 | + // translators: %s is the discount percentage. | |
| 1617 | + $config['plugin_meta_message'] = sprintf( __( 'Black Friday Sale - up to %s off', 'visualizer' ), '30%' ); | |
| 1618 | + // translators: %1$s - discount, %2$s - discount. | |
| 1619 | + $message = sprintf( __( 'Upgrade your Visualizer Pro plan: %1$s off this week. Already on the plan you need? Renew early and save up to %2$s.', 'visualizer' ), '30%', '20%' ); | |
| 1620 | + $cta_label = __( 'See your options', 'visualizer' ); | |
| 1621 | + } elseif ( $is_expired ) { | |
| 1622 | + // translators: %s is the discount percentage. | |
| 1623 | + $config['upgrade_menu_text'] = sprintf( __( 'BF Sale - %s off', 'visualizer' ), '50%' ); | |
| 1624 | + // translators: %s is the discount percentage. | |
| 1625 | + $config['plugin_meta_message'] = sprintf( __( 'Black Friday Sale - %s off', 'visualizer' ), '50%' ); | |
| 1626 | + $message = __( 'Your Visualizer Pro features are still here, just locked. Renew at a reduced rate this week.', 'visualizer' ); | |
| 1627 | + $cta_label = __( 'Reactivate now', 'visualizer' ); | |
| 1628 | + } else { | |
| 1629 | + // translators: %s is the discount percentage. | |
| 1630 | + $config['plugin_meta_message'] = sprintf( __( 'Black Friday Sale - %s off', 'visualizer' ), '60%' ); | |
| 1631 | + $config['title'] = __( 'Visualizer Pro: 60% off this week', 'visualizer' ); | |
| 1632 | + // translators: %s is the discount percentage. | |
| 1633 | + $config['upgrade_menu_text'] = sprintf( __( 'BF Sale - %s off', 'visualizer' ), '60%' ); | |
| 1615 | 1634 | } |
| 1616 | 1635 | |
| 1617 | - $product_label = sprintf( '<strong>%s</strong>', $product_label ); | |
| 1618 | 1636 | $url_params = array( |
| 1619 | 1637 | 'utm_term' => $is_pro ? 'plan-' . $plan : 'free', |
| 1620 | 1638 | 'lkey' => ! empty( $license ) ? $license : false, |
| 1639 | + 'expired' => $is_expired ? '1' : false, | |
| 1621 | 1640 | ); |
| 1622 | 1641 | |
| 1623 | - $config['message'] = sprintf( $message_template, '<strong>', $discount, '</strong>', $product_label ); | |
| 1642 | + if ( ( $is_pro || $is_expired ) && ! empty( $pro_product_slug ) ) { | |
| 1643 | + $config['plugin_meta_targets'] = array( $pro_product_slug ); | |
| 1644 | + } | |
| 1645 | + | |
| 1646 | + $config['message'] = $message; | |
| 1647 | + $config['cta_label'] = $cta_label; | |
| 1648 | + | |
| 1624 | 1649 | $config['sale_url'] = add_query_arg( |
| 1625 | 1650 | $url_params, |
| 1626 | 1651 | tsdk_translate_link( tsdk_utmify( 'https://themeisle.link/vizualizer-bf', 'bfcm', 'visualizer' ) ) |
| 1627 | 1652 | ); |