diff --git a/facebook-commerce.php b/facebook-commerce.php
index 7e55f64e0..d5e15ea03 100644
--- a/facebook-commerce.php
+++ b/facebook-commerce.php
@@ -1,6 +1,4 @@
Facebook for WooCommerce
';
public const FB_SYNC_IN_PROGRESS = 'fb_sync_in_progress';
- public const FB_SYNC_REMAINING = 'fb_sync_remaining';
- public const FB_SYNC_TIMEOUT = 30;
- public const FB_PRIORITY_MID = 9;
+ public const FB_SYNC_REMAINING = 'fb_sync_remaining';
+ public const FB_SYNC_TIMEOUT = 30;
+ public const FB_PRIORITY_MID = 9;
/**
* Facebook exception test mode switch.
@@ -256,8 +258,8 @@ public function __construct( WC_Facebookcommerce $facebook_for_woocommerce ) {
WC_Facebookcommerce_Utils::$ems = $this->get_external_merchant_settings_id();
// Set meta diagnosis to yes by default
- if(!get_option( self::SETTING_ENABLE_META_DIAGNOSIS )) {
- update_option(self::SETTING_ENABLE_META_DIAGNOSIS, 'yes');
+ if ( ! get_option( self::SETTING_ENABLE_META_DIAGNOSIS ) ) {
+ update_option( self::SETTING_ENABLE_META_DIAGNOSIS, 'yes' );
}
if ( is_admin() ) {
@@ -270,8 +272,8 @@ public function __construct( WC_Facebookcommerce $facebook_for_woocommerce ) {
// Display an info banner for eligible pixel and user.
if ( $this->get_external_merchant_settings_id()
- && $this->get_facebook_pixel_id()
- && $this->get_pixel_install_time() ) {
+ && $this->get_facebook_pixel_id()
+ && $this->get_pixel_install_time() ) {
$should_query_tip =
WC_Facebookcommerce_Utils::check_time_cap(
get_option( 'fb_info_banner_last_query_time', '' ),
@@ -446,7 +448,7 @@ public function init_pixel() {
if (
WC_Facebookcommerce_Utils::is_valid_id( $settings_pixel_id ) &&
( ! WC_Facebookcommerce_Utils::is_valid_id( $pixel_id ) ||
- $pixel_id != $settings_pixel_id
+ $pixel_id !== $settings_pixel_id
)
) {
WC_Facebookcommerce_Pixel::set_pixel_id( $settings_pixel_id );
@@ -475,7 +477,6 @@ public function init_pixel() {
*
* @return AAMSettings
* @since 2.0.3
- *
*/
private function load_aam_settings_of_pixel() {
$installed_pixel = $this->get_facebook_pixel_id();
@@ -488,7 +489,7 @@ private function load_aam_settings_of_pixel() {
$refresh_interval = 20 * MINUTE_IN_SECONDS;
$aam_settings = null;
// If wc_facebook_aam_settings is present in the DB it is converted into an AAMSettings object.
- if ( $saved_value !== false ) {
+ if ( false !== $saved_value ) {
$cached_aam_settings = new AAMSettings( json_decode( $saved_value, true ) );
// This condition is added because
// it is possible that the AAMSettings saved do not belong to the current
@@ -575,11 +576,10 @@ public function ajax_fb_background_check_queue() {
* Gets a list of Product Item IDs indexed by the ID of the variation.
*
* @param WC_Facebook_Product|WC_Product $product product
- * @param string $product_group_id product group ID
+ * @param string $product_group_id product group ID
*
* @return array
* @since 2.0.0
- *
*/
public function get_variation_product_item_ids( $product, $product_group_id ) {
$product_item_ids_by_variation_id = [];
@@ -587,8 +587,10 @@ public function get_variation_product_item_ids( $product, $product_group_id ) {
// get the product item IDs from meta data and build a list of variations that don't have a product item ID stored
foreach ( $product->get_children() as $variation_id ) {
- if ( $variation = wc_get_product( $variation_id ) ) {
- if ( $product_item_id = $variation->get_meta( self::FB_PRODUCT_ITEM_ID ) ) {
+ $variation = wc_get_product( $variation_id );
+ if ( $variation ) {
+ $product_item_id = $variation->get_meta( self::FB_PRODUCT_ITEM_ID );
+ if ( $product_item_id ) {
$product_item_ids_by_variation_id[ $variation_id ] = $product_item_id;
} else {
$retailer_id = WC_Facebookcommerce_Utils::get_fb_retailer_id( $variation );
@@ -800,7 +802,6 @@ public function load_assets() {
* @since 2.3.0
*
* @internal
- *
*/
private function get_removed_from_sync_products_to_delete() {
$posted_products = Helper::get_posted_value( WC_Facebook_Product::FB_REMOVE_FROM_SYNC );
@@ -819,7 +820,6 @@ private function get_removed_from_sync_products_to_delete() {
* @since 1.10.0
*
* @internal
- *
*/
public function on_product_save( int $wp_id ) {
$product = wc_get_product( $wp_id );
@@ -855,7 +855,7 @@ public function on_product_save( int $wp_id ) {
}
}
- if( $sync_enabled ) {
+ if ( $sync_enabled ) {
Products::enable_sync_for_products( [ $product ] );
Products::set_product_visibility( $product, Admin::SYNC_MODE_SYNC_AND_HIDE !== $sync_mode );
$this->save_product_settings( $product );
@@ -948,7 +948,6 @@ private function save_variable_product_settings( $product ) {
* @param \WC_Product $product the product object
*
* @since 1.10.0
- *
*/
private function save_product_settings( WC_Product $product ) {
$woo_product = new WC_Facebook_Product( $product->get_id() );
@@ -956,6 +955,8 @@ private function save_product_settings( WC_Product $product ) {
// phpcs:disable WordPress.Security.NonceVerification.Missing
if ( isset( $_POST[ self::FB_PRODUCT_DESCRIPTION ] ) ) {
$woo_product->set_description( sanitize_text_field( wp_unslash( $_POST[ self::FB_PRODUCT_DESCRIPTION ] ) ) );
+ // phpcs:disable WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
+ // phpcs:disable WordPress.Security.ValidatedSanitizedInput.MissingUnslash
$woo_product->set_rich_text_description( $_POST[ self::FB_PRODUCT_DESCRIPTION ] );
}
@@ -1017,7 +1018,6 @@ public function on_product_delete( int $product_id ) {
* @since 2.3.0
*
* @internal
- *
*/
public function delete_fb_product( $product ) {
@@ -1051,12 +1051,11 @@ public function delete_fb_product( $product ) {
/**
* Updates Facebook Visibility upon trashing and restore.
*
- * @param string $new_status
- * @param string $old_status
+ * @param string $new_status
+ * @param string $old_status
* @param \WP_post $post
*
* @internal
- *
*/
public function fb_change_product_published_status( $new_status, $old_status, $post ) {
if ( ! $post ) {
@@ -1087,7 +1086,7 @@ public function fb_change_product_published_status( $new_status, $old_status, $p
$visibility = $product->is_visible() ? self::FB_SHOP_PRODUCT_VISIBLE : self::FB_SHOP_PRODUCT_HIDDEN;
- if ( $visibility === self::FB_SHOP_PRODUCT_VISIBLE ) {
+ if ( self::FB_SHOP_PRODUCT_VISIBLE === $visibility ) {
// - new status is 'publish' regardless of old status, sync to Facebook
$this->on_product_publish( $product->get_id() );
} else {
@@ -1101,7 +1100,6 @@ public function fb_change_product_published_status( $new_status, $old_status, $p
* @param int $post_id
*
* @internal
- *
*/
public function fb_restore_untrashed_variable_product( $post_id ) {
$product = wc_get_product( $post_id );
@@ -1116,7 +1114,7 @@ public function fb_restore_untrashed_variable_product( $post_id ) {
$visibility = $product->is_visible() ? self::FB_SHOP_PRODUCT_VISIBLE : self::FB_SHOP_PRODUCT_HIDDEN;
- if ( $visibility === self::FB_SHOP_PRODUCT_VISIBLE ) {
+ if ( self::FB_SHOP_PRODUCT_VISIBLE === $visibility ) {
// - new status is 'publish' regardless of old status, sync to Facebook
$this->on_product_publish( $product->get_id() );
}
@@ -1135,10 +1133,9 @@ public function fb_restore_untrashed_variable_product( $post_id ) {
*
* @return bool
* @since 2.0.2
- *
*/
private function should_update_visibility_for_product_status_change( $new_status, $old_status ) {
- return ( $old_status === 'publish' && $new_status !== 'publish' ) || ( $old_status === 'trash' && $new_status === 'publish' ) || ( $old_status === 'future' && $new_status === 'publish' );
+ return ( 'publish' === $old_status && 'publish' !== $new_status ) || ( 'trash' === $old_status && 'publish' === $new_status ) || ( 'future' === $old_status && 'publish' === $new_status );
}
/**
@@ -1185,7 +1182,7 @@ public function on_product_publish( $product_id ) {
* If the user has opt-in to remove products that are out of stock,
* this function will delete the product from FB Page as well.
*
- * @param int $wp_id
+ * @param int $wp_id
* @param WC_Product $woo_product
*
* @return bool
@@ -1204,7 +1201,7 @@ public function delete_on_out_of_stock( int $wp_id, WC_Product $woo_product ): b
/**
* Syncs product to Facebook when saving a variable product.
*
- * @param int $wp_id product post ID
+ * @param int $wp_id product post ID
* @param WC_Facebook_Product|null $woo_product product object
*/
public function on_variable_product_publish( $wp_id, $woo_product = null ) {
@@ -1247,7 +1244,7 @@ public function on_variable_product_publish( $wp_id, $woo_product = null ) {
/**
* Syncs product to Facebook when saving a simple product.
*
- * @param int $wp_id product post ID
+ * @param int $wp_id product post ID
* @param WC_Facebook_Product|null $woo_product product object
* @param WC_Facebook_Product|null $parent_product parent object
*
@@ -1285,7 +1282,6 @@ public function on_simple_product_publish( $wp_id, $woo_product = null, &$parent
* @param WC_Product $product product object
*
* @since 2.0.0
- *
*/
public function product_should_be_synced( WC_Product $product ): bool {
try {
@@ -1301,24 +1297,22 @@ public function product_should_be_synced( WC_Product $product ): bool {
* Create product group and product, store fb-specific info.
*
* @param WC_Facebook_Product $woo_product
- * @param string|null $fb_product_group_id
*
* @return string
*/
- public function create_product_simple( WC_Facebook_Product $woo_product): string {
+ public function create_product_simple( WC_Facebook_Product $woo_product ): string {
$retailer_id = WC_Facebookcommerce_Utils::get_fb_retailer_id( $woo_product );
return $this->create_product_item_batch_api( $woo_product, $retailer_id );
}
/**
* @param WC_Facebook_Product $woo_product
- * @param string $retailer_id
- * @param bool $variants
+ * @param string $retailer_id
*
* @return ?string
*/
public function create_product_group( WC_Facebook_Product $woo_product, string $retailer_id ): ?string {
- $product_group_data = [
+ $product_group_data = [
'retailer_id' => $retailer_id,
];
$product_group_data['variants'] = $woo_product->prepare_variants_for_group();
@@ -1418,8 +1412,8 @@ public function update_product_group( WC_Facebook_Product $woo_product ) {
* which is currently using facebook Product Item API implemented by `WC_Facebookcommerce_Integration::create_product_item`
*
* @param WC_Facebook_Product $woo_product
- * @param string $retailer_id
- **@since 3.1.7
+ * @param string $retailer_id
+ * *@since 3.1.7
*/
public function create_product_item_batch_api( $woo_product, $retailer_id ): string {
try {
@@ -1478,14 +1472,13 @@ public function create_product_item( $woo_product, $retailer_id, $product_group_
* Select closest matching if best can't be found.
*
* @param WC_Facebook_Product $woo_product
- * @param string $fb_product_group_id
+ * @param string $fb_product_group_id
*
* @return integer|null Facebook Catalog variation id.
* @since 2.1.2
*
* @since 2.6.6
* The algorithm only considers the variations that already have been synchronized to the catalog successfully.
- *
*/
private function get_product_group_default_variation( WC_Facebook_Product $woo_product, string $fb_product_group_id ) {
$default_attributes = $woo_product->woo_product->get_default_attributes( 'edit' );
@@ -1560,7 +1553,6 @@ private function get_product_group_default_variation( WC_Facebook_Product $woo_p
*
* @return array
* @since 2.1.2
- *
*/
private function get_product_variation_attributes( array $variation ): array {
$final_attributes = [];
@@ -1577,7 +1569,7 @@ private function get_product_variation_attributes( array $variation ): array {
* Update existing product using batch API.
*
* @param WC_Facebook_Product $woo_product
- * @param string $fb_product_item_id
+ * @param string $fb_product_item_id
*
* @return void
*/
@@ -1609,7 +1601,7 @@ public function update_product_item_batch_api( WC_Facebook_Product $woo_product,
* Update existing product.
*
* @param WC_Facebook_Product $woo_product
- * @param string $fb_product_item_id
+ * @param string $fb_product_item_id
*
* @return void
*/
@@ -1644,9 +1636,8 @@ public function update_product_item( WC_Facebook_Product $woo_product, string $f
* Create or update product set
*
* @param array $product_set_data Product Set data.
- * @param int $product_set_id Product Set Term Id.
- **@since 2.3.0
- *
+ * @param int $product_set_id Product Set Term Id.
+ * *@since 2.3.0
*/
public function create_or_update_product_set_item( $product_set_data, $product_set_id ) {
// check if exists in FB
@@ -1679,8 +1670,8 @@ public function create_or_update_product_set_item( $product_set_data, $product_s
* @param string $fb_product_set_id Facebook Product Set ID.
*
* @return void
- * @throws ApiException
- * @throws \WooCommerce\Facebook\API\Exceptions\Request_Limit_Reached
+ * @throws ApiException If the request fails.
+ * @throws \WooCommerce\Facebook\API\Exceptions\Request_Limit_Reached If the request limit is reached.
*/
public function delete_product_set_item( string $fb_product_set_id ) {
$allow_live_deletion = apply_filters( 'wc_facebook_commerce_allow_live_product_set_deletion', true, $fb_product_set_id );
@@ -1731,9 +1722,8 @@ public function display_batch_api_completed( $post ) {
if ( $fb_product_item_id ) {
$this->display_success_message(
'' .
- 'View product on Meta catalog'
+ $this->get_product_catalog_id() .
+ '/products/" target="_blank">View product on Meta catalog'
);
}
}
@@ -1811,7 +1801,6 @@ public function ajax_check_feed_upload_status_v2() {
*
* @return void
* @deprecated 2.1.0
- *
*/
public function display_success_message( string $msg ): void {
$msg = self::FB_ADMIN_MESSAGE_PREPEND . $msg;
@@ -1918,10 +1907,14 @@ public function ajax_woo_adv_bulk_edit_compat( string $import_id ): void {
public function wp_all_import_compat( string $import_id ): void {
$import = new PMXI_Import_Record();
$import->getById( $import_id );
- if ( ! $import->isEmpty() && in_array( $import->options['custom_type'], [
+ if ( ! $import->isEmpty() && in_array(
+ $import->options['custom_type'],
+ [
'product',
- 'product_variation'
- ], true ) ) {
+ 'product_variation',
+ ],
+ true
+ ) ) {
$this->display_out_of_sync_message( 'import' );
}
}
@@ -1948,7 +1941,7 @@ public function display_out_of_sync_message( string $action_name ): void {
* id error, update existing ID.
*
* @param stdClass $error_data
- * @param int $wpid
+ * @param int $wpid
*
* @return null
**/
@@ -2204,10 +2197,10 @@ private function sync_facebook_products() {
/**
* Syncs Facebook products using the background processor.
*
- * @return bool
- * @throws ApiException Some comment.
- * @throws PluginException If product sync disabled.
* @since 1.10.2
+ *
+ * @return bool
+ * @throws PluginException If the plugin is not configured or the Catalog ID is missing.
*/
private function sync_facebook_products_using_background_processor() {
if ( ! $this->is_product_sync_enabled() ) {
@@ -2345,7 +2338,6 @@ public function ajax_fb_toggle_visibility() {
*
* @return string
* @since 1.10.0
- *
*/
public function get_product_catalog_id() {
if ( ! is_string( $this->product_catalog_id ) ) {
@@ -2360,7 +2352,6 @@ public function get_product_catalog_id() {
* @param \WC_Facebookcommerce_Integration $integration the integration instance
*
* @since 1.10.0
- *
*/
return apply_filters( 'wc_facebook_product_catalog_id', $this->product_catalog_id, $this );
}
@@ -2370,7 +2361,6 @@ public function get_product_catalog_id() {
*
* @return string
* @since 1.10.0
- *
*/
public function get_external_merchant_settings_id() {
if ( ! is_string( $this->external_merchant_settings_id ) ) {
@@ -2385,7 +2375,6 @@ public function get_external_merchant_settings_id() {
* @param \WC_Facebookcommerce_Integration $integration the integration instance
*
* @since 1.10.0
- *
*/
return (string) apply_filters( 'wc_facebook_external_merchant_settings_id', $this->external_merchant_settings_id, $this );
}
@@ -2395,7 +2384,6 @@ public function get_external_merchant_settings_id() {
*
* @return string
* @since 1.10.0
- *
*/
public function get_feed_id() {
if ( ! is_string( $this->feed_id ) ) {
@@ -2410,7 +2398,6 @@ public function get_feed_id() {
* @param \WC_Facebookcommerce_Integration $integration the integration instance
*
* @since 1.10.0
- *
*/
return (string) apply_filters( 'wc_facebook_feed_id', $this->feed_id, $this );
}
@@ -2420,7 +2407,6 @@ public function get_feed_id() {
*
* @return string
* @since 1.11.0
- *
*/
public function get_upload_id() {
if ( ! is_string( $this->upload_id ) ) {
@@ -2435,7 +2421,6 @@ public function get_upload_id() {
* @param \WC_Facebookcommerce_Integration $integration the integration instance
*
* @since 1.11.0
- *
*/
return (string) apply_filters( 'wc_facebook_upload_id', $this->upload_id, $this );
}
@@ -2445,11 +2430,11 @@ public function get_upload_id() {
*
* @return int
* @since 1.10.0
- *
*/
public function get_pixel_install_time() {
if ( ! (int) $this->pixel_install_time ) {
- $value = (int) get_option( self::OPTION_PIXEL_INSTALL_TIME, 0 );
+ $value = (int) get_option( self::OPTION_PIXEL_INSTALL_TIME, 0 );
+ // phpcs:ignore Universal.Operators.DisallowShortTernary.Found
$this->pixel_install_time = $value ?: null;
}
@@ -2460,7 +2445,6 @@ public function get_pixel_install_time() {
* @param \WC_Facebookcommerce_Integration $integration the integration instance
*
* @since 1.10.0
- *
*/
return (int) apply_filters( 'wc_facebook_pixel_install_time', $this->pixel_install_time, $this );
}
@@ -2470,7 +2454,6 @@ public function get_pixel_install_time() {
*
* @return string
* @since 1.10.0
- *
*/
public function get_js_sdk_version() {
if ( ! is_string( $this->js_sdk_version ) ) {
@@ -2485,7 +2468,6 @@ public function get_js_sdk_version() {
* @param \WC_Facebookcommerce_Integration $integration the integration instance
*
* @since 1.10.0
- *
*/
return (string) apply_filters( 'wc_facebook_js_sdk_version', $this->js_sdk_version, $this );
}
@@ -2495,7 +2477,6 @@ public function get_js_sdk_version() {
*
* @return string
* @since 1.10.0
- *
*/
public function get_facebook_page_id() {
/**
@@ -2505,7 +2486,6 @@ public function get_facebook_page_id() {
* @param \WC_Facebookcommerce_Integration $integration the integration instance
*
* @since 1.10.0
- *
*/
return (string) apply_filters( 'wc_facebook_page_id', get_option( self::SETTING_FACEBOOK_PAGE_ID, '' ), $this );
}
@@ -2515,7 +2495,6 @@ public function get_facebook_page_id() {
*
* @return string
* @since 1.10.0
- *
*/
public function get_facebook_pixel_id() {
/**
@@ -2525,7 +2504,6 @@ public function get_facebook_pixel_id() {
* @param \WC_Facebookcommerce_Integration $integration the integration instance
*
* @since 1.10.0
- *
*/
return (string) apply_filters( 'wc_facebook_pixel_id', get_option( self::SETTING_FACEBOOK_PIXEL_ID, '' ), $this );
}
@@ -2535,7 +2513,6 @@ public function get_facebook_pixel_id() {
*
* @return int[]
* @since 1.10.0
- *
*/
public function get_excluded_product_category_ids() {
/**
@@ -2545,7 +2522,6 @@ public function get_excluded_product_category_ids() {
* @param \WC_Facebookcommerce_Integration $integration the integration instance
*
* @since 1.10.0
- *
*/
return (array) apply_filters( 'wc_facebook_excluded_product_category_ids', get_option( self::SETTING_EXCLUDED_PRODUCT_CATEGORY_IDS, [] ), $this );
}
@@ -2555,7 +2531,6 @@ public function get_excluded_product_category_ids() {
*
* @return int[]
* @since 1.10.0
- *
*/
public function get_excluded_product_tag_ids() {
/**
@@ -2565,7 +2540,6 @@ public function get_excluded_product_tag_ids() {
* @param \WC_Facebookcommerce_Integration $integration the integration instance
*
* @since 1.10.0
- *
*/
return (array) apply_filters( 'wc_facebook_excluded_product_tag_ids', get_option( self::SETTING_EXCLUDED_PRODUCT_TAG_IDS, [] ), $this );
}
@@ -2579,7 +2553,6 @@ public function get_excluded_product_tag_ids() {
* @param string $value product catalog ID value
*
* @since 1.10.0
- *
*/
public function update_product_catalog_id( $value ) {
$this->product_catalog_id = $this->sanitize_facebook_credential( $value );
@@ -2593,7 +2566,6 @@ public function update_product_catalog_id( $value ) {
* @param string $value external merchant settings ID value
*
* @since 1.10.0
- *
*/
public function update_external_merchant_settings_id( $value ) {
$this->external_merchant_settings_id = $this->sanitize_facebook_credential( $value );
@@ -2607,7 +2579,6 @@ public function update_external_merchant_settings_id( $value ) {
* @param string $value feed ID value
*
* @since 1.10.0
- *
*/
public function update_feed_id( $value ) {
$this->feed_id = $this->sanitize_facebook_credential( $value );
@@ -2621,7 +2592,6 @@ public function update_feed_id( $value ) {
* @param string $value upload ID value
*
* @since 1.11.0
- *
*/
public function update_upload_id( $value ) {
$this->upload_id = $this->sanitize_facebook_credential( $value );
@@ -2635,13 +2605,13 @@ public function update_upload_id( $value ) {
* @param int $value pixel install time, in UTC seconds
*
* @since 1.10.0
- *
*/
public function update_pixel_install_time( $value ) {
$value = (int) $value;
-
+ // phpcs:ignore Universal.Operators.DisallowShortTernary.Found
$this->pixel_install_time = $value ?: null;
+ // phpcs:ignore Universal.Operators.DisallowShortTernary.Found
update_option( self::OPTION_PIXEL_INSTALL_TIME, $value ?: '' );
}
@@ -2651,7 +2621,6 @@ public function update_pixel_install_time( $value ) {
* @param string $value JS SDK version
*
* @since 1.10.0
- *
*/
public function update_js_sdk_version( $value ) {
$this->js_sdk_version = $this->sanitize_facebook_credential( $value );
@@ -2666,7 +2635,6 @@ public function update_js_sdk_version( $value ) {
*
* @return string
* @since 1.10.0
- *
*/
private function sanitize_facebook_credential( $value ) {
return wc_clean( is_string( $value ) ? $value : '' );
@@ -2677,7 +2645,6 @@ private function sanitize_facebook_credential( $value ) {
*
* @return bool
* @since 1.10.0
- *
*/
public function is_configured() {
return $this->get_facebook_page_id() && $this->facebook_for_woocommerce->get_connection_handler()->is_connected();
@@ -2688,7 +2655,6 @@ public function is_configured() {
*
* @return bool
* @since 1.10.0
- *
*/
public function is_advanced_matching_enabled() {
/**
@@ -2698,7 +2664,6 @@ public function is_advanced_matching_enabled() {
* @param \WC_Facebookcommerce_Integration $integration the integration instance
*
* @since 1.10.0
- *
*/
return (bool) apply_filters( 'wc_facebook_is_advanced_matching_enabled', true, $this );
}
@@ -2708,7 +2673,6 @@ public function is_advanced_matching_enabled() {
*
* @return bool
* @since 1.10.0
- *
*/
public function is_product_sync_enabled() {
/**
@@ -2718,7 +2682,6 @@ public function is_product_sync_enabled() {
* @param \WC_Facebookcommerce_Integration $integration the integration instance
*
* @since 1.10.0
- *
*/
return (bool) apply_filters( 'wc_facebook_is_product_sync_enabled', 'yes' === get_option( self::SETTING_ENABLE_PRODUCT_SYNC, 'yes' ), $this );
}
@@ -2748,7 +2711,6 @@ public function is_legacy_feed_file_generation_enabled() {
*
* @return bool
* @since 3.4.4
- *
*/
public function is_meta_diagnosis_enabled() {
return (bool) ( 'yes' === get_option( self::SETTING_ENABLE_META_DIAGNOSIS ) );
@@ -2759,7 +2721,6 @@ public function is_meta_diagnosis_enabled() {
*
* @return bool
* @since 1.10.2
- *
*/
public function is_debug_mode_enabled() {
/**
@@ -2769,7 +2730,6 @@ public function is_debug_mode_enabled() {
* @param \WC_Facebookcommerce_Integration $integration the integration instance
*
* @since 1.10.2
- *
*/
return (bool) apply_filters( 'wc_facebook_is_debug_mode_enabled', 'yes' === get_option( self::SETTING_ENABLE_DEBUG_MODE ), $this );
}
@@ -2779,7 +2739,6 @@ public function is_debug_mode_enabled() {
*
* @return bool
* @since 2.6.6
- *
*/
public function is_new_style_feed_generation_enabled() {
return (bool) ( 'yes' === get_option( self::SETTING_ENABLE_NEW_STYLE_FEED_GENERATOR ) );
@@ -2801,7 +2760,6 @@ public function are_headers_requested_for_debug() {
*
* @return bool
* @since 1.11.0
- *
*/
public function is_feed_migrated() {
if ( ! is_bool( $this->feed_migrated ) ) {
@@ -2819,10 +2777,12 @@ public function is_feed_migrated() {
* @param string $type
*
* @return string
+ *
+ * phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
*/
private function get_message_html( string $message, string $type = 'error' ): string {
ob_start();
- // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
+
printf(
'
%s