themes icon indicating copy to clipboard operation
themes copied to clipboard

Raw Code Appearing on Huntt Theme

Open cat-og opened this issue 1 year ago • 6 comments

Quick summary

  • The Huntt theme is both Premium and retired

On the default Home page (showing recent posts), raw code appears at the top of the page. Screenshot on 2024-08-03 at 10-17-40

Steps to reproduce

  1. Switch to Huntt theme
  2. On live site, Posts page (or Home page if set to show most recent posts) scroll down so that the top of the page is no longer visible, then scroll back up.
  3. Raw code will have appeared at the top of the page.

What you expected to happen

I will be able to scroll up and down the posts list without additional effects

What actually happened

After scrolling down the page, when you scroll back up, raw code appears at the top of the page.

Browser

Google Chrome/Chromium, Mozilla Firefox, Microsoft Edge, Apple Safari, iOS Safari

Context

Customer Report

Platform (Simple, Atomic, or both?)

Simple, Atomic

Other notes

Code which appeared on my simple site, Starter plan:

/* <![CDATA[ */ function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function () { oldonload(); func(); } } } /* ]]> */

On my simple site, Explorer plan, the same code appeared three times in a row.

During my tests, I found that the code tended to vary from site to site, but in all variations, the above line of code was the one consistent element, though not always at the top or beginning of the code section.

Reproducibility

Consistent

Severity

Some (< 50%)

Available workarounds?

Yes, difficult to implement

Workaround details

If the site is an Atomic site, they should be able to go to Jetpack > Dashboard, then scroll to Theme Enhancements. There the 'Infinite Scroll' can be updated to 'Load more posts using the default theme behavior', which switches the user to a paginated posts display, and the page can't scroll down far enough to trigger the issue.

However, this is not an option on Simple sites, and turning off infinite scroll does not help, as the new posts load in the same page and user will then continue scrolling and trigger this issue.

cat-og avatar Aug 03 '24 18:08 cat-og

8562731-zd-a8c

cat-og avatar Aug 04 '24 01:08 cat-og

8638510-zd-a8c -- Simple site

retnonindya avatar Aug 22 '24 03:08 retnonindya

Support References

This comment is automatically generated. Please do not edit it.

  • [ ] 8562731-zen
  • [ ] 8638510-zen
  • [ ] 8742904-zen
  • [ ] 8757766-zen
  • [ ] 9024155-zen

github-actions[bot] avatar Aug 22 '24 03:08 github-actions[bot]

📌 REPRODUCTION RESULTS

  • Tested on Simple – Replicated
  • Tested on Atomic – Uncertain (I can't find the theme on the Themes Showcase on my AT site)

📌 FINDINGS/SCREENSHOTS/VIDEO I can replicate the issue, and I received similar report from a user.

📌 ACTIONS

  • Triaged

retnonindya avatar Aug 22 '24 08:08 retnonindya

Another report with the Huntt theme. 8742904-zd-a8c

hacchism avatar Sep 16 '24 23:09 hacchism

Another report here. Huntt theme, simple site. 8757766-zd-a8c

cat-og avatar Sep 24 '24 18:09 cat-og

Also reported here, Atomic site. 9024155-zd-a8c

chad1008 avatar Nov 11 '24 15:11 chad1008

This appears to be caused by Infinite scroll loading all of the <title>, <link>, <meta>, and <script> elements in addition to the expected <article>, and <div> entries, the theme's Masonry implementation then does what is effectively jQuery('script').show() which TIL causes the raw javascript to be displayed on the screen.

Noting this here while I get access to PR it.

@@ -176,7 +176,7 @@

             // Reactivate masonry on post load

-            var newEl = $container.children().not('article.post-loaded, span.infinite-loader, div.grid-sizer').addClass('post-loaded');
+            var newEl = $container.children('article, div').not('article.post-loaded, div.grid-sizer').addClass('post-loaded');

             newEl.hide();
             newEl.imagesLoaded(function () {

dd32 avatar Jan 15 '25 05:01 dd32

Fixed via 154548-ghe-Automattic/wpcom-premium-themes

dd32 avatar Jan 21 '25 01:01 dd32