Version Description
Fixed minor issues with undeclared PHP variables throwing warnings Added Polylang links
Download this release
Release Info
Developer | jorisverwater |
Plugin | Product Feed PRO for WooCommerce |
Version | 8.7.2 |
Comparing to | |
See all releases |
Code changes from version 8.7.1 to 8.7.2
- TODO.txt +1 -1
- classes/class-get-products.php +8 -6
- classes/class-update-channel.php +3 -1
- pages/admin/woosea-manage-feed.php +1 -1
- woocommerce-sea.php +15 -5
TODO.txt
CHANGED
@@ -5,7 +5,7 @@ Tutorial / Blog posts:
|
|
5 |
- Explain all the different fields/attributes that can be selected from the drop-downs
|
6 |
|
7 |
Priority issues:
|
8 |
-
-
|
9 |
- Filters or rules that have slashes in them (on links) do no work - make this work!
|
10 |
- Add possibility to copy feed configuration from one WooCommerce instance to the other instance
|
11 |
- Add support for Multisites
|
5 |
- Explain all the different fields/attributes that can be selected from the drop-downs
|
6 |
|
7 |
Priority issues:
|
8 |
+
- Facebook pixel: add other attributes to the tracking apart from the curreny product ID (such as the SKU);
|
9 |
- Filters or rules that have slashes in them (on links) do no work - make this work!
|
10 |
- Add possibility to copy feed configuration from one WooCommerce instance to the other instance
|
11 |
- Add support for Multisites
|
classes/class-get-products.php
CHANGED
@@ -23,8 +23,7 @@ class WooSEA_Get_Products {
|
|
23 |
* Function to add CDATA brackets to title, short_description and description attributes
|
24 |
*/
|
25 |
protected function woosea_append_cdata( $string ){
|
26 |
-
return $string;
|
27 |
-
// return "<![CDATA[ $string ]]>";
|
28 |
}
|
29 |
|
30 |
/**
|
@@ -2217,6 +2216,9 @@ class WooSEA_Get_Products {
|
|
2217 |
// Raw descriptions, unfiltered
|
2218 |
$product_data['raw_description'] = do_shortcode(wpautop($post->post_content));
|
2219 |
$product_data['raw_short_description'] = do_shortcode(wpautop($post->post_excerpt));
|
|
|
|
|
|
|
2220 |
|
2221 |
$product_data['description'] = html_entity_decode((str_replace("\r", "", $post->post_content)), ENT_QUOTES | ENT_XML1, 'UTF-8');
|
2222 |
$product_data['short_description'] = html_entity_decode((str_replace("\r", "", $post->post_excerpt)), ENT_QUOTES | ENT_XML1, 'UTF-8');
|
@@ -3148,9 +3150,9 @@ class WooSEA_Get_Products {
|
|
3148 |
* In order to prevent XML formatting errors in Google's Merchant center
|
3149 |
* we will add CDATA brackets to the title and description attributes
|
3150 |
*/
|
3151 |
-
|
3152 |
-
|
3153 |
-
|
3154 |
|
3155 |
/**
|
3156 |
* Check if individual products need to be excluded
|
@@ -3703,7 +3705,7 @@ class WooSEA_Get_Products {
|
|
3703 |
$published_products = $count_single->publish;
|
3704 |
}
|
3705 |
|
3706 |
-
if ($val['project_hash'] == $project_hash){
|
3707 |
$nrpr = $feed_config[$key]['nr_products_processed'];
|
3708 |
$nr_prods_processed = $nrpr+$offset_step_size;
|
3709 |
|
23 |
* Function to add CDATA brackets to title, short_description and description attributes
|
24 |
*/
|
25 |
protected function woosea_append_cdata( $string ){
|
26 |
+
return "<![CDATA[ $string ]]>";
|
|
|
27 |
}
|
28 |
|
29 |
/**
|
2216 |
// Raw descriptions, unfiltered
|
2217 |
$product_data['raw_description'] = do_shortcode(wpautop($post->post_content));
|
2218 |
$product_data['raw_short_description'] = do_shortcode(wpautop($post->post_excerpt));
|
2219 |
+
// if ( $product_data['raw_description'] != strip_tags($product_data['raw_description']) ) {
|
2220 |
+
// $product_data['raw_description'] = $this->woosea_append_cdata($product_data['raw_description']);
|
2221 |
+
// }
|
2222 |
|
2223 |
$product_data['description'] = html_entity_decode((str_replace("\r", "", $post->post_content)), ENT_QUOTES | ENT_XML1, 'UTF-8');
|
2224 |
$product_data['short_description'] = html_entity_decode((str_replace("\r", "", $post->post_excerpt)), ENT_QUOTES | ENT_XML1, 'UTF-8');
|
3150 |
* In order to prevent XML formatting errors in Google's Merchant center
|
3151 |
* we will add CDATA brackets to the title and description attributes
|
3152 |
*/
|
3153 |
+
//$product_data['title'] = $this->woosea_append_cdata ( $product_data['title'] );
|
3154 |
+
//$product_data['description'] = $this->woosea_append_cdata ( $product_data['description'] );
|
3155 |
+
//$product_data['short_description'] = $this->woosea_append_cdata ( $product_data['short_description'] );
|
3156 |
|
3157 |
/**
|
3158 |
* Check if individual products need to be excluded
|
3705 |
$published_products = $count_single->publish;
|
3706 |
}
|
3707 |
|
3708 |
+
if (isset($val['project_hash']) AND ($val['project_hash'] == $project_hash)){
|
3709 |
$nrpr = $feed_config[$key]['nr_products_processed'];
|
3710 |
$nr_prods_processed = $nrpr+$offset_step_size;
|
3711 |
|
classes/class-update-channel.php
CHANGED
@@ -38,7 +38,8 @@ class WooSEA_Update_Project {
|
|
38 |
$project_config = array();
|
39 |
|
40 |
foreach ($cron_projects as $key=>$val){
|
41 |
-
if(!empty($val)){
|
|
|
42 |
if($val['project_hash'] === $project_hash){
|
43 |
$project_config = $val;
|
44 |
}
|
@@ -151,6 +152,7 @@ class WooSEA_Update_Project {
|
|
151 |
/**
|
152 |
* Update project hash with new values
|
153 |
*/
|
|
|
154 |
foreach ($project_data as $key=>$val){
|
155 |
$project_config[$key] = $val;
|
156 |
}
|
38 |
$project_config = array();
|
39 |
|
40 |
foreach ($cron_projects as $key=>$val){
|
41 |
+
//if(!empty($val)){
|
42 |
+
if(!empty($val['project_hash'])){
|
43 |
if($val['project_hash'] === $project_hash){
|
44 |
$project_config = $val;
|
45 |
}
|
152 |
/**
|
153 |
* Update project hash with new values
|
154 |
*/
|
155 |
+
|
156 |
foreach ($project_data as $key=>$val){
|
157 |
$project_config[$key] = $val;
|
158 |
}
|
pages/admin/woosea-manage-feed.php
CHANGED
@@ -149,7 +149,7 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
|
|
149 |
|
150 |
//echo '<pre>' . print_r( $val, true ) . '</pre>';
|
151 |
|
152 |
-
if($val['active'] == "true"){
|
153 |
$checked = "checked";
|
154 |
$class = "";
|
155 |
} else {
|
149 |
|
150 |
//echo '<pre>' . print_r( $val, true ) . '</pre>';
|
151 |
|
152 |
+
if(isset($val['active']) AND ($val['active'] == "true")){
|
153 |
$checked = "checked";
|
154 |
$class = "";
|
155 |
} else {
|
woocommerce-sea.php
CHANGED
@@ -83,6 +83,13 @@ function woosea_styles() {
|
|
83 |
}
|
84 |
add_action( 'admin_enqueue_scripts' , 'woosea_styles' );
|
85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
/**
|
87 |
* Enqueue js assets admin pages
|
88 |
*/
|
@@ -1918,7 +1925,7 @@ function woosea_project_delete(){
|
|
1918 |
$found = false;
|
1919 |
|
1920 |
foreach ( $feed_config as $key => $val ) {
|
1921 |
-
if ($val['project_hash'] == $project_hash){
|
1922 |
$found = true;
|
1923 |
$found_key = $key;
|
1924 |
|
@@ -1979,7 +1986,7 @@ function woosea_project_processing_status(){
|
|
1979 |
$proc_perc = 0;
|
1980 |
|
1981 |
foreach ( $feed_config as $key => $val ) {
|
1982 |
-
if ($val['project_hash'] === $project_hash){
|
1983 |
$this_feed = $val;
|
1984 |
}
|
1985 |
}
|
@@ -2080,7 +2087,7 @@ function woosea_project_refresh(){
|
|
2080 |
$feed_config = get_option( 'cron_projects' );
|
2081 |
|
2082 |
foreach ( $feed_config as $key => $val ) {
|
2083 |
-
if ($val['project_hash'] == $project_hash){
|
2084 |
$batch_project = "batch_project_".$project_hash;
|
2085 |
if (!get_option( $batch_project )){
|
2086 |
update_option( $batch_project, $val);
|
@@ -4103,6 +4110,8 @@ function woosea_generate_pages(){
|
|
4103 |
$generate_step = 0;
|
4104 |
} else {
|
4105 |
$from_post = $_POST;
|
|
|
|
|
4106 |
$channel_hash = sanitize_text_field($_POST['channel_hash']);
|
4107 |
$step = sanitize_text_field($_POST['step']);
|
4108 |
$generate_step = $step;
|
@@ -4217,6 +4226,7 @@ function woosea_generate_pages(){
|
|
4217 |
}
|
4218 |
}
|
4219 |
|
|
|
4220 |
/**
|
4221 |
* This function copies feed configurations from another domain
|
4222 |
* so users do not have to re-configure feeds for all their domains
|
@@ -4342,11 +4352,11 @@ function woosea_nr_products($project_hash, $nr_products){
|
|
4342 |
*/
|
4343 |
function woosea_last_updated($project_hash){
|
4344 |
$feed_config = get_option( 'cron_projects' );
|
4345 |
-
|
4346 |
$last_updated = date("d M Y H:i");
|
4347 |
|
4348 |
foreach ( $feed_config as $key => $val ) {
|
4349 |
-
|
|
|
4350 |
$upload_dir = wp_upload_dir();
|
4351 |
$base = $upload_dir['basedir'];
|
4352 |
$path = $base . "/woo-product-feed-pro/" . $val['fileformat'];
|
83 |
}
|
84 |
add_action( 'admin_enqueue_scripts' , 'woosea_styles' );
|
85 |
|
86 |
+
/**
|
87 |
+
* Strip slashes from POST requests
|
88 |
+
*/
|
89 |
+
function stripslashes_recursive($object) {
|
90 |
+
return is_array($object) ? array_map('stripslashes_recursive', $object) : stripslashes($object);
|
91 |
+
}
|
92 |
+
|
93 |
/**
|
94 |
* Enqueue js assets admin pages
|
95 |
*/
|
1925 |
$found = false;
|
1926 |
|
1927 |
foreach ( $feed_config as $key => $val ) {
|
1928 |
+
if (isset($val['project_hash']) AND ($val['project_hash'] == $project_hash)){
|
1929 |
$found = true;
|
1930 |
$found_key = $key;
|
1931 |
|
1986 |
$proc_perc = 0;
|
1987 |
|
1988 |
foreach ( $feed_config as $key => $val ) {
|
1989 |
+
if (isset($val['project_hash']) AND ($val['project_hash'] === $project_hash)){
|
1990 |
$this_feed = $val;
|
1991 |
}
|
1992 |
}
|
2087 |
$feed_config = get_option( 'cron_projects' );
|
2088 |
|
2089 |
foreach ( $feed_config as $key => $val ) {
|
2090 |
+
if (isset($val['project_hash']) AND ($val['project_hash'] == $project_hash)){
|
2091 |
$batch_project = "batch_project_".$project_hash;
|
2092 |
if (!get_option( $batch_project )){
|
2093 |
update_option( $batch_project, $val);
|
4110 |
$generate_step = 0;
|
4111 |
} else {
|
4112 |
$from_post = $_POST;
|
4113 |
+
$from_post = stripslashes_recursive($from_post);
|
4114 |
+
|
4115 |
$channel_hash = sanitize_text_field($_POST['channel_hash']);
|
4116 |
$step = sanitize_text_field($_POST['step']);
|
4117 |
$generate_step = $step;
|
4226 |
}
|
4227 |
}
|
4228 |
|
4229 |
+
|
4230 |
/**
|
4231 |
* This function copies feed configurations from another domain
|
4232 |
* so users do not have to re-configure feeds for all their domains
|
4352 |
*/
|
4353 |
function woosea_last_updated($project_hash){
|
4354 |
$feed_config = get_option( 'cron_projects' );
|
|
|
4355 |
$last_updated = date("d M Y H:i");
|
4356 |
|
4357 |
foreach ( $feed_config as $key => $val ) {
|
4358 |
+
|
4359 |
+
if (isset($val['project_hash']) AND ($val['project_hash'] == $project_hash)){
|
4360 |
$upload_dir = wp_upload_dir();
|
4361 |
$base = $upload_dir['basedir'];
|
4362 |
$path = $base . "/woo-product-feed-pro/" . $val['fileformat'];
|