Skip to content

[GOOWOO-474] Performance: Avoid uncached Ads API request in NotificationManager#3263

Open
jamesmorrison wants to merge 2 commits intodevelopfrom
feature/GOOWOO-474-performance-avoid-uncached-ads-api-request-in-notificationmanager
Open

[GOOWOO-474] Performance: Avoid uncached Ads API request in NotificationManager#3263
jamesmorrison wants to merge 2 commits intodevelopfrom
feature/GOOWOO-474-performance-avoid-uncached-ads-api-request-in-notificationmanager

Conversation

@jamesmorrison
Copy link
Collaborator

@jamesmorrison jamesmorrison commented Feb 19, 2026

Changes proposed in this Pull Request:

Closes https://linear.app/a8c/issue/GOOWOO-474/performance-avoid-uncached-ads-api-request-in-notificationmanager

Screenshots:

Screenshot 2026-02-19 at 15 42 07

Before clearing transient cache:
Screenshot 2026-02-23 at 13 57 25

After clearing transient cache (i.e. the data is looked up and stored):
Screenshot 2026-02-23 at 13 58 05

Detailed test instructions:

  1. In terminal run: wp transient get gla_ads_highest_spend_campaign - the transient should not exist at this point so expect the output to be: Warning: Transient with key "gla_ads_highest_spend_campaign" is not set.
  2. Open WP Admin, navigate to Marketing -> Google for WooCommerce and select any campaign (or create one if need be). This process should set the transient.
  3. In terminal run: wp transient get gla_ads_highest_spend_campaign You should see array data set now, for example:
array (
  'campaign' => 
  array (
    'id' => 23349407739,
    'name' => 'Campaign 2025-12-11 15:09:02',
    'status' => 'enabled',
    'type' => 'performance_max',
    'targeted_locations' => 
    array (
      0 => 'GB',
    ),
    'eu_political_advertising_confirmation' => false,
    'amount' => 14.0,
    'country' => 'GB',
  ),
)

Additional details:

Add - Added transient caching for highest spend campaign.

@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.6%. Comparing base (dd249e1) to head (b3a140a).
⚠️ Report is 4 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             develop   #3263     +/-   ##
===========================================
- Coverage       66.8%   66.6%   -0.2%     
- Complexity      5095    5097      +2     
===========================================
  Files            867     507    -360     
  Lines          26180   20326   -5854     
  Branches        1466       0   -1466     
===========================================
- Hits           17479   13528   -3951     
+ Misses          8528    6798   -1730     
+ Partials         173       0    -173     
Flag Coverage Δ
js-unit-tests ?
php-unit-tests 66.6% <100.0%> (+0.1%) ⬆️

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

Files with missing lines Coverage Δ
src/API/Google/AdsCampaign.php 96.5% <100.0%> (+3.9%) ⬆️

... and 362 files with indirect coverage changes

🚀 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.

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 looks good, left some minor feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants