Skip to content

Commit

Permalink
Merge pull request #2759 from woocommerce/develop
Browse files Browse the repository at this point in the history
Release 3.2.4
  • Loading branch information
rawdreeg authored Jun 13, 2024
2 parents 5d51f9c + 5a1ec9e commit 8fad5a3
Show file tree
Hide file tree
Showing 10 changed files with 1,677 additions and 182 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ codeception.yml
/assets/build

# local dev configurations
.wp-env.json
.wp-env.override.json
php.ini
wp-config.php

Expand Down
14 changes: 14 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"core": null,
"phpVersion": "7.4",
"plugins": [
"https://downloads.wordpress.org/plugin/woocommerce.latest-stable.zip",
"."
],
"config": {
"WP_DEBUG": true,
"WP_DEBUG_LOG": true,
"WP_DEBUG_DISPLAY": true,
"SCRIPT_DEBUG": true
}
}
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
*** Facebook for WooCommerce Changelog ***

= 3.2.4 - 2024-06-13 =
* Dev - Adds support for wp-env.
* Tweak - Fully remove Facebook Messenger code references.
* Tweak - WC 9.0 compatibility.

= 3.2.3 - 2024-05-28 =
* Add - Versioning and compatibility checks to implement support policy.
* Fix - Errors and warnings while generating pot file.
Expand Down
96 changes: 0 additions & 96 deletions facebook-commerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,6 @@ class WC_Facebookcommerce_Integration extends WC_Integration {
/** @var string the scheduled resync offset setting ID */
const SETTING_SCHEDULED_RESYNC_OFFSET = 'scheduled_resync_offset';

/** @var string the "enable messenger" setting ID */
const SETTING_ENABLE_MESSENGER = 'wc_facebook_enable_messenger';

/** @var string the messenger locale setting ID */
const SETTING_MESSENGER_LOCALE = 'wc_facebook_messenger_locale';

/** @var string the messenger greeting setting ID */
const SETTING_MESSENGER_GREETING = 'wc_facebook_messenger_greeting';

/** @var string the messenger color HEX setting ID */
const SETTING_MESSENGER_COLOR_HEX = 'wc_facebook_messenger_color_hex';

/** @var string the "debug mode" setting ID */
const SETTING_ENABLE_DEBUG_MODE = 'wc_facebook_enable_debug_mode';

Expand Down Expand Up @@ -2484,64 +2472,6 @@ public function get_product_description_mode() {
return $mode;
}

/**
* Gets the configured Facebook messenger locale.
*
* @since 1.10.0
* @deprecated 3.2.0
*
* @return string
*/
public function get_messenger_locale() {
$this->messenger_doing_it_wrong();
return 'en_US';
}

/**
* Gets the configured Facebook messenger greeting.
*
* @since 1.10.0
* @deprecated 3.2.0
*
* @return string
*/
public function get_messenger_greeting() {
$this->messenger_doing_it_wrong();
return Helper::str_truncate(
__( "Hi! We're here to answer any questions you may have.", 'facebook-for-woocommerce' ),
$this->get_messenger_greeting_max_characters(),
''
);
}

/**
* Gets the maximum number of characters allowed in the messenger greeting.
*
* @since 1.10.0
* @deprecated 3.2.0
*
* @return int
*/
public function get_messenger_greeting_max_characters() {
$this->messenger_doing_it_wrong();
return 80;
}

/**
* Gets the configured Facebook messenger color hex.
*
* This is used to style the messenger UI.
*
* @since 1.10.0
* @deprecated 3.2.0
*
* @return string
*/
public function get_messenger_color_hex() {
$this->messenger_doing_it_wrong();
return '#0084ff';
}

/** Setter methods ************************************************************************************************/


Expand Down Expand Up @@ -2706,32 +2636,6 @@ public function is_legacy_feed_file_generation_enabled() {
return 'yes' === get_option( self::OPTION_LEGACY_FEED_FILE_GENERATION_ENABLED, 'yes' );
}

/**
* Determines whether the Facebook messenger is enabled.
*
* @since 1.10.0
* @deprecated 3.2.0
*
* @return bool
*/
public function is_messenger_enabled() {
$this->messenger_doing_it_wrong();
return false;
}

/**
* Show _doing_it_wrong for any deprecated public Messenger-related methods.
*
* @since 3.2.0
*/
private function messenger_doing_it_wrong() {
_doing_it_wrong(
__FUNCTION__,
esc_html__( 'The Facebook Messenger chat plugin was deprecated in May 2024.', 'facebook-for-woocommerce' ),
'3.2.0'
);
}

/**
* Determines whether debug mode is enabled.
*
Expand Down
6 changes: 3 additions & 3 deletions facebook-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
* 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.3
* Version: 3.2.4
* 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.9
* WC tested up to: 9.0
*
* @package FacebookCommerce
*/
Expand Down Expand Up @@ -48,7 +48,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.3'; // WRCS: DEFINED_VERSION.
const PLUGIN_VERSION = '3.2.4'; // WRCS: DEFINED_VERSION.

// Minimum PHP version required by this plugin.
const MINIMUM_PHP_VERSION = '7.4.0';
Expand Down
38 changes: 25 additions & 13 deletions includes/Lifecycle.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@
*/
class Lifecycle extends Framework\Lifecycle {

/** @var string the "enable messenger" setting ID */
const SETTING_ENABLE_MESSENGER = 'wc_facebook_enable_messenger';

/** @var string the messenger locale setting ID */
const SETTING_MESSENGER_LOCALE = 'wc_facebook_messenger_locale';

/** @var string the messenger greeting setting ID */
const SETTING_MESSENGER_GREETING = 'wc_facebook_messenger_greeting';

/** @var string the messenger color HEX setting ID */
const SETTING_MESSENGER_COLOR_HEX = 'wc_facebook_messenger_color_hex';


/**
* Lifecycle constructor.
Expand Down Expand Up @@ -119,10 +131,10 @@ private function migrate_1_9_settings() {
'fb_page_id' => \WC_Facebookcommerce_Integration::SETTING_FACEBOOK_PAGE_ID,
'fb_pixel_id' => \WC_Facebookcommerce_Integration::SETTING_FACEBOOK_PIXEL_ID,
'fb_pixel_use_pii' => \WC_Facebookcommerce_Integration::SETTING_ENABLE_ADVANCED_MATCHING,
'is_messenger_chat_plugin_enabled' => \WC_Facebookcommerce_Integration::SETTING_ENABLE_MESSENGER,
'msger_chat_customization_locale' => \WC_Facebookcommerce_Integration::SETTING_MESSENGER_LOCALE,
'msger_chat_customization_greeting_text_code' => \WC_Facebookcommerce_Integration::SETTING_MESSENGER_GREETING,
'msger_chat_customization_theme_color_code' => \WC_Facebookcommerce_Integration::SETTING_MESSENGER_COLOR_HEX,
'is_messenger_chat_plugin_enabled' => self::SETTING_ENABLE_MESSENGER,
'msger_chat_customization_locale' => self::SETTING_MESSENGER_LOCALE,
'msger_chat_customization_greeting_text_code' => self::SETTING_MESSENGER_GREETING,
'msger_chat_customization_theme_color_code' => self::SETTING_MESSENGER_COLOR_HEX,
);

foreach ( $settings as $old_index => $new_index ) {
Expand Down Expand Up @@ -208,11 +220,11 @@ protected function upgrade_to_2_0_0() {
'excluded_product_category_ids' => \WC_Facebookcommerce_Integration::SETTING_EXCLUDED_PRODUCT_CATEGORY_IDS,
'excluded_product_tag_ids' => \WC_Facebookcommerce_Integration::SETTING_EXCLUDED_PRODUCT_TAG_IDS,
'product_description_mode' => \WC_Facebookcommerce_Integration::SETTING_PRODUCT_DESCRIPTION_MODE,
'enable_messenger' => \WC_Facebookcommerce_Integration::SETTING_ENABLE_MESSENGER,
'messenger_locale' => \WC_Facebookcommerce_Integration::SETTING_MESSENGER_LOCALE,
'messenger_greeting' => \WC_Facebookcommerce_Integration::SETTING_MESSENGER_GREETING,
'messenger_color_hex' => \WC_Facebookcommerce_Integration::SETTING_MESSENGER_COLOR_HEX,
'enable_debug_mode' => \WC_Facebookcommerce_Integration::SETTING_ENABLE_DEBUG_MODE,
'enable_messenger' => self::SETTING_ENABLE_MESSENGER,
'messenger_locale' => self::SETTING_MESSENGER_LOCALE,
'messenger_greeting' => self::SETTING_MESSENGER_GREETING,
'messenger_color_hex' => self::SETTING_MESSENGER_COLOR_HEX,
'enable_debug_mode' => self::SETTING_ENABLE_DEBUG_MODE,
);
foreach ( $settings_map as $old_name => $new_name ) {
if ( ! empty( $settings[ $old_name ] ) ) {
Expand Down Expand Up @@ -323,10 +335,10 @@ protected function upgrade_to_3_2_0() {
}

// Delete all messenger options
delete_option( \WC_Facebookcommerce_Integration::SETTING_ENABLE_MESSENGER );
delete_option( \WC_Facebookcommerce_Integration::SETTING_MESSENGER_LOCALE );
delete_option( \WC_Facebookcommerce_Integration::SETTING_MESSENGER_GREETING );
delete_option( \WC_Facebookcommerce_Integration::SETTING_MESSENGER_COLOR_HEX );
delete_option( self::SETTING_ENABLE_MESSENGER );
delete_option( self::SETTING_MESSENGER_LOCALE );
delete_option( self::SETTING_MESSENGER_GREETING );
delete_option( self::SETTING_MESSENGER_COLOR_HEX );
}

}
Loading

0 comments on commit 8fad5a3

Please sign in to comment.