From d1b345c274e98aa6941faea9a45c244c2cf308c8 Mon Sep 17 00:00:00 2001 From: Kader Ibrahim S Date: Thu, 2 May 2024 12:45:42 +0530 Subject: [PATCH 1/8] Adds WooCommerce as a dependency to the plugin header (#2733) --- facebook-for-woocommerce.php | 1 + 1 file changed, 1 insertion(+) diff --git a/facebook-for-woocommerce.php b/facebook-for-woocommerce.php index cf73b0548..b952ca4af 100644 --- a/facebook-for-woocommerce.php +++ b/facebook-for-woocommerce.php @@ -14,6 +14,7 @@ * Version: 3.2.0 * Requires at least: 5.6 * Text Domain: facebook-for-woocommerce + * Requires Plugins: woocommerce * Tested up to: 6.5 * WC requires at least: 6.4 * WC tested up to: 8.8 From c6147aa0e074c7c3023496628b2ddcd682b4dfc4 Mon Sep 17 00:00:00 2001 From: Dima <9010963+message-dimke@users.noreply.github.com> Date: Thu, 2 May 2024 23:03:08 +0300 Subject: [PATCH 2/8] Adding event filtering. Only AddToCart events should be deferred in case `cart redirect after add` option is active. --- facebook-commerce-pixel-event.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/facebook-commerce-pixel-event.php b/facebook-commerce-pixel-event.php index 9b4eafde2..ef6899710 100644 --- a/facebook-commerce-pixel-event.php +++ b/facebook-commerce-pixel-event.php @@ -283,11 +283,13 @@ public function get_event_script( $event_name, $params, $method = 'track' ) { * @param string $method Name of the pixel's fbq() function to call. */ public function inject_event( $event_name, $params, $method = 'track' ) { - // If we have add to cart redirect enabled, we must defer the events to render them the next page load. - $should_defer = 'yes' === get_option( 'woocommerce_cart_redirect_after_add', 'no' ); if ( WC_Facebookcommerce_Utils::isWoocommerceIntegration() ) { $code = $this->get_event_code( $event_name, self::build_params( $params, $event_name ), $method ); - if ( $should_defer ) { + + // If we have add to cart redirect enabled, we must defer the AddToCart events to render them the next page load. + $is_redirect = 'yes' === get_option( 'woocommerce_cart_redirect_after_add', 'no' ); + $is_add_to_cart = 'AddToCart' === $event_name; + if ( $is_redirect && $is_add_to_cart ) { WC_Facebookcommerce_Utils::add_deferred_event( $code ); } else { WC_Facebookcommerce_Utils::wc_enqueue_js( $code ); From 49bfe09eff7715c573109148e139f9f20f89885a Mon Sep 17 00:00:00 2001 From: Justin Palmer <228780+layoutd@users.noreply.github.com> Date: Tue, 7 May 2024 10:53:21 +0200 Subject: [PATCH 3/8] Clearer upgrade method documentation --- includes/Lifecycle.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/Lifecycle.php b/includes/Lifecycle.php index e6410dc3d..1a2dc24fa 100644 --- a/includes/Lifecycle.php +++ b/includes/Lifecycle.php @@ -310,6 +310,11 @@ protected function upgrade_to_2_5_0() { as_unschedule_all_actions( Products\Feed::GENERATE_FEED_ACTION ); } + /** + * Upgrades to version 3.1.13 adding a notice about upcoming Messenger deprecation. + * + * @since 3.1.13 + */ protected function upgrade_to_3_1_13() { $notice_slug = 'facebook_messenger_deprecation_warning'; $is_messenger_enabled = get_option( \WC_Facebookcommerce_Integration::SETTING_ENABLE_MESSENGER, 'no' ) === 'yes'; @@ -325,7 +330,7 @@ protected function upgrade_to_3_1_13() { } /** - * Removes the messenger deprecation notice on upgrade to 3.2.0. + * Removes the messenger settings and deprecation notice on upgrade to 3.2.0. * * @since 3.2.0 */ From 9ae4b565f8f5bc76ece8d52dc8f7ac7d5b0a7e41 Mon Sep 17 00:00:00 2001 From: Justin Palmer <228780+layoutd@users.noreply.github.com> Date: Tue, 7 May 2024 10:54:31 +0200 Subject: [PATCH 4/8] Remove deprecation notice upgrade step. --- includes/Lifecycle.php | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/includes/Lifecycle.php b/includes/Lifecycle.php index 1a2dc24fa..fb39b909a 100644 --- a/includes/Lifecycle.php +++ b/includes/Lifecycle.php @@ -41,7 +41,6 @@ public function __construct( Framework\Plugin $plugin ) { '2.0.4', '2.4.0', '2.5.0', - '3.1.13', '3.2.0' ); } @@ -310,27 +309,9 @@ protected function upgrade_to_2_5_0() { as_unschedule_all_actions( Products\Feed::GENERATE_FEED_ACTION ); } - /** - * Upgrades to version 3.1.13 adding a notice about upcoming Messenger deprecation. - * - * @since 3.1.13 - */ - protected function upgrade_to_3_1_13() { - $notice_slug = 'facebook_messenger_deprecation_warning'; - $is_messenger_enabled = get_option( \WC_Facebookcommerce_Integration::SETTING_ENABLE_MESSENGER, 'no' ) === 'yes'; - - // Add Messenger deprecation notice. - if ( $is_messenger_enabled && class_exists( 'WC_Admin_Notices' ) ) { - \WC_Admin_Notices::add_custom_notice( - $notice_slug, - Admin\Settings_Screens\Messenger::get_deprecation_message() - ); - - } - } - /** * Removes the messenger settings and deprecation notice on upgrade to 3.2.0. + * Note: deprecation notice upgrade step removed in 3.2.1. * * @since 3.2.0 */ From 0f88d8044ebd51b7170b807905a9ce70a1d2c312 Mon Sep 17 00:00:00 2001 From: Justin Palmer <228780+layoutd@users.noreply.github.com> Date: Tue, 7 May 2024 11:53:00 +0200 Subject: [PATCH 5/8] =?UTF-8?q?Revert=20woo.com=20=E2=86=92=20woocommerce.?= =?UTF-8?q?com?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/CODE_OF_CONDUCT.md | 2 +- .github/ISSUE_TEMPLATE/1-Bug-report.md | 2 +- .github/ISSUE_TEMPLATE/2-Support-question.md | 4 ++-- .github/ISSUE_TEMPLATE/3-Feedback-idea.md | 4 ++-- .github/workflows/prepare-release.yml | 4 ++-- README.md | 6 +++--- class-wc-facebookcommerce.php | 4 ++-- includes/Utilities/Tracker.php | 2 +- package.json | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md index 9194b71fc..e0d865b5a 100644 --- a/.github/CODE_OF_CONDUCT.md +++ b/.github/CODE_OF_CONDUCT.md @@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe ## Enforcement -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at support@woo.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at support@woocommerce.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. diff --git a/.github/ISSUE_TEMPLATE/1-Bug-report.md b/.github/ISSUE_TEMPLATE/1-Bug-report.md index 0f9f50118..2b3d7b13f 100644 --- a/.github/ISSUE_TEMPLATE/1-Bug-report.md +++ b/.github/ISSUE_TEMPLATE/1-Bug-report.md @@ -26,7 +26,7 @@ assignees: '' ## πŸ—ƒ Logs - +
diff --git a/.github/ISSUE_TEMPLATE/2-Support-question.md b/.github/ISSUE_TEMPLATE/2-Support-question.md index b4d1cfa1c..5476507a5 100644 --- a/.github/ISSUE_TEMPLATE/2-Support-question.md +++ b/.github/ISSUE_TEMPLATE/2-Support-question.md @@ -11,7 +11,7 @@ We’re happy to help with this question! Our support team works in our help des ## πŸ“– Read documentation -The [Facebook for WooCommerce documentation](https://woo.com/document/facebook-for-woocommerce/) will help you set up the extension, use its features, and answer frequently asked questions. +The [Facebook for WooCommerce documentation](https://woocommerce.com/document/facebook-for-woocommerce/) will help you set up the extension, use its features, and answer frequently asked questions. ## πŸ‘©β€πŸ’» Check forums @@ -19,4 +19,4 @@ The [Facebook for WooCommerce forums](https://wordpress.org/support/plugin/faceb ## πŸ—£ Contact support -Our support team would be happy to help answer your questions! [Click here to get in touch with support.](https://woo.com/my-account/contact-support/) +Our support team would be happy to help answer your questions! [Click here to get in touch with support.](https://woocommerce.com/my-account/contact-support/) diff --git a/.github/ISSUE_TEMPLATE/3-Feedback-idea.md b/.github/ISSUE_TEMPLATE/3-Feedback-idea.md index edb7385c8..e0ed117b6 100644 --- a/.github/ISSUE_TEMPLATE/3-Feedback-idea.md +++ b/.github/ISSUE_TEMPLATE/3-Feedback-idea.md @@ -9,9 +9,9 @@ assignees: '' ## Feature requests -If you have an idea for how we could improve Facebook for WooCommerce, please let us know by [contacting our support team](https://woo.com/my-account/contact-support/)! We'd love to learn more about the problem you're facing and how Facebook for WooCommerce could help solve it. +If you have an idea for how we could improve Facebook for WooCommerce, please let us know by [contacting our support team](https://woocommerce.com/my-account/contact-support/)! We'd love to learn more about the problem you're facing and how Facebook for WooCommerce could help solve it. -Check the [Facebook for WooCommerce feature requests](https://woo.com/feature-requests/facebook/) to see and vote on ideas. +Check the [Facebook for WooCommerce feature requests](https://woocommerce.com/feature-requests/facebook/) to see and vote on ideas. ## Developers diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 813f5de6c..4ec58ac4d 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -47,5 +47,5 @@ jobs: 1. [ ] Wait for a while, and the zip file should be able to download from: [https://downloads.wordpress.org/plugin/facebook-for-woocommerce.x.x.x.zip](https://downloads.wordpress.org/plugin/facebook-for-woocommerce.x.x.x.zip) 1. [ ] Close the release milestone. 1. [ ] Publish any documentation updates relating to the release: - - [ ] [User documentation](https://woo.com/document/facebook-for-woocommerce) - - [ ] [Any changes to privacy/tracking](https://woo.com/usage-tracking/) + - [ ] [User documentation](https://woocommerce.com/document/facebook-for-woocommerce) + - [ ] [Any changes to privacy/tracking](https://woocommerce.com/usage-tracking/) diff --git a/README.md b/README.md index 3430d2b35..1f81eb65b 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,14 @@ This is the development repository for the Facebook for WooCommerce plugin. -- [Woo.com product page](https://woo.com/products/facebook) +- [WooCommerce.com product page](https://woocommerce.com/products/facebook/) - [WordPress.org plugin page](https://wordpress.org/plugins/facebook-for-woocommerce/) -- [User documentation](https://woo.com/document/facebook-for-woocommerce) +- [User documentation](https://woocommerce.com/document/facebook-for-woocommerce/) ## Support The best place to get support is the [WordPress.org Facebook for WooCommerce forum](https://wordpress.org/support/plugin/facebook-for-woocommerce/). -If you have a Woo.com account, you can [search for help or submit a help request on Woo.com](https://woo.com/my-account/contact-support/). +If you have a woocommerce.com account, you can [search for help or submit a help request on woocommerce.com](https://woocommerce.com/my-account/contact-support/). ### Logging The plugin offers logging that can help debug various problems. You can enable debug mode in the main plugin settings panel under the `Enable debug mode` section. diff --git a/class-wc-facebookcommerce.php b/class-wc-facebookcommerce.php index 7c0c07159..9cd4e5b64 100644 --- a/class-wc-facebookcommerce.php +++ b/class-wc-facebookcommerce.php @@ -709,7 +709,7 @@ public function get_settings_url( $plugin_id = null ) { * @return string */ public function get_documentation_url() { - return 'https://woo.com/document/facebook-for-woocommerce/'; + return 'https://woocommerce.com/document/facebook-for-woocommerce/'; } @@ -733,7 +733,7 @@ public function get_support_url() { * @return string */ public function get_sales_page_url() { - return 'https://woo.com/products/facebook/'; + return 'https://woocommerce.com/products/facebook/'; } diff --git a/includes/Utilities/Tracker.php b/includes/Utilities/Tracker.php index 9d19d1832..95ee506cf 100644 --- a/includes/Utilities/Tracker.php +++ b/includes/Utilities/Tracker.php @@ -15,7 +15,7 @@ /** * Class for adding diagnostic info to WooCommerce Tracker snapshot. * - * See https://woo.com/usage-tracking/ for more information. + * See https://woocommerce.com/usage-tracking/ for more information. * * @since 2.3.4 */ diff --git a/package.json b/package.json index ab88ee00e..bc9c48199 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "facebook-for-woocommerce", "version": "3.2.0", "author": "Facebook", - "homepage": "https://woo.com/products/facebook/", + "homepage": "https://woocommerce.com/products/facebook/", "license": "GPL-2.0", "repository": { "type": "git", From ee3480599828654c27971cc734c9b14d07a0208c Mon Sep 17 00:00:00 2001 From: Justin Palmer <228780+layoutd@users.noreply.github.com> Date: Tue, 7 May 2024 12:12:43 +0200 Subject: [PATCH 6/8] Camelcase WooCommerce.com in visible text Co-authored-by: Rodrigue --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1f81eb65b..4d8920a79 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ This is the development repository for the Facebook for WooCommerce plugin. ## Support The best place to get support is the [WordPress.org Facebook for WooCommerce forum](https://wordpress.org/support/plugin/facebook-for-woocommerce/). -If you have a woocommerce.com account, you can [search for help or submit a help request on woocommerce.com](https://woocommerce.com/my-account/contact-support/). +If you have a WooCommerce.com account, you can [search for help or submit a help request on WooCommerce.com](https://woocommerce.com/my-account/contact-support/). ### Logging The plugin offers logging that can help debug various problems. You can enable debug mode in the main plugin settings panel under the `Enable debug mode` section. From 47a58ff328bb1d4272c4a839e44e66165180d797 Mon Sep 17 00:00:00 2001 From: Justin Palmer <228780+layoutd@users.noreply.github.com> Date: Tue, 7 May 2024 13:25:21 +0200 Subject: [PATCH 7/8] Product version bump update --- facebook-for-woocommerce.php | 4 ++-- package-lock.json | 2 +- package.json | 2 +- readme.txt | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/facebook-for-woocommerce.php b/facebook-for-woocommerce.php index b952ca4af..89c0507f1 100644 --- a/facebook-for-woocommerce.php +++ b/facebook-for-woocommerce.php @@ -11,7 +11,7 @@ * Description: Grow your business on Facebook! Use this official plugin to help sell more of your products using Facebook. After completing the setup, you'll be ready to create ads that promote your products and you can also create a shop section on your Page where customers can browse your products on Facebook. * Author: Facebook * Author URI: https://www.facebook.com/ - * Version: 3.2.0 + * Version: 3.2.1 * Requires at least: 5.6 * Text Domain: facebook-for-woocommerce * Requires Plugins: woocommerce @@ -45,7 +45,7 @@ class WC_Facebook_Loader { /** * @var string the plugin version. This must be in the main plugin file to be automatically bumped by Woorelease. */ - const PLUGIN_VERSION = '3.2.0'; // WRCS: DEFINED_VERSION. + const PLUGIN_VERSION = '3.2.1'; // WRCS: DEFINED_VERSION. // Minimum PHP version required by this plugin. const MINIMUM_PHP_VERSION = '7.4.0'; diff --git a/package-lock.json b/package-lock.json index 9dd8c3cb7..7d6e7d565 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "facebook-for-woocommerce", - "version": "3.2.0", + "version": "3.2.1", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index bc9c48199..88dfe6d26 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "facebook-for-woocommerce", - "version": "3.2.0", + "version": "3.2.1", "author": "Facebook", "homepage": "https://woocommerce.com/products/facebook/", "license": "GPL-2.0", diff --git a/readme.txt b/readme.txt index 1215f77a6..1ff095190 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: facebook, automattic, woothemes Tags: facebook, woocommerce, marketing, product catalog feed, pixel Requires at least: 4.4 Tested up to: 6.5 -Stable tag: 3.2.0 +Stable tag: 3.2.1 Requires PHP: 5.6 or greater MySQL: 5.6 or greater License: GPLv2 or later From efd8f5c3a91de4509de9bf2f47c2ce1b08833f1a Mon Sep 17 00:00:00 2001 From: Justin Palmer <228780+layoutd@users.noreply.github.com> Date: Tue, 7 May 2024 13:25:39 +0200 Subject: [PATCH 8/8] Changelog update --- changelog.txt | 6 ++++++ readme.txt | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/changelog.txt b/changelog.txt index d52ab8f8a..a515455c1 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,11 @@ *** Facebook for WooCommerce Changelog *** += 3.2.1 - 2024-05-07 = +* Fix - Defer only AddToCart events if applicable. +* Fix - Direct upgrade path from < 3.1.13 to β‰₯ 3.2.0. +* Tweak - Adds WooCommerce as a dependency to the plugin header. +* Tweak - Revert to WooCommerce.com domain. + = 3.2.0 - 2024-05-01 = * Tweak - PHP8.3 to GitHub PHPCS and Unit Tests workflows. * Update - Remove the sunsetted Messenger Chat feature. diff --git a/readme.txt b/readme.txt index 1ff095190..92adea2dc 100644 --- a/readme.txt +++ b/readme.txt @@ -40,6 +40,12 @@ When opening a bug on GitHub, please give us as many details as possible. == Changelog == += 3.2.1 - 2024-05-07 = +* Fix - Defer only AddToCart events if applicable. +* Fix - Direct upgrade path from < 3.1.13 to β‰₯ 3.2.0. +* Tweak - Adds WooCommerce as a dependency to the plugin header. +* Tweak - Revert to WooCommerce.com domain. + = 3.2.0 - 2024-05-01 = * Tweak - PHP8.3 to GitHub PHPCS and Unit Tests workflows. * Update - Remove the sunsetted Messenger Chat feature.