Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion facebook-commerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -3107,7 +3107,7 @@ public function ajax_display_test_result() {
* Determines if the enhanced onboarding (iframe) should be used.
*
* @return bool
* @since 2.0.0
* @internal
*
*/
public function use_enhanced_onboarding() {
Expand Down
2 changes: 1 addition & 1 deletion includes/Admin/Settings_Screens/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ private function render_facebook_iframe() {
height="800"
frameborder="0"
style="background: transparent;"
id=""></iframe>
id="facebook-commerce-iframe"></iframe>
<?php
}

Expand Down
23 changes: 15 additions & 8 deletions includes/Handlers/MetaExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* Handles Meta Commerce Extension functionality and configuration.
*
* @since 2.0.0
* @since 2.5.2
*/
class MetaExtension {

Expand Down Expand Up @@ -57,7 +57,7 @@ class MetaExtension {
/**
* Constructor.
*
* @since 2.0.0
* @since 2.5.2
*/
public function __construct() {
add_action( 'rest_api_init', array( __CLASS__, 'init_rest_endpoint' ) );
Expand All @@ -73,7 +73,7 @@ public function __construct() {
* @param array $tokens Array of tokens to validate.
*
* @return true|WP_Error True if all required tokens are present, WP_Error otherwise.
* @since 2.0.0
* @internal
*/
private static function validate_required_tokens( $tokens ) {
$error_message = '';
Expand All @@ -100,7 +100,7 @@ private static function validate_required_tokens( $tokens ) {
* @param array $settings Array of settings to update.
*
* @return void
* @since 2.0.0
* @internal
*/
private static function update_settings( $settings ) {
foreach ( $settings as $key => $value ) {
Expand All @@ -118,7 +118,7 @@ private static function update_settings( $settings ) {
* @param bool $sanitize Whether to sanitize the value.
*
* @return mixed|string The value or empty string if not set.
* @since 2.0.0
* @internal
*/
private static function get_param_value( $data, $key, $sanitize = true ) {
if ( ! isset( $data[ $key ] ) ) {
Expand All @@ -140,7 +140,7 @@ private static function get_param_value( $data, $key, $sanitize = true ) {
* @param array $params Request parameters.
*
* @return array Mapped options with values.
* @since 2.0.0
* @internal
*/
private static function map_params_to_options( $params ) {
$options = array();
Expand Down Expand Up @@ -190,7 +190,7 @@ private static function map_params_to_options( $params ) {
* @param array $params Parameters containing tokens.
*
* @return void
* @since 2.0.0
* @internal
*/
private static function update_connection_status( $params ) {
if ( ! empty( $params['access_token'] ) ) {
Expand All @@ -206,7 +206,7 @@ private static function update_connection_status( $params ) {
* Clears Facebook integration options.
*
* @return void
* @since 2.0.0
* @internal
*/
private static function clear_integration_options() {
$options = array(
Expand Down Expand Up @@ -267,6 +267,7 @@ private static function clear_integration_options() {
*
* @return array Response data
* @throws \Exception If the request fails.
* @internal
*/
private static function call_api( $method, $endpoint, $params ) {
$url = 'https://graph.facebook.com/' . self::API_VERSION . '/' . $endpoint;
Expand Down Expand Up @@ -314,6 +315,7 @@ private static function call_api( $method, $endpoint, $params ) {
* Initialize the REST API endpoint for updating Facebook settings.
*
* @return void
* @since 2.5.2
*/
public static function init_rest_endpoint() {
register_rest_route(
Expand Down Expand Up @@ -341,6 +343,7 @@ public static function init_rest_endpoint() {
* Permission callback for the REST API endpoint.
*
* @return bool
* @since 2.5.2
*/
public static function rest_update_fb_settings_permission_callback() {
return current_user_can( 'manage_woocommerce' );
Expand All @@ -362,6 +365,7 @@ public static function rest_update_fb_settings_permission_callback() {
*
* @param WP_REST_Request $request The request.
* @return WP_REST_Response
* @since 2.5.2
*/
public static function rest_update_fb_settings( WP_REST_Request $request ) {
// Get JSON data from request body
Expand Down Expand Up @@ -398,6 +402,7 @@ public static function rest_update_fb_settings( WP_REST_Request $request ) {
* REST API endpoint callback to handle uninstall requests.
*
* @return WP_REST_Response|WP_Error
* @since 2.5.2
*/
public static function rest_handle_uninstall() {
try {
Expand Down Expand Up @@ -449,6 +454,7 @@ public static function rest_handle_uninstall() {
* @param string $external_business_id External business ID.
*
* @return string
* @since 2.5.2
*/
public static function generate_iframe_splash_url( $is_connected, $plugin, $external_business_id ): string {
$connection_handler = facebook_for_woocommerce()->get_connection_handler();
Expand Down Expand Up @@ -484,6 +490,7 @@ public static function generate_iframe_splash_url( $is_connected, $plugin, $exte
* @param string $external_business_id External business ID.
*
* @return string
* @since 2.5.2
*/
public static function generate_iframe_management_url( $external_business_id ) {
$access_token = get_option( self::OPTION_ACCESS_TOKEN, '' );
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Admin/Settings_Screens/ConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,6 @@ public function test_renders_management_url_based_on_merchant_token() {
// Check that the iframe is rendered
$this->assertStringContainsString('<iframe', $output);
$this->assertStringContainsString('frameborder="0"', $output);
$this->assertStringContainsString('id="facebook-commerce-iframe"', $output);
}
}