Skip to content
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

Fix Ad Blocker Warning Message based on modules connected state. #4065

Merged
merged 9 commits into from
Sep 29, 2021

Conversation

kuasha420
Copy link
Contributor

@kuasha420 kuasha420 commented Sep 16, 2021

Summary

Addresses issue #3208

Relevant technical choices

Checklist

  • My code is tested and passes existing unit tests.
  • My code has an appropriate set of unit tests which all pass.
  • My code is backward-compatible with WordPress 4.7 and PHP 5.6.
  • My code follows the WordPress coding standards.
  • My code has proper inline documentation.
  • I have added a QA Brief on the issue linked above.
  • I have signed the Contributor License Agreement (see https://cla.developers.google.com/).

@google-cla google-cla bot added the cla: yes label Sep 16, 2021
@github-actions
Copy link

github-actions bot commented Sep 16, 2021

Size Change: +12.4 kB (+1%)

Total Size: 1.15 MB

Filename Size Change
./dist/assets/css/admin.css 0 B -38.5 kB (removed) 🏆
./dist/assets/css/adminbar.css 0 B -8 kB (removed) 🏆
./dist/assets/css/wpdashboard.css 0 B -4.58 kB (removed) 🏆
./dist/assets/js/33.********************.js 3.12 kB +1 B (0%)
./dist/assets/js/googlesitekit-activation.********************.js 38.6 kB +727 B (+2%)
./dist/assets/js/googlesitekit-adminbar.********************.js 31.4 kB +634 B (+2%)
./dist/assets/js/googlesitekit-api.********************.js 9.03 kB -5 B (0%)
./dist/assets/js/googlesitekit-base.********************.js 1.59 kB +1 B (0%)
./dist/assets/js/googlesitekit-dashboard-details.********************.js 45.6 kB +1.24 kB (+3%)
./dist/assets/js/googlesitekit-dashboard-splash.********************.js 52.8 kB +758 B (+1%)
./dist/assets/js/googlesitekit-dashboard.********************.js 45.8 kB +1.22 kB (+3%)
./dist/assets/js/googlesitekit-datastore-forms.********************.js 8.74 kB +11 B (0%)
./dist/assets/js/googlesitekit-datastore-location.********************.js 2.02 kB -3 B (0%)
./dist/assets/js/googlesitekit-datastore-site.********************.js 13.2 kB -10 B (0%)
./dist/assets/js/googlesitekit-datastore-ui.********************.js 8.7 kB -9 B (0%)
./dist/assets/js/googlesitekit-datastore-user.********************.js 20.9 kB -34 B (0%)
./dist/assets/js/googlesitekit-idea-hub-notice.********************.js 2.4 kB -1 B (0%)
./dist/assets/js/googlesitekit-idea-hub-post-list.********************.js 23.8 kB +216 B (+1%)
./dist/assets/js/googlesitekit-module.********************.js 45.1 kB +760 B (+2%)
./dist/assets/js/googlesitekit-modules-adsense.********************.js 45.2 kB +400 B (+1%)
./dist/assets/js/googlesitekit-modules-analytics-4.********************.js 18.8 kB +4 B (0%)
./dist/assets/js/googlesitekit-modules-analytics.********************.js 66.9 kB +1.14 kB (+2%)
./dist/assets/js/googlesitekit-modules-idea-hub.********************.js 24.6 kB +816 B (+3%)
./dist/assets/js/googlesitekit-modules-optimize.********************.js 18.3 kB -9 B (0%)
./dist/assets/js/googlesitekit-modules-pagespeed-insights.********************.js 16.8 kB +457 B (+3%)
./dist/assets/js/googlesitekit-modules-search-console.********************.js 28.8 kB +351 B (+1%)
./dist/assets/js/googlesitekit-modules-subscribe-with-google.********************.js 16.4 kB -17 B (0%)
./dist/assets/js/googlesitekit-modules-tagmanager.********************.js 29.8 kB -10 B (0%)
./dist/assets/js/googlesitekit-settings.********************.js 49.7 kB +954 B (+2%)
./dist/assets/js/googlesitekit-user-input.********************.js 45.7 kB +732 B (+2%)
./dist/assets/js/googlesitekit-vendor.********************.js 312 kB +169 B (0%)
./dist/assets/js/googlesitekit-widgets.********************.js 12.5 kB +1.11 kB (+10%) ⚠️
./dist/assets/js/googlesitekit-wp-dashboard.********************.js 33.5 kB +790 B (+2%)
./dist/assets/js/runtime.********************.js 1.19 kB +2 B (0%)
./dist/assets/css/googlesitekit-admin-css.********************.css 38.6 kB +38.6 kB (new file) 🆕
./dist/assets/css/googlesitekit-adminbar-css.********************.css 8 kB +8 kB (new file) 🆕
./dist/assets/css/googlesitekit-wp-dashboard-css.********************.css 4.58 kB +4.58 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size
./dist/assets/js/analytics-advanced-tracking.js 769 B
./dist/assets/js/googlesitekit-data.********************.js 1.65 kB
./dist/assets/js/googlesitekit-i18n.js 3.92 kB
./dist/assets/js/googlesitekit-modules.********************.js 16.5 kB
./dist/assets/js/googlesitekit-polyfills.********************.js 378 B

compressed-size-action

Copy link
Collaborator

@tofumatt tofumatt left a comment

Choose a reason for hiding this comment

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

This needs some changes because it doesn't actually behave as-intended—see the issue I mentioned with the resolveSelect not working anymore. The E2E and Visual Regression tests are failing as a result.

I'll add a commit that should fix it though.

assets/js/modules/adsense/index.js Outdated Show resolved Hide resolved
assets/js/modules/adsense/datastore/adblocker.js Outdated Show resolved Hide resolved
assets/js/modules/adsense/datastore/adblocker.js Outdated Show resolved Hide resolved
Comment on lines 79 to 80
.__experimentalResolveSelect( MODULES_ADSENSE )
.isAdBlockerActive();
.getAdBlockerWarningMessage();
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is the reason VRT and E2E tests were failing; resolveSelect will return a value after the selector's resolver has completed, but because the IB suggested changing the selector used, this returns immediately because getAdBlockerWarningMessage doesn't have an associated selector.

There are two options here:

  1. continue using isAdBlockerActive here but getting the message later on if isAdBlockerActive is true
  2. add a (redundant) resolver to getAdBlockerWarningMessage

I added a commit that does the former. It's not 100% in line with the IB but still fulfills the ACs and behaves as-intended.

@google-cla
Copy link

google-cla bot commented Sep 22, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: no and removed cla: yes labels Sep 22, 2021
@tofumatt
Copy link
Collaborator

@googlebot I consent.

@google-cla google-cla bot added cla: yes and removed cla: no labels Sep 22, 2021
Copy link
Collaborator

@tofumatt tofumatt left a comment

Choose a reason for hiding this comment

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

The rest of this works for me; I think there are a few string changes we should make but I'll leave it for the reviewer to confirm.

I'm moving this to merge review to get another look at the approach though.

@google-cla
Copy link

google-cla bot commented Sep 29, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: no and removed cla: yes labels Sep 29, 2021
@aaemnnosttv
Copy link
Collaborator

@googlebot I consent.

@google-cla google-cla bot added cla: yes and removed cla: no labels Sep 29, 2021
@aaemnnosttv
Copy link
Collaborator

I pushed one commit to fix a doc block but otherwise this LGTM 👍

I like the changes to the wording as well but I'll leave this for @felixarntz to sign off on.

@felixarntz felixarntz merged commit 165b2b2 into develop Sep 29, 2021
@felixarntz felixarntz deleted the enhancement/3208-adblocker-warning-msg branch September 29, 2021 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants