-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter out closed AdSense accounts based on new API capabilities #5050
Comments
If this is open I would like to help. However, it'll be my first time tackling |
@asvinb Just one thing regarding the IB: The |
@sancodes Absolutely, your contribution would be welcome! We need to complete this issue within the next week to get it into the upcoming Site Kit release, so if you could work on a pull request in the next few days that would be great. Before starting the pull request, please review the "Implementation Brief" in the issue description. It describes the technical approach to take, so you can follow that for the PR. It will probably also help you especially as you're new to the PHP codebase. |
@felixarntz will do thanks. |
@felixarntz IB has been updated as per your feedback. Can you take another look? Thanks! |
@felixarntz will start on it thank you. |
QA ✅
Screenshots |
@felixarntz I am creating the test plan for AdSense Setup Improvement and wondering if this could now be tested by us since we have the tester plugin update. What are your thoughts? If it can, would it be possible for you to write up a new QAB, and I can make sure that this gets included. 🤔 |
@wpdarren Since this is something which happens on the server-side, it wouldn't really be possible to mock this via the tester plugin. I think this piece is simple enough so that we don't need to cover this as part of the bug bash. |
Based on the recently released new AdSense API capabilities and the corresponding enhancements to the design doc, we need to ensure closed AdSense accounts are ignored by Site Kit. For example, if a user has only a single closed account, they will need to create a new AdSense account, which is the same as if they had no account at all.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
GET:accounts
data point should filter out any accounts from the API response that have astate: CLOSED
, as they can be ignored from our perspective.Implementation Brief
includes/Modules/AdSense.php
,is_account_not_closed
which should have theaccount
array as parameter. The function should return a boolean, whetheraccount.state
is different fromCLOSED
.GET:accounts
inparse_data_response
, instead of returning the result of$response->getAccounts
(with the filtered account IDs), store the accounts in a variable ($accounts
) and then usearray_filter
to filter the array, passing the array ($accounts
) as first parameter and the functionfilter_account_with_state_closed
as second parameter. Return the updated array.Test Coverage
QA Brief
adsenseSetupV2
flag enabled.Changelog entry
The text was updated successfully, but these errors were encountered: