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

Remove esc_js from add_inline_event_script #2312

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

martynmjones
Copy link
Contributor

Changes proposed in this Pull Request:

When Google Analytics for WooCommerce version > 2.0.0 is installed, inline Javascript is being incorrectly escaped for GLA events. This PR removes the esc_js call so that the code is output correctly and how it previously was.

Screenshots:

Screenshot 2024-03-14 at 16 13 24

Detailed test instructions:

  1. Checkout fix/escaping-inline-javascript on a test site with Google Analytics for WooCommerce version 2.0.3 installed and active
  2. View page source and look for send_to
  3. Confirm the inline JS for GLA is correct

Changelog entry

Fix - Inline Javascript encoding for gtag events

@github-actions github-actions bot added changelog: fix Took care of something that wasn't working. type: bug The issue is a confirmed bug. labels Mar 14, 2024
Copy link

codecov bot commented Mar 14, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 63.8%. Comparing base (0e805bc) to head (9841530).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             develop   #2312     +/-   ##
===========================================
+ Coverage       62.1%   63.8%   +1.7%     
  Complexity      4205    4205             
===========================================
  Files            748     455    -293     
  Lines          21595   17878   -3717     
  Branches         533       0    -533     
===========================================
- Hits           13418   11412   -2006     
+ Misses          7725    6466   -1259     
+ Partials         452       0    -452     
Flag Coverage Δ
js-unit-tests ?
php-unit-tests 63.8% <0.0%> (ø)

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

Files Coverage Δ
src/Google/GlobalSiteTag.php 0.0% <0.0%> (ø)

... and 293 files with indirect coverage changes

@martynmjones martynmjones merged commit 07d9505 into develop Mar 14, 2024
13 checks passed
@martynmjones martynmjones deleted the fix/escaping-inline-javascript branch March 14, 2024 16:30
@Juberstine
Copy link

When is a release going to be cut that addresses this ?

@martynmjones
Copy link
Contributor Author

Hey @Juberstine,

When is a release going to be cut that addresses this ?

There will be a new release of Google Listings & Ads (2.6.3) today that will include this fix.

@tomalec tomalec mentioned this pull request Mar 19, 2024
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: fix Took care of something that wasn't working. type: bug The issue is a confirmed bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants