From 541c7f4c9f8a800da7f18336d7372ae24d9e7f28 Mon Sep 17 00:00:00 2001 From: Vahid Kaykhaei Date: Tue, 28 Jan 2025 04:56:40 -0800 Subject: [PATCH] Fixed an issue with OB loading, and also removed the reuse pixel id text (#73) Summary: The echo command was missing from the code that loads OpenBridge, making the plugin unable to send CAPI events. Also the text that said reuse pixel id ... was removed from the top of the window, which was confusing and irrelevant in case MBE was not connected Pull Request resolved: https://github.com/facebookincubator/Facebook-Pixel-for-Wordpress/pull/73 Differential Revision: D68767036 Pulled By: vahidkay-meta fbshipit-source-id: fb261548b9c57f26f6621f4fb6fdc95a8a04111f --- .../class-facebookwordpresspixelinjection.php | 2 +- core/class-facebookwordpresssettingspage.php | 32 ------------------- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/core/class-facebookwordpresspixelinjection.php b/core/class-facebookwordpresspixelinjection.php index fcc2f936..c50341b1 100644 --- a/core/class-facebookwordpresspixelinjection.php +++ b/core/class-facebookwordpresspixelinjection.php @@ -130,7 +130,7 @@ public function inject_pixel_code() { $capi_integration_status = FacebookWordpressOptions::get_capi_integration_status(); if ( '1' === $capi_integration_status ) { - FacebookPixel::get_open_bridge_config_code(); + echo FacebookPixel::get_open_bridge_config_code(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } echo FacebookPixel::get_pixel_init_code( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped FacebookWordpressOptions::get_agent_string(), diff --git a/core/class-facebookwordpresssettingspage.php b/core/class-facebookwordpresssettingspage.php index 248340c9..05a78f0b 100644 --- a/core/class-facebookwordpresssettingspage.php +++ b/core/class-facebookwordpresssettingspage.php @@ -153,42 +153,10 @@ public function add_fbe_box() { ) ); } - $pixel_id_message = $this->get_previous_pixel_id_message(); - if ( $pixel_id_message ) { - echo $pixel_id_message; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } echo $this->get_fbe_browser_settings(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped wp_enqueue_script( 'fbe_allinone_script' ); } - /** - * Retrieves a message regarding the previous pixel ID setup. - * - * If the Facebook Business Extension is installed, it returns null. - * Otherwise, it checks for the existence of a pixel ID and returns - * a formatted message indicating the reuse of the pixel ID from a - * previous setup. If no pixel ID is found, it returns null. - * - * @return string|null The message with the previous pixel ID or null if - * the pixel ID is not found or FBE is installed. - */ - private function get_previous_pixel_id_message() { - if ( FacebookWordpressOptions::get_is_fbe_installed() ) { - return null; - } - $pixel_id = FacebookWordpressOptions::get_pixel_id(); - if ( empty( $pixel_id ) ) { - return null; - } - $message = - sprintf( - '

Reuse the pixel id from your previous setup: ' . - '%s

', - $pixel_id - ); - return $message; - } - /** * Generates and returns the browser settings HTML and JavaScript * for the Facebook Business Extension.