diff --git a/.github/workflows/test-php.yml b/.github/workflows/test-php.yml index b8d9a5f1..6d1e6e9a 100755 --- a/.github/workflows/test-php.yml +++ b/.github/workflows/test-php.yml @@ -5,7 +5,7 @@ concurrency: on: push: branches-ignore: - - 'master' + - "master" jobs: phplint: @@ -15,7 +15,7 @@ jobs: - name: Setup PHP version uses: shivammathur/setup-php@v2 with: - php-version: '7.4' + php-version: "7.4" extensions: simplexml - name: Checkout source code uses: actions/checkout@v2 @@ -38,7 +38,7 @@ jobs: phpunit: name: PHPUnit - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 services: mysql: image: mysql:5.7 @@ -51,7 +51,7 @@ jobs: - name: Setup PHP version uses: shivammathur/setup-php@v2 with: - php-version: '7.4' + php-version: "7.4" extensions: simplexml, mysql tools: phpunit-polyfills - name: Checkout source code diff --git a/feedzy-rss-feed.php b/feedzy-rss-feed.php index 581f86b0..28980128 100644 --- a/feedzy-rss-feed.php +++ b/feedzy-rss-feed.php @@ -161,7 +161,7 @@ function() { 'location' => 'feedzy-admin-menu', 'has_upgrade_menu' => ! feedzy_is_pro(), 'upgrade_text' => esc_html__( 'Upgrade to Pro', 'feedzy-rss-feeds' ), - 'upgrade_link' => tsdk_utmify( FEEDZY_UPSELL_LINK, 'aboutUsPage' ), + 'upgrade_link' => tsdk_translate_link( tsdk_utmify( FEEDZY_UPSELL_LINK, 'aboutUsPage' ), 'query' ), ); } ); @@ -217,8 +217,8 @@ function feedzy_themeisle_log_event( $name, $msg, $type, $file, $line ) { 'primary_color' => '#4268CF', 'pages' => array( 'feedzy_imports', 'edit-feedzy_imports', 'edit-feedzy_categories', 'feedzy_page_feedzy-settings', 'feedzy_page_feedzy-support' ), 'has_upgrade_menu' => ! feedzy_is_pro(), - 'upgrade_link' => tsdk_utmify( FEEDZY_UPSELL_LINK, 'floatWidget' ), - 'documentation_link' => tsdk_utmify( 'https://docs.themeisle.com/collection/1569-feedzy-rss-feeds', 'floatWidget' ), + 'upgrade_link' => tsdk_translate_link( tsdk_utmify( FEEDZY_UPSELL_LINK, 'floatWidget' ), 'query' ), + 'documentation_link' => tsdk_translate_link( tsdk_utmify( 'https://docs.themeisle.com/collection/1569-feedzy-rss-feeds', 'floatWidget' ), 'query' ), 'wizard_link' => ! feedzy_is_pro() && ! empty( get_option( 'feedzy_fresh_install', false ) ) ? admin_url( 'admin.php?page=feedzy-setup-wizard&tab#step-1' ) : '', ); } diff --git a/form/form.php b/form/form.php index a705d3f5..3bc83620 100644 --- a/form/form.php +++ b/form/form.php @@ -32,17 +32,16 @@ $output .= '
'; $output .= '
' . $section['title'] . '
'; if ( ! feedzy_is_pro() && 'section_feed' === $item ) { - $upsell_url = add_query_arg( - array( - 'utm_source' => 'wpadmin', - 'utm_medium' => 'classiceditorshortcode', - 'utm_campaign' => 'amazonproductadvertising', - 'utm_content' => 'feedzy-rss-feeds', - ), - FEEDZY_UPSELL_LINK - ); + $upsell_url = tsdk_translate_link( tsdk_utmify( FEEDZY_UPSELL_LINK, 'amazonproductadvertising', 'classiceditorshortcode' ), 'query' ); + $output .= '
'; - $output .= wp_sprintf( __( 'NEW! Enable Amazon Product Advertising feeds to generate affiliate revenue by upgrading to Feedzy Pro.', 'feedzy-rss-feeds' ), esc_url_raw( $upsell_url ) ); + $output .= '' . __( 'NEW!', 'feedzy-rss-feeds' ) . ''; + $output .= wp_sprintf( + // translators: %1$s: opening anchor tag, %2$s: closing anchor tag + __( 'Enable Amazon Product Advertising feeds to generate affiliate revenue by %1$s upgrading to Feedzy Pro. %2$s', 'feedzy-rss-feeds' ), + '', + '' + ); $output .= '
'; } if ( isset( $section['description'] ) ) { diff --git a/includes/abstract/feedzy-rss-feeds-admin-abstract.php b/includes/abstract/feedzy-rss-feeds-admin-abstract.php index e3e0d7a9..352f9663 100644 --- a/includes/abstract/feedzy-rss-feeds-admin-abstract.php +++ b/includes/abstract/feedzy-rss-feeds-admin-abstract.php @@ -208,9 +208,13 @@ public function feedzy_default_error_notice( $errors, $feed, $feed_url ) { $final_msg = ''; if ( $show_error ) { - $final_msg = '

' . sprintf( __( 'Sorry, some part of this feed is currently unavailable or does not exist anymore. The detailed error is %s', 'feedzy-rss-feeds' ), '

' . wp_strip_all_tags( $error_msg ) . '

' ); + $final_msg = '

' . sprintf( + // translators: %s: Detailed error message. + __( 'Sorry, some part of this feed is currently unavailable or does not exist anymore. The detailed error is %s', 'feedzy-rss-feeds' ), + '

' . wp_strip_all_tags( $error_msg ) . '

' + ); if ( ! is_admin() ) { - $final_msg .= sprintf( __( '%1$s(Only you are seeing this detailed error because you are the creator of this post. Other users will see the error message as below.)%2$s', 'feedzy-rss-feeds' ), '', '' ); + $final_msg .= '(' . __( 'Only you are seeing this detailed error because you are the creator of this post. Other users will see the error message as below.', 'feedzy-rss-feeds' ) . ')'; } $final_msg .= '

'; } else { @@ -989,7 +993,13 @@ protected function get_valid_source_urls( $feed_url, $cache, $echo = true ) { $valid_feed_url[] = $url; } else { if ( $echo ) { - echo wp_kses_post( sprintf( __( 'Feed URL: %s not valid and removed from fetch.', 'feedzy-rss-feeds' ), '' . esc_url( $url ) . '' ) ); + echo wp_kses_post( + sprintf( + // translators: %s: Feed URL. + __( 'Feed URL: %s not valid and removed from fetch.', 'feedzy-rss-feeds' ), + '' . esc_url( $url ) . '' + ) + ); } } } @@ -1005,7 +1015,13 @@ protected function get_valid_source_urls( $feed_url, $cache, $echo = true ) { $valid_feed_url[] = $feed_url; } else { if ( $echo ) { - echo wp_kses_post( sprintf( __( 'Feed URL: %s not valid and removed from fetch.', 'feedzy-rss-feeds' ), '' . esc_url( $feed_url ) . '' ) ); + echo wp_kses_post( + sprintf( + // translators: %s: Feed URL. + __( 'Feed URL: %s not valid and removed from fetch.', 'feedzy-rss-feeds' ), + '' . esc_url( $feed_url ) . '' + ) + ); } } } @@ -1245,7 +1261,11 @@ private function get_dry_run_results( $sc, $item ) { if ( ! empty( $item['full_content_error'] ) ) { $statuses[] = array( 'success' => false, - 'msg' => sprintf( __( 'Full content: %s', 'feedzy-rss-feeds' ), $item['full_content_error'] ), + 'msg' => sprintf( + // translators: %s: Error message for full content extraction. + __( 'Full content: %s', 'feedzy-rss-feeds' ), + $item['full_content_error'] + ), ); } elseif ( isset( $item['item_full_content'] ) ) { if ( ! empty( $item['item_full_content'] ) ) { diff --git a/includes/admin/feedzy-rss-feeds-admin.php b/includes/admin/feedzy-rss-feeds-admin.php index 1eb68339..0066a6f5 100644 --- a/includes/admin/feedzy-rss-feeds-admin.php +++ b/includes/admin/feedzy-rss-feeds-admin.php @@ -369,7 +369,7 @@ public function render_upsell_rn() {
  • - Translate content
  • - Elementor Templates support
  • '; - echo 'View more details'; + echo 'View more details'; } @@ -389,10 +389,17 @@ public function feedzy_category_feed() { $output = ' - ' . sprintf( __( 'Please be aware that multiple feeds, when mashed together, may sometimes not work as expected as explained %1$shere%2$s.', 'feedzy-rss-feeds' ), '', '' ) . '

    ' + ' . + sprintf( + // translators: %1$s and %2$s are placeholders for HTML anchor tags. + __( 'Please be aware that multiple feeds, when mashed together, may sometimes not work as expected as explained %1$s here %2$s.', 'feedzy-rss-feeds' ), + '', + '' + ) + . '

    ' . $invalid . ' -

    ' . __( 'Learn how to organize feeds in Categories', 'feedzy-rss-feeds' ) . '

    +

    ' . __( 'Learn how to organize feeds in Categories', 'feedzy-rss-feeds' ) . '

    '; echo wp_kses( $output, apply_filters( 'feedzy_wp_kses_allowed_html', array() ) ); } @@ -540,9 +547,9 @@ public function feedzy_filter_plugin_row_meta( $links, $file ) { $new_links['doc'] = '' . __( 'Documentation and examples', 'feedzy-rss-feeds' ) . ''; if ( ! feedzy_is_pro() ) { - $new_links['more_features'] = '' . __( 'Upgrade to Pro', 'feedzy-rss-feeds' ) . ''; + $new_links['more_features'] = '' . __( 'Upgrade to Pro', 'feedzy-rss-feeds' ) . ''; } elseif ( false === apply_filters( 'feedzy_is_license_of_type', false, 'agency' ) ) { - $new_links['more_features'] = '' . __( 'Upgrade your license', 'feedzy-rss-feeds' ) . ''; + $new_links['more_features'] = '' . __( 'Upgrade your license', 'feedzy-rss-feeds' ) . ''; } $links = array_merge( $links, $new_links ); } diff --git a/includes/admin/feedzy-rss-feeds-import.php b/includes/admin/feedzy-rss-feeds-import.php index a434e45b..135a0841 100644 --- a/includes/admin/feedzy-rss-feeds-import.php +++ b/includes/admin/feedzy-rss-feeds-import.php @@ -102,7 +102,7 @@ public function upsell_content( $content, $area, $location ) {
    ' . __( 'This feature is available in the Pro version. Unlock more features, by', 'feedzy-rss-feeds' ) . ' - ' . __( 'upgrading to Feedzy Pro', 'feedzy-rss-feeds' ) . ' + ' . __( 'upgrading to Feedzy Pro', 'feedzy-rss-feeds' ) . '
    '; @@ -708,7 +708,12 @@ public function manage_feedzy_import_columns( $column, $post_id ) { $then = new DateTime(); $then = $then->setTimestamp( $last ); $in = $now->diff( $then ); - $msg = sprintf( __( 'Ran %1$d hours %2$d minutes ago', 'feedzy-rss-feeds' ), $in->format( '%h' ), $in->format( '%i' ) ); + $msg = sprintf( + // translators: %1$d: number of hours, %2$d: number of minutes + __( 'Ran %1$d hours %2$d minutes ago', 'feedzy-rss-feeds' ), + $in->format( '%h' ), + $in->format( '%i' ) + ); } $msg .= $this->get_last_run_details( $post_id ); @@ -726,7 +731,14 @@ public function manage_feedzy_import_columns( $column, $post_id ) { $then = new DateTime(); $then = $then->setTimestamp( $next ); $in = $now->diff( $then ); - echo wp_kses_post( sprintf( __( 'In %1$d hours %2$d minutes', 'feedzy-rss-feeds' ), $in->format( '%h' ), $in->format( '%i' ) ) ); + echo wp_kses_post( + sprintf( + // translators: %1$d: number of hours, %2$d: number of minutes + __( 'In %1$d hours %2$d minutes', 'feedzy-rss-feeds' ), + $in->format( '%h' ), + $in->format( '%i' ) + ) + ); } break; default: @@ -1134,15 +1146,45 @@ private function dry_run() { 'feedzy_default_error', function ( $errors, $feed, $url ) { $errors .= - sprintf( __( 'For %1$ssingle feeds%2$s, this could be because of the following reasons:', 'feedzy-rss-feeds' ), '', '' ) + sprintf( + // translators: %1$s and %2$s are opening and closing bold tags respectively. + __( 'For %1$ssingle feeds%2$s, this could be because of the following reasons:', 'feedzy-rss-feeds' ), + '', '' + ) . '
      ' - . '
    1. ' . sprintf( __( '%1$sSource invalid%2$s: Check that your source is valid by clicking the validate button adjacent to the source box.', 'feedzy-rss-feeds' ), '', '' ) . '
    2. ' - . '
    3. ' . sprintf( __( '%1$sSource unavailable%2$s: Copy the source and paste it on the browser to check that it is available. It could be an intermittent issue.', 'feedzy-rss-feeds' ), '', '' ) . '
    4. ' - . '
    5. ' . sprintf( __( '%1$sSource inaccessible from server%2$s: Check that your source is accessible from the server (not the browser). It could be an intermittent issue.', 'feedzy-rss-feeds' ), '', '' ) . '
    6. ' + . '
    7. ' + . sprintf( + // translators: %1$s and %2$s are opening and closing bold tags respectively. + __( '%1$sSource invalid%2$s: Check that your source is valid by clicking the validate button adjacent to the source box.', 'feedzy-rss-feeds' ), + '', '' + ) + . '
    8. ' + . '
    9. ' + . sprintf( + // translators: %1$s and %2$s are opening and closing bold tags respectively. + __( '%1$sSource unavailable%2$s: Copy the source and paste it on the browser to check that it is available. It could be an intermittent issue.', 'feedzy-rss-feeds' ), '', '' + ) + . '
    10. ' + . '
    11. ' + . sprintf( + // translators: %1$s and %2$s are opening and closing bold tags respectively. + __( '%1$sSource inaccessible from server%2$s: Check that your source is accessible from the server (not the browser). It could be an intermittent issue.', 'feedzy-rss-feeds' ), '', '' + ) + . '
    12. ' . '
    ' - . sprintf( __( 'For %1$smultiple feeds%2$s (comma-separated or in a Feedzy Category), this could be because of the following reasons:', 'feedzy-rss-feeds' ), '', '' ) + . sprintf( + // translators: %1$s and %2$s are opening and closing bold tags respectively. + __( 'For %1$smultiple feeds%2$s (comma-separated or in a Feedzy Category), this could be because of the following reasons:', 'feedzy-rss-feeds' ), + '', '' + ) . '
      ' - . '
    1. ' . sprintf( __( '%1$sSource invalid%2$s: One or more feeds may be misbehaving. Check each feed individually as mentioned above to weed out the problematic feed.', 'feedzy-rss-feeds' ), '', '' ) . '
    2. ' + . '
    3. ' + . sprintf( + // translators: %1$s and %2$s are opening and closing bold tags respectively. + __( '%1$sSource invalid%2$s: One or more feeds may be misbehaving. Check each feed individually as mentioned above to weed out the problematic feed.', 'feedzy-rss-feeds' ), + '', '' + ) + . '
    4. ' . '
    '; return $errors; @@ -1574,7 +1616,11 @@ function ( $attr, $key ) { if ( empty( $full_content_error ) ) { $full_content_error = __( 'Unknown', 'feedzy-rss-feeds' ); } - $import_errors[] = sprintf( __( 'Full content is empty. Error: %s', 'feedzy-rss-feeds' ), $full_content_error ); + $import_errors[] = sprintf( + // translators: %s: Error message for empty full content. + __( 'Full content is empty. Error: %s', 'feedzy-rss-feeds' ), + $full_content_error + ); } $post_content = str_replace( @@ -1923,7 +1969,12 @@ function( $term ) { update_post_meta( $job->ID, 'imported_items_count', $count ); if ( $import_image_errors > 0 ) { - $import_errors[] = sprintf( __( 'Unable to find an image for %1$d out of %2$d items imported', 'feedzy-rss-feeds' ), $import_image_errors, $count ); + $import_errors[] = sprintf( + // translators: %1$d is the number of items without images, %2$d is the total number of items imported. + __( 'Unable to find an image for %1$d out of %2$d items imported', 'feedzy-rss-feeds' ), + $import_image_errors, + $count + ); } update_post_meta( $job->ID, 'import_errors', $import_errors ); diff --git a/includes/admin/feedzy-rss-feeds-ui-lang.php b/includes/admin/feedzy-rss-feeds-ui-lang.php index b2c097de..b1bbd7f2 100644 --- a/includes/admin/feedzy-rss-feeds-ui-lang.php +++ b/includes/admin/feedzy-rss-feeds-ui-lang.php @@ -48,7 +48,7 @@ class Feedzy_Rss_Feeds_Ui_Lang { public function __construct() { $this->strings = array( 'popup_url' => wp_nonce_url( 'admin-ajax.php', 'feedzy_ajax_token', 'feedzy_request_form_token' ), - 'pro_url' => tsdk_utmify( FEEDZY_UPSELL_LINK, 'shortcode' ), + 'pro_url' => tsdk_translate_link( tsdk_utmify( FEEDZY_UPSELL_LINK, 'shortcode' ), 'query' ), 'plugin_label' => __( 'Feedzy Lite', 'feedzy-rss-feeds' ), 'plugin_title' => __( 'Insert Feedzy RSS Feeds Shortcode', 'feedzy-rss-feeds' ), 'image_button' => __( 'Use Image', 'feedzy-rss-feeds' ), @@ -88,19 +88,39 @@ public static function get_form_defaults() { * @return array|mixed|void */ public static function get_form_elements() { - $meta = sprintf( __( 'Should we display additional meta fields out of %1$sauthor%2$s, %3$sdate%4$s and %5$stime%6$s? (comma-separated list, in order of display). View documentation %7$shere%8$s.', 'feedzy-rss-feeds' ), '', '', '', '', '', '', '', '' ); + $meta = sprintf( + // translators: 1: tag for author, 2: closing tag, 3: tag for date, 4: closing tag, 5: tag for time, 6: closing tag, 7: tag for documentation link, 8: closing tag + __( 'Should we display additional meta fields out of %1$s author %2$s, %3$s date %4$s and %5$s time %6$s? (comma-separated list, in order of display). View documentation %7$s here %8$s.', 'feedzy-rss-feeds' ), + '', '', '', '', '', '', '', '' + ); if ( has_filter( 'feedzy_retrieve_categories' ) ) { - $meta = sprintf( __( 'Should we display additional meta fields out of %1$sauthor%2$s, %3$sdate%4$s, %5$stime%6$s and %7$scategories%8$s? (comma-separated list). View documentation %9$shere%10$s.', 'feedzy-rss-feeds' ), '', '', '', '', '', '', '', '', '', '' ); + $meta = sprintf( + // translators: 1: tag for author, 2: closing tag, 3: tag for date, 4: closing tag, 5: tag for time, 6: closing tag, 7: tag for categories, 8: closing tag, 9: tag for documentation link, 10: closing tag + __( 'Should we display additional meta fields out of %1$s author%2$s, %3$s date%4$s, %5$s time %6$s and %7$s categories %8$s? (comma-separated list). View documentation %9$s here %10$s.', 'feedzy-rss-feeds' ), + '', '', '', '', '', '', '', '', '', '' + ); } - $multiple = sprintf( __( 'When using multiple sources, should we display additional meta fields? %1$ssource%2$s (feed title).', 'feedzy-rss-feeds' ), '', '', '', '' ); + $multiple = sprintf( + // translators: 1: tag for source, 2: closing tag + __( 'When using multiple sources, should we display additional meta fields? %1$s source %2$s (feed title).', 'feedzy-rss-feeds' ), + '', '' + ); $elements = array( 'section_feed' => array( 'title' => __( 'Feed Source', 'feedzy-rss-feeds' ), 'elements' => array( 'feeds' => array( - 'label' => __( 'The feed(s) URL (comma-separated list).', 'feedzy-rss-feeds' ) . ' ' . sprintf( __( 'Click %1$shere%2$s to check if feed is valid.', 'feedzy-rss-feeds' ), '', '' ) . '
    ' . __( 'Invalid feeds will NOT display items.', 'feedzy-rss-feeds' ) . '', + 'label' => ( + __( 'The feed(s) URL (comma-separated list).', 'feedzy-rss-feeds' ) . ' ' . + sprintf( + // translators: 1: tag opening, 2: tag closing + __( 'Click %1$s here %2$s to check if feed is valid.', 'feedzy-rss-feeds' ), + '', '' + ) + . '
    ' . __( 'Invalid feeds will NOT display items.', 'feedzy-rss-feeds' ) . '' + ), 'placeholder' => __( 'Feed URL', 'feedzy-rss-feeds' ), 'type' => 'text', 'value' => '', @@ -434,10 +454,16 @@ public static function get_form_elements() { ), 'section_pro' => array( 'title' => __( 'PRO Options', 'feedzy-rss-feeds' ), - 'description' => __( 'Get access to more options and customizations with full version of Feedzy RSS Feeds . Use existing templates or extend them and make them your own.', 'feedzy-rss-feeds' ) . '
    ' . '' . __( 'See more features of Feedzy RSS Feeds PRO', 'feedzy-rss-feeds' ) . '', + 'description' => __( 'Get access to more options and customizations with full version of Feedzy RSS Feeds . Use existing templates or extend them and make them your own.', 'feedzy-rss-feeds' ) . '
    ' . '' . __( 'See more features of Feedzy RSS Feeds PRO', 'feedzy-rss-feeds' ) . '', 'elements' => array( 'price' => array( - 'label' => sprintf( __( 'Should we display the price from the feed if it is available?
    You can read about how to extract price from a custom tag %1$shere%2$s', 'feedzy-rss-feeds' ), '', '' ), + 'label' => sprintf( + // translators: 1:
    tag, 2: tag opening, 3: tag closing + __( 'Should we display the price from the feed if it is available? %1$s You can read about how to extract price from a custom tag %2$s here %3$s', 'feedzy-rss-feeds' ), + '
    ', + '', + '' + ), 'type' => 'select', 'disabled' => true, 'value' => '', @@ -453,7 +479,12 @@ public static function get_form_elements() { ), ), 'referral_url' => array( - 'label' => sprintf( __( 'Referral URL parameters as per %1$sthis document here%2$s', 'feedzy-rss-feeds' ), '', '' ), + 'label' => sprintf( + // translators: 1: tag opening, 2: tag closing + __( 'Referral URL parameters as per %1$s this document here %2$s', 'feedzy-rss-feeds' ), + '', + '' + ), 'placeholder' => '', 'type' => 'text', 'disabled' => true, @@ -467,7 +498,12 @@ public static function get_form_elements() { 'value' => '1', ), 'mapping' => array( - 'label' => sprintf( __( 'Provide mapping for custom feed elements as per %1$sthis document here%2$s. This will only work for single feeds, not comma-separated feeds.', 'feedzy-rss-feeds' ), '', '' ), + 'label' => sprintf( + // translators: 1: tag opening, 2: tag closing + __( 'Provide mapping for custom feed elements as per %1$s this document here %2$s. This will only work for single feeds, not comma-separated feeds.', 'feedzy-rss-feeds' ), + '', + '' + ), 'type' => 'text', 'disabled' => true, 'value' => '', diff --git a/includes/admin/feedzy-rss-feeds-ui.php b/includes/admin/feedzy-rss-feeds-ui.php index 58866477..81151f41 100644 --- a/includes/admin/feedzy-rss-feeds-ui.php +++ b/includes/admin/feedzy-rss-feeds-ui.php @@ -221,7 +221,13 @@ public function feedzy_import_post_title_section() {
    upgrading to Feedzy Pro', 'feedzy-rss-feeds' ), tsdk_utmify( FEEDZY_UPSELL_LINK, 'post_title', 'import-screen' ) ) ); + $upgrade_url = tsdk_translate_link( tsdk_utmify( FEEDZY_UPSELL_LINK, 'post_title', 'import-screen' ), 'query' ); + + $content = __( 'You are using Feedzy Lite.', 'feedzy-rss-feeds' ) . ' '; + // translators: %1$s: opening anchor tag, %2$s: closing anchor tag + $content .= wp_sprintf( __( 'Unlock more powerful features, by %1$s upgrading to Feedzy Pro %2$s', 'feedzy-rss-feeds' ), '', '' ); + + echo wp_kses_post( $content ); ?>
    diff --git a/includes/elementor/controls/template-layout.php b/includes/elementor/controls/template-layout.php index 54b0b0a1..57060cdf 100644 --- a/includes/elementor/controls/template-layout.php +++ b/includes/elementor/controls/template-layout.php @@ -46,16 +46,17 @@ public function enqueue() {
    '; } $upsell_notice = '
    '; - $upsell_url = add_query_arg( - array( - 'utm_source' => 'wpadmin', - 'utm_medium' => 'elementoreditor', - 'utm_campaign' => 'amazonproductadvertising', - 'utm_content' => 'feedzy-rss-feeds', - ), - FEEDZY_UPSELL_LINK + + $upsell_url = tsdk_translate_link( tsdk_utmify( FEEDZY_UPSELL_LINK, 'amazonproductadvertising', 'elementoreditor' ), 'query' ); + + $upsell_notice .= '' . __( 'NEW!', 'feedzy-rss-feeds' ) . ''; + $upsell_notice .= wp_sprintf( + // translators: %1$s: opening anchor tag, %2$s: closing anchor tag + __( 'Enable Amazon Product Advertising feeds to generate affiliate revenue by %1$s upgrading to Feedzy Pro. %2$s', 'feedzy-rss-feeds' ), + '', + '' ); - $upsell_notice .= wp_kses_post( wp_sprintf( __( 'NEW! Enable Amazon Product Advertising feeds to generate affiliate revenue by upgrading to Feedzy Pro.', 'feedzy-rss-feeds' ), esc_url_raw( $upsell_url ) ) ); + $upsell_notice .= '
    '; wp_localize_script( 'feedzy-elementor', diff --git a/includes/elementor/feedzy-rss-feeds-elementor.php b/includes/elementor/feedzy-rss-feeds-elementor.php index 629c5092..6a5f8580 100644 --- a/includes/elementor/feedzy-rss-feeds-elementor.php +++ b/includes/elementor/feedzy-rss-feeds-elementor.php @@ -69,17 +69,18 @@ public function feedzy_elementor_register_datetime_local_control( $controls_mana public function feedzy_elementor_editor_upsell_notice( $widget ) { if ( 'feedzy-rss-feeds' === $widget->get_name() ) { if ( ! feedzy_is_pro() && \Elementor\Plugin::$instance->editor->is_edit_mode() ) { - $upsell_url = add_query_arg( - array( - 'utm_source' => 'wpadmin', - 'utm_medium' => 'elementoreditor', - 'utm_campaign' => 'amazonproductadvertising', - 'utm_content' => 'feedzy-rss-feeds', - ), - FEEDZY_UPSELL_LINK - ); + $upsell_url = tsdk_translate_link( tsdk_utmify( FEEDZY_UPSELL_LINK, 'amazonproductadvertising', 'elementoreditor' ), 'query' ); echo '
    '; - echo wp_kses_post( wp_sprintf( __( 'NEW! Enable Amazon Product Advertising feeds to generate affiliate revenue by upgrading to Feedzy Pro.', 'feedzy-rss-feeds' ), esc_url_raw( $upsell_url ) ) ); + + $upsell_msg = '' . __( 'NEW!', 'feedzy-rss-feeds' ) . ''; + $upsell_msg .= wp_sprintf( + // translators: %1$s: opening anchor tag, %2$s: closing anchor tag + __( 'Enable Amazon Product Advertising feeds to generate affiliate revenue by %1$s upgrading to Feedzy Pro. %2$s', 'feedzy-rss-feeds' ), + '', + '' + ); + + echo wp_kses_post( $upsell_msg ); echo '