=== Adjet – Ad Inserter & Manager ===
Contributors: hafenstudios
Tags: ads, advertising, adsense, ad manager, shortcode
Requires at least: 5.8
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.6.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Place and manage ads and AdSense blocks with auto-placement, shortcodes, targeting, consent gating, lazy loading and local stats.

== Description ==
Adjet is a friendly ad operations cockpit for WordPress publishers and part of the hafenstudios plugin family. Create multiple ad blocks, choose where they appear, control who sees them, and keep an eye on impressions, clicks and CTR — without sending any analytics to an external server.

= Highlights =
* Clean, focused admin interface with brand bar, KPI cards and clear navigation tabs.
* Automatic placements before content, after content, after paragraph N or after the first image.
* Manual placement via shortcode `[adjet_ad id="1"]`, widget or Gutenberg block.
* Weighted ad rotation via `[adjet_ad_group name="header"]`.
* Device targeting for desktop, tablet and mobile.
* Post type targeting plus exclusions for posts, categories, tags and custom terms.
* Optional "Advertisement" label with editable text.
* Lazy loading via IntersectionObserver.
* Consent-cookie gating for common consent tools.
* Optional anonymous local impression and click statistics.
* Campaign scheduling with optional start and end time.
* One-click duplicate and pause/activate actions for faster workflow.
* Code editor and admin-side live preview that does not execute scripts.
* AdSense Wizard: Publisher-ID + Slot-ID are enough for responsive AdSense units.
* Optional AdSense Auto Ads script loader with clear settings.
* 30-day statistics chart (impressions and clicks) rendered inline, no external libraries.
* Least-privilege capability `manage_adjet` with an optional editor-access toggle.
* REST API (`adjet/v1`) for ad blocks, stats and settings via Application Passwords.
* JSON import and export with file-size/type checks.
* Clean uninstall routine.

= Privacy =
Adjet does not contact Adjet or hafenstudios servers from the WordPress admin area or frontend. Optional statistics are stored locally in your own WordPress database. Third-party ad code pasted into an ad block may contact external services; configure your consent solution accordingly. If you enable AdSense features, the frontend loads Google AdSense scripts from Google domains to display ads; the admin area still does not make external calls.

= Security =
Adjet uses capability checks, nonces for form actions, sanitization on save and escaping on output. Raw ad code is only stored unchanged for users with the `unfiltered_html` capability.

= Localization =
* Source language: German (default UI).
* Included starter translations: English, Spanish, French and Dutch.

= Support =
Adjet is developed and maintained by hafenstudios. For direct support you can reach us by e-mail at info@hafenstudios.com or by phone at +49 174 3935796. You are also welcome to use the plugin support forum on WordPress.org.

== Installation ==
1. Upload the ZIP via Plugins > Add New > Upload Plugin.
2. Activate Adjet.
3. Open the new "Adjet" menu and create your first ad block.
4. Optional: configure the ad label, consent-cookie settings and local statistics.

Upgrading from "AdEngine – Free Ad Inserter & Manager"? Just install Adjet — your ad blocks, settings and statistics are migrated automatically on first load.

== Frequently Asked Questions ==
= Does Adjet work with AdSense? =
Yes. You can either paste original AdSense code as custom code or use the AdSense Wizard with your Publisher-ID and Slot-ID. Adjet then generates a responsive ad unit and loads the AdSense script on the frontend when needed.

= Can I use it manually? =
Yes. Use the shortcode `[adjet_ad id="1"]`, the shortcode `[adjet_ad_group name="header"]`, the included widget or the Gutenberg block.

= Does it replace a consent tool? =
No. Adjet can wait for a configured consent cookie, but it does not provide legal advice or a cookie banner.

= Does Adjet track users externally? =
No. The optional statistics feature stores anonymous aggregated counts locally in your WordPress database.

= Can editors manage ads without being administrators? =
Yes. Enable "Zugriff für Redakteure" in Settings to grant the `manage_adjet` capability to the editor role. Administrators always have access.

= Is there a REST API? =
Yes. The `adjet/v1` namespace exposes ad blocks (`/blocks`, CRUD), statistics (`/stats`) and settings (`/settings`). Authenticate with an Application Password; access requires the `manage_adjet` capability.

== Changelog ==

= 1.6.0 =
* Added a least-privilege capability `manage_adjet` (administrators keep access via a manage_options fallback) plus an optional editor-access toggle in Settings.
* Added a REST API under `adjet/v1` for ad blocks, statistics and settings (Application Password auth).
* Added a 30-day impressions/clicks chart to the statistics page, rendered inline as SVG without external libraries.

= 1.5.0 =
* Rebranded the plugin to Adjet, part of the hafenstudios plugin family.
* Redesigned the admin interface in the clean hafenstudios/Linkjet design language (brand bar, tab navigation, teal accent, KPI and content cards).
* Migrated shortcodes to `[adjet_ad]` and `[adjet_ad_group]`; the legacy `[sai_ad]` / `[sai_ad_group]` shortcodes keep working as aliases.
* Automatic data migration from a previous AdEngine install (ad blocks, settings and statistics).
* Added object-cache-backed statistics totals to reduce database load.
* Fixed AdSense script enqueue to always carry a version and cleaned up Plugin Check notices.

= 1.4.3 =
* Renamed the public plugin title to comply with WordPress.org naming restrictions.

= 1.4.1 =
* Refined admin interface with cleaner hero, glass navigation, stronger cards and better responsive behavior.
* Improved backend usability, visual hierarchy and AdSense onboarding cues.

= 1.4.0 =
* Added AdSense Wizard for easy responsive AdSense ad units using Publisher-ID and Slot-ID.
* Added optional AdSense Auto Ads frontend loader.
* Added dynamic Gutenberg block for manual placements.
* Added weighted ad rotation groups.

= 1.3.1 =
* Added campaign scheduling with optional start/end time.
* Added one-click duplicate and pause/activate actions.
* Added automatic placement after the first image.
* Added WordPress code editor integration and a safer admin-side live preview.

= 1.3.0 =
* Added optional local statistics toggle.
* Hardened import flow with JSON extension and file-size validation.
* Improved security posture around raw ad code.

= 1.2.0 =
* Added backend styling with hero area and KPI cards.
* Added localization starter files.

= 1.1.0 =
* Added label, AMP exclusion, server-side device detection, minimum word count, max-per-post, exclusion lists, lazy loading, consent gating, stats, import/export and uninstall routine.

= 1.0.0 =
* Initial version.

== Upgrade Notice ==

= 1.6.0 =
Adds the manage_adjet capability, a REST API and a statistics chart. No action required.

= 1.5.0 =
Rebrand to Adjet with a refreshed admin interface. Existing ad blocks, settings and stats are migrated automatically.
