Skip to content

Enhancement/13737 - Implement the GET:cta datapoint and getCTA() selector for Reader Revenue Manager - #14248

Merged
nfmohit merged 14 commits into
developfrom
enhancement/13737-get-cta-datapoint
Nov 26, 2026
Merged

nfmohit merged 14 commits into
developfrom
enhancement/13737-get-cta-datapoint

Conversation

@hussain-t

@hussain-t hussain-t commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Related issue(s):

Relevant technical choices

PR Author 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 5.2 and PHP 7.4.
  • 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/).

Do not alter or remove anything below. The following sections will be managed by moderators only.

Code Reviewer Checklist

  • Run the code.
  • Ensure the acceptance criteria are satisfied.
  • Reassess the implementation with the IB.
  • Ensure no unrelated changes are included.
  • Ensure CI checks pass.
  • Check Storybook where applicable.
  • Ensure there is a QA Brief.
  • Ensure there are no unexpected significant changes to file sizes.

Merge Reviewer Checklist

  • Ensure the PR has the correct target branch.
  • Double-check that the PR is okay to be merged.
  • Ensure the corresponding issue has a ZenHub release assigned.
  • Add a changelog message to the issue.

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

🤖 This comment is automatically updated by CI workflows. Each section is managed independently.

📚 Storybook for be676fd:

  • Storybook has been deleted.

📦 Build files for be676fd:

  • Build files have been deleted.

🖼️ VRT report for be676fd:

  • Reports have been deleted.

🎭 Playwright reports for be676fd:

  • Reports have been deleted.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the ability to fetch a single Call to Action (CTA) by its ID within the Reader Revenue Manager module. On the PHP side, it registers a new GET:cta datapoint (Get_CTA class) and adds corresponding integration tests. On the JavaScript side, it extends the CTAs datastore with a new getPublicationCTA fetch store, a getCTA selector, and a resolver to handle single CTA retrieval, caching them in a new ctasByID state slice. Extensive Jest tests have been added to cover various scenarios for the new selector and resolver. There are no review comments provided, and I have no additional feedback to offer as the implementation is clean, well-tested, and adheres to the repository's guidelines.

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Size Change: 0 B

Total Size: 3.59 MB

ℹ️ View Unchanged
Filename Size Change
dist/assets/blocks/reader-revenue-manager/block-editor-plugin/editor-styles.css 124 B 0 B
dist/assets/blocks/reader-revenue-manager/block-editor-plugin/editor-styles.js 0 B 0 B 🆕
dist/assets/blocks/reader-revenue-manager/block-editor-plugin/index.js 47.1 kB 0 B
dist/assets/blocks/reader-revenue-manager/common/editor-styles.css 307 B 0 B
dist/assets/blocks/reader-revenue-manager/common/editor-styles.js 0 B 0 B 🆕
dist/assets/blocks/reader-revenue-manager/contribute-with-google/index.js 7.25 kB 0 B
dist/assets/blocks/reader-revenue-manager/contribute-with-google/non-site-kit-user.js 6.46 kB 0 B
dist/assets/blocks/reader-revenue-manager/subscribe-with-google/index.js 7.26 kB 0 B
dist/assets/blocks/reader-revenue-manager/subscribe-with-google/non-site-kit-user.js 6.46 kB 0 B
dist/assets/blocks/sign-in-with-google/editor-styles.css 84 B 0 B
dist/assets/blocks/sign-in-with-google/editor-styles.js 0 B 0 B 🆕
dist/assets/blocks/sign-in-with-google/index.js 18.5 kB 0 B
dist/assets/css/googlesitekit-admin-css-********************.min.css 79.2 kB 0 B
dist/assets/css/googlesitekit-adminbar-css-********************.min.css 12.7 kB 0 B
dist/assets/css/googlesitekit-authorize-application-css-********************.min.css 851 B 0 B
dist/assets/css/googlesitekit-wp-dashboard-css-********************.min.css 9.09 kB 0 B
dist/assets/js/492-********************.js 970 B 0 B
dist/assets/js/959-********************.js 3 kB 0 B
dist/assets/js/1020-********************.js 1.03 kB 0 B
dist/assets/js/1212-********************.js 2.26 kB 0 B
dist/assets/js/1315-********************.js 3.08 kB 0 B
dist/assets/js/3022-********************.js 2.41 kB 0 B
dist/assets/js/3741-********************.js 3.84 kB 0 B
dist/assets/js/6174-********************.js 4.04 kB 0 B
dist/assets/js/7603-********************.js 61.5 kB 0 B
dist/assets/js/7792-********************.js 110 kB 0 B
dist/assets/js/9397-********************.js 477 kB 0 B
dist/assets/js/analytics-advanced-tracking-********************.js 428 B 0 B
dist/assets/js/googlesitekit-activation-********************.js 31.9 kB 0 B
dist/assets/js/googlesitekit-ad-blocking-recovery-********************.js 72.9 kB 0 B
dist/assets/js/googlesitekit-admin-pointers-********************.js 6.88 kB 0 B
dist/assets/js/googlesitekit-adminbar-********************.js 38.8 kB 0 B
dist/assets/js/googlesitekit-api-********************.js 9.93 kB 0 B
dist/assets/js/googlesitekit-block-tracking-********************.js 6.88 kB 0 B
dist/assets/js/googlesitekit-components-********************.js 7.02 kB 0 B
dist/assets/js/googlesitekit-consent-mode-********************.js 25.5 kB 0 B
dist/assets/js/googlesitekit-data-********************.js 1.84 kB 0 B
dist/assets/js/googlesitekit-datastore-forms-********************.js 8.6 kB 0 B
dist/assets/js/googlesitekit-datastore-location-********************.js 1.6 kB 0 B
dist/assets/js/googlesitekit-datastore-pdf-********************.js 1.23 kB 0 B
dist/assets/js/googlesitekit-datastore-site-********************.js 21.7 kB 0 B
dist/assets/js/googlesitekit-datastore-ui-********************.js 8.76 kB 0 B
dist/assets/js/googlesitekit-datastore-user-********************.js 27 kB 0 B
dist/assets/js/googlesitekit-entity-dashboard-********************.js 99.2 kB 0 B
dist/assets/js/googlesitekit-events-provider-contact-form-7-********************.js 1.27 kB 0 B
dist/assets/js/googlesitekit-events-provider-content-events-********************.js 3.16 kB 0 B
dist/assets/js/googlesitekit-events-provider-easy-digital-downloads-********************.js 651 B 0 B
dist/assets/js/googlesitekit-events-provider-mailchimp-********************.js 1.24 kB 0 B
dist/assets/js/googlesitekit-events-provider-ninja-forms-********************.js 1.26 kB 0 B
dist/assets/js/googlesitekit-events-provider-optin-monster-********************.js 1.28 kB 0 B
dist/assets/js/googlesitekit-events-provider-popup-maker-********************.js 1.35 kB 0 B
dist/assets/js/googlesitekit-events-provider-woocommerce-********************.js 895 B 0 B
dist/assets/js/googlesitekit-events-provider-wpforms-********************.js 1.3 kB 0 B
dist/assets/js/googlesitekit-feature-discovery-********************.js 40.2 kB 0 B
dist/assets/js/googlesitekit-features-********************.js 93 kB 0 B
dist/assets/js/googlesitekit-features-badge-********************.js 835 B 0 B
dist/assets/js/googlesitekit-i18n-********************.js 4.43 kB 0 B
dist/assets/js/googlesitekit-intents-********************.js 9.33 kB 0 B
dist/assets/js/googlesitekit-key-metrics-setup-********************.js 67.9 kB 0 B
dist/assets/js/googlesitekit-main-dashboard-********************.js 230 kB 0 B
dist/assets/js/googlesitekit-metric-selection-********************.js 70 kB 0 B
dist/assets/js/googlesitekit-modules-********************.js 30.9 kB 0 B
dist/assets/js/googlesitekit-modules-ads-********************.js 62.6 kB 0 B
dist/assets/js/googlesitekit-modules-adsense-********************.js 158 kB 0 B
dist/assets/js/googlesitekit-modules-analytics-4-********************.js 321 kB 0 B
dist/assets/js/googlesitekit-modules-pagespeed-insights-********************.js 32.6 kB 0 B
dist/assets/js/googlesitekit-modules-reader-revenue-manager-********************.js 155 kB +192 B (+0.12%)
dist/assets/js/googlesitekit-modules-search-console-********************.js 79.7 kB 0 B
dist/assets/js/googlesitekit-modules-sign-in-with-google-********************.js 41 kB 0 B
dist/assets/js/googlesitekit-modules-tagmanager-********************.js 35 kB 0 B
dist/assets/js/googlesitekit-notifications-********************.js 97.6 kB 0 B
dist/assets/js/googlesitekit-polyfills-********************.js 227 B 0 B
dist/assets/js/googlesitekit-settings-********************.js 91.4 kB 0 B
dist/assets/js/googlesitekit-splash-********************.js 75.6 kB 0 B
dist/assets/js/googlesitekit-user-input-********************.js 63.8 kB 0 B
dist/assets/js/googlesitekit-vendor-********************.js 315 kB 0 B
dist/assets/js/googlesitekit-vendor-lazy-pdf-********************.js 24.6 kB 0 B
dist/assets/js/googlesitekit-widgets-********************.js 187 kB 0 B
dist/assets/js/googlesitekit-wp-dashboard-********************.js 47.7 kB 0 B
dist/assets/js/runtime-********************.js 1.98 kB 0 B
dist/assets/js/sign-in-with-google-********************.js 1.35 kB 0 B

compressed-size-action

@ankitrox ankitrox left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great work @hussain-t. I have added one very minor comment on this PR for your consideration after which this is good to go to MR.
Thank you.

Comment on lines +186 to +188
state.ctasByID[ publicationID ] = {
...state.ctasByID[ publicationID ],
};

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this would be simpler with immer.

Suggested change
state.ctasByID[ publicationID ] = {
...state.ctasByID[ publicationID ],
};
state.ctasByID[ publicationID ] ??= {};

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks @ankitrox, updated to use ??=. I made the same change in the single CTA reducer too.

@ankitrox ankitrox left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you @hussain-t , all looks good!
Moving to MR 🚀

@nfmohit nfmohit left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @hussain-t! I've left a few small comments for your consideration. Please let me know if you have any questions or concerns, thank you!

@nfmohit
nfmohit merged commit 88e1ec7 into develop Nov 26, 2026
51 checks passed
@nfmohit
nfmohit deleted the enhancement/13737-get-cta-datapoint branch November 26, 2026 07:17
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.

Add the GET:cta datapoint and getCTA() selector for Reader Revenue Manager

3 participants