=== Header Footer Script Adder – Insert Code in Header, Body & Footer === Contributors: mahethekiller, freemius Tags: header footer, insert code, insert headers, google analytics, facebook pixel, tracking code, custom css, javascript, meta tags, seo, tag manager, chat widgets, code snippets Requires at least: 6.0 Tested up to: 6.9 Donate link: https://www.buymeacoffee.com/mahethekiller Requires PHP: 7.4 Stable tag: 2.0.7 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Easily inject custom scripts and code snippets into your site’s header, body, or footer. Includes a powerful Pro Snippet Manager, Core Web Vitals optimization (Async/Defer), and granular user role, device, or WooCommerce targeting. == Description == **Header Footer Script Adder** is a lightweight, highly secure, and performance-optimized WordPress plugin that lets you easily insert **custom HTML, CSS, and JavaScript** into your site’s header, body, or footer without editing theme files. Stop modifying your theme's `header.php` or `footer.php` files directly! When you change or update your theme, your crucial marketing, analytics, and tracking codes remain safely stored and active. The **Free Version** gives you immediate, bloat-free global text areas to inject your scripts across your site, while the **Pro Version** unlocks a complete, developer-grade Tag Management System to control exactly *how*, *when*, and *for whom* your scripts execute. ### ✨ Free Core Features * **Targeted Placements:** Add scripts precisely to the Header (``), Body (immediately after `` via `wp_body_open`), or Footer (before ``). * **Smart Conditional Loading:** Control script visibility sitewide, homepage only, posts/pages only, or archive pages. * **Per-Page & Per-Post Overrides:** Inject completely unique tracking codes or custom scripts into specific individual posts or pages. * **Developer-Grade Code Editor:** Built-in CodeMirror code editor with full syntax highlighting for error-free coding. * **Secure Input Handling:** Robust input sanitization without breaking valid HTML, CSS, or JS scripts. * **Lightweight & Fast:** Zero bloat architecture that minimizes database queries to protect front-end site speed. * **Full Compatibility:** Works seamlessly with the Block Editor (Gutenberg), Classic Editor, and WordPress Multisite installations. ### ✅ Perfect For * **Analytics & SEO:** Google Analytics / GA4 tracking code, Google Tag Manager (GTM), and SEO verification meta tags (Google Search Console, Bing, Pinterest). * **Conversion Tracking:** Meta (Facebook) Pixel, TikTok Pixel, Pinterest Tag, and ad tracking scripts. * **User Engagement:** Live chat widgets (WhatsApp, Crisp, Tawk.to, HubSpot). * **Custom Styling & Scripts:** Global or page-specific custom CSS modifications and JavaScript actions. ### 🚀 Upgrade to Pro: Unlock Ultimate Control & Speed For advanced developers, agencies, and e-commerce stores, the Pro version transforms your setup into an advanced tracking engine: * **1. Granular Conditional Targeting:** * **User Role Targeting:** Load scripts for Everyone, Logged-In Users Only, Logged-Out Users Only, or specific roles (Administrator, Subscriber, WooCommerce Customer, etc.). * **Device Targeting:** Optimize layouts by choosing to load scripts only on Desktop, Tablet, or Mobile devices. * **Advanced Page-Specific Targeting:** Target specific Custom Post Types or key WooCommerce Pages (Shop, Cart, Checkout, Single Products) to eliminate checkout tracking discrepancies. * **2. Core Web Vitals & Performance Optimization:** * **Loading Strategies:** Automatically inject `async` (non-blocking) or `defer` (delayed execution) attributes into scripts to skyrocket your Google PageSpeed scores. * **Flexible Injection Methods:** Print code Inline directly to the page, or as an Enqueued File to take advantage of browser caching. * **Automatic Code Minification:** Automatically strips comments and whitespace from your custom snippets to reduce payload size. * **3. One-Click Native Pixel Integrations:** No more copying messy code blocks. Simply paste your tracking IDs for optimized, automated deployment of: * **Google Tag Manager (GTM):** Automated header script and body `