=== MeNoAds ===
Contributors: wpstackonline
Tags: admin notices, ads, banners, dashboard cleanup, remove ads, upsell, nag notices, wp-admin
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 2.0.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Enterprise-grade anti-adware for your WordPress dashboard. Silently strips promotional banners, upsell nags, review requests, and all other plugin-injected noise — without disabling any plugin.

== Description ==

**Your WordPress dashboard should show your content — not their ads.**

Every day, the plugins you rely on inject promotional banners, upgrade nags, review requests, and marketplace offers into your admin dashboard. MeNoAds intercepts every known WordPress hook that plugins use for this and silently strips the promotional content before it reaches your screen.

MeNoAds does not deactivate any plugins. It never modifies plugin files, database data, or disables any functionality. It simply hides the ads they try to show you — keeping your dashboard clean, focused, and yours.

= Nine Blocking Modules =

* **Admin Notices** — Three-layer defence: callback unhooking, output-buffer regex filtering, and a live DOM MutationObserver for JS-injected notices.
* **Dashboard Widgets** — Removes 25+ known promotional widget IDs from Yoast, MonsterInsights, WPForms, Jetpack, Elementor, Rank Math, and more.
* **Footer Text** — Strips "Powered by...", "Built with...", and other promotional text. Silences the version number.
* **Meta Boxes** — Removes purely promotional meta boxes from edit screens. (Functional boxes like Yoast SEO analysis and WooCommerce product data are preserved.)
* **Admin Menu** — Hides submenu items that point to add-on stores, license pages, and setup wizards.
* **Admin Toolbar** — Removes promotional nodes from the toolbar (not functional tools).
* **Plugin Page** — Hides "Go Pro" links and promotional banners on the Plugins page.
* **Updates Page** — Strips promotional links from the Updates page.
* **JS MutationObserver** — An always-on DOM watcher that instantly removes promotional notices injected via JavaScript after the page loads.

= Developer Friendly =

Every data set in MeNoAds is filterable via standard WordPress hooks:

* `meno_ads_promotional_callbacks` — Add admin_notice callbacks to block.
* `meno_ads_promotional_class_prefixes` — Add class namespace prefixes for partial callback matching.
* `meno_ads_dashboard_widgets` — Add dashboard widget IDs to remove.
* `meno_ads_notice_patterns` — Add regex patterns to filter from notice HTML.
* `meno_ads_observer_selectors` — Add CSS selectors for the JS MutationObserver.
* `meno_ads_footer_keywords` — Add footer text keywords to strip.
* `meno_ads_metabox_ids` — Add meta box IDs to remove.
* `meno_ads_menu_targets` — Add submenu slugs to hide.
* `meno_ads_toolbar_nodes` — Add toolbar node IDs to remove.
* `meno_ads_upsell_keywords` — Add keywords that identify "Go Pro" links.
* `meno_ads_active_modules` — Override the list of active blocking modules.
* `meno_ads_metabox_side_ids` — Add side-context meta box IDs.

= WP-CLI =

Manage MeNoAds from the command line:

```
wp meno-ads status
wp meno-ads toggle block_admin_notices
wp meno-ads list
```

= Multisite Compatible =

MeNoAds is fully multisite-compatible with `Network: true` declared in the plugin header. Settings are per-site, so each site in your network can configure its own blocking preferences.

== Installation ==

1. Upload the `me-no-ads` folder to `/wp-content/plugins/` or install via **Plugins → Add New**.
2. Activate the plugin through the **Plugins** screen.
3. All features are enabled by default — your dashboard becomes cleaner immediately.
4. Optional: Visit **Settings → MeNoAds** to toggle specific blockers on/off.

= Requirements =

* WordPress 5.8 or later.
* PHP 7.4 or later.

== Frequently Asked Questions ==

= Will this break my plugins? =

No. MeNoAds only hides promotional content. It never modifies plugin files, database data, or disables any functionality.

= Does it remove all notices? =

No. It only removes promotional notices — upgrade nags, review requests, discount offers, and similar marketing content. Legitimate system notices remain visible.

= Will this work with my caching plugin? =

Yes. MeNoAds operates on the server side through WordPress hooks, so it works regardless of page caching.

= Does it support multisite? =

Yes. MeNoAds is fully multisite-compatible with `Network: true` declared in the plugin header. Settings are per-site.

= How do I add a custom pattern? =

Use the `meno_ads_notice_patterns` filter. See the **Developer API** section on the settings page for examples.

== Screenshots ==

1. Dashboard before MeNoAds — promotional banners, upsell nags, and review requests from multiple plugins cluttering the screen.
2. Dashboard after MeNoAds — all promotional content silently removed. Only legitimate widgets and notices remain.
3. Settings page — toggle each blocking module on or off individually. All blockers are enabled by default.

== Changelog ==

= 2.0.1 =
* New: Redesigned settings page with modern card-based UI, toggle switches, and stats bar.
* New: Dedicated settings page CSS stylesheet for polished visual design.
* Fix: Output buffer (Layer B) was non-functional due to incorrect hook priorities — buffer now starts before notices fire and flushes after.
* Fix: Regex patterns for notice filtering now use PCRE recursion to correctly handle nested `<div>` elements.
* Fix: Squirrly SEO callback identifier was incomplete — added class-prefix matching via new `meno_ads_promotional_class_prefixes` filter.
* Fix: Menu submenu array not reindexed after removing items, causing potential menu rendering glitches.
* Fix: Plugin page link filter now checks only the href URL instead of full link HTML, preventing false positives on legitimate documentation links.
* Fix: Plugin page link filter now only runs on the plugins screen, not globally.
* Fix: Updates page CSS now covers all promotional keyword patterns (pricing, premium, go-pro, etc.).
* Fix: Plugin page CSS now covers missing selectors (go-pro, go_pro, pro_version, /checkout/).
* Fix: Meta box removal optimized — single hook instead of two, caches `get_post_types()`.
* Fix: Legacy option migration no longer overwrites existing v2.0 settings on reactivation.
* Fix: JS MutationObserver now uses `requestAnimationFrame` debouncing for better performance.
* Fix: JS MutationObserver now disconnects on `beforeunload` to prevent memory leaks.

= 2.0.0 =
* Complete rewrite with modular architecture (namespaced classes, PSR-4 autoloader).
* New: Three-layer admin notices removal (callback unhooking + buffer filter + MutationObserver).
* New: JS MutationObserver for DOM-watching JS-injected notices.
* New: WP-CLI commands (`wp meno-ads`).
* New: Enterprise-grade security (nonces, capabilities, escaping, sanitization).
* New: Proper i18n with `.pot` template.
* New: Upgrade routine from v1.x settings.
* New: Comprehensive developer API with 11+ WordPress filters.
* New: `readme.txt` and full documentation.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 2.0.1 =
Bugfix release: fixes non-functional output buffer layer, nested-div regex patterns, Squirrly callback matching, menu array reindexing, and plugin page link filter false positives. Recommended for all users.

= 2.0.0 =
Major architecture rewrite. Settings from v1.x are automatically migrated. All features now enabled by default. Visit **Settings → MeNoAds** to review your preferences.
