Skip to content

Disable API Pull mode for all users#3273

Merged
joemcgill merged 6 commits intodevelopfrom
feature/GOOWOO-483-disable-api-pull-mode-for-all-users
Mar 3, 2026
Merged

Disable API Pull mode for all users#3273
joemcgill merged 6 commits intodevelopfrom
feature/GOOWOO-483-disable-api-pull-mode-for-all-users

Conversation

@jamesmorrison
Copy link
Collaborator

@jamesmorrison jamesmorrison commented Feb 26, 2026

Changes proposed in this Pull Request:

Closes https://linear.app/a8c/issue/GOOWOO-483/disable-api-pull-mode-for-all-users

Screenshots:

N/A

Detailed test instructions:

1. Prepare the DB (pull enabled)

Set the sync mode option so some datatypes have pull enabled (use direct DB update so filters don’t overwrite it):

wp db query "UPDATE wp_options SET option_value = 'a:4:{s:8:\"products\";a:2:{s:4:\"push\";b:1;s:4:\"pull\";b:1;}s:7:\"coupons\";a:2:{s:4:\"push\";b:1;s:4:\"pull\";b:0;}s:8:\"shipping\";a:2:{s:4:\"push\";b:1;s:4:\"pull\";b:1;}s:8:\"settings\";a:2:{s:4:\"push\";b:1;s:4:\"pull\";b:0;}}' WHERE option_name = 'gla_api_pull_sync_mode';"

(Replace wp_options with your table prefix if different, e.g. wp_2_options.)

Verify:
wp db query "SELECT option_value FROM wp_options WHERE option_name = 'gla_api_pull_sync_mode';"
You should see pull with b:1 for products and shipping.

2. Trigger the migration

Set the stored DB version to 3.5.2 so the 3.5.3 migration runs on next admin load:

wp option update gla_db_version 3.5.2

(Or via SQL: wp db query "UPDATE wp_options SET option_value = '3.5.2' WHERE option_name = 'gla_db_version';")

3. Run the migration

Load the Google for WooCommerce admin page:
https://yoursite.test/wp-admin/admin.php?page=wc-admin&path=%2Fgoogle%2Fdashboard

4. Set the plugin version to 3.5.3

  • In google-listings-and-ads.php set the version to 3.5.3 on lines 6 (plugin header) and 36 (plugin constant)
  • Without changing this, the migration will not run

5. Verify migration and version

  • wp option get gla_db_version → expected: 3.5.3. If you still see 3.5.2, clear object cache and reload the admin page once.
  • wp db query "SELECT option_value FROM wp_options WHERE option_name = 'gla_api_pull_sync_mode';" → expected: all pull are b:0 (e.g. ...s:4:\"pull\";b:0;... for each datatype).
  • wp option get gla_api_pull_sync_mode --format=json → expected: every datatype has "pull": false, e.g. {"products":{"pull":false,"push":true},"coupons":{"pull":false,"push":true},"shipping":{"pull":false,"push":true},"settings":{"pull":false,"push":true}}.

6. Revert the plugin version to 3.5.2

  • In google-listings-and-ads.php set the version to 3.5.2 on lines 6 (plugin header) and 36 (plugin constant) - should show no git changes after completing this step.

Additional details:

Changelog entry

Update - Disable API Pull mode for all users.

@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

❌ Patch coverage is 23.07692% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.4%. Comparing base (4b4e9b4) to head (8bbae3c).
⚠️ Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
src/Options/SyncStatus.php 31.8% 15 Missing ⚠️
src/DB/Migration/Migration20260226T1200000000.php 0.0% 13 Missing ⚠️
...ernal/DependencyManagement/CoreServiceProvider.php 0.0% 1 Missing ⚠️
...nternal/DependencyManagement/DBServiceProvider.php 0.0% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             develop   #3273     +/-   ##
===========================================
- Coverage       66.5%   66.4%   -0.1%     
- Complexity      5095    5113     +18     
===========================================
  Files            507     509      +2     
  Lines          20312   20349     +37     
===========================================
+ Hits           13504   13511      +7     
- Misses          6808    6838     +30     
Flag Coverage Δ
php-unit-tests 66.4% <23.1%> (-0.1%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...rc/API/Site/Controllers/RestAPI/SyncController.php 94.1% <100.0%> (ø)
src/API/WP/NotificationsService.php 94.5% <100.0%> (ø)
...ernal/DependencyManagement/CoreServiceProvider.php 0.0% <0.0%> (ø)
...nternal/DependencyManagement/DBServiceProvider.php 5.7% <0.0%> (-0.2%) ⬇️
src/DB/Migration/Migration20260226T1200000000.php 0.0% <0.0%> (ø)
src/Options/SyncStatus.php 31.8% <31.8%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jamesmorrison jamesmorrison changed the title Draft: [GOOWOO-483] Disable API Pull mode for all users [GOOWOO-483] Disable API Pull mode for all users Feb 26, 2026
@eason9487 eason9487 added the changelog: update Big changes to something that wasn't broken. label Feb 26, 2026
Copy link
Collaborator

@jjgrainger jjgrainger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jamesmorrison looking good, just some feedback to review.

Copy link
Collaborator

@jjgrainger jjgrainger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jamesmorrison looking good, just some minor feedback/cleanup before the release tomorrow.

@asvinb
Copy link
Collaborator

asvinb commented Mar 3, 2026

QA ✅

  • gla_api_pull_sync_mode did not exist in the wp_options table and was inserted by making a POST request to the /wp-json/wc/gla/sync endpoint.
  • Manually updated the pull values for the option, by setting the values to 1
  • Changed the version to 3.5.2
  • Visited the dashboard
  • Version in the DB was updated to 3.5.3
  • Option values were updated to
    • a:4:{s:8:"products";a:2:{s:4:"push";b:1;s:4:"pull";b:0;}s:7:"coupons";a:2:{s:4:"push";b:1;s:4:"pull";b:0;}s:8:"shipping";a:2:{s:4:"push";b:1;s:4:"pull";b:0;}s:8:"settings";a:2:{s:4:"push";b:1;s:4:"pull";b:0;}}

foreach ( $sync_mode as $key => $entry ) {
if ( is_array( $entry ) && array_key_exists( 'pull', $entry ) ) {
$sync_mode[ $key ]['pull'] = false;
if ( true === $sync_mode[ $key ]['pull'] ) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻 This update looks good to me.

@joemcgill joemcgill merged commit 2affb08 into develop Mar 3, 2026
13 checks passed
@joemcgill joemcgill deleted the feature/GOOWOO-483-disable-api-pull-mode-for-all-users branch March 3, 2026 21:00
@joemcgill joemcgill changed the title [GOOWOO-483] Disable API Pull mode for all users Disable API Pull mode for all users Mar 4, 2026
@joemcgill joemcgill mentioned this pull request Mar 4, 2026
22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: update Big changes to something that wasn't broken.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants