| @@ -222,9 +222,9 @@ | ||
| 222 | 222 | |
| 223 | 223 | if ( $meta ) { |
| 224 | 224 | foreach ( $meta as $key => $value ) { |
| 225 | 225 | if ( 0 === strpos( $key, 'visualizer' ) ) { |
| 226 | - add_metadata( 'post', $revision_id, $key, self::maybe_decode_content( $value[0] ) ); | |
| 226 | + add_metadata( 'post', $revision_id, $key, maybe_unserialize( $value[0] ) ); | |
| 227 | 227 | } |
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | 230 | } |
| @@ -250,9 +250,9 @@ | ||
| 250 | 250 | |
| 251 | 251 | if ( $meta ) { |
| 252 | 252 | foreach ( $meta as $key => $value ) { |
| 253 | 253 | if ( 0 === strpos( $key, 'visualizer' ) ) { |
| 254 | - add_post_meta( $post_id, $key, self::maybe_decode_content( $value[0] ) ); | |
| 254 | + add_post_meta( $post_id, $key, maybe_unserialize( $value[0] ) ); | |
| 255 | 255 | } |
| 256 | 256 | } |
| 257 | 257 | } |
| 258 | 258 | } |
| @@ -436,9 +436,9 @@ | ||
| 436 | 436 | 'library' => array( |
| 437 | 437 | 'filters' => $chart_types, |
| 438 | 438 | 'types' => array_keys( $chart_types ), |
| 439 | 439 | ), |
| 440 | - 'nonce' => wp_create_nonce( Visualizer_Plugin::ACTION_GET_CHARTS ), | |
| 440 | + 'nonce' => wp_create_nonce(), | |
| 441 | 441 | 'buildurl' => esc_url( add_query_arg( 'action', Visualizer_Plugin::ACTION_CREATE_CHART, admin_url( 'admin-ajax.php' ) ) ), |
| 442 | 442 | ); |
| 443 | 443 | |
| 444 | 444 | return $strings; |
| @@ -1406,21 +1406,18 @@ | ||
| 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 ); | |
| 1411 | 1410 | // knowledge base link |
| 1412 | 1411 | $plugin_meta[] = sprintf( |
| 1413 | 1412 | '<a href="' . VISUALIZER_MAIN_DOC . '" target="_blank">%s</a>', |
| 1414 | 1413 | esc_html__( 'Docs', 'visualizer' ) |
| 1415 | 1414 | ); |
| 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 | - } | |
| 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 | + ); | |
| 1423 | 1420 | } |
| 1424 | 1421 | |
| 1425 | 1422 | return $plugin_meta; |
| 1426 | 1423 | } |
| @@ -1600,53 +1597,31 @@ | ||
| 1600 | 1597 | */ |
| 1601 | 1598 | public function add_black_friday_data( $configs ) { |
| 1602 | 1599 | $config = $configs['default']; |
| 1603 | 1600 | |
| 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' ); | |
| 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%'; | |
| 1606 | 1605 | |
| 1607 | 1606 | $plan = apply_filters( 'product_visualizer_license_plan', 0 ); |
| 1608 | 1607 | $license = apply_filters( 'product_visualizer_license_key', false ); |
| 1609 | - $status = apply_filters( 'product_visualizer_license_status', false ); | |
| 1610 | - $pro_product_slug = defined( 'VISUALIZER_PRO_BASEFILE' ) ? basename( dirname( VISUALIZER_PRO_BASEFILE ) ) : ''; | |
| 1608 | + $is_pro = 0 < $plan; | |
| 1611 | 1609 | |
| 1612 | - $is_pro = 'valid' === $status; | |
| 1613 | - $is_expired = 'expired' === $status || 'active-expired' === $status; | |
| 1614 | - | |
| 1615 | 1610 | if ( $is_pro ) { |
| 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%' ); | |
| 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%'; | |
| 1634 | 1615 | } |
| 1635 | 1616 | |
| 1617 | + $product_label = sprintf( '<strong>%s</strong>', $product_label ); | |
| 1636 | 1618 | $url_params = array( |
| 1637 | 1619 | 'utm_term' => $is_pro ? 'plan-' . $plan : 'free', |
| 1638 | 1620 | 'lkey' => ! empty( $license ) ? $license : false, |
| 1639 | - 'expired' => $is_expired ? '1' : false, | |
| 1640 | 1621 | ); |
| 1641 | 1622 | |
| 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 | - | |
| 1623 | + $config['message'] = sprintf( $message_template, '<strong>', $discount, '</strong>', $product_label ); | |
| 1649 | 1624 | $config['sale_url'] = add_query_arg( |
| 1650 | 1625 | $url_params, |
| 1651 | 1626 | tsdk_translate_link( tsdk_utmify( 'https://themeisle.link/vizualizer-bf', 'bfcm', 'visualizer' ) ) |
| 1652 | 1627 | ); |