Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6621849
E2E tests fully automated
immadhavv Sep 12, 2025
361c301
added workflow_dispatch to test if e2e tests work correctly
immadhavv Sep 12, 2025
70340bf
removed workflow_dispatch after testing
immadhavv Sep 12, 2025
6f17ceb
renamed the validator file
immadhavv Sep 12, 2025
8091208
renamed the validator file
immadhavv Sep 12, 2025
584ac33
added space
immadhavv Sep 12, 2025
93c0a24
Feat/stock update fix (#3602)
rithikb24 Sep 15, 2025
f75b473
updated IDs to use secrets instead
immadhavv Sep 24, 2025
42ea50f
added workflow_dispatch option
immadhavv Sep 24, 2025
64bd3be
updated page_id variable name
immadhavv Sep 24, 2025
dfa203e
update SKU to ensure unique values across runs and avoid collision
immadhavv Sep 24, 2025
26c224f
Fix Resize issue by listening to WA specific Resize PostMessage (#3607)
sharunaanandraj Sep 16, 2025
85fdf1a
Fix Iframe Management Url Stefi API Call (#3608)
sharunaanandraj Sep 16, 2025
c528402
Add Logs for WooCommerce WhatsApp Iframe Infra to Help with Debugging…
sharunaanandraj Sep 19, 2025
a552389
WooCommerce Changes to call Customer Events Endpoint for Order Fulfil…
woo-ardsouza Sep 19, 2025
34892a3
Remediate privacy vulnerability due to lack of nonce check (#3610)
guansu-meta Sep 19, 2025
6a7382e
Woo Changes to support Order Refunded (#3614)
woo-ardsouza Sep 19, 2025
dec93fd
Changes to support Order Placed (#3615)
woo-ardsouza Sep 19, 2025
80c8c1f
Return Error Banner if Iframe Management Url Fetching Fails (#3618)
sharunaanandraj Sep 22, 2025
d7d3133
Removed Graph API product delete functionality (#3621)
vinkmeta Sep 23, 2025
f0d8885
Deprecated product group update functionality (#3619)
vinkmeta Sep 23, 2025
159d5f5
Update switch from only dogfooding GK to one combined with prod GK (#…
sharunaanandraj Sep 23, 2025
442c41f
Fix - PHP 8.2 string interpolation warning (#3626)
ukilla Sep 23, 2025
6c56d4a
Removing unnecessary banner for every item publish (#3620)
vinkmeta Sep 23, 2025
dc869f3
Revert "changelog: add parambuilder (#3549)" (#3628)
vahidkay-meta Sep 23, 2025
888fcbc
Added a check for the # of posts found with a query (#3606)
vahidkay-meta Sep 23, 2025
acb9354
Add on-hold and pending as valid purchase order states (#3629)
ukilla Sep 23, 2025
5e87234
Error Message for Customer Events API call (#3630)
woo-ardsouza Sep 23, 2025
189bd5b
Cleanup deprecated product delete functionality (#3622)
vinkmeta Sep 23, 2025
90372e3
add extra waiting period for variable products
immadhavv Sep 24, 2025
313b6c5
Merge branch 'facebook:automate-e2e-tests-completely' into automate-e…
immadhavv Sep 24, 2025
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
35 changes: 34 additions & 1 deletion .github/workflows/product-creation-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ on:
required: false
type: boolean
default: false
workflow_dispatch:
inputs:
use-marketplace-version:
description: 'Should this use marketplace version of the plugin'
required: false
type: boolean
default: false
pull_request:
branches: [ main, master, develop ]

Expand Down Expand Up @@ -149,7 +156,18 @@ jobs:
cd /tmp/wordpress
fi

# Activate the plugin
# Configure Facebook connection before activation
wp option update wc_facebook_access_token "${{ secrets.FB_ACCESS_TOKEN }}" --allow-root
wp option update wc_facebook_merchant_access_token "${{ secrets.FB_ACCESS_TOKEN }}" --allow-root
wp option update wc_facebook_business_manager_id "${{ secrets.FB_BUSINESS_MANAGER_ID }}" --allow-root
wp option update wc_facebook_external_business_id "${{ secrets.FB_EXTERNAL_BUSINESS_ID }}" --allow-root
wp option update wc_facebook_product_catalog_id "${{ secrets.FB_PRODUCT_CATALOG_ID }}" --allow-root
wp option update wc_facebook_pixel_id "${{ secrets.FB_PIXEL_ID }}" --allow-root
wp option update wc_facebook_has_connected_fbe_2 "yes" --allow-root
wp option update wc_facebook_has_authorized_pages_read_engagement "yes" --allow-root
wp option update wc_facebook_enable_product_sync "yes" --allow-root
wp option update wc_facebook_page_id "${{ secrets.FB_PAGE_ID }}" --allow-root
# Activate the plugin (this triggers automatic sync)
wp plugin activate facebook-for-woocommerce --allow-root


Expand All @@ -166,6 +184,21 @@ jobs:
# Test if site is accessible
curl -f http://localhost:8080 || exit 1

- name: Verify Facebook for WooCommerce setup
run: |
cd /tmp/wordpress
echo "=== Facebook for WooCommerce Info ==="
wp eval "
if (function_exists('facebook_for_woocommerce')) {
\$connection = facebook_for_woocommerce()->get_connection_handler();
echo 'Connected: ' . (\$connection->is_connected() ? 'YES' : 'NO') . PHP_EOL;
echo 'Access Token: ' . (\$connection->get_access_token() ? 'Present' : 'Missing') . PHP_EOL;
echo 'External Business ID: ' . \$connection->get_external_business_id() . PHP_EOL;
echo 'Business Manager ID: ' . \$connection->get_business_manager_id() . PHP_EOL;
} else {
echo 'Facebook plugin not loaded properly';
}" --allow-root

- name: Install Playwright
run: |
npm install
Expand Down
17 changes: 17 additions & 0 deletions includes/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,23 @@ public function get_product_facebook_ids( string $facebook_product_catalog_id, s
}


/**
* Returns requested fields from Facebook for the given product.
*
* @param string $facebook_product_catalog_id
* @param string $facebook_retailer_id
* @param string $fields_string Comma-separated string of fields to request from Facebook API.
* @return API\Response|API\ProductCatalog\Products\Id\Response
* @throws ApiException In case of network request error.
* @throws API\Exceptions\Request_Limit_Reached In case of rate limit error.
*/
public function get_product_facebook_fields( string $facebook_product_catalog_id, string $facebook_retailer_id, string $fields_string = 'id,product_group{id}' ): API\ProductCatalog\Products\Id\Response {
$request = new API\ProductCatalog\Products\Id\Request( $facebook_product_catalog_id, $facebook_retailer_id, $fields_string );
$this->set_response_handler( API\ProductCatalog\Products\Id\Response::class );
return $this->perform_request( $request );
}


/**
* @param string $product_catalog_id
* @param array $data
Expand Down
5 changes: 3 additions & 2 deletions includes/API/ProductCatalog/Products/Id/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ class Request extends ApiRequest {
/**
* @param string $facebook_product_catalog_id Facebook Product Catalog ID.
* @param string $facebook_product_retailer_id Facebook Product Retailer ID.
* @param string $fields_string Comma-separated string of fields to request from Facebook API.
*/
public function __construct( string $facebook_product_catalog_id, string $facebook_product_retailer_id ) {
public function __construct( string $facebook_product_catalog_id, string $facebook_product_retailer_id, string $fields_string = 'id,product_group{id}' ) {

/**
* We use the endpoint with filter to get the product id and group id for new products to check if the product is already synced to Facebook.
Expand All @@ -29,7 +30,7 @@ public function __construct( string $facebook_product_catalog_id, string $facebo
$this->set_params(
array(
'filter' => '{"retailer_id":{"eq":"' . $facebook_product_retailer_id . '"}}',
'fields' => 'id,product_group{id}',
'fields' => $fields_string,
)
);
}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
"test:js": "jest",
"test:e2e": "playwright test",
"test:e2e:ui": "playwright test --ui",
"test:e2e:debug": "playwright test --debug"
"test:e2e:debug": "playwright test --debug",
"test:e2e:local:ui": "WORDPRESS_URL=http://wooc-auto-mbe-site.local WP_USERNAME=madhav WP_PASSWORD=madhav-wooc playwright test --ui --debug"
},
"woorelease": {
"wp_org_slug": "facebook-for-woocommerce",
Expand Down
Loading
Loading