=== AWO — Automatic Website Optimizer ===
Contributors:      zwareonline, shinji3rd
Tags:              ads, adsense, ad manager, reading time, website optimizer
Requires at least: 6.0
Tested up to:      7.0
Stable Tag:        2.3.0
Requires PHP:      7.4
License:           GPL-2.0-or-later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html

All-in-one website optimizer: Ad Manager for AdSense, Reading Time indicator, and a full Premium suite (SEO, Analytics, SMTP, Performance & more).

== Description ==

**AWO — Automatic Website Optimizer** is a lightweight, modular plugin that manages AdSense ads intelligently and displays reading time estimates — completely free. Extend it with **AWO Premium** for SEO automation, internal analytics, SMTP mail, performance optimization, related posts, traffic booster, and more.

=== ✅ Free Features ===

**📢 Ad Manager**
Place AdSense ads in up to 5 strategic positions: before content, mid-content, after content, sidebar widget, and sticky footer. Each position can be individually enabled or disabled. Includes Google Auto Ads integration.

**🏷️ Ad Label**
Automatically adds a configurable "Advertisement" label above every ad unit, keeping your site compliant with Google AdSense and FTC disclosure policies.

**👁️ Viewability Tracking**
Uses the Intersection Observer API to track how long each ad is visible in the user's viewport, so you can identify your most effective ad positions.

**🤖 AdSense Auto Ads**
One-click activation of Google's Auto Ads feature. Just enter your Publisher ID.

**⏱️ Reading Time**
Displays estimated reading time at the top of each post. Customisable: background colour, text colour, font size, and border radius.

---

=== 🚀 AWO Premium Features ===

*Requires AWO Premium — available at [zwareonline.com/plugins/awo](https://zwareonline.com/plugins/awo)*

**🔍 SEO Optimizer**
Automatically generates meta descriptions, Open Graph tags, Twitter Card tags, JSON-LD schema markup (Article, BreadcrumbList, Organisation), canonical URLs, and hreflang tags. No manual entry required.

**📋 Table of Contents (TOC)**
Automatically builds a table of contents from your post headings (H2–H4). Configurable position, collapsible option, and fully styled.

**🔗 Auto Internal Links**
Automatically links configurable keywords to related articles within your site. Reduces bounce rate, distributes link equity, and improves crawlability.

**📰 Related Posts**
Displays a customisable grid of related articles at the end of every post. Configure: number of cards (1–12), module alignment, card text alignment, minimum card width, and optional excerpt/date display.

**📊 Internal Analytics**
Track page views without Google Analytics or any third-party service. Stats stored in your own database. View 7-day and 30-day activity charts in the AWO dashboard. Zero cookies, zero GDPR issues.

**⚡ Performance Optimizer**
Improves Core Web Vitals: defers non-critical JavaScript, enables lazy loading, adds LCP preload hints, reduces CLS by reserving ad space, and sets HTTP security headers.

**📡 Traffic Booster**
Generates an XML sitemap, pings Google and Bing via IndexNow when you publish new content, and enhances your RSS feed with full content and featured images.

**🛡️ Ad Obfuscation**
Randomises ad container IDs and uses JavaScript injection to make AdSense units harder for ad-blockers to detect.

**🔄 Ad Refresh**
Automatically refreshes visible ad units after a configurable interval (viewport-only), staying within Google's policies.

**🔔 Anti-Adblock Notice**
Detects ad-blocker usage and shows a customisable notice asking users to whitelist your site.

**📧 SMTP Email**
Replace WordPress's default PHP mail with a fully authenticated SMTP connection. Supports TLS/SSL, manual auth method (PLAIN, LOGIN, CRAM-MD5, AUTO), AES-256 password encryption, connection validation, and test email.

---

=== 🌐 Bilingual (ES / EN) ===

The entire plugin interface automatically detects whether WordPress is installed in Spanish or English and displays accordingly. No language files required.

---

== Installation ==

1. Install directly from the WordPress plugin directory, or upload to `/wp-content/plugins/awo-automatic-website-optimizer/`.
2. Activate the plugin through the **Plugins** menu.
3. Go to **AWO → Panel** to see your dashboard.
4. Configure your AdSense Publisher ID under **AWO → Ajustes de anuncios**.
5. Toggle modules under **AWO → Funciones**.
6. To unlock Premium, install AWO Premium and activate your licence under **AWO → Licencia**.

== Frequently Asked Questions ==

= Is AWO free? =

Yes. Ad Manager, Ad Label, Viewability Tracking, Auto Ads, and Reading Time are completely free.

= What does AWO Premium add? =

SEO Optimizer, Table of Contents, Auto Internal Links, Related Posts, Internal Analytics, Performance Optimizer, Traffic Booster, Ad Obfuscation, Ad Refresh, Anti-Adblock Notice, and SMTP Email. Purchase at [zwareonline.com](https://zwareonline.com/plugins/awo).

= Does AWO send data externally? =

The free plugin makes no external requests. AWO Premium contacts the AWO licence server to verify your licence, and optionally pings Google/Bing via IndexNow (Traffic Booster).

= Compatible with caching plugins? =

Yes — LiteSpeed Cache, WP Rocket, W3 Total Cache, and others.

= Does Ad Refresh violate Google's policies? =

No. AWO only refreshes ads visible in the viewport, with a configurable interval, which is within Google's policy.

= Works with Gutenberg? =

Yes — compatible with Gutenberg, Classic Editor, Elementor, Divi, and any editor.

== Screenshots ==

1. AWO Dashboard — module status overview and activity chart (Premium).
2. AWO Dashboard with Premium active — analytics chart and all module cards.
3. Features page — toggle free and premium modules in one unified view.
4. License management — activate, deactivate, and check your AWO Premium licence.
5. Ad Manager settings — configure Publisher ID and ad positions.
6. Built-in guide — accordion-style documentation for every feature.
7. Internal Analytics chart — 7-day and 30-day page-view graphs (Premium).
8. SMTP Configuration — full mail-server settings with connection validator (Premium).
9. Related Posts — customisable card grid on the frontend (Premium).

== Changelog ==

= 2.3.0 =
* New: Unified Features page — free and premium module toggles in one view when Premium is active.
* New: Related Posts customisation — card count, alignment, width, excerpt, date.
* New: Modern UI — gradient headers, hover effects, animated guide accordion.
* Fix: Dashboard banner now correctly detects Premium licence status.
* Fix: Internal Analytics — AJAX action mismatch preventing pageview tracking.
* Fix: Chart tab buttons now correctly switch between 7-day and 30-day views.
* Fix: Guide accordion HTML structure and PRO badge positioning.

= 2.2.0 =
* Prefix renamed from `awo` to `awozware` for WordPress.org compliance.
* Contributors: added shinji3rd.
* Dashboard block order: Overview → Activity → Active Modules → Quick Links.
* Migration code added: settings survive prefix rename on upgrade.

= 2.1.0 =
* Dashboard version badge reflects active plan (Free / Pro).
* Premium dashboard: module cards and activity chart hidden when licence is not active.

= 2.0.0 =
* Initial release.

== Upgrade Notice ==

= 2.3.0 =
Safe to upgrade. Settings are migrated automatically on first load.
