Version Description
(2020-12-24) = * Added: Debug feed file form in status page. * Fixed: Image url fatal error solved. * Fixed: Uncaught WC_Logger class error solved. * Fixed: Fixed product ID error issue.
Download this release
Release Info
Developer | wahid0003 |
Plugin | CTX Feed – WooCommerce Product Feed Manager Plugin |
Version | 4.3.12 |
Comparing to | |
See all releases |
Code changes from version 4.3.11 to 4.3.12
- README.txt +7 -1
- admin/partials/woo-feed-status.php +20 -0
- includes/classes/class-woo-feed-products-v3.php +1 -1
- includes/helper.php +157 -154
- includes/log-helper.php +5 -0
- libs/WebAppick/AppServices/Insights.php +1 -1
- woo-feed.php +2 -2
README.txt
CHANGED
@@ -8,7 +8,7 @@ Google Product Review feed, product variations, rakuteen, shopping, skroutz, TSV
|
|
8 |
Requires at least: 3.6
|
9 |
Tested Up To: 5.6
|
10 |
Requires PHP: 5.6
|
11 |
-
Stable tag: 4.3.
|
12 |
License: GPLv2 or later
|
13 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
14 |
|
@@ -308,6 +308,12 @@ Using pro version:
|
|
308 |
|
309 |
== Changelog ==
|
310 |
|
|
|
|
|
|
|
|
|
|
|
|
|
311 |
= 4.3.11 (2020-12-23) =
|
312 |
* Added: Google shipping, identifier, tax attribute rule.
|
313 |
* Added: Bing shipping, identifier, tax attribute rule.
|
8 |
Requires at least: 3.6
|
9 |
Tested Up To: 5.6
|
10 |
Requires PHP: 5.6
|
11 |
+
Stable tag: 4.3.12
|
12 |
License: GPLv2 or later
|
13 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
14 |
|
308 |
|
309 |
== Changelog ==
|
310 |
|
311 |
+
= 4.3.12 (2020-12-24) =
|
312 |
+
* Added: Debug feed file form in status page.
|
313 |
+
* Fixed: Image url fatal error solved.
|
314 |
+
* Fixed: Uncaught WC_Logger class error solved.
|
315 |
+
* Fixed: Fixed product ID error issue.
|
316 |
+
|
317 |
= 4.3.11 (2020-12-23) =
|
318 |
* Added: Google shipping, identifier, tax attribute rule.
|
319 |
* Added: Bing shipping, identifier, tax attribute rule.
|
admin/partials/woo-feed-status.php
CHANGED
@@ -45,8 +45,28 @@
|
|
45 |
<?php
|
46 |
}
|
47 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
</tbody>
|
49 |
</table>
|
50 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
</div>
|
52 |
</div>
|
45 |
<?php
|
46 |
}
|
47 |
?>
|
48 |
+
<tr>
|
49 |
+
<td><?php esc_html_e('Debug Feed File', 'woo-feed'); ?></td>
|
50 |
+
<td>
|
51 |
+
<form action="" method="post">
|
52 |
+
<label for="woo-feed-test-options" style="display: none;">Test Option</label>
|
53 |
+
<input type="text" id="woo-feed-test-options" name="woo-feed-test-options" placeholder="option name">
|
54 |
+
<input type="submit" name="woo-feed-test-options-submit" value="Test">
|
55 |
+
</form>
|
56 |
+
</td>
|
57 |
+
</tr>
|
58 |
</tbody>
|
59 |
</table>
|
60 |
</div>
|
61 |
+
<?php
|
62 |
+
if( isset( $_POST['woo-feed-test-options-submit'] ) ) {
|
63 |
+
$option_name = sanitize_text_field($_POST['woo-feed-test-options']);
|
64 |
+
|
65 |
+
$get_option_val = maybe_unserialize(get_option($option_name));
|
66 |
+
echo "<pre>";
|
67 |
+
print_r($get_option_val);
|
68 |
+
echo "</pre>";
|
69 |
+
}
|
70 |
+
?>
|
71 |
</div>
|
72 |
</div>
|
includes/classes/class-woo-feed-products-v3.php
CHANGED
@@ -2001,7 +2001,7 @@ class Woo_Feed_Products_v3
|
|
2001 |
if ( has_post_thumbnail($product->get_id()) ) :
|
2002 |
$getImage = wp_get_attachment_image_src(get_post_thumbnail_id($product->get_id()),
|
2003 |
'single-post-thumbnail');
|
2004 |
-
$image = woo_feed_get_formatted_url($getImage[0]);
|
2005 |
else :
|
2006 |
$image = woo_feed_get_formatted_url(wp_get_attachment_url($product->get_id()));
|
2007 |
endif;
|
2001 |
if ( has_post_thumbnail($product->get_id()) ) :
|
2002 |
$getImage = wp_get_attachment_image_src(get_post_thumbnail_id($product->get_id()),
|
2003 |
'single-post-thumbnail');
|
2004 |
+
$image = isset($getImage[0]) ? woo_feed_get_formatted_url($getImage[0]) : '';
|
2005 |
else :
|
2006 |
$image = woo_feed_get_formatted_url(wp_get_attachment_url($product->get_id()));
|
2007 |
endif;
|
includes/helper.php
CHANGED
@@ -3184,160 +3184,163 @@ if ( ! function_exists( 'woo_feed_product_structured_data' ) ) {
|
|
3184 |
* Product Structured data
|
3185 |
*/
|
3186 |
function woo_feed_product_structured_data() {
|
3187 |
-
global $post;
|
3188 |
-
$product = wc_get_product( $post->ID );
|
3189 |
|
3190 |
-
|
3191 |
-
|
3192 |
-
|
3193 |
-
|
3194 |
-
|
3195 |
-
|
3196 |
-
|
3197 |
-
|
3198 |
-
|
3199 |
-
|
3200 |
-
|
3201 |
-
|
3202 |
-
|
3203 |
-
|
3204 |
-
|
3205 |
-
|
3206 |
-
|
3207 |
-
|
3208 |
-
|
3209 |
-
|
3210 |
-
|
3211 |
-
|
3212 |
-
|
3213 |
-
|
3214 |
-
|
3215 |
-
|
3216 |
-
|
3217 |
-
|
3218 |
-
|
3219 |
-
|
3220 |
-
|
3221 |
-
|
3222 |
-
|
3223 |
-
|
3224 |
-
|
3225 |
-
|
3226 |
-
|
3227 |
-
|
3228 |
-
|
3229 |
-
|
3230 |
-
|
3231 |
-
|
3232 |
-
|
3233 |
-
|
3234 |
-
|
3235 |
-
|
3236 |
-
|
3237 |
-
|
3238 |
-
|
3239 |
-
|
3240 |
-
|
3241 |
-
|
3242 |
-
|
3243 |
-
|
3244 |
-
|
3245 |
-
|
3246 |
-
|
3247 |
-
|
3248 |
-
|
3249 |
-
|
3250 |
-
|
3251 |
-
|
3252 |
-
|
3253 |
-
|
3254 |
-
|
3255 |
-
|
3256 |
-
|
3257 |
-
|
3258 |
-
|
3259 |
-
|
3260 |
-
|
3261 |
-
|
3262 |
-
|
3263 |
-
|
3264 |
-
|
3265 |
-
|
3266 |
-
|
3267 |
-
|
3268 |
-
|
3269 |
-
|
3270 |
-
|
3271 |
-
|
3272 |
-
|
3273 |
-
|
3274 |
-
|
3275 |
-
|
3276 |
-
|
3277 |
-
|
3278 |
-
|
3279 |
-
|
3280 |
-
|
3281 |
-
|
3282 |
-
|
3283 |
-
|
3284 |
-
|
3285 |
-
|
3286 |
-
|
3287 |
-
|
3288 |
-
|
3289 |
-
|
3290 |
-
|
3291 |
-
|
3292 |
-
|
3293 |
-
|
3294 |
-
|
3295 |
-
|
3296 |
-
|
3297 |
-
|
3298 |
-
|
3299 |
-
|
3300 |
-
|
3301 |
-
|
3302 |
-
|
3303 |
-
|
3304 |
-
|
3305 |
-
|
3306 |
-
|
3307 |
-
|
3308 |
-
|
3309 |
-
|
3310 |
-
|
3311 |
-
|
3312 |
-
|
3313 |
-
|
3314 |
-
|
3315 |
-
|
3316 |
-
|
3317 |
-
|
3318 |
-
|
3319 |
-
|
3320 |
-
|
3321 |
-
|
3322 |
-
|
3323 |
-
|
3324 |
-
|
3325 |
-
|
3326 |
-
|
3327 |
-
|
3328 |
-
|
3329 |
-
|
3330 |
-
|
3331 |
-
|
3332 |
-
|
3333 |
-
|
3334 |
-
|
3335 |
-
|
3336 |
-
|
3337 |
-
|
3338 |
-
|
3339 |
-
|
3340 |
-
|
|
|
|
|
|
|
|
|
|
|
3341 |
|
3342 |
}
|
3343 |
|
@@ -3365,7 +3368,6 @@ if ( ! function_exists( 'woo_feed_pixel_script' ) ) {
|
|
3365 |
function woo_feed_pixel_script(){
|
3366 |
|
3367 |
global $woocommerce, $post, $product;
|
3368 |
-
$product = wc_get_product( $post->ID );
|
3369 |
|
3370 |
// Pixel Config.
|
3371 |
$settings = woo_feed_get_options( 'all' );
|
@@ -3377,6 +3379,7 @@ if ( ! function_exists( 'woo_feed_pixel_script' ) ) {
|
|
3377 |
|
3378 |
// Product Tracking
|
3379 |
if ( is_product() ) {
|
|
|
3380 |
|
3381 |
$view_type .= "fbq('track', 'ViewContent', {
|
3382 |
content_name: '$post->post_title',
|
3184 |
* Product Structured data
|
3185 |
*/
|
3186 |
function woo_feed_product_structured_data() {
|
|
|
|
|
3187 |
|
3188 |
+
if (is_product()) {
|
3189 |
+
global $post;
|
3190 |
+
$product = wc_get_product( $post->ID );
|
3191 |
+
|
3192 |
+
if ( ! is_object( $product ) ) {
|
3193 |
+
global $product;
|
3194 |
+
}
|
3195 |
+
|
3196 |
+
if ( ! is_a( $product, 'WC_Product' ) ) {
|
3197 |
+
return;
|
3198 |
+
}
|
3199 |
+
|
3200 |
+
$shop_name = get_bloginfo( 'name' );
|
3201 |
+
$shop_url = home_url();
|
3202 |
+
$currency = get_woocommerce_currency();
|
3203 |
+
$permalink = get_permalink( $product->get_id() );
|
3204 |
+
$image = wp_get_attachment_url( $product->get_image_id() );
|
3205 |
+
$mpn = $product->get_meta( 'woo_feed_mpn' );
|
3206 |
+
$brand_term = wp_get_post_terms( $post->ID, 'woo-feed-brand', array( 'fields' => 'names' ) );
|
3207 |
+
$settings = woo_feed_get_options( 'all' );
|
3208 |
+
$disable_mpn = $settings['disable_mpn'];
|
3209 |
+
$disable_brand = $settings['disable_brand'];
|
3210 |
+
|
3211 |
+
$markup = array(
|
3212 |
+
'@context' => 'https://schema.org',
|
3213 |
+
'@type' => 'Product',
|
3214 |
+
'@id' => $permalink . '#product',
|
3215 |
+
// Append '#product' to differentiate between this @id and the @id generated for the Breadcrumblist.
|
3216 |
+
'name' => $product->get_name(),
|
3217 |
+
'url' => $permalink,
|
3218 |
+
'description' => wp_strip_all_tags( do_shortcode( $product->get_short_description() ? $product->get_short_description() : $product->get_description() ) ),
|
3219 |
+
);
|
3220 |
+
if ( $image ) {
|
3221 |
+
$markup['image'] = $image;
|
3222 |
+
}
|
3223 |
+
// Declare SKU or fallback to ID.
|
3224 |
+
if ( $product->get_sku() ) {
|
3225 |
+
$markup['sku'] = $product->get_sku();
|
3226 |
+
} else {
|
3227 |
+
$markup['sku'] = $product->get_id();
|
3228 |
+
}
|
3229 |
+
if ( '' !== $product->get_price() ) {
|
3230 |
+
// Assume prices will be valid until the end of next year, unless on sale and there is an end date.
|
3231 |
+
$price_valid_until = gmdate( 'Y-12-31', time() + YEAR_IN_SECONDS );
|
3232 |
+
if ( $product->is_type( 'variable' ) ) {
|
3233 |
+
$lowest = $product->get_variation_price( 'min', false );
|
3234 |
+
$highest = $product->get_variation_price( 'max', false );
|
3235 |
+
if ( $lowest === $highest ) {
|
3236 |
+
$markup_offer = array(
|
3237 |
+
'@type' => 'Offer',
|
3238 |
+
'price' => wc_format_decimal( $lowest, wc_get_price_decimals() ),
|
3239 |
+
'priceValidUntil' => $price_valid_until,
|
3240 |
+
'priceSpecification' => array(
|
3241 |
+
'price' => wc_format_decimal( $lowest, wc_get_price_decimals() ),
|
3242 |
+
'priceCurrency' => $currency,
|
3243 |
+
'valueAddedTaxIncluded' => wc_prices_include_tax() ? 'true' : 'false',
|
3244 |
+
),
|
3245 |
+
);
|
3246 |
+
} else {
|
3247 |
+
$markup_offer = array(
|
3248 |
+
'@type' => 'AggregateOffer',
|
3249 |
+
'lowPrice' => wc_format_decimal( $lowest, wc_get_price_decimals() ),
|
3250 |
+
'highPrice' => wc_format_decimal( $highest, wc_get_price_decimals() ),
|
3251 |
+
'offerCount' => count( $product->get_children() ),
|
3252 |
+
);
|
3253 |
+
}
|
3254 |
+
} else {
|
3255 |
+
if ( $product->is_on_sale() && $product->get_date_on_sale_to() ) {
|
3256 |
+
$price_valid_until = gmdate( 'Y-m-d', $product->get_date_on_sale_to()->getTimestamp() );
|
3257 |
+
}
|
3258 |
+
$markup_offer = array(
|
3259 |
+
'@type' => 'Offer',
|
3260 |
+
'price' => wc_format_decimal( $product->get_price(), wc_get_price_decimals() ),
|
3261 |
+
'priceValidUntil' => $price_valid_until,
|
3262 |
+
'priceSpecification' => array(
|
3263 |
+
'price' => wc_format_decimal( $product->get_price(), wc_get_price_decimals() ),
|
3264 |
+
'priceCurrency' => $currency,
|
3265 |
+
'valueAddedTaxIncluded' => wc_prices_include_tax() ? 'true' : 'false',
|
3266 |
+
),
|
3267 |
+
);
|
3268 |
+
}
|
3269 |
+
$markup_offer += array(
|
3270 |
+
'priceCurrency' => $currency,
|
3271 |
+
'availability' => 'http://schema.org/' . ( $product->is_in_stock() ? 'InStock' : 'OutOfStock' ),
|
3272 |
+
'url' => $permalink,
|
3273 |
+
'seller' => array(
|
3274 |
+
'@type' => 'Organization',
|
3275 |
+
'name' => $shop_name,
|
3276 |
+
'url' => $shop_url,
|
3277 |
+
),
|
3278 |
+
);
|
3279 |
+
$markup['offers'] = array( apply_filters( 'woocommerce_structured_data_product_offer', $markup_offer, $product ) );
|
3280 |
+
}
|
3281 |
+
if ( $product->get_rating_count() && wc_review_ratings_enabled() ) {
|
3282 |
+
$markup['aggregateRating'] = array(
|
3283 |
+
'@type' => 'AggregateRating',
|
3284 |
+
'ratingValue' => $product->get_average_rating(),
|
3285 |
+
'reviewCount' => $product->get_review_count(),
|
3286 |
+
);
|
3287 |
+
// Markup 5 most recent rating/review.
|
3288 |
+
$comments = get_comments(
|
3289 |
+
array(
|
3290 |
+
'number' => 5,
|
3291 |
+
'post_id' => $product->get_id(),
|
3292 |
+
'status' => 'approve',
|
3293 |
+
'post_status' => 'publish',
|
3294 |
+
'post_type' => 'product',
|
3295 |
+
'parent' => 0,
|
3296 |
+
'meta_query' => array( // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query
|
3297 |
+
array(
|
3298 |
+
'key' => 'rating',
|
3299 |
+
'type' => 'NUMERIC',
|
3300 |
+
'compare' => '>',
|
3301 |
+
'value' => 0,
|
3302 |
+
),
|
3303 |
+
),
|
3304 |
+
)
|
3305 |
+
);
|
3306 |
+
if ( $comments ) {
|
3307 |
+
$markup['review'] = array();
|
3308 |
+
foreach ( $comments as $comment ) {
|
3309 |
+
$markup['review'][] = array(
|
3310 |
+
'@type' => 'Review',
|
3311 |
+
'reviewRating' => array(
|
3312 |
+
'@type' => 'Rating',
|
3313 |
+
'bestRating' => '5',
|
3314 |
+
'ratingValue' => get_comment_meta( $comment->comment_ID, 'rating', true ),
|
3315 |
+
'worstRating' => '1',
|
3316 |
+
),
|
3317 |
+
'author' => array(
|
3318 |
+
'@type' => 'Person',
|
3319 |
+
'name' => get_comment_author( $comment ),
|
3320 |
+
),
|
3321 |
+
'reviewBody' => get_comment_text( $comment ),
|
3322 |
+
'datePublished' => get_comment_date( 'c', $comment ),
|
3323 |
+
);
|
3324 |
+
}
|
3325 |
+
}
|
3326 |
+
}
|
3327 |
+
// Check we have required data.
|
3328 |
+
if ( empty( $markup['aggregateRating'] ) && empty( $markup['offers'] ) && empty( $markup['review'] ) ) {
|
3329 |
+
return;
|
3330 |
+
}
|
3331 |
+
|
3332 |
+
// Check if we have mpn data.
|
3333 |
+
if ( $disable_mpn == 'enable' && ! empty( $mpn ) ) {
|
3334 |
+
$markup['mpn'] = $mpn;
|
3335 |
+
}
|
3336 |
+
|
3337 |
+
// Check if we have brand data.
|
3338 |
+
if ( $disable_brand == 'enable' && ! empty( $brand_term ) ) {
|
3339 |
+
$markup['brand'] = $brand_term[0];
|
3340 |
+
}
|
3341 |
+
|
3342 |
+
echo '<script type="application/ld+json">' . json_encode( $markup, JSON_UNESCAPED_SLASHES ) . '</script>'; //encode schema for job posting
|
3343 |
+
}
|
3344 |
|
3345 |
}
|
3346 |
|
3368 |
function woo_feed_pixel_script(){
|
3369 |
|
3370 |
global $woocommerce, $post, $product;
|
|
|
3371 |
|
3372 |
// Pixel Config.
|
3373 |
$settings = woo_feed_get_options( 'all' );
|
3379 |
|
3380 |
// Product Tracking
|
3381 |
if ( is_product() ) {
|
3382 |
+
$product = wc_get_product( $post->ID );
|
3383 |
|
3384 |
$view_type .= "fbq('track', 'ViewContent', {
|
3385 |
content_name: '$post->post_title',
|
includes/log-helper.php
CHANGED
@@ -35,6 +35,11 @@ if ( ! function_exists( 'woo_feed_get_logger' ) ) {
|
|
35 |
if ( null !== $logger && is_a( $logger, 'WC_Logger' ) ) {
|
36 |
return $logger;
|
37 |
}
|
|
|
|
|
|
|
|
|
|
|
38 |
$logger = new WC_Logger( [ new Woo_Feed_Log_Handler_File() ] );
|
39 |
|
40 |
return $logger;
|
35 |
if ( null !== $logger && is_a( $logger, 'WC_Logger' ) ) {
|
36 |
return $logger;
|
37 |
}
|
38 |
+
|
39 |
+
if( !class_exists('WC_Logger') ) {
|
40 |
+
return $logger;
|
41 |
+
}
|
42 |
+
|
43 |
$logger = new WC_Logger( [ new Woo_Feed_Log_Handler_File() ] );
|
44 |
|
45 |
return $logger;
|
libs/WebAppick/AppServices/Insights.php
CHANGED
@@ -402,7 +402,7 @@ class Insights {
|
|
402 |
*/
|
403 |
public function __is_local_server() {
|
404 |
// phpcs:disable
|
405 |
-
|
406 |
// phpcs:enable
|
407 |
}
|
408 |
|
402 |
*/
|
403 |
public function __is_local_server() {
|
404 |
// phpcs:disable
|
405 |
+
return apply_filters( 'WebAppick_is_local', isset( $_SERVER['REMOTE_ADDR'] ) ? in_array( $_SERVER['REMOTE_ADDR'], [ '127.0.0.1', '::1' ] ) : true );
|
406 |
// phpcs:enable
|
407 |
}
|
408 |
|
woo-feed.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
* Plugin Name: WooCommerce Product Feed
|
11 |
* Plugin URI: https://webappick.com/
|
12 |
* Description: Easily generate woocommerce product feed for any marketing channel like Google Shopping(Merchant), Facebook Remarketing, Bing, eBay & more. Support 100+ Merchants.
|
13 |
-
* Version: 4.3.
|
14 |
* Author: WebAppick
|
15 |
* Author URI: https://webappick.com/
|
16 |
* License: GPL v2
|
@@ -38,7 +38,7 @@ if ( ! defined( 'WOO_FEED_FREE_VERSION' ) ) {
|
|
38 |
* @var string
|
39 |
* @since 3.1.6
|
40 |
*/
|
41 |
-
define( 'WOO_FEED_FREE_VERSION', '4.3.
|
42 |
}
|
43 |
|
44 |
if ( ! defined( 'WOO_FEED_FREE_FILE' ) ) {
|
10 |
* Plugin Name: WooCommerce Product Feed
|
11 |
* Plugin URI: https://webappick.com/
|
12 |
* Description: Easily generate woocommerce product feed for any marketing channel like Google Shopping(Merchant), Facebook Remarketing, Bing, eBay & more. Support 100+ Merchants.
|
13 |
+
* Version: 4.3.12
|
14 |
* Author: WebAppick
|
15 |
* Author URI: https://webappick.com/
|
16 |
* License: GPL v2
|
38 |
* @var string
|
39 |
* @since 3.1.6
|
40 |
*/
|
41 |
+
define( 'WOO_FEED_FREE_VERSION', '4.3.12' );
|
42 |
}
|
43 |
|
44 |
if ( ! defined( 'WOO_FEED_FREE_FILE' ) ) {
|