diff --git a/.github/workflows/php-cs-on-changes.yml b/.github/workflows/php-cs-on-changes.yml index 94b82d7be..fedc8577c 100644 --- a/.github/workflows/php-cs-on-changes.yml +++ b/.github/workflows/php-cs-on-changes.yml @@ -16,7 +16,7 @@ jobs: timeout-minutes: 15 strategy: matrix: - php: [7.4, 8.2] + php: [7.4, 8.3] name: Code sniff (PHP ${{ matrix.php }}, WP Latest) permissions: contents: read diff --git a/.github/workflows/php-unit-tests.yml b/.github/workflows/php-unit-tests.yml index dc1bec91e..a37abe4a6 100644 --- a/.github/workflows/php-unit-tests.yml +++ b/.github/workflows/php-unit-tests.yml @@ -30,7 +30,7 @@ jobs: WP_TESTS_DIR: "/tmp/wordpress/tests/phpunit" strategy: matrix: - php: [7.4, 8.0, 8.1, 8.2] + php: [7.4, 8.3] wp-version: [latest] steps: diff --git a/changelog.txt b/changelog.txt index 8f45f24ea..d52ab8f8a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,9 @@ *** Facebook for WooCommerce Changelog *** += 3.2.0 - 2024-05-01 = +* Tweak - PHP8.3 to GitHub PHPCS and Unit Tests workflows. +* Update - Remove the sunsetted Messenger Chat feature. + = 3.1.15 - 2024-04-16 = * Tweak - Replace the middleware URL from connect.woocommerce.com to api.woocommerce.com/integrations. * Tweak - Test environment setup to resolve notice. diff --git a/class-wc-facebookcommerce.php b/class-wc-facebookcommerce.php index 8602692d4..7c0c07159 100644 --- a/class-wc-facebookcommerce.php +++ b/class-wc-facebookcommerce.php @@ -181,7 +181,6 @@ public function init() { include_once 'facebook-commerce.php'; require_once __DIR__ . '/includes/fbproductfeed.php'; - require_once __DIR__ . '/facebook-commerce-messenger-chat.php'; $this->heartbeat = new Heartbeat( WC()->queue() ); $this->heartbeat->init(); diff --git a/facebook-commerce-messenger-chat.php b/facebook-commerce-messenger-chat.php deleted file mode 100755 index 426234258..000000000 --- a/facebook-commerce-messenger-chat.php +++ /dev/null @@ -1,114 +0,0 @@ -page_id = isset( $settings['fb_page_id'] ) - ? $settings['fb_page_id'] - : ''; - - $this->jssdk_version = isset( $settings['facebook_jssdk_version'] ) - ? $settings['facebook_jssdk_version'] - : ''; - - add_action( 'wp_footer', array( $this, 'inject_messenger_chat_plugin' ) ); - } - - /** - * __get method for backward compatibility. - * - * @param string $key property name - * @return mixed - * @since 3.0.32 - */ - public function __get( $key ) { - // Add warning for private properties. - if ( in_array( $key, array( 'page_id', 'jssdk_version' ), true ) ) { - /* translators: %s property name. */ - _doing_it_wrong( __FUNCTION__, sprintf( esc_html__( 'The %s property is private and should not be accessed outside its class.', 'facebook-for-woocommerce' ), esc_html( $key ) ), '3.0.32' ); - return $this->$key; - } - - return null; - } - - /** - * Outputs the Facebook Messenger chat script. - * - * @internal - */ - public function inject_messenger_chat_plugin() { - - if ( facebook_for_woocommerce()->get_integration()->is_messenger_enabled() ) : - - printf( - " -
- - -
- ", - esc_attr( $this->page_id ), - esc_js( $this->jssdk_version ?: 'v5.0' ), - esc_js( facebook_for_woocommerce()->get_integration()->get_messenger_locale() ?: 'en_US' ) - ); - - endif; - } - - } - -endif; diff --git a/facebook-commerce.php b/facebook-commerce.php index ca358cd6f..81113a46b 100644 --- a/facebook-commerce.php +++ b/facebook-commerce.php @@ -185,9 +185,6 @@ class WC_Facebookcommerce_Integration extends WC_Integration { /** @var WC_Facebookcommerce_EventsTracker instance. */ private $events_tracker; - /** @var WC_Facebookcommerce_MessengerChat instance. */ - private $messenger_chat; - /** @var WC_Facebookcommerce_Background_Process instance. */ private $background_processor; @@ -360,14 +357,6 @@ public function __construct( WC_Facebookcommerce $facebook_for_woocommerce ) { $this->events_tracker = new WC_Facebookcommerce_EventsTracker( $user_info, $aam_settings ); } - // Initialize the messenger chat features. - $this->messenger_chat = new WC_Facebookcommerce_MessengerChat( - array( - 'fb_page_id' => $this->get_facebook_page_id(), - 'facebook_jssdk_version' => $this->get_js_sdk_version(), - ) - ); - // Update products on change of status. add_action( 'transition_post_status', @@ -400,7 +389,7 @@ public function __construct( WC_Facebookcommerce $facebook_for_woocommerce ) { */ public function __get( $key ) { // Add warning for private properties. - if ( in_array( $key, array( 'events_tracker', 'messenger_chat', 'background_processor' ), true ) ) { + if ( in_array( $key, array( 'events_tracker', 'background_processor' ), true ) ) { /* translators: %s property name. */ _doing_it_wrong( __FUNCTION__, sprintf( esc_html__( 'The %s property is private and should not be accessed outside its class.', 'facebook-for-woocommerce' ), esc_html( $key ) ), '3.0.32' ); return $this->$key; @@ -717,7 +706,7 @@ public function load_assets() {