Skip to content

Release Notes: v1.7.1

Choose a tag to compare

@CyberSphinxxx CyberSphinxxx released this 28 Jun 05:22

AdSense Compliance and Edge Case Fixes

This release addresses critical edge cases and bugs surrounding the Google AdSense integration to ensure the site maintains 100% compliance with Google Publisher Policies.

Files Changed (8)

  • src/hooks/useMediaQuery.ts [NEW]

    • Created a custom React hook to reliably track screen breakpoints and window resize events on the client side without triggering React hydration mismatches.
  • src/components/AdBanner.tsx [MODIFIED]

    • Fixed a bug where React 18 Strict Mode would execute useEffect twice, causing the AdSense script to crash or throw console errors by attempting to fill the same ad slot multiple times.
    • Introduced a useRef flag to guarantee that adsbygoogle.push({}) is strictly executed only once per mount.
  • src/app/layout.tsx [MODIFIED]

    • Swapped the Next.js <Script> component with a raw HTML <script> tag to resolve the harmless but annoying data-nscript console warning that AdSense bots throw when scanning Next.js projects.
  • src/app/login/page.tsx [MODIFIED]

    • Completely removed the side-gutter AdBanners from the Account Settings page.
    • This resolves a critical "No Content" policy violation risk, as AdSense forbids ad placement on login, logout, and settings pages that lack substantial editorial content.
  • src/components/DailyGame.tsx [MODIFIED]

    • Implemented the useMediaQuery hook.
    • AdBanners are now conditionally unmounted from the DOM entirely on screens smaller than 1280px (xl), preventing the generation of hidden ad impressions that could result in an AdSense account suspension.
  • src/app/archive/page.tsx [MODIFIED]

    • Integrated the useMediaQuery hook to properly unmount the side-gutter ads on mobile screens.
  • src/app/dictionary/page.tsx [MODIFIED]

    • Integrated the useMediaQuery hook to properly unmount the side-gutter ads on mobile screens.
  • src/app/stats/page.tsx [MODIFIED]

    • Integrated the useMediaQuery hook to properly unmount the side-gutter ads on mobile screens.

Full Changelog: v1.7.0...v1.7.1