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
4 changes: 2 additions & 2 deletions facebook-commerce-events-tracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ function ( $post ) {
'custom_data' => array(
'content_name' => $category->name,
'content_category' => $category->name,
'content_ids' => json_encode( array_slice( $product_ids, 0, 10 ) ),
'content_ids' => wp_json_encode( array_slice( $product_ids, 0, 10 ) ),
'content_type' => $content_type,
'contents' => $contents,
),
Expand Down Expand Up @@ -453,7 +453,7 @@ private function get_search_event() {
'event_name' => 'Search',
'custom_data' => array(
'content_type' => $content_type,
'content_ids' => json_encode( array_slice( $product_ids, 0, 10 ) ),
'content_ids' => wp_json_encode( array_slice( $product_ids, 0, 10 ) ),
'contents' => $contents,
'search_string' => get_search_query(),
'value' => Helper::number_format( $total_value ),
Expand Down
10 changes: 5 additions & 5 deletions facebook-commerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ public function ajax_fb_background_check_queue() {
'background' => false,
];
}
printf( json_encode( $response ) );
printf( wp_json_encode( $response ) );
wp_die();
}

Expand Down Expand Up @@ -1735,7 +1735,7 @@ public function ajax_check_feed_upload_status() {
'connected' => true,
'status' => 'complete',
];
printf( json_encode( $response ) );
printf( wp_json_encode( $response ) );
wp_die();
}

Expand Down Expand Up @@ -1786,7 +1786,7 @@ public function ajax_check_feed_upload_status_v2() {
} else {
$response = [ 'connected' => false ];
}
printf( json_encode( $response ) );
printf( wp_json_encode( $response ) );
wp_die();
}

Expand Down Expand Up @@ -2015,7 +2015,7 @@ public function get_sample_product_feed() {
wp_reset_postdata();
ob_end_clean();

return json_encode( [ $items ] );
return wp_json_encode( [ $items ] );
}

/**
Expand Down Expand Up @@ -3009,7 +3009,7 @@ public function ajax_display_test_result() {
delete_transient( 'facebook_plugin_test_stack_trace' );
}
delete_option( 'fb_test_pass' );
printf( json_encode( $response ) );
printf( wp_json_encode( $response ) );
wp_die();
}

Expand Down
1 change: 0 additions & 1 deletion includes/Handlers/WhatsAppUtilityConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ public static function get_supported_languages_for_templates( $integration_confi
__( 'Integration Config GET API call Succeeded', 'facebook-for-woocommerce' )
)
);
// $response_object = json_decode( $data[0] );
wp_send_json_success( $data, 'Finish Integration Config API Call' );
}
}
Expand Down
4 changes: 2 additions & 2 deletions includes/fbutils.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ public static function fblog(
$obj['plugin_version'] = self::PLUGIN_VERSION;
$obj['php_version'] = phpversion();
}
$message = json_encode(
$message = wp_json_encode(
array(
'message' => $message,
'object' => $obj,
Expand Down Expand Up @@ -1020,7 +1020,7 @@ public static function log_with_debug_mode_enabled( $message, $level = null ) {
}

if ( is_array( $message ) || is_object( $message ) ) {
$message = json_encode( $message );
$message = wp_json_encode( $message );
} else {
$message = sanitize_textarea_field( $message );
}
Expand Down