This commit is contained in:
2026-04-26 23:47:49 +02:00
parent 1b95f03d1e
commit b073e009d8
5288 changed files with 1112699 additions and 55536 deletions

View File

@@ -7,19 +7,15 @@ Tutorial / Blog posts:
Priority issues:
- Add automotive fields for Facebook feed, see: https://developers.facebook.com/docs/marketing-api/dynamic-ads-auto/auto-catalog/
- Autosuggest for category mapping broken
- Add AddToCart event on buttons again
- Add Pinterest Tag; https://help.pinterest.com/nl/business/article/install-the-pinterest-tag
- License key input field needs to be a password field (asterixes)
- A seperate FB pixel per WPML website / language
- Add a preview option so only 5-10 products are being generated
- Own hosted plugin updating: https://rudrastyh.com/wordpress/self-hosted-plugin-update.html
- Add support for Wordpress Multisites
- Add a filter on review score (and amount of reviews)
- Make extra woosea fields available for front-end usage
- Add header to extra fields on product edit pages
- Add possibility to create OR rules
- Add support for Google My Business product feeds
- AMAZON integration:
- requires a professional seller account, 39 dollar a month, before being able to create a developer account
- only then we can use their MWS service needed to connect our plugin

File diff suppressed because it is too large Load Diff

View File

@@ -80,9 +80,10 @@ class WooSEA_fruugoaus {
"format" => "optional",
),
"VAT Rate" => array(
"name" => "VatRate",
"feed_name" => "VatRate",
"name" => "VATRate",
"feed_name" => "VATRate",
"format" => "required",
"woo_suggest" => "vat",
),
"Image URL 2" => array(
"name" => "Imageurl2",

View File

@@ -69,20 +69,21 @@ class WooSEA_fruugoes {
"woo_suggest" => "description",
),
"Normal Price With VAT" => array(
"name" => "NormalPriceWithVat",
"feed_name" => "NormalPriceWithVat",
"name" => "NormalPriceWithVAT",
"feed_name" => "NormalPriceWithVAT",
"format" => "required",
"woo_suggest" => "price",
),
"Normal Price Without VAT" => array(
"name" => "NormalPriceWithoutVat",
"feed_name" => "NormalPriceWithoutVat",
"name" => "NormalPriceWithoutVAT",
"feed_name" => "NormalPriceWithoutVAT",
"format" => "optional",
),
"VAT Rate" => array(
"name" => "VatRate",
"feed_name" => "VatRate",
"name" => "VATRate",
"feed_name" => "VATRate",
"format" => "required",
"woo_suggest" => "vat",
),
"Image URL 2" => array(
"name" => "Imageurl2",

View File

@@ -83,6 +83,7 @@ class WooSEA_fruugonl {
"name" => "VATRate",
"feed_name" => "VATRate",
"format" => "required",
"woo_suggest" => "vat",
),
"Image URL 2" => array(
"name" => "Imageurl2",

View File

@@ -69,21 +69,22 @@ class WooSEA_fruugouk {
"woo_suggest" => "description",
),
"Normal Price Without VAT" => array(
"name" => "NormalPriceWithoutVat",
"feed_name" => "NormalPriceWithoutVat",
"name" => "NormalPriceWithoutVAT",
"feed_name" => "NormalPriceWithoutVAT",
"format" => "optional",
),
"Normal Price With VAT" => array(
"name" => "NormalPriceWithVat",
"feed_name" => "NormalPriceWithVat",
"name" => "NormalPriceWithVAT",
"feed_name" => "NormalPriceWithVAT",
"format" => "required",
"woo_suggest" => "price",
),
"VAT Rate" => array(
"name" => "VatRate",
"feed_name" => "VatRate",
"name" => "VATRate",
"feed_name" => "VATRate",
"format" => "required",
"woo_suggest" => "vat",
),
"Image URL 2" => array(
"name" => "Imageurl2",

View File

@@ -69,20 +69,21 @@ class WooSEA_fruugous {
"woo_suggest" => "description",
),
"Normal Price With VAT" => array(
"name" => "NormalPriceWithVat",
"feed_name" => "NormalPriceWithVat",
"name" => "NormalPriceWithVAT",
"feed_name" => "NormalPriceWithVAT",
"format" => "required",
"woo_suggest" => "price",
),
"Normal Price Without VAT" => array(
"name" => "NormalPriceWithoutVat",
"feed_name" => "NormalPriceWithoutVat",
"name" => "NormalPriceWithoutVAT",
"feed_name" => "NormalPriceWithoutVAT",
"format" => "optional",
),
"VAT Rate" => array(
"name" => "VatRate",
"feed_name" => "VatRate",
"name" => "VATRate",
"feed_name" => "VATRate",
"format" => "required",
"woo_suggest" => "vat",
),
"Image URL 2" => array(
"name" => "Imageurl2",

View File

@@ -61,6 +61,12 @@ class WooSEA_google_shopping {
"feed_name" => "g:mobile_link",
"format" => "optional",
),
"Checkout link template" => array(
"name" => "checkout_link_template",
"feed_name" => "g:checkout_link_template",
"format" => "required",
"woo_suggest" => "cart_link",
),
),
"Price & availability" => array(
"Stock status" => array(
@@ -127,6 +133,11 @@ class WooSEA_google_shopping {
"feed_name" => "g:loyalty_points",
"format" => "optional",
),
"Auto pricing min price" => array(
"name" => "auto_pricing_min_price",
"feed_name" => "g:auto_pricing_min_price",
"format" => "optional",
),
),
"Product category" => array(
"Google product category" => array(
@@ -139,7 +150,7 @@ class WooSEA_google_shopping {
"name" => "product_type",
"feed_name" => "g:product_type",
"format" => "required",
"woo_suggest" => "raw_categories",
"woo_suggest" => "category_path",
),
),
"Product identifiers" => array(
@@ -290,9 +301,29 @@ class WooSEA_google_shopping {
"feed_name" => "g:promotion_id",
"format" => "optional",
),
"Included destination" => array(
"name" => "included_destination",
"feed_name" => "included_destination",
"Included destination 1" => array(
"name" => "included_destination_1",
"feed_name" => "g:included_destination",
"format" => "optional",
),
"Included destination 2" => array(
"name" => "included_destination_2",
"feed_name" => "g:included_destination",
"format" => "optional",
),
"Included destination 3" => array(
"name" => "included_destination_3",
"feed_name" => "g:included_destination",
"format" => "optional",
),
"Included destination 4" => array(
"name" => "included_destination_4",
"feed_name" => "g:included_destination",
"format" => "optional",
),
"Included destination 5" => array(
"name" => "included_destination_5",
"feed_name" => "g:included_destination",
"format" => "optional",
),
"Ads grouping" => array(
@@ -421,8 +452,18 @@ class WooSEA_google_shopping {
"feed_name" => "g:consumer_datasheet",
"format" => "optional",
),
"Consumer notice" => array(
"name" => "consumer_notice",
"Consumer notice 1" => array(
"name" => "consumer_notice_1",
"feed_name" => "g:consumer_notice",
"format" => "optional",
),
"Consumer notice 2" => array(
"name" => "consumer_notice_2",
"feed_name" => "g:consumer_notice",
"format" => "optional",
),
"Consumer notice 3" => array(
"name" => "consumer_notice_3",
"feed_name" => "g:consumer_notice",
"format" => "optional",
),
@@ -436,8 +477,53 @@ class WooSEA_google_shopping {
"feed_name" => "g:shopping_ads_excluded_country",
"format" => "optional",
),
"Product detail" => array(
"name" => "product_detail",
"Product detail 1" => array(
"name" => "product_detail_1",
"feed_name" => "g:product_detail",
"format" => "optional",
),
"Product detail 2" => array(
"name" => "product_detail_2",
"feed_name" => "g:product_detail",
"format" => "optional",
),
"Product detail 3" => array(
"name" => "product_detail_3",
"feed_name" => "g:product_detail",
"format" => "optional",
),
"Product detail 4" => array(
"name" => "product_detail_4",
"feed_name" => "g:product_detail",
"format" => "optional",
),
"Product detail 5" => array(
"name" => "product_detail_5",
"feed_name" => "g:product_detail",
"format" => "optional",
),
"Product detail 6" => array(
"name" => "product_detail_6",
"feed_name" => "g:product_detail",
"format" => "optional",
),
"Product detail 7" => array(
"name" => "product_detail_7",
"feed_name" => "g:product_detail",
"format" => "optional",
),
"Product detail 8" => array(
"name" => "product_detail_8",
"feed_name" => "g:product_detail",
"format" => "optional",
),
"Product detail 9" => array(
"name" => "product_detail_9",
"feed_name" => "g:product_detail",
"format" => "optional",
),
"Product detail 10" => array(
"name" => "product_detail_10",
"feed_name" => "g:product_detail",
"format" => "optional",
),
@@ -626,6 +712,31 @@ class WooSEA_google_shopping {
"feed_name" => "g:display_ads_value",
"format" => "optional",
),
"3D model link" => array(
"name" => "virtual_model_link",
"feed_name" => "g:virtual_model_link",
"format" => "optional",
),
"Certification" => array(
"name" => "certification",
"feed_name" => "g:certification",
"format" => "optional",
),
"Lifestyle image link" => array(
"name" => "lifestyle_image_link",
"feed_name" => "g:lifestyle_image_link",
"format" => "optional",
),
"External seller ID" => array(
"name" => "external_seller_id",
"feed_name" => "g:external_seller_id",
"format" => "optional",
),
"Pause" => array(
"name" => "pause",
"feed_name" => "g:pause",
"format" => "optional",
),
),
);
return $google_attributes;

View File

@@ -0,0 +1,159 @@
<?php
/**
* Settings for PriceRunner feeds
*/
class WooSEA_pricerunner {
public $pricerunner;
public static function get_channel_attributes() {
$sitename = get_option('blogname');
$pricerunner = array(
"Feed fields" => array(
"ProductId" => array(
"name" => "ProductId",
"feed_name" => "ProductId",
"format" => "required",
"woo_suggest" => "id",
),
"ProductName" => array(
"name" => "ProductName",
"feed_name" => "ProductName",
"format" => "required",
"woo_suggest" => "title",
),
"Price" => array(
"name" => "Price",
"feed_name" => "Price",
"format" => "required",
"woo_suggest" => "price",
),
"ShippingCost" => array(
"name" => "ShippingCost",
"feed_name" => "ShippingCost",
"format" => "required",
"woo_suggest" => "shipping_price",
),
"StockStatus" => array(
"name" => "StockStatus",
"feed_name" => "StockStatus",
"format" => "required",
"woo_suggest" => "availability",
),
"LeadTime" => array(
"name" => "LeadTime",
"feed_name" => "LeadTime",
"format" => "required",
),
"Brand" => array(
"name" => "Brand",
"feed_name" => "Brand",
"format" => "required",
),
"SKU" => array(
"name" => "Msku",
"feed_name" => "Msku",
"format" => "required",
"woo_suggest" => "sku",
),
"EAN / GTIN" => array(
"name" => "EAN",
"feed_name" => "EAN",
"format" => "required",
),
"Url" => array(
"name" => "Url",
"feed_name" => "Url",
"format" => "required",
"woo_suggest" => "link",
),
"ImageUrl" => array(
"name" => "ImageUrl",
"feed_name" => "ImageUrl",
"format" => "required",
"woo_suggest" => "image",
),
"Category" => array(
"name" => "Category",
"feed_name" => "Category",
"format" => "required",
"woo_suggest" => "category_path_short",
),
"Description" => array(
"name" => "Description",
"feed_name" => "Description",
"format" => "required",
"woo_suggest" => "description",
),
"AdultContent" => array(
"name" => "AdultContent",
"feed_name" => "AdultContent",
"format" => "optional",
),
"AgeGroup" => array(
"name" => "AgeGroup",
"feed_name" => "AgeGroup",
"format" => "optional",
),
"Bundled" => array(
"name" => "Bundled",
"feed_name" => "Bundled",
"format" => "optional",
),
"Color" => array(
"name" => "Color",
"feed_name" => "Color",
"format" => "optional",
),
"EnergyEfficiencyClass" => array(
"name" => "EnergyEfficiencyClass",
"feed_name" => "EnergyEfficiencyClass",
"format" => "optional",
),
"Gender" => array(
"name" => "Gender",
"feed_name" => "Gender",
"format" => "optional",
),
"Condition" => array(
"name" => "Condition",
"feed_name" => "Condition",
"format" => "optional",
),
"GroupId" => array(
"name" => "GroupId",
"feed_name" => "GroupId",
"format" => "optional",
),
"Material" => array(
"name" => "Material",
"feed_name" => "Material",
"format" => "optional",
),
"Multipack" => array(
"name" => "Multipack",
"feed_name" => "Multipack",
"format" => "optional",
),
"Pattern" => array(
"name" => "Pattern",
"feed_name" => "Pattern",
"format" => "optional",
),
"Size" => array(
"name" => "Size",
"feed_name" => "Size",
"format" => "optional",
),
"SizeSystem" => array(
"name" => "SizeSystem",
"feed_name" => "SizeSystem",
"format" => "optional",
),
),
);
return $pricerunner;
}
}
?>

View File

@@ -55,9 +55,9 @@ class WooSEA_shopflix {
"format" => "required",
"woo_suggest" => "link",
),
"Main Photo URL" => array(
"name" => "main_photo_url",
"feed_name" => "main_photo_url",
"Image" => array(
"name" => "image",
"feed_name" => "image",
"format" => "required",
"woo_suggest" => "image",
),

View File

@@ -404,8 +404,8 @@ class WooSEA_Activation {
"Pricerunner" => array (
"channel_hash" => md5("Pricerunner.dk"),
"name" => "Pricerunner.dk",
"fields" => "google_shopping",
"taxonomy" => "google_shopping",
"fields" => "pricerunner",
"taxonomy" => "none",
"utm_source" => "Pricerunner.dk",
"type" => "Comparison shopping engine" ),
"Shopalike" => array (
@@ -567,8 +567,8 @@ class WooSEA_Activation {
"Pricerunner.fr" => array (
"channel_hash" => md5("Pricerunner.fr"),
"name" => "Pricerunner.fr",
"fields" => "google_shopping",
"taxonomy" => "google_shopping",
"fields" => "pricerunner",
"taxonomy" => "none",
"utm_source" => "Pricerunner.fr",
"type" => "Comparison shopping engine" ),
"ShopAlike.fr" => array (
@@ -839,8 +839,8 @@ class WooSEA_Activation {
"Pricerunner.de" => array (
"channel_hash" => md5("Pricerunner.de"),
"name" => "Pricerunner.de",
"fields" => "google_shopping",
"taxonomy" => "google_shopping",
"fields" => "pricerunner",
"taxonomy" => "none",
"utm_source" => "Pricerunner.de",
"type" => "Comparison shopping engine" ),
"Rakuten.de" => array (
@@ -1305,7 +1305,7 @@ class WooSEA_Activation {
"fields" => "customfeed",
"taxonomy" => "none",
"utm_source" => "Adform.pl",
"type" => "Advertising" ),
"type" => "Advertising" ),
"Cenowarka" => array (
"channel_hash" => md5("Cenowarka.pl"),
"name" => "Cenowarka.pl",
@@ -1358,6 +1358,7 @@ class WooSEA_Activation {
"utm_source" => "Kuantokusta.pt",
"type" => "Comparison shopping engine" ),
),
"Puerto Rico" => array (),
"Qatar" => array (),
"Reunion" => array (),
"Romania" => array (
@@ -1521,8 +1522,8 @@ class WooSEA_Activation {
"Pricerunner" => array (
"channel_hash" => md5("Pricerunner.se"),
"name" => "Pricerunner.se",
"fields" => "google_shopping",
"taxonomy" => "google_shopping",
"fields" => "pricerunner",
"taxonomy" => "none",
"utm_source" => "Pricerunner.se",
"type" => "Comparison shopping engine" ),
"Miinto" => array (
@@ -1681,8 +1682,8 @@ class WooSEA_Activation {
"Pricerunner" => array (
"channel_hash" => md5("Pricerunner.co.uk"),
"name" => "Pricerunner.co.uk",
"fields" => "google_shopping",
"taxonomy" => "google_shopping",
"fields" => "pricerunner",
"taxonomy" => "none",
"utm_source" => "Pricerunner.co.uk",
"type" => "Comparison shopping engine" ),
"Pricespy" => array (
@@ -1938,5 +1939,14 @@ class WooSEA_Activation {
$new_activation = $count_activation+1;
update_option ( 'woosea_count_activation', $new_activation );
}
/**
* Delete the debug.log file from the uploads directory if it exists.
*/
$upload_dir = wp_upload_dir();
$debug_file = $upload_dir['basedir'] . "/woo-product-feed-pro/logs/debug.log";
if ( file_exists($debug_file)) {
unlink($debug_file);
}
}
}

View File

@@ -10,42 +10,17 @@ class WooSEA_Get_Admin_Notifications {
}
public function woosea_debug_informations ($versions, $product_numbers, $order_rows, $cron_objects) {
$upload_dir = wp_upload_dir();
$filename = "debug";
// Log timestamp
$debug_info = "\n";
$debug_info .= date("F j, Y, g:i a"); // e.g. March 10, 2001, 5:16 pm
$debug_info .= "\n";
$base = $upload_dir['basedir'];
$path = $base . "/woo-product-feed-pro/logs";
$file = $path . "/". $filename ."." ."log";
$debug_info .= print_r($versions, true);
$debug_info .= print_r($product_numbers, true);
$debug_info .= print_r($cron_objects, true);
$debug_info .= print_r($order_rows, true);
// Remove the previous file, preventing the file from becoming to big
if ( file_exists ( $file ) ){
unlink($file);
}
// External location for downloading the file
$external_base = $upload_dir['baseurl'];
$external_path = $external_base . "/woo-product-feed-pro/logs";
$external_file = $external_path . "/" . $filename ."." ."log";
// Check if directory in uploads exists, if not create one
if ( ! file_exists( $path ) ) {
wp_mkdir_p( $path );
}
// Log timestamp
$today = "\n";
$today .= date("F j, Y, g:i a"); // March 10, 2001, 5:16 pm
$today .= "\n";
$fp = fopen($file, 'a+');
fwrite($fp, $today);
fwrite($fp, print_r($versions, TRUE));
fwrite($fp, print_r($product_numbers, TRUE));
fwrite($fp, print_r($cron_objects, TRUE));
fwrite($fp, print_r($order_rows, TRUE));
fclose($fp);
return $this->notification_details = $external_file;
return $debug_info;
}
public function get_admin_notifications ( $step, $error ) {

View File

@@ -3,7 +3,6 @@
* This class is called to: retrieve product attributes
* for populating the rules dropdowns and draggable boxes
*/
class WooSEA_Attributes {
public $attributes;
@@ -49,8 +48,8 @@ private function get_dynamic_attributes(){
$list = array();
$no_taxonomies = array("portfolio_category","portfolio_skills","portfolio_tags","nav_menu","post_format","slide-page","element_category","template_category","portfolio_category","portfolio_skills","portfolio_tags","faq_category","slide-page","category","post_tag","nav_menu","link_category","post_format","product_type","product_visibility","product_cat","product_shipping_class","product_tag");
$taxonomies = get_taxonomies();
$diff_taxonomies = array_diff($taxonomies, $no_taxonomies);
$taxonomies = get_taxonomies();
$diff_taxonomies = array_diff($taxonomies, $no_taxonomies);
# get custom taxonomy values for a product
foreach($diff_taxonomies as $tax_diff){
@@ -246,8 +245,11 @@ public function get_mapping_attributes_dropdown() {
"regular_price" => "Regular price",
"sale_price" => "Sale price",
"net_price" => "Price excl. VAT",
"net_regular_price" => "Regular price excl. VAT",
"net_price_rounded" => "Price excl. VAT rounded",
"net_regular_price" => "Regular price excl. VAT",
"net_regular_price_rounded" => "Regular price excl. VAT rounded",
"net_sale_price" => "Sale price excl. VAT",
"net_sale_price_rounded" => "Sale price excl. VAT rounded",
"price_forced" => "Price incl. VAT front end",
"regular_price_forced" => "Regular price incl. VAT front end",
"sale_price_forced" => "Sale price incl. VAT front end",
@@ -282,10 +284,12 @@ public function get_mapping_attributes_dropdown() {
"link_no_tracking" => "Link without parameters",
"variable_link" => "Product variable link",
"add_to_cart_link" => "Add to cart link",
"cart_link" => "Cart link",
"product_creation_date" => "Product creation date",
"days_back_created" => "Product days back created",
"currency" => "Currency",
"categories" => "Category",
"raw_categories" => "Category (not used for mapping)",
"category_link" => "Category link",
"category_path" => "Category path",
"category_path_short" => "Category path short",
@@ -324,7 +328,8 @@ public function get_mapping_attributes_dropdown() {
"total_product_orders" => "Total product orders",
"tax_status" => "Tax status",
"tax_class" => "Tax class",
"featured" => "Featured",
"vat" => "VAT",
"featured" => "Featured",
"item_group_id" => "Item group ID",
"weight" => "Weight",
"width" => "Width",
@@ -436,6 +441,7 @@ public function get_mapping_attributes_dropdown() {
$dropdown .= "<option value='product_tag_space'>Product tags space</option>";
$dropdown .= "<option value='menu_order'>Menu order</option>";
$dropdown .= "<option value='reviews'>Reviews</option>";
$dropdown .= "<option value='review_rating'>Review rating</option>";
$dropdown .= "<option value='author'>Author</option>";
$dropdown .= "</optgroup>";
@@ -483,7 +489,8 @@ public function get_mapping_attributes_dropdown() {
"link" => "Link",
"link_no_tracking" => "Link without parameters",
"variable_link" => "Product variable link",
"add_to_cart_link" => "Add to cart link",
"add_to_cart_link" => "Add to cart link",
"cart_link" => "Cart link",
"image" => "Main image",
"image_all" => "Main image simple and variations",
"feature_image" => "Feature image",
@@ -497,6 +504,7 @@ public function get_mapping_attributes_dropdown() {
"featured" => "Featured",
"tax_status" => "Tax status",
"tax_class" => "Tax class",
"vat" => "VAT",
"currency" => "Currency",
"categories" => "Category",
"raw_categories" => "Category (not used for mapping)",
@@ -532,8 +540,11 @@ public function get_mapping_attributes_dropdown() {
"regular_price" => "Regular price",
"sale_price" => "Sale price",
"net_price" => "Price excl. VAT",
"net_regular_price" => "Regular price excl. VAT",
"net_sale_price" => "Sale price excl. VAT",
"net_price_rounded" => "Price excl. VAT rounded",
"net_regular_price" => "Regular price excl. VAT",
"net_regular_price_rounded" => "Regular price excl. VAT rounded",
"net_sale_price" => "Sale price excl. VAT",
"net_sale_price_rounded" => "Sale price excl. VAT rounded",
"price_forced" => "Price incl. VAT front end",
"regular_price_forced" => "Regular price incl. VAT front end",
"sale_price_forced" => "Sale price incl. VAT front end",
@@ -610,10 +621,23 @@ public function get_mapping_attributes_dropdown() {
"calculated" => "Plugin calculation",
"product_tag" => "Product tags",
"product_tag_space" => "Product tags space",
"product_detail" => "Product detail",
"product_detail 1" => "Product detail 1",
"product_detail 2" => "Product detail 2",
"product_detail 3" => "Product detail 3",
"product_detail 4" => "Product detail 4",
"product_detail 5" => "Product detail 5",
"product_detail 6" => "Product detail 6",
"product_detail 7" => "Product detail 7",
"product_detail 8" => "Product detail 8",
"product_detail 9" => "Product detail 9",
"product_detail 10" => "Product detail 10",
"product_highlight" => "Product highlight",
"consumer_notice_1" => "Consumer notice 1",
"consumer_notice_2" => "Consumer notice 2",
"consumer_notice_3" => "Consumer notice 3",
"menu_order" => "Menu order",
"reviews" => "Reviews",
"review_rating" => "Review rating",
"author" => "Author",
);
@@ -631,9 +655,11 @@ public function get_mapping_attributes_dropdown() {
$custom_attributes['custom_attributes__aioseop_title'] = "All in one seo pack title";
$custom_attributes['custom_attributes__aioseop_description'] = "All in one seo pack description";
}
array_walk($custom_attributes, function(&$value, $key) { $value .= ' (Custom attribute)';});
$attributes = array_merge($attributes, $custom_attributes);
if (is_array($custom_attributes)){
array_walk($custom_attributes, function(&$value, $key) { $value .= ' (Custom attribute)';});
$attributes = array_merge($attributes, $custom_attributes);
}
$attributes = array_merge($attributes, $static);

View File

@@ -0,0 +1,250 @@
<?php
class WooSEA_Caching {
/**
* Exclude Feed URL from being cached by LiteSpeed
*
* @return false
*/
function litespeed_cache() {
if ( ! class_exists( 'LiteSpeed\Core' ) || ! defined( 'LSCWP_DIR' ) ) {
return false;
}
$litespeed_ex_paths = maybe_unserialize( get_option( 'litespeed.conf.cdn-exc' ) );
if ( $litespeed_ex_paths && is_array( $litespeed_ex_paths ) && ! in_array( '/wp-content/uploads/woo-product-feed-pro', $litespeed_ex_paths ) ) {
$litespeed_ex_paths = array_merge(
$litespeed_ex_paths,
array( '/wp-content/uploads/woo-product-feed-pro' )
);
update_option( 'litespeed.conf.cdn-exc', $litespeed_ex_paths );
}
return false;
}
/**
* Exclude Feed URL from being cached by WP Fastest
*
* @return false
*/
public function wp_fastest_cache() {
if ( ! class_exists( 'WpFastestCache' ) ) {
return false;
}
$wp_fastest_cache_ex_paths = json_decode( get_option( 'WpFastestCacheExclude' ), false );
if ( $wp_fastest_cache_ex_paths && is_array( $wp_fastest_cache_ex_paths ) ) {
$feed_path_exist = false;
foreach ( $wp_fastest_cache_ex_paths as $path ) {
if ( 'woo-product-feed-pro' === $path->content ) {
$feed_path_exist = true;
break;
}
}
if ( ! $feed_path_exist ) {
$new_rule = new stdClass();
$new_rule->prefix = "contain";
$new_rule->content = 'woo-product-feed-pro';
$new_rule->type = "page";
$wp_fastest_cache_ex_paths = array_merge(
$wp_fastest_cache_ex_paths,
[ $new_rule ]
);
update_option( 'WpFastestCacheExclude', wp_json_encode( $wp_fastest_cache_ex_paths ) );
}
} elseif ( empty( $wp_fastest_cache_ex_paths ) ) {
$wp_fastest_cache_ex_paths = [];
$new_rule = new stdClass();
$new_rule->prefix = "contain";
$new_rule->content = 'woo-product-feed-pro';
$new_rule->type = "page";
$wp_fastest_cache_ex_paths = array_merge(
$wp_fastest_cache_ex_paths,
[ $new_rule ]
);
update_option( 'WpFastestCacheExclude', wp_json_encode( $wp_fastest_cache_ex_paths ) );
}
return false;
}
/**
* Exclude Feed URL from being cached by WP Super
*
* @return false
*/
public function wp_super_cache() {
if ( ! function_exists( 'wpsc_init' ) ) {
return false;
}
$wp_super_ex_paths = get_option( 'ossdl_off_exclude' );
if ( $wp_super_ex_paths && strpos( $wp_super_ex_paths, 'woo-product-feed-pro' ) === false ) {
$wp_super_ex_paths = explode( ',', $wp_super_ex_paths );
$wp_super_ex_paths = array_merge( $wp_super_ex_paths, [ 'woo-product-feed-pro' ] );
update_option( 'ossdl_off_exclude', implode( ',', $wp_super_ex_paths ) );
}
return false;
}
/**
* Exclude Feed URL from being cached by BREEZE
*
* @return false
*/
public function breeze_cache() {
if ( ! class_exists( 'Breeze_Admin' ) ) {
return false;
}
$breeze_settings = maybe_unserialize( get_option( 'breeze_cdn_integration' ) );
if ( is_array( $breeze_settings ) ) {
$woo_product_feed_pro_files = [ '.xml', '.csv', '.tsv', '.txt', '.xls' ];
$woo_product_feed_pro_files = array_unique( array_merge( $woo_product_feed_pro_files, $breeze_settings['cdn-exclude-content'] ) );
$breeze_settings['cdn-exclude-content'] = $woo_product_feed_pro_files;
update_option( 'breeze_cdn_integration', $breeze_settings );
}
return false;
}
/**
* Exclude Feed URL from being cached by WP Optimize
*
* @return false
*/
public function wp_optimize_cache() {
if ( ! class_exists( 'WP_Optimize' ) ) {
return false;
}
$wp_optimize_ex_paths = maybe_unserialize( get_option( 'wpo_cache_config' ) );
// If page Caching enabled
if ( isset( $wp_optimize_ex_paths['enable_page_caching'] ) && $wp_optimize_ex_paths['enable_page_caching'] && is_array( $wp_optimize_ex_paths ) && ! in_array( '/wp-content/uploads/woo-product-feed-pro', $wp_optimize_ex_paths['cache_exception_urls'], true ) ) {
$woo_feed_ex_path['cache_exception_urls'] = [ '/wp-content/uploads/woo-product-feed-pro' ];
$wp_optimize_ex_paths = array_merge_recursive(
$wp_optimize_ex_paths,
$woo_feed_ex_path
);
update_option( 'wpo_cache_config', $wp_optimize_ex_paths );
}
return false;
}
/**
* Exclude Feed URL from being cached by Cache Enabler
*
* @return false
*/
public function cache_enabler_cache() {
if ( ! class_exists( 'Cache_Enabler' ) ) {
return false;
}
$cache_enabler_ex_paths = maybe_unserialize( get_option( 'cache_enabler' ) );
if ( isset( $cache_enabler_ex_paths['excluded_page_paths'] ) && empty( $cache_enabler_ex_paths['excluded_page_paths'] ) ) {
$cache_enabler_ex_paths['excluded_page_paths'] = '/wp-content/uploads/woo-product-feed-pro/';
update_option( 'cache_enabler', $cache_enabler_ex_paths );
}
return false;
}
/**
* Exclude Feed URL from being cached by Swift Performance
*
* @return false
*/
public function swift_performance_cache() {
if ( ! class_exists( 'Swift_Performance_Lite' ) ) {
return false;
}
$swift_perform_ex_paths = maybe_unserialize( get_option( 'swift_performance_options' ) );
if ( $swift_perform_ex_paths && isset( $swift_perform_ex_paths['exclude-strings'] ) ) {
$exclude_strings = $swift_perform_ex_paths['exclude-strings'];
if ( is_array( $exclude_strings ) && ! in_array( '/wp-content/uploads/woo-product-feed-pro', $exclude_strings, true ) ) {
$woo_feed_ex_path['exclude-strings'] = [ '/wp-content/uploads/woo-product-feed-pro' ];
$swift_perform_ex_paths = array_merge_recursive(
$swift_perform_ex_paths,
$woo_feed_ex_path
);
} else {
$swift_perform_ex_paths['exclude-strings'] = [ '/wp-content/uploads/woo-product-feed-pro' ];
}
update_option( 'swift_performance_options', $swift_perform_ex_paths );
} elseif ( empty( $swift_perform_ex_paths ) ) {
$swift_perform_ex_paths['exclude-strings'] = [ '/wp-content/uploads/woo-product-feed-pro' ];
update_option( 'swift_performance_options', $swift_perform_ex_paths );
}
return false;
}
/**
* Exclude Feed URL from being cached by Comet Cache
*
* @return false
*/
public function comet_cache() {
if ( ! is_plugin_active( 'comet-cache/comet-cache.php' ) ) {
return false;
}
$comet_cache_settings = maybe_unserialize( get_option( 'comet_cache_options' ) );
if ( $comet_cache_settings && isset( $comet_cache_settings['exclude_uris'] ) ) {
$exclude_uris = $comet_cache_settings['exclude_uris'];
if ( strpos( $exclude_uris, '/wp-content/uploads/woo-product-feed-pro' ) === false ) {
$exclude_uris .= "\n/wp-content/uploads/woo-product-feed-pro";
$comet_cache_settings['exclude_uris'] = $exclude_uris;
update_option( 'comet_cache_options', $comet_cache_settings );
}
}
return false;
}
/**
* Exclude Feed URL from being cached by Hyper Caching
*
* @return false
*/
public function hyper_cache() {
if ( ! class_exists( 'HyperCache' ) ) {
return false;
}
$hyper_cache_settings = maybe_unserialize( get_option( 'hyper-cache' ) );
if ( $hyper_cache_settings && isset( $hyper_cache_settings['reject_uris'] ) ) {
$exclude_strings = $hyper_cache_settings['reject_uris'];
if ( is_array( $exclude_strings ) && ! in_array( '/wp-content/uploads/woo-product-feed-pro', $exclude_strings, true ) ) {
$woo_feed_ex_path['reject_uris'] = [ '/wp-content/uploads/woo-product-feed-pro' ];
$woo_feed_ex_path['reject_uris_enabled'] = 1;
$hyper_cache_settings = array_merge_recursive(
$hyper_cache_settings,
$woo_feed_ex_path
);
}
update_option( 'hyper-cache', $hyper_cache_settings );
}
return false;
}
}

View File

@@ -215,6 +215,15 @@ class WooSEA_Update_Project {
}
}
/**
* Did the option to preview the feed got disabled?
*/
if(array_key_exists('fileformat', $project_data)){
if(!array_key_exists('preview_feed', $project_data)) {
unset($project_config['preview_feed']);
}
}
/**
* Did all the filters got removed
*/

View File

@@ -341,6 +341,31 @@ input:checked + .woo-product-feed-pro-slider:before {
box-shadow: 0 0 5px #888;
}
.woo-product-feed-pro-debug-info {
margin: 2em 0 0;
}
.woo-product-feed-pro-debug-info h3 {
margin: 0;
}
.woo-product-feed-pro-debug-info .copy-product-feed-pro-debug-info {
position: relative;
top: 1.5em;
float: right;
}
.woo-product-feed-pro-debug-info pre {
clear: both;
display: block;
margin: 0;
padding: 1em 1.5em;
border: 1px solid #ccc;
background: #fff;
height: 531px;
overflow: auto;
}
@keyframes blinker {
50% { opacity: 0; }
}

View File

@@ -26,7 +26,7 @@ jQuery(document).ready(function($) {
var license_key = $('#license-key').val();
jQuery.ajax({
url: 'https://www.adtribes.io/check/license.php?key=' + license_key + '&email=' + license_email + '&domain=' + root_domain + '&version=12.4.5',
url: 'https://www.adtribes.io/check/license.php?key=' + license_key + '&email=' + license_email + '&domain=' + root_domain + '&version=13.3.2',
jsonp: 'callback',
dataType: 'jsonp',
type: 'GET',

View File

@@ -16,14 +16,18 @@ jQuery(function($) {
}
if (get_value == 'woosea_manage_feed') {
jQuery(function($) {
//$(document).on('ready',function(){
// Check if feed is processing
jQuery.ajax({
var nonce = $('#_wpnonce').val();
jQuery.ajax({
method: "POST",
url: ajaxurl,
data: { 'action': 'woosea_check_processing' }
dataType: "json",
data: {
'action': 'woosea_check_processing',
'security': nonce,
}
})
.done(function( data ) {
if(data.processing == "true"){
@@ -33,16 +37,22 @@ jQuery(function($) {
}
})
.fail(function( data ) {
console.log('Failed AJAX Call :( /// Return Data: ' + data);
console.log('Failed AJAX Call :( /// Return Data: ' + data);
});
});
}
$(".dismiss-review-notification").on('click', function(){
jQuery.ajax({
var nonce = $('#_wpnonce').val();
jQuery.ajax({
method: "POST",
url: ajaxurl,
data: { 'action': 'woosea_review_notification' }
data: {
'action': 'woosea_review_notification',
'security': nonce,
}
})
$(".review-notification").remove();
@@ -50,6 +60,8 @@ jQuery(function($) {
});
$(".get_elite").on('click', function(e){
var nonce = $('#_wpnonce').val();
if(e.target.tagName === 'A') return; // clicking on links should not close the div notice
$(".get_elite").remove();
@@ -57,11 +69,16 @@ jQuery(function($) {
jQuery.ajax({
method: "POST",
url: ajaxurl,
data: { 'action': 'woosea_getelite_notification' }
data: {
'action': 'woosea_getelite_notification',
'security': nonce,
}
})
});
$(".get_elite_activate").on('click', function(e){
var nonce = $('#_wpnonce').val();
if(e.target.tagName === 'A') return; // clicking on links should not close the div notice
$(".get_elite_activate").remove();
@@ -69,14 +86,17 @@ jQuery(function($) {
jQuery.ajax({
method: "POST",
url: ajaxurl,
data: { 'action': 'woosea_getelite_active_notification' }
data: {
'action': 'woosea_getelite_active_notification',
'security': nonce,
}
})
});
$("td[id=manage_inline]").find("div").parents("tr").hide();
$('.checkbox-field').on('change', function(index, obj){
var csrfToken = $('#csrfToken').val();
var nonce = $('#_wpnonce').val();
if(get_value == 'woosea_manage_settings' && tab_value == 'woosea_manage_attributes'){
var attribute_value = $(this).val();
var attribute_name = $(this).attr('name');
@@ -87,7 +107,7 @@ jQuery(function($) {
url: ajaxurl,
data: {
'action': 'woosea_add_attributes',
'security': csrfToken,
'security': nonce,
'attribute_name': attribute_name,
'attribute_value': attribute_value,
'active': attribute_status
@@ -102,6 +122,7 @@ jQuery(function($) {
url: ajaxurl,
data: {
'action': 'woosea_project_status',
'security': nonce,
'project_hash': project_hash,
'active': project_status
}
@@ -349,12 +370,18 @@ jQuery(function($) {
// Check if user would like to add a Facebook Pixel to their website
$('#woosea_content_ids').on('change', function(){ // on change of state
var nonce = $('#_wpnonce').val();
var content_ids = $('#woosea_content_ids').val();
if(content_ids){
jQuery.ajax({
method: "POST",
url: ajaxurl,
data: { 'action': 'woosea_facebook_content_ids', 'content_ids': content_ids }
data: {
'action': 'woosea_facebook_content_ids',
'security': nonce,
'content_ids': content_ids
}
})
}
})
@@ -559,7 +586,7 @@ jQuery(function($) {
var adwords_conversion_id = $('#adwords_conv_id').val();
var re = /^[0-9,-]*$/;
var woosea_valid_conversion_id=re.test(adwords_conversion_id);
// Check for allowed characters
if (!woosea_valid_conversion_id){
$('.notice').replaceWith("<div class='notice notice-error woosea-notice-conversion is-dismissible'><p>Sorry, only numbers are allowed for your Dynamic Remarketing Conversion tracking ID.</p></div>");
@@ -645,6 +672,7 @@ jQuery(function($) {
var idsplit = id.split('_');
var project_hash = idsplit[1];
var action = idsplit[0];
var nonce = $('#_wpnonce').val();
if (action == "gear"){
$("tr").not(':first').click(
@@ -656,13 +684,16 @@ jQuery(function($) {
}
if (action == "copy"){
var popup_dialog = confirm("Are you sure you want to copy this feed?");
if (popup_dialog == true){
jQuery.ajax({
method: "POST",
url: ajaxurl,
data: { 'action': 'woosea_project_copy', 'project_hash': project_hash }
data: {
'action': 'woosea_project_copy',
'security': nonce,
'project_hash': project_hash
}
})
.done(function( data ) {
@@ -680,7 +711,11 @@ jQuery(function($) {
jQuery.ajax({
method: "POST",
url: ajaxurl,
data: { 'action': 'woosea_project_delete', 'project_hash': project_hash }
data: {
'action': 'woosea_project_delete',
'security': nonce,
'project_hash': project_hash
}
})
$("table tbody").find('input[name="manage_record"]').each(function(){
@@ -699,7 +734,11 @@ jQuery(function($) {
jQuery.ajax({
method: "POST",
url: ajaxurl,
data: { 'action': 'woosea_project_cancel', 'project_hash': project_hash }
data: {
'action': 'woosea_project_cancel',
'security': nonce,
'project_hash': project_hash
}
})
// Replace status of project to stop processing
@@ -722,7 +761,11 @@ jQuery(function($) {
jQuery.ajax({
method: "POST",
url: ajaxurl,
data: { 'action': 'woosea_project_refresh', 'project_hash': project_hash }
data: {
'action': 'woosea_project_refresh',
'security': nonce,
'project_hash': project_hash
}
})
// Replace status of project to processing
@@ -752,13 +795,18 @@ jQuery(function($) {
function woosea_check_perc(){
// Check if we need to UP the processing percentage
var nonce = $('#_wpnonce').val();
$("table tbody").find('input[name="manage_record"]').each(function(){
var hash = this.value;
jQuery.ajax({
method: "POST",
url: ajaxurl,
data: { 'action': 'woosea_project_processing_status', 'project_hash': hash },
data: {
'action': 'woosea_project_processing_status',
'security': nonce,
'project_hash': hash
},
success: function(data) {
data = JSON.parse( data );
@@ -784,7 +832,10 @@ jQuery(function($) {
jQuery.ajax({
method: "POST",
url: ajaxurl,
data: { 'action': 'woosea_check_processing' }
data: {
'action': 'woosea_check_processing',
'security': nonce,
}
})
.done(function( data ) {
data = JSON.parse( data );
@@ -798,4 +849,7 @@ jQuery(function($) {
});
});
}
// Add copy to clipboard functionality for the debug information content box.
new ClipboardJS('.copy-product-feed-pro-debug-info');
});

View File

@@ -84,6 +84,7 @@ if (array_key_exists('project_hash', $_GET)){
// Set default notification to show
$getelite_notice = get_option('woosea_getelite_notification');
if(empty($getelite_notice['show'])){
$getelite_notice = array();
$getelite_notice['show'] = "yes";
$getelite_notice['timestamp'] = date( 'd-m-Y' );
}
@@ -502,9 +503,22 @@ if (array_key_exists('project_hash', $_GET)){
<td>
<?php
if((isset($project)) AND (array_key_exists('products_changed',$project))){
print "<input name=\"products_changed\" type=\"checkbox\" class=\"checkbox-field\" checked>";
print "<input name=\"products_changed\" type=\"checkbox\" class=\"checkbox-field\" checked> <a href=\"https://adtribes.io/update-product-feed-products-changed-new-ones-added/\" target=\"_blank\">Read our tutorial about this feature</a>";
} else {
print "<input name=\"products_changed\" type=\"checkbox\" class=\"checkbox-field\">";
print "<input name=\"products_changed\" type=\"checkbox\" class=\"checkbox-field\"> <a href=\"https://adtribes.io/update-product-feed-products-changed-new-ones-added/\" target=\"_blank\">Read our tutorial about this feature</a>";
}
?>
</td>
</tr>
<tr>
<td><span><?php _e( 'Create a preview of the feed','woo-product-feed-pro' );?>:</span></td>
<td>
<?php
if((isset($project)) AND (array_key_exists('preview_feed',$project))){
print "<input name=\"preview_feed\" type=\"checkbox\" class=\"checkbox-field\" checked> <a href=\"https://adtribes.io/create-product-feed-preview/\" target=\"_blank\">Read our tutorial about this feature</a>";
} else {
print "<input name=\"preview_feed\" type=\"checkbox\" class=\"checkbox-field\"> <a href=\"https://adtribes.io/create-product-feed-preview/\" target=\"_blank\">Read our tutorial about this feature</a>";
}
?>
</td>

View File

@@ -1,20 +1,9 @@
<?php
$cron_projects = get_option( 'cron_projects' );
$license_information = get_option( 'license_information' );
$count_variation = wp_count_posts('product_variation');
$count_single = wp_count_posts('product');
$published_single = $count_single->publish;
$published_variation = $count_variation->publish;
$published_products = $published_single+$published_variation;
$host = sanitize_text_field($_SERVER['HTTP_HOST']);
$add_manipulation_support = get_option ('add_manipulation_support');
$product_numbers = array (
"Single products" => $published_single,
"Variation products" => $published_variation,
"Total products" => $published_products
);
$plugin_data = get_plugin_data( __FILE__ );
$versions = array (
@@ -24,13 +13,6 @@ $versions = array (
"WooCommerce Product Feed PRO" => WOOCOMMERCESEA_PLUGIN_VERSION
);
// Get the sales from created product feeds
//global $wpdb;
//$charset_collate = $wpdb->get_charset_collate();
//$table_name = $wpdb->prefix . 'adtribes_my_conversions';
//$order_rows = $wpdb->get_results("SELECT * FROM $table_name", ARRAY_A);
$order_rows = "";
/**
* Change default footer text, asking to review our plugin
**/
@@ -69,6 +51,9 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
$notifications_box = $notifications_obj->get_admin_notifications ( '12', 'false' );
}
// create nonce
$nonce = wp_create_nonce( 'woosea_ajax_nonce' );
?>
<div class="wrap">
<div class="woo-product-feed-pro-form-style-2">
@@ -79,20 +64,6 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
// KILL SWITCH, THIS WILL REMOVE ALL YOUR FEED PROJECTS
// delete_option( 'cron_projects');
if(sanitize_text_field($_GET['debug']) == "true"){
$external_debug_file = $notifications_obj->woosea_debug_informations ($versions, $product_numbers, $order_rows, $cron_projects);
?>
<div class="woo-product-feed-pro-form-style-2-heading"><?php _e( 'Debugging mode', 'woo-product-feed-pro' );?></div>
<div class="notice notice-error is-dismissible">
<p>
<?php _e( 'Thank you for taking the time to help us find bugs in our plugin. It is greatly appreciated by us and your feedback will help all current and future users of this plugin. Could you please copy / paste the debug URL in the box below and send it to <a href="mailto:support@adtribes.io">support@adtribes.io</a> so we can analyse how your feed projects are configured and discover potential problems.','woo-product-feed-pro' );?><br/><br/>
<?php
print "<strong>Debug file:</strong><br/><a href=\"$external_debug_file\" target=\"_blank\">$external_debug_file</a>";
?>
</p>
</div><br/>
<?php
}
} elseif (array_key_exists('force-active', $_GET)){
// Force active all feeds
foreach($cron_projects as $key => $value){
@@ -118,9 +89,10 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
// Set default notification to show
$getelite_notice = get_option('woosea_getelite_notification');
if(empty($getelite_notice['show'])){
$getelite_notice['show'] = "yes";
$getelite_notice = array();
$getelite_notice['show'] = "yes";
$getelite_notice['timestamp'] = date( 'd-m-Y' );
}
}
if($getelite_notice['show'] <> "no"){
?>
@@ -129,10 +101,10 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
<strong><?php _e( 'Would you like to get more out of your product feeds? Upgrade to the Elite version of the plugin and you will get:', 'woo-product-feed-pro' );?></strong><br/></br/>
<span class="dashicons dashicons-yes"></span><?php _e( 'Priority support - we will help you to get your product feed(s) up-and-running;', 'woo-product-feed-pro' );?><br/>
<span class="dashicons dashicons-yes"></span><?php _e( 'GTIN, Brand, MPN, EAN, Condition and more fields for your product feeds', 'woo-product-feed-pro' );?> [<a href="https://adtribes.io/add-gtin-mpn-upc-ean-product-condition-optimised-title-and-brand-attributes/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=adding%20fields" target="_blank"><?php _e( 'Read more','woo-product-feed-pro' );?></a>];<br/>
<span class="dashicons dashicons-yes"></span><?php _e( 'Enhanched structured data on your product pages: more products approved in your Google Merchant Center', 'woo-product-feed-pro' );?> [<a href="https://adtribes.io/woocommerce-structured-data-bug/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=structured%20data%20bug" target="_blank"><?php _e( 'Read more','woo-product-feed-pro' );?></a>];<br/>
<span class="dashicons dashicons-yes"></span><?php _e( 'Solve Googe Shopping price mismatch product disapprovals', 'woo-product-feed-pro' );?> [<a href="https://adtribes.io/woocommerce-structured-data-bug/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=structured%20data%20bug" target="_blank"><?php _e( 'Read more','woo-product-feed-pro' );?></a>];<br/>
<span class="dashicons dashicons-yes"></span><?php _e( 'Advanced product data manipulation','woo-product-feed-pro' );?> [<a href="https://adtribes.io/feature-product-data-manipulation/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=product%20data%20manipulation" target="_blank"><?php _e( 'Read more','woo-product-feed-pro' );?></a>];<br/>
<span class="dashicons dashicons-yes"></span><?php _e( 'WPML support - including their currency switcher','woo-product-feed-pro' );?> [<a href="https://adtribes.io/wpml-support/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=wpml%20support" target="_blank"><?php _e( 'Read more','woo-product-feed-pro' );?></a>];<br/>
<span class="dashicons dashicons-yes"></span><?php _e( 'Aelia currency switcher support','woo-product-feed-pro' );?> [<a href="https://adtribes.io/aelia-currency-switcher-feature/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=aelia%20support" target="_blank"><?php _e( 'Read more','woo-product-feed-pro' );?></a>];<br/>
<span class="dashicons dashicons-yes"></span><?php _e( 'Aelia & Curcy currency switcher support','woo-product-feed-pro' );?> [<a href="https://adtribes.io/aelia-currency-switcher-feature/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=aelia%20support" target="_blank"><?php _e( 'Read more','woo-product-feed-pro' );?></a>];<br/>
<span class="dashicons dashicons-yes"></span><?php _e( 'Polylang support','woo-product-feed-pro' );?> [<a href="https://adtribes.io/polylang-support-product-feeds/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=polylang%20support" target="_blank"><?php _e( 'Read more','woo-product-feed-pro' );?></a>];<br/>
<span class="dashicons dashicons-yes"></span><?php _e( 'Facebook pixel feature','woo-product-feed-pro' );?> [<a href="https://adtribes.io/facebook-pixel-feature/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=facebook pixel feature" target="_blank"><?php _e( 'Read more','woo-product-feed-pro' );?></a>];<br/><br/>
<?php _e( 'Upgrade to the','woo-product-feed-pro' );?> <strong><a href="https://adtribes.io/pro-vs-elite/?utm_source=<?php print"$host";?>&utm_medium=manage-feed&utm_campaign=top-notification&utm_content=notification" target="_blank"><?php _e( 'Elite version of our plugin</a></strong> to get all these features.','woo-product-feed-pro' );?>
@@ -142,7 +114,6 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
}
}
if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) {
?>
<div class="notice notice-error is-dismissible">
@@ -157,7 +128,26 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
// Double check if the woosea_cron_hook is there, when it is not create a new one
if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
wp_schedule_event ( time(), 'hourly', 'woosea_cron_hook');
}
}
/**
* Request our plugin users to write a review
**/
if(!empty( $cron_projects )){
$nr_projects = count($cron_projects);
$first_activation = get_option ( 'woosea_first_activation' );
$notification_interaction = get_option( 'woosea_review_interaction' );
$current_time = time();
$show_after = 604800; // Show only after one week
$is_active = $current_time-$first_activation;
$page = sanitize_text_field(basename($_SERVER['REQUEST_URI']));
if(($nr_projects > 0) AND ($is_active > $show_after) AND ($notification_interaction != "yes")){
echo '<div class="notice notice-info review-notification">';
echo '<table><tr><td></td><td><font color="green" style="font-weight:normal";><p>Hey, I noticed you have been using our plugin, <u>Product Feed PRO for WooCommerce by AdTribes.io</u>, for over a week now and have created product feed projects with it - that\'s awesome! Could you please do our support volunteers and me a BIG favor and give it a <strong>5-star rating</strong> on WordPress? Just to help us spread the word and boost our motivation. We would greatly appreciate if you would do so :)<br/>~ Adtribes.io support team<br><ul><li><span class="ui-icon ui-icon-caret-1-e" style="display: inline-block;"></span><a href="https://wordpress.org/support/plugin/woo-product-feed-pro/reviews?rate=5#new-post" target="_blank" class="dismiss-review-notification">Ok, you deserve it</a></li><li><span class="ui-icon ui-icon-caret-1-e" style="display: inline-block;"></span><a href="#" class="dismiss-review-notification">Nope, maybe later</a></li><li><span class="ui-icon ui-icon-caret-1-e" style="display: inline-block;"></span><a href="#" class="dismiss-review-notification">I already did</a></li></ul></p></font></td></tr></table>';
echo '</div>';
}
}
?>
<div class="woo-product-feed-pro-form-style-2-heading"><?php _e( 'Manage feeds','woo-product-feed-pro' );?></div>
@@ -191,6 +181,7 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
$projectname = ucfirst($val['projectname']);
?>
<form action="" method="post">
<?php wp_nonce_field( 'woosea_ajax_nonce' ); ?>
<tr class="<?php print "$class";?>">
<td>
<label class="woo-product-feed-pro-switch">

View File

@@ -1,4 +1,5 @@
<?php
$cron_projects = get_option( 'cron_projects' );
$domain = sanitize_text_field($_SERVER['HTTP_HOST']);
$plugin_settings = get_option( 'plugin_settings' );
$license_information = get_option( 'license_information' );
@@ -26,13 +27,26 @@ if(empty($license_information['license_key'])){
$license_information['license_key'] = "";
}
$count_variation = wp_count_posts('product_variation');
$count_single = wp_count_posts('product');
$published_single = $count_single->publish;
$published_variation = $count_variation->publish;
$published_products = $published_single+$published_variation;
$product_numbers = array (
"Single products" => $published_single,
"Variation products" => $published_variation,
"Total products" => $published_products
);
$versions = array (
"PHP" => (float)phpversion(),
"Wordpress" => get_bloginfo('version'),
"WooCommerce" => WC()->version,
"PHP" => (float)phpversion(),
"Wordpress" => get_bloginfo('version'),
"WooCommerce" => WC()->version,
"WooCommerce Product Feed PRO" => WOOCOMMERCESEA_PLUGIN_VERSION
);
$order_rows = "";
/**
* Create notification object and get message and message type as WooCommerce is inactive
* also set variable allowed on 0 to disable submit button on step 1 of configuration
@@ -121,9 +135,27 @@ if(isset($_GET["tab"])) {
</p>
</div>
<?php
}
/**
* Request our plugin users to write a review
**/
if(!empty( $cron_projects )){
$nr_projects = count($cron_projects);
$first_activation = get_option ( 'woosea_first_activation' );
$notification_interaction = get_option( 'woosea_review_interaction' );
$current_time = time();
$show_after = 604800; // Show only after one week
$is_active = $current_time-$first_activation;
$page = sanitize_text_field(basename($_SERVER['REQUEST_URI']));
if(($nr_projects > 0) AND ($is_active > $show_after) AND ($notification_interaction != "yes")){
echo '<div class="notice notice-info review-notification">';
echo '<table><tr><td></td><td><font color="green" style="font-weight:normal";><p>Hey, I noticed you have been using our plugin, <u>Product Feed PRO for WooCommerce by AdTribes.io</u>, for over a week now and have created product feed projects with it - that\'s awesome! Could you please do our support volunteers and me a BIG favor and give it a <strong>5-star rating</strong> on WordPress? Just to help us spread the word and boost our motivation. We would greatly appreciate if you would do so :)<br/>~ Adtribes.io support team<br><ul><li><span class="ui-icon ui-icon-caret-1-e" style="display: inline-block;"></span><a href="https://wordpress.org/support/plugin/woo-product-feed-pro/reviews?rate=5#new-post" target="_blank" class="dismiss-review-notification">Ok, you deserve it</a></li><li><span class="ui-icon ui-icon-caret-1-e" style="display: inline-block;"></span><a href="#" class="dismiss-review-notification">Nope, maybe later</a></li><li><span class="ui-icon ui-icon-caret-1-e" style="display: inline-block;"></span><a href="#" class="dismiss-review-notification">I already did</a></li></ul></p></font></td></tr></table>';
echo '</div>';
}
}
?>
<!-- wordpress provides the styling for tabs. -->
<h2 class="nav-tab-wrapper">
@@ -542,6 +574,17 @@ if(isset($_GET["tab"])) {
print "<tr><td colspan=\"2\">&nbsp;</td></tr>";
print "</table>";
// Display the debugging information.
$debug_info_content = $notifications_obj->woosea_debug_informations( $versions, $product_numbers, $order_rows, $cron_projects );
$debug_info_title = __( 'System Report', 'woo-product-feed-pro' );
print "<div class=\"woo-product-feed-pro-debug-info\">";
print "<button class=\"button copy-product-feed-pro-debug-info\" type=\"button\" data-clipboard-target=\"#woo-product-feed-pro-debug-info\">Copy to clipboard</button>";
print "<h3>{$debug_info_title}</h3>";
print "<p>" . __( 'Copy the below text and paste to the support team when requested to help us debug any systems issues with your feeds.', 'woo-product-feed-pro' ) . "</p>";
print "<pre id=\"woo-product-feed-pro-debug-info\">{$debug_info_content}</pre>";
print "</div>";
} else {
?>
<table class="woo-product-feed-pro-table">

File diff suppressed because it is too large Load Diff

View File

@@ -1,23 +1,23 @@
<?php
/**
* Plugin Name: Product Feed PRO for WooCommerce
* Version: 12.4.5
* Version: 13.3.2
* Plugin URI: https://www.adtribes.io/support/?utm_source=wpadmin&utm_medium=plugin&utm_campaign=woosea_product_feed_pro
* Description: Configure and maintain your WooCommerce product feeds for Google Shopping, Catalog managers, Remarketing, Bing, Skroutz, Yandex, Comparison shopping websites and over a 100 channels more.
* Author: AdTribes.io
* Plugin URI: https://wwww.adtribes.io/pro-vs-elite/
* Author URI: https://www.adtribes.io
* Developer: Joris Verwater
* Developer: AdTribes.io
* License: GPL3
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
* Requires at least: 4.5
* Tested up to: 6.1
* Tested up to: 6.3
*
* Text Domain: woo-product-feed-pro
* Domain Path: /languages
*
* WC requires at least: 4.4
* WC tested up to: 7.5
* WC tested up to: 8.7
*
* Product Feed PRO for WooCommerce is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -48,7 +48,7 @@ if (!defined('ABSPATH')) {
* Plugin versionnumber, please do not override.
* Define some constants
*/
define( 'WOOCOMMERCESEA_PLUGIN_VERSION', '12.4.5' );
define( 'WOOCOMMERCESEA_PLUGIN_VERSION', '13.3.2' );
define( 'WOOCOMMERCESEA_PLUGIN_NAME', 'woocommerce-product-feed-pro' );
define( 'WOOCOMMERCESEA_PLUGIN_NAME_SHORT', 'woo-product-feed-pro' );
@@ -135,7 +135,7 @@ function woosea_scripts($hook) {
wp_enqueue_script( 'woosea_key-js' );
}
// JS for manage projects page
wp_register_script( 'woosea_manage-js', plugin_dir_url( __FILE__ ) . 'js/woosea_manage.js?yo=12', '',WOOCOMMERCESEA_PLUGIN_VERSION, true );
wp_register_script( 'woosea_manage-js', plugin_dir_url( __FILE__ ) . 'js/woosea_manage.js?yo=12', array( 'clipboard' ),WOOCOMMERCESEA_PLUGIN_VERSION, true );
wp_enqueue_script( 'woosea_manage-js' );
}
add_action( 'admin_enqueue_scripts' , 'woosea_scripts' );
@@ -158,14 +158,13 @@ require plugin_dir_path(__FILE__) . 'classes/class-admin-notifications.php';
require plugin_dir_path(__FILE__) . 'classes/class-update-channel.php';
require plugin_dir_path(__FILE__) . 'classes/class-attributes.php';
require plugin_dir_path(__FILE__) . 'classes/class-google-remarketing.php';
require plugin_dir_path(__FILE__) . 'classes/class-caching.php';
/**
* Add links to the plugin page
*/
function woosea_plugin_action_links($links, $file) {
static $this_plugin;
if (!$this_plugin) {
if (!isset($this_plugin)) {
$this_plugin = plugin_basename(__FILE__);
}
@@ -183,7 +182,9 @@ function woosea_plugin_action_links($links, $file) {
// add the links to the list of links already there
foreach($plugin_links as $link) {
array_unshift($links, $link);
if(is_array($links)){
array_unshift($links, $link);
}
}
}
return $links;
@@ -236,14 +237,15 @@ function woosea_add_facebook_pixel( $product = null ){
if ( ! is_object( $product ) ) {
global $product;
}
$fb_pagetype = WooSEA_Google_Remarketing::woosea_google_remarketing_pagetype();
$add_facebook_pixel = get_option ('add_facebook_pixel');
$add_facebook_capi = get_option ('add_facebook_capi');
$viewContent = "";
$event_id = uniqid (rand (),true);
$currency = get_woocommerce_currency();
if($add_facebook_pixel == "yes"){
$fb_pagetype = WooSEA_Google_Remarketing::woosea_google_remarketing_pagetype();
$viewContent = "";
$event_id = uniqid (rand (),true);
$currency = get_woocommerce_currency();
$facebook_pixel_id = get_option("woosea_facebook_pixel_id");
$facebook_capi_token = get_option("woosea_facebook_capi_token");
@@ -634,6 +636,7 @@ function woosea_add_remarketing_tags( $product = null ){
if($add_remarketing == "yes"){
$adwords_conversion_id = get_option("woosea_adwords_conversion_id");
// Add vulnerability check, unset when no proper comversion ID was inserted
if(!is_numeric($adwords_conversion_id)){
unset($adwords_conversion_id);
@@ -679,7 +682,6 @@ function woosea_add_remarketing_tags( $product = null ){
$product_price = $variable_product->get_price();
// ----- remove HTML TAGs -----
//$product_price = preg_replace ('/<[^>]*>/', ' ', $product_price);
$ecomm_price = $product_price;
} else {
// AggregateOffer
@@ -829,12 +831,18 @@ register_activation_hook(__FILE__, 'activate_woosea_feed');
* Close the get Elite notification
**/
function woosea_getelite_notification(){
$get_elite_notice = array(
"show" => "no",
"timestamp" => date( 'd-m-Y' )
);
check_ajax_referer( 'woosea_ajax_nonce', 'security' );
update_option('woosea_getelite_notification',$get_elite_notice);
$user = wp_get_current_user();
$allowed_roles = array( 'administrator','editor','author' );
if ( array_intersect( $allowed_roles, $user->roles ) ) {
$get_elite_notice = array(
"show" => "no",
"timestamp" => date( 'd-m-Y' )
);
update_option('woosea_getelite_notification',$get_elite_notice);
}
}
add_action( 'wp_ajax_woosea_getelite_notification', 'woosea_getelite_notification' );
@@ -842,49 +850,28 @@ add_action( 'wp_ajax_woosea_getelite_notification', 'woosea_getelite_notificatio
* Close the get Elite activation notification
**/
function woosea_getelite_active_notification(){
$get_elite_notice = array(
"show" => "no",
"timestamp" => date( 'd-m-Y' )
);
check_ajax_referer( 'woosea_ajax_nonce', 'security' );
update_option('woosea_getelite_active_notification',$get_elite_notice);
$user = wp_get_current_user();
$allowed_roles = array( 'administrator','editor','author' );
if ( array_intersect( $allowed_roles, $user->roles ) ) {
$get_elite_notice = array(
"show" => "no",
"timestamp" => date( 'd-m-Y' )
);
update_option('woosea_getelite_active_notification',$get_elite_notice);
}
}
add_action( 'wp_ajax_woosea_getelite_active_notification', 'woosea_getelite_active_notification' );
/**
* Request our plugin users to write a review
**/
function woosea_request_review(){
// Only request for a review when:
// Plugin activation has been > 1 week
// Active projects > 0
$cron_projects = get_option( 'cron_projects' );
if(!empty( $cron_projects )){
$nr_projects = count($cron_projects);
$first_activation = get_option ( 'woosea_first_activation' );
$notification_interaction = get_option( 'woosea_review_interaction' );
$current_time = time();
$show_after = 604800; // Show only after one week
$is_active = $current_time-$first_activation;
$page = sanitize_text_field(basename($_SERVER['REQUEST_URI']));
if(($nr_projects > 0) AND ($is_active > $show_after) AND ($notification_interaction != "yes")){
echo '<div class="notice notice-info review-notification">';
echo '<table><tr><td></td><td><font color="green" style="font-weight:normal";><p>Hey, I noticed you have been using our plugin, <u>Product Feed PRO for WooCommerce by AdTribes.io</u>, for over a week now and have created product feed projects with it - that\'s awesome! Could you please do Eva and me a BIG favor and give it a 5-star rating on WordPress? Just to help us spread the word and boost our motivation. We would greatly appreciate if you would do so :)<br/>~ Adtribes.io support team<br><ul><li><span class="ui-icon ui-icon-caret-1-e" style="display: inline-block;"></span><a href="https://wordpress.org/support/plugin/woo-product-feed-pro/reviews?rate=5#new-post" target="_blank" class="dismiss-review-notification">Ok, you deserve it</a></li><li><span class="ui-icon ui-icon-caret-1-e" style="display: inline-block;"></span><a href="#" class="dismiss-review-notification">Nope, maybe later</a></li><li><span class="ui-icon ui-icon-caret-1-e" style="display: inline-block;"></span><a href="#" class="dismiss-review-notification">I already did</a></li></ul></p></font></td></tr></table>';
echo '</div>';
}
}
}
add_action('admin_notices', 'woosea_request_review');
/**
* Add some JS and mark-up code on every front-end page in order to get the conversion tracking to work
*/
function woosea_hook_header() {
$marker = sprintf('<!-- This website runs the Product Feed PRO for WooCommerce by AdTribes.io plugin - version ' . WOOCOMMERCESEA_PLUGIN_VERSION .' -->');
$allowed_tags = array('<!--' => array(), '-->' => array());
echo wp_kses("\n${marker}\n",$allowed_tags);
echo wp_kses("\n{$marker}\n",$allowed_tags);
}
add_action('wp_head','woosea_hook_header');
@@ -953,7 +940,6 @@ add_action( 'wp_ajax_woosea_ajax', 'woosea_ajax' );
*/
function woosea_categories_dropdown() {
$rowCount = absint(esc_attr(sanitize_text_field($_POST['rowCount'])));
$user = wp_get_current_user();
$allowed_roles = array( 'administrator','editor','author' );
@@ -1012,7 +998,7 @@ function woosea_recursive_sanitize_text_field($array) {
* Save Google Dynamic Remarketing Conversion Tracking ID
*/
function woosea_save_adwords_conversion_id() {
check_ajax_referer('woosea_ajax_nonce', 'security2');
check_ajax_referer('woosea_ajax_nonce', 'security');
$user = wp_get_current_user();
$allowed_roles = array( 'administrator' );
@@ -1572,7 +1558,6 @@ function woosea_product_delete_meta_price( $product = null ) {
}
return $markup_offer;
}
//add_filter( 'woocommerce_structured_data_product_offer', 'woosea_product_delete_meta_price', 1000, 1 );
/**
@@ -1964,26 +1949,31 @@ add_action( 'wp_ajax_woosea_shipping_zones', 'woosea_shipping_zones' );
* Determine if any of the feeds is updating
*/
function woosea_check_processing(){
$processing = "false";
check_ajax_referer( 'woosea_ajax_nonce', 'security' );
$feed_config = get_option( 'cron_projects' );
$found = false;
$user = wp_get_current_user();
$allowed_roles = array( 'administrator','editor','author' );
foreach ( $feed_config as $key => $val ) {
if(array_key_exists('running', $val)){
if ( array_intersect( $allowed_roles, $user->roles ) ) {
$processing = "false";
$feed_config = get_option( 'cron_projects' );
$found = false;
if(($val['running'] == "true") OR ($val['running'] == "stopped")){
$processing = "true";
foreach ( $feed_config as $key => $val ) {
if(array_key_exists('running', $val)){
if( in_array($val['running'], array( "true", "processing", "stopped", "not run yet" ) ) ){
$processing = "true";
}
}
}
}
$data = array (
'processing' => $processing,
);
$data = array (
'processing' => $processing,
);
echo json_encode($data);
wp_die();
echo json_encode($data);
wp_die();
}
}
add_action( 'wp_ajax_woosea_check_processing', 'woosea_check_processing' );
@@ -2022,33 +2012,40 @@ add_action( 'wp_ajax_woosea_channel', 'woosea_channel' );
* Delete a project from cron
*/
function woosea_project_delete(){
$project_hash = sanitize_text_field($_POST['project_hash']);
$feed_config = get_option( 'cron_projects' );
$found = false;
check_ajax_referer( 'woosea_ajax_nonce', 'security' );
foreach ( $feed_config as $key => $val ) {
if (isset($val['project_hash']) AND ($val['project_hash'] == $project_hash)){
$found = true;
$found_key = $key;
$user = wp_get_current_user();
$allowed_roles = array( 'administrator' );
$upload_dir = wp_upload_dir();
$base = $upload_dir['basedir'];
$path = $base . "/woo-product-feed-pro/" . $val['fileformat'];
$file = $path . "/" . sanitize_file_name($val['filename']) . "." . $val['fileformat'];
if ( array_intersect( $allowed_roles, $user->roles ) ) {
$project_hash = sanitize_text_field($_POST['project_hash']);
$feed_config = get_option( 'cron_projects' );
$found = false;
foreach ( $feed_config as $key => $val ) {
if (isset($val['project_hash']) AND ($val['project_hash'] == $project_hash)){
$found = true;
$found_key = $key;
$upload_dir = wp_upload_dir();
$base = $upload_dir['basedir'];
$path = $base . "/woo-product-feed-pro/" . $val['fileformat'];
$file = $path . "/" . sanitize_file_name($val['filename']) . "." . $val['fileformat'];
}
}
}
if ($found == "true"){
# Remove project from project array
unset($feed_config[$found_key]);
if ($found == "true"){
# Remove project from project array
unset($feed_config[$found_key]);
# Update cron
update_option('cron_projects', $feed_config, 'no');
# Remove project file
@unlink($file);
}
# Update cron
update_option('cron_projects', $feed_config, 'no');
# Remove project file
@unlink($file);
}
}
}
add_action( 'wp_ajax_woosea_project_delete', 'woosea_project_delete' );
@@ -2056,29 +2053,37 @@ add_action( 'wp_ajax_woosea_project_delete', 'woosea_project_delete' );
* Stop processing of a project
*/
function woosea_project_cancel(){
$project_hash = sanitize_text_field($_POST['project_hash']);
$feed_config = get_option( 'cron_projects' );
check_ajax_referer( 'woosea_ajax_nonce', 'security' );
foreach ( $feed_config as $key => $val ) {
if ($val['project_hash'] == $project_hash){
$user = wp_get_current_user();
$allowed_roles = array( 'administrator' );
$batch_project = "batch_project_".$project_hash;
delete_option( $batch_project );
if ( array_intersect( $allowed_roles, $user->roles ) ) {
$project_hash = sanitize_text_field($_POST['project_hash']);
$feed_config = get_option( 'cron_projects' );
foreach ( $feed_config as $key => $val ) {
if ($val['project_hash'] == $project_hash){
$batch_project = "batch_project_".$project_hash;
delete_option( $batch_project );
$feed_config[$key]['nr_products_processed'] = 0;
$feed_config[$key]['nr_products_processed'] = 0;
// Set processing status on ready
$feed_config[$key]['running'] = "stopped";
$feed_config[$key]['last_updated'] = date("d M Y H:i");
// Set processing status on ready
$feed_config[$key]['running'] = "stopped";
$feed_config[$key]['last_updated'] = date("d M Y H:i");
// Delete processed product array for preventing duplicates
delete_option('woosea_duplicates');
// Delete processed product array for preventing duplicates
delete_option('woosea_duplicates');
// In 1 minute from now check the amount of products in the feed and update the history count
wp_schedule_single_event( time() + 60, 'woosea_update_project_stats', array($val['project_hash']) );
}
}
update_option( 'cron_projects', $feed_config, 'no');
// In 1 minute from now check the amount of products in the feed and update the history count
wp_schedule_single_event( time() + 60, 'woosea_update_project_stats', array($val['project_hash']) );
}
}
update_option( 'cron_projects', $feed_config, 'no');
}
}
add_action( 'wp_ajax_woosea_project_cancel', 'woosea_project_cancel' );
@@ -2086,32 +2091,43 @@ add_action( 'wp_ajax_woosea_project_cancel', 'woosea_project_cancel' );
* Get the processing status of a project feed
*/
function woosea_project_processing_status(){
$project_hash = sanitize_text_field($_POST['project_hash']);
$feed_config = get_option( 'cron_projects' );
$proc_perc = 0;
check_ajax_referer( 'woosea_ajax_nonce', 'security' );
foreach ( $feed_config as $key => $val ) {
if (isset($val['project_hash']) AND ($val['project_hash'] === $project_hash)){
$this_feed = $val;
$user = wp_get_current_user();
$allowed_roles = array( 'administrator','editor','author' );
if ( array_intersect( $allowed_roles, $user->roles ) ) {
$project_hash = sanitize_text_field($_POST['project_hash']);
$feed_config = get_option( 'cron_projects' );
$proc_perc = 0;
foreach ( $feed_config as $key => $val ) {
if (isset($val['project_hash']) AND ($val['project_hash'] === $project_hash)){
$this_feed = $val;
}
}
if($this_feed['running'] == "ready"){
$proc_perc = 100;
} elseif($this_feed['running'] == "not run yet"){
$proc_perc = 999;
} else {
if(isset($this_feed['nr_products'])){
if($this_feed['nr_products'] > 0){
$proc_perc = round(($this_feed['nr_products_processed']/$this_feed['nr_products'])*100);
}
}
}
}
if($this_feed['running'] == "ready"){
$proc_perc = 100;
} elseif($this_feed['running'] == "not run yet"){
$proc_perc = 999;
} else {
$proc_perc = round(($this_feed['nr_products_processed']/$this_feed['nr_products'])*100);
$data = array (
'project_hash' => $project_hash,
'running' => $this_feed['running'],
'proc_perc' => $proc_perc,
);
echo json_encode($data);
wp_die();
}
$data = array (
'project_hash' => $project_hash,
'running' => $this_feed['running'],
'proc_perc' => $proc_perc,
);
echo json_encode($data);
wp_die();
}
add_action( 'wp_ajax_woosea_project_processing_status', 'woosea_project_processing_status' );
@@ -2119,68 +2135,75 @@ add_action( 'wp_ajax_woosea_project_processing_status', 'woosea_project_processi
* Copy a project
*/
function woosea_project_copy(){
$project_hash = sanitize_text_field($_POST['project_hash']);
$feed_config = get_option( 'cron_projects' );
check_ajax_referer( 'woosea_ajax_nonce', 'security' );
$max_key = max(array_keys($feed_config));
$add_project = array();
$upload_dir = wp_upload_dir();
$external_base = $upload_dir['baseurl'];
$user = wp_get_current_user();
$allowed_roles = array( 'administrator' );
foreach ( $feed_config as $key => $val ) {
if ($val['project_hash'] == $project_hash){
$val['projectname'] = "Copy ". $val['projectname'];
if ( array_intersect( $allowed_roles, $user->roles ) ) {
// New code to create the project hash so dependency on openSSL is removed
$keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$pieces = [];
$length = 32;
$max = mb_strlen($keyspace, '8bit') - 1;
for ($i = 0; $i < $length; ++$i) {
$pieces []= $keyspace[random_int(0, $max)];
}
$val['project_hash'] = implode('', $pieces);
//$val['project_hash'] = bin2hex(openssl_random_pseudo_bytes(16));
$val['filename'] = $val['project_hash'];
$val['utm_campaign'] = "Copy ". $val['utm_campaign'];
$val['last_updated'] = "";
$val['running'] = "not run yet";
$project_hash = sanitize_text_field($_POST['project_hash']);
$feed_config = get_option( 'cron_projects' );
// Construct product feed URL
$external_path = $external_base . "/woo-product-feed-pro/" . $val['fileformat'];
$val['external_file'] = $external_path . "/" . sanitize_file_name($val['filename']) . "." . $val['fileformat'];
$max_key = max(array_keys($feed_config));
$add_project = array();
$upload_dir = wp_upload_dir();
$external_base = $upload_dir['baseurl'];
// To build the new project row on the manage feed page
$projecthash = $val['project_hash'];
$projectname = $val['projectname'];
$channel = $val['name'];
$fileformat = $val['fileformat'];
$interval = $val['cron'];
$external_file = $val['external_file'];
foreach ( $feed_config as $key => $val ) {
if ($val['project_hash'] == $project_hash){
$val['projectname'] = "Copy ". $val['projectname'];
// Save the copied project
$new_key = $max_key+1;
$add_project[$new_key] = $val;
array_push($feed_config, $add_project[$new_key]);
update_option( 'cron_projects', $feed_config, 'no');
// New code to create the project hash so dependency on openSSL is removed
$keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$pieces = [];
$length = 32;
$max = mb_strlen($keyspace, '8bit') - 1;
for ($i = 0; $i < $length; ++$i) {
$pieces []= $keyspace[random_int(0, $max)];
}
$val['project_hash'] = implode('', $pieces);
$val['filename'] = $val['project_hash'];
$val['utm_campaign'] = "Copy ". $val['utm_campaign'];
$val['last_updated'] = "";
$val['running'] = "not run yet";
// Construct product feed URL
$external_path = $external_base . "/woo-product-feed-pro/" . $val['fileformat'];
$val['external_file'] = $external_path . "/" . sanitize_file_name($val['filename']) . "." . $val['fileformat'];
// To build the new project row on the manage feed page
$projecthash = $val['project_hash'];
$projectname = $val['projectname'];
$channel = $val['name'];
$fileformat = $val['fileformat'];
$interval = $val['cron'];
$external_file = $val['external_file'];
// Save the copied project
$new_key = $max_key+1;
$add_project[$new_key] = $val;
array_push($feed_config, $add_project[$new_key]);
update_option( 'cron_projects', $feed_config, 'no');
// Do not start processing, user wants to make changes to the copied project
$copy_status = "true";
// Do not start processing, user wants to make changes to the copied project
$copy_status = "true";
}
}
}
$data = array (
'project_hash' => $projecthash,
'channel' => $channel,
'projectname' => $projectname,
'fileformat' => $fileformat,
'interval' => $interval,
'external_file' => $external_file,
'copy_status' => $copy_status
);
$data = array (
'project_hash' => $projecthash,
'channel' => $channel,
'projectname' => $projectname,
'fileformat' => $fileformat,
'interval' => $interval,
'external_file' => $external_file,
'copy_status' => $copy_status
);
echo json_encode($data);
wp_die();
echo json_encode($data);
wp_die();
}
}
add_action( 'wp_ajax_woosea_project_copy', 'woosea_project_copy' );
@@ -2188,6 +2211,12 @@ add_action( 'wp_ajax_woosea_project_copy', 'woosea_project_copy' );
* Refresh a project
*/
function woosea_project_refresh(){
check_ajax_referer( 'woosea_ajax_nonce', 'security' );
// Force garbage collection dump
gc_enable();
gc_collect_cycles();
$project_hash = sanitize_text_field($_POST['project_hash']);
$feed_config = get_option( 'cron_projects' );
@@ -2195,11 +2224,62 @@ function woosea_project_refresh(){
$allowed_roles = array( 'administrator','editor','author' );
if ( array_intersect( $allowed_roles, $user->roles ) ) {
foreach ( $feed_config as $key => $val ) {
// Make sure content of feeds is not being cached
// Make sure feeds are not being cached
$no_caching = new WooSEA_Caching();
// LiteSpeed Caching
if (class_exists( 'LiteSpeed\Core' ) || defined( 'LSCWP_DIR' ) ) {
$no_caching->litespeed_cache();
}
// WP Fastest Caching
if (class_exists( 'WpFastestCache' ) ) {
$no_caching->wp_fastest_cache();
}
// WP Super Caching
if (function_exists( 'wpsc_init' ) ) {
$no_caching->wp_super_cache();
}
// Breeze Caching
if (class_exists( 'Breeze_Admin' ) ) {
$no_caching->breeze_cache();
}
// WP Optimize Caching
if (class_exists( 'WP_Optimize' ) ) {
$no_caching->wp_optimize_cache();
}
// Cache Enabler
if (class_exists( 'Cache_Enabler' ) ) {
$no_caching->cache_enabler_cache();
}
// Swift Performance Lite
if (class_exists( 'Swift_Performance_Lite' ) ) {
$no_caching->swift_performance_cache();
}
// Comet Cache
if (is_plugin_active( 'comet-cache/comet-cache.php' ) ) {
$no_caching->comet_cache();
}
// HyperCache
if (class_exists( 'HyperCache' ) ) {
$no_caching->hyper_cache();
}
foreach ( $feed_config as $key => $val ) {
if (isset($val['project_hash']) AND ($val['project_hash'] == $project_hash)){
$batch_project = "batch_project_".$project_hash;
if (!get_option( $batch_project )){
update_option( $batch_project, $val);
update_option( $batch_project, $val, 'no');
$final_creation = woosea_continue_batch($project_hash);
} else {
$final_creation = woosea_continue_batch($project_hash);
@@ -2258,37 +2338,44 @@ add_action( 'wp_ajax_woosea_add_attributes', 'woosea_add_attributes' );
* Change status of a project from active to inactive or visa versa
*/
function woosea_project_status() {
$project_hash = sanitize_text_field($_POST['project_hash']);
$active = sanitize_text_field($_POST['active']);
$feed_config = get_option( 'cron_projects' );
check_ajax_referer( 'woosea_ajax_nonce', 'security' );
$number_feeds = count($feed_config);
$user = wp_get_current_user();
$allowed_roles = array( 'administrator','editor','author' );
if ($number_feeds > 0){
if ( array_intersect( $allowed_roles, $user->roles ) ) {
$project_hash = sanitize_text_field($_POST['project_hash']);
$active = sanitize_text_field($_POST['active']);
$feed_config = get_option( 'cron_projects' );
foreach ( $feed_config as $key => $val ) {
if ($val['project_hash'] == $project_hash){
$feed_config[$key]['active'] = $active;
$upload_dir = wp_upload_dir();
$base = $upload_dir['basedir'];
$path = $base . "/woo-product-feed-pro/" . $val['fileformat'];
$file = $path . "/" . sanitize_file_name($val['filename']) . "." . $val['fileformat'];
}
}
}
$number_feeds = count($feed_config);
// When project is put on inactive, delete the product feed
if($active == "false"){
@unlink($file);
}
if ($number_feeds > 0){
// Regenerate product feed
if($active == "true"){
$update_project = woosea_project_refresh($project_hash);
}
foreach ( $feed_config as $key => $val ) {
if ($val['project_hash'] == $project_hash){
$feed_config[$key]['active'] = $active;
$upload_dir = wp_upload_dir();
$base = $upload_dir['basedir'];
$path = $base . "/woo-product-feed-pro/" . $val['fileformat'];
$file = $path . "/" . sanitize_file_name($val['filename']) . "." . $val['fileformat'];
}
}
}
// Update cron with new project status
update_option( 'cron_projects', $feed_config, 'no');
// When project is put on inactive, delete the product feed
if($active == "false"){
@unlink($file);
}
// Regenerate product feed
if($active == "true"){
$update_project = woosea_project_refresh($project_hash);
}
// Update cron with new project status
update_option( 'cron_projects', $feed_config, 'no');
}
}
add_action( 'wp_ajax_woosea_project_status', 'woosea_project_status' );
@@ -2298,7 +2385,13 @@ add_action( 'wp_ajax_woosea_project_status', 'woosea_project_status' );
*/
function woosea_review_notification() {
// Update review notification status
update_option( 'woosea_review_interaction', 'yes', 'yes');
check_ajax_referer( 'woosea_ajax_nonce', 'security' );
$user = wp_get_current_user();
$allowed_roles = array( 'administrator','editor','author' );
if ( array_intersect( $allowed_roles, $user->roles ) ) {
update_option( 'woosea_review_interaction', 'yes', 'yes');
}
}
add_action( 'wp_ajax_woosea_review_notification', 'woosea_review_notification' );
@@ -2631,7 +2724,9 @@ add_action( 'wp_ajax_woosea_add_facebook_capi_setting', 'woosea_add_facebook_cap
* This function saves the value that needs to be used in the Facebook pixel content_ids parameter
*/
function woosea_facebook_content_ids (){
$user = wp_get_current_user();
check_ajax_referer('woosea_ajax_nonce', 'security');
$user = wp_get_current_user();
$allowed_roles = array( 'administrator' );
if ( array_intersect( $allowed_roles, $user->roles ) ) {
@@ -4140,8 +4235,10 @@ function woosea_update_project_history($project_hash){
$nr_products = count($xml->offers->offer);
}
} else {
if ($project['taxonomy'] == "none"){
$nr_products = count($xml->product);
if ($project['taxonomy'] == "none"){
if(is_countable($xml->product)){
$nr_products = count($xml->product);
}
} else {
$nr_products = count($xml->channel->item);
}
@@ -4424,7 +4521,7 @@ function woosea_generate_pages(){
if (!get_option( $batch_project )) {
// Batch project hook expects a multidimentional array
update_option( $batch_project, $project_data);
update_option( $batch_project, $project_data, 'no');
$final_creation = woosea_continue_batch($project_data['project_hash']);
} else {
$final_creation = woosea_continue_batch($project_data['project_hash']);
@@ -4465,9 +4562,6 @@ function woosea_generate_pages(){
case 9:
load_template( plugin_dir_path( __FILE__ ) . '/pages/admin/woosea-generate-feed-step-9.php' );
break;
case 11:
load_template( plugin_dir_path( __FILE__ ) . '/pages/admin/woosea-gs-analytics.php' );
break;
case 100:
load_template( plugin_dir_path( __FILE__ ) . '/pages/admin/woosea-manage-feed.php' );
break;
@@ -4505,6 +4599,56 @@ function woosea_create_all_feeds(){
$products_changes = "no"; // default value
$products_changes = get_option('woosea_allow_update');
// Make sure content of feeds is not being cached
// Make sure feeds are not being cached
$no_caching = new WooSEA_Caching();
// LiteSpeed Caching
if (class_exists( 'LiteSpeed\Core' ) || defined( 'LSCWP_DIR' ) ) {
$no_caching->litespeed_cache();
}
// WP Fastest Caching
if (class_exists( 'WpFastestCache' ) ) {
$no_caching->wp_fastest_cache();
}
// WP Super Caching
if (function_exists( 'wpsc_init' ) ) {
$no_caching->wp_super_cache();
}
// Breeze Caching
if (class_exists( 'Breeze_Admin' ) ) {
$no_caching->breeze_cache();
}
// WP Optimize Caching
if (class_exists( 'WP_Optimize' ) ) {
$no_caching->wp_optimize_cache();
}
// Cache Enabler
if (class_exists( 'Cache_Enabler' ) ) {
$no_caching->cache_enabler_cache();
}
// Swift Performance Lite
if (class_exists( 'Swift_Performance_Lite' ) ) {
$no_caching->swift_performance_cache();
}
// Comet Cache
if (is_plugin_active( 'comet-cache/comet-cache.php' ) ) {
$no_caching->comet_cache();
}
// HyperCache
if (class_exists( 'HyperCache' ) ) {
$no_caching->hyper_cache();
}
if(!empty($feed_config)){
foreach ( $feed_config as $key => $val ) {
@@ -4520,11 +4664,10 @@ function woosea_create_all_feeds(){
// Only process projects that are active
if(($val['active'] == "true") AND (!empty($val)) AND($update_this_feed == "yes") AND (isset($val['cron']))){
if (($val['cron'] == "daily") AND ($hour == 07)){
$batch_project = "batch_project_".$val['project_hash'];
if (!get_option( $batch_project )){
update_option( $batch_project, $val);
update_option( $batch_project, $val, 'no');
$start_project = woosea_continue_batch($val['project_hash']);
} else {
$start_project = woosea_continue_batch($val['project_hash']);
@@ -4533,7 +4676,7 @@ function woosea_create_all_feeds(){
} elseif (($val['cron'] == "twicedaily") AND ($hour == 19 || $hour == 07)){
$batch_project = "batch_project_".$val['project_hash'];
if (!get_option( $batch_project )){
update_option( $batch_project, $val);
update_option( $batch_project, $val, 'no');
$start_project = woosea_continue_batch($val['project_hash']);
} else {
$start_project = woosea_continue_batch($val['project_hash']);
@@ -4543,7 +4686,7 @@ function woosea_create_all_feeds(){
// Re-start daily and twicedaily projects that are hanging
$batch_project = "batch_project_".$val['project_hash'];
if (!get_option( $batch_project )){
update_option( $batch_project, $val);
update_option( $batch_project, $val, 'no');
$start_project = woosea_continue_batch($val['project_hash']);
} else {
$start_project = woosea_continue_batch($val['project_hash']);
@@ -4554,7 +4697,7 @@ function woosea_create_all_feeds(){
} elseif ($val['cron'] == "hourly") {
$batch_project = "batch_project_".$val['project_hash'];
if (!get_option( $batch_project )){
update_option( $batch_project, $val);
update_option( $batch_project, $val, 'no');
$start_project = woosea_continue_batch($val['project_hash']);
} else {
$start_project = woosea_continue_batch($val['project_hash']);