You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have confirmed this occurs in the most recent version of WordPress, WooCommerce, and Meta for WooCommerce.
I have confirmed this occurs when only WooCommerce and Meta for WooCommerce are active and when using a default WordPress or WooCommerce theme.
βοΈ Describe the bug
After a thorough code review of Meta for WooCommerce v3.6.0, I found several security, performance, and compatibility issues. These are not runtime bugs per se, but code-level issues that can cause security vulnerabilities, page cache invalidation, and WooCommerce compatibility gaps. Grouped by severity below.
// Line 1076 sanitizes for plain text:$woo_product->set_description( sanitize_text_field( wp_unslash( $_POST[ self::FB_PRODUCT_DESCRIPTION ] ) ) );
// But line 1079 passes raw input for rich text:$woo_product->set_rich_text_description( $_POST[ self::FB_PRODUCT_DESCRIPTION ] );
The set_rich_text_description() method receives completely unsanitized POST data. The phpcs sanitization and unslash warnings are explicitly suppressed with phpcs:disable comments. This should use wp_kses_post() at minimum to prevent stored XSS.
This sets cookies on every frontend page load via PHP (server-side). This prevents WP Rocket, LiteSpeed Cache, Cloudflare, and any other page cache from caching the response β because the Set-Cookie header makes each response unique. For sites relying on full-page caching (most production WooCommerce stores), this silently disables caching site-wide.
Suggestion: Set cookies via JavaScript instead (client-side), or defer to an AJAX endpoint, so the HTML response remains cacheable.
The plugin declares HPOS compatibility but does not declare compatibility with:
cart_checkout_blocks β WooCommerce checkout blocks have been default since WC 8.3+
product_block_editor β the new product editing experience
// Currently only this is declared:
FeaturesUtil::declare_compatibility( 'custom_order_tables', plugin_basename( __FILE__ ), true );
// Missing:
FeaturesUtil::declare_compatibility( 'cart_checkout_blocks', plugin_basename( __FILE__ ), true );
FeaturesUtil::declare_compatibility( 'product_block_editor', plugin_basename( __FILE__ ), true );
WooCommerce shows incompatibility warnings in the admin for plugins that don't declare these.
4. readme.txt Stable Tag Version Mismatch
File:readme.txt:6
The plugin header says Version: 3.6.0, but readme.txt says Stable tag: 3.5.18. This is 12 versions behind and can cause confusion for WordPress.org update mechanisms and version checks.
π Isolate the bug
βοΈ Describe the bug
After a thorough code review of Meta for WooCommerce v3.6.0, I found several security, performance, and compatibility issues. These are not runtime bugs per se, but code-level issues that can cause security vulnerabilities, page cache invalidation, and WooCommerce compatibility gaps. Grouped by severity below.
π΄ High Severity
1. Unsanitized
$_POSTInput β Potential Stored XSSFile:
facebook-commerce.php:1079The
set_rich_text_description()method receives completely unsanitized POST data. The phpcs sanitization and unslash warnings are explicitly suppressed withphpcs:disablecomments. This should usewp_kses_post()at minimum to prevent stored XSS.2. Frontend
setcookie()Breaks Page CacheFile:
facebook-commerce-events-tracker.php:143This sets cookies on every frontend page load via PHP (server-side). This prevents WP Rocket, LiteSpeed Cache, Cloudflare, and any other page cache from caching the response β because the
Set-Cookieheader makes each response unique. For sites relying on full-page caching (most production WooCommerce stores), this silently disables caching site-wide.Suggestion: Set cookies via JavaScript instead (client-side), or defer to an AJAX endpoint, so the HTML response remains cacheable.
3. Missing WooCommerce Block Compatibility Declarations
File:
facebook-for-woocommerce.php:32-40The plugin declares HPOS compatibility but does not declare compatibility with:
cart_checkout_blocksβ WooCommerce checkout blocks have been default since WC 8.3+product_block_editorβ the new product editing experienceWooCommerce shows incompatibility warnings in the admin for plugins that don't declare these.
4. readme.txt Stable Tag Version Mismatch
File:
readme.txt:6The plugin header says
Version: 3.6.0, but readme.txt saysStable tag: 3.5.18. This is 12 versions behind and can cause confusion for WordPress.org update mechanisms and version checks.π‘ Medium Severity
5. SQL Queries Without
$wpdb->prepare()File:
includes/Utilities/Background_Remove_Duplicate_Visibility_Meta.php:115, 182Two SQL queries execute directly on
wp_postmetawithout using$wpdb->prepare():While these queries don't use user input,
$wpdb->prepare()is a defense-in-depth best practice and the phpcs overrides suggest awareness of the issue.6. Missing Nonce Verification on State-Changing GET Parameter
File:
facebook-commerce.php:383The
remove_stickyGET parameter triggers a state change without nonce verification, making it vulnerable to CSRF.7. Direct
error_log()Instead ofwc_get_logger()Multiple files use
error_log()directly instead of WooCommerce's logging API:includes/Admin/Settings_Screens/Localization_Settings_Trait.php:119, 129, 165includes/API/Plugin/InitializeRestAPI.php:100includes/ProductAttributeMapper.php:849includes/fbproduct.php:1756This bypasses WooCommerce's structured logging (WC > Status > Logs), making debugging harder for store admins.
8. Redundant
get_post_meta()CallsFile:
includes/Admin.php:1034-1042Seven product attributes each use a ternary pattern that calls
get_post_meta()2-3 times:This results in 14-21 DB queries where 7 would suffice. Should assign to a variable first:
π’ Low Severity
9. Bare
die()in AJAX HandlerFile:
includes/AJAX.php:98Should use
wp_send_json_error()orwp_die()for proper WordPress AJAX response handling.10. Inline Script Echo
File:
includes/fbutils.php:107Should use
wp_add_inline_script()for proper WordPress script management and CSP header compatibility.πΆββοΈ Steps to reproduce
Set-Cookieheader is present on every response, preventing page cachingreadme.txtstable tag (3.5.18) with plugin header version (3.6.0)βοΈ Expected behavior
wp_kses_post()or equivalent before storagecart_checkout_blocksandproduct_block_editorcompatibility$wpdb->prepare()even when not handling user inputwc_get_logger()for WooCommerce integrationπ Logs
Environment
All findings are from static code review of v3.6.0 source files.