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

Place RRM snippet only on singular WordPress posts #9670

Open
3 tasks done
nfmohit opened this issue Nov 12, 2024 · 2 comments
Open
3 tasks done

Place RRM snippet only on singular WordPress posts #9670

nfmohit opened this issue Nov 12, 2024 · 2 comments
Labels
Module: RRM Reader Revenue Manager module related issues P0 High priority Team M Issues for Squad 2 Type: Bug Something isn't working

Comments

@nfmohit
Copy link
Collaborator

nfmohit commented Nov 12, 2024

Bug Description

The RRM snippet is currently placed across the entire site. Instead, it should only be placed on singular WordPress posts.


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

Acceptance criteria

  • The Reader Revenue Manager snippet should only be placed on singular posts of the "post" post type.

Implementation Brief

  • In includes/Modules/Reader_Revenue_Manager/Web_Tag.php:
    • Update the enqueue_swg_script method:
      • Call the wp_enqueue_script function only if it is a singular post of the "post" post type, i.e. is_singular( 'post' ).

Test Coverage

  • In tests/phpunit/integration/Modules/Reader_Revenue_Manager/Web_TagTest.php:
    • Update tests to assert that the snippet is only added according to ACs.
      • You can take a look at how it was done for Thank with Google here.

QA Brief

  • Turn on the rrmModule feature flag.
  • Set up Site Kit and the Reader Revenue Manager module.
  • Go to the site front-end.
  • View page source and verify that the RRM snippet is only added to singular posts and nowhere else.

Changelog entry

  • Only place the Reader Revenue Manager snippet on singular WordPress posts.
@nfmohit nfmohit self-assigned this Nov 12, 2024
@nfmohit nfmohit added Type: Bug Something isn't working P0 High priority Team M Issues for Squad 2 Module: RRM Reader Revenue Manager module related issues labels Nov 12, 2024
@nfmohit nfmohit removed their assignment Nov 12, 2024
@techanvil techanvil self-assigned this Nov 12, 2024
@techanvil
Copy link
Collaborator

IB ✅

@techanvil techanvil removed their assignment Nov 12, 2024
@nfmohit nfmohit self-assigned this Nov 12, 2024
@nfmohit nfmohit assigned techanvil and unassigned nfmohit and techanvil Nov 12, 2024
techanvil added a commit that referenced this issue Nov 12, 2024
Enqueue RRM snippet only on WP singular posts
@techanvil techanvil removed their assignment Nov 12, 2024
@mohitwp mohitwp self-assigned this Nov 12, 2024
@mohitwp
Copy link
Collaborator

mohitwp commented Nov 13, 2024

QA Update ✅

  • Tested on main environment.
  • Tested after setting up RRM module.
  • Verified that the RRM snippet is only added to singular posts and nowhere else.
  • Verified that if RRM module is disconnect then snippet gets remove from WP posts.
Recording.1589.mp4
Recording.1590.mp4

@mohitwp mohitwp removed their assignment Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: RRM Reader Revenue Manager module related issues P0 High priority Team M Issues for Squad 2 Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants