From 84f153cccff391bdb07e99789f3d738b89ea71c1 Mon Sep 17 00:00:00 2001 From: Kaarel Rooparg Date: Fri, 1 Feb 2019 17:39:25 +0200 Subject: [PATCH 1/2] Rss feed description field changed to support htmlentities. Removed image from description. Version 1.2.1 --- inc/Base/DataHandler.php | 5 +++-- readme.md | 4 ++++ readme.txt | 6 +++++- smaily-for-woocommerce.php | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/inc/Base/DataHandler.php b/inc/Base/DataHandler.php index 56c7ec9..f95b686 100644 --- a/inc/Base/DataHandler.php +++ b/inc/Base/DataHandler.php @@ -97,13 +97,14 @@ public static function generate_rss_feed( $category, $limit = 50 ) { ' . esc_attr( $price ) . ' -' . esc_attr( $discount ) . '%'; } - + // Remove image if inserted to description. + $description = preg_replace( '/\[.*caption\]/', '', ( $prod->get_description() ) ); $items[] = ' ' . esc_attr( $prod->get_title() ) . ' ' . esc_url( $url ) . ' ' . esc_url( $url ) . ' ' . date( 'D, d M Y H:i:s', $create_time ) . ' - ' . htmlentities( $prod->get_description() ) . ' + ' . esc_attr( $splc_price ) . '' . $price_fields . ' diff --git a/readme.md b/readme.md index 669db4c..9567eed 100644 --- a/readme.md +++ b/readme.md @@ -122,6 +122,10 @@ Up to 10 products can be received in Smaily templating engine. You can refrence ## Changelog +### 1.2.1 + +- Bugfix. Rss-feed now displays special characters. + ### 1.2.0 - New feature. Rss-feed now supports category and limit parameters from url. diff --git a/readme.txt b/readme.txt index ef40e4b..c8a307d 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Requires PHP: 5.6 Requires at least: 4.0 Tested up to: 5.0.2 WC tested up to: 3.5.3 -Stable tag: 1.2.0 +Stable tag: 1.2.1 License: GPLv3 Simple and flexible Smaily newsletter and rss-feed integration for WooCommerce. @@ -131,6 +131,10 @@ Up to 10 products can be received in Smaily templating engine. You can refrence == Changelog == +### 1.2.1 + +- Bugfix. Rss-feed now displays special characters. + ### 1.2.0 - New feature. Rss-feed now supports category and limit parameters from url. diff --git a/smaily-for-woocommerce.php b/smaily-for-woocommerce.php index 52ed5d9..5595696 100644 --- a/smaily-for-woocommerce.php +++ b/smaily-for-woocommerce.php @@ -13,7 +13,7 @@ * Plugin Name: Smaily for WooCommerce * Plugin URI: https://github.com/sendsmaily/smaily-woocommerce-plugin * Description: Smaily email marketing and automation extension plugin for WooCommerce (set up opt-in form, client sync and output RSS-feed) for easy product import into template. - * Version: 1.2.0 + * Version: 1.2.1 * License: GPL3 * Author: Smaily * Author URI: https://smaily.com/ From 167d18cfa79bef20af90b797b6130f262cc777c1 Mon Sep 17 00:00:00 2001 From: Kaarel Rooparg Date: Sat, 2 Feb 2019 15:44:41 +0200 Subject: [PATCH 2/2] Updated title and description fields --- inc/Base/DataHandler.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/inc/Base/DataHandler.php b/inc/Base/DataHandler.php index f95b686..9461d8b 100644 --- a/inc/Base/DataHandler.php +++ b/inc/Base/DataHandler.php @@ -97,14 +97,15 @@ public static function generate_rss_feed( $category, $limit = 50 ) { ' . esc_attr( $price ) . ' -' . esc_attr( $discount ) . '%'; } - // Remove image if inserted to description. - $description = preg_replace( '/\[.*caption\]/', '', ( $prod->get_description() ) ); + // Parse image to form element. + $description = do_shortcode( $prod->get_description()); + $items[] = ' - ' . esc_attr( $prod->get_title() ) . ' + <![CDATA[' . $prod->get_title() . ']]> ' . esc_url( $url ) . ' ' . esc_url( $url ) . ' ' . date( 'D, d M Y H:i:s', $create_time ) . ' - + ' . esc_attr( $splc_price ) . '' . $price_fields . '