Skip to content

Commit

Permalink
Fixed an issue with OB loading, and also removed the reuse pixel id t…
Browse files Browse the repository at this point in the history
…ext (#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: #73

Differential Revision: D68767036

Pulled By: vahidkay-meta

fbshipit-source-id: fb261548b9c57f26f6621f4fb6fdc95a8a04111f
  • Loading branch information
vahidkay-meta authored and facebook-github-bot committed Jan 28, 2025
1 parent 69388b3 commit 541c7f4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 33 deletions.
2 changes: 1 addition & 1 deletion core/class-facebookwordpresspixelinjection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
32 changes: 0 additions & 32 deletions core/class-facebookwordpresssettingspage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
'<p>Reuse the pixel id from your previous setup: ' .
'<strong>%s</strong></p>',
$pixel_id
);
return $message;
}

/**
* Generates and returns the browser settings HTML and JavaScript
* for the Facebook Business Extension.
Expand Down

0 comments on commit 541c7f4

Please sign in to comment.