=== EHERO Cleaner ===
Contributors: cehero
Donate link: https://consultoriaehero.com/
Tags: cleanup, database, optimize, transients, revisions
Requires at least: 6.2
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Clean your WordPress database safely in one click. Remove expired transients, old revisions, spam comments, orphaned metadata and more.

== Description ==

**EHERO Cleaner** is a maintenance toolkit for WordPress. It safely removes data that bloats your database and slows your site down: expired transients, old post revisions, spam and trashed comments, orphaned metadata, auto-drafts, leftover plugin data, Action Scheduler history, expired sessions and more.

All operations use official WordPress APIs and only touch content that is already trash, already expired or structurally orphaned. Your published content is never touched.

= Key features =

* **20+ cleanup tools** — transients, revisions, orphaned meta, Action Scheduler, WooCommerce sessions, feed cache, edit locks…
* **Scheduled cleanup** — run selected tools automatically daily, twice-daily or weekly.
* **Metadata viewer** — inspect all metadata on any post, product or taxonomy term. Groups keys by plugin of origin (WooCommerce, Yoast, Elementor…).
* **Plugin meta detector** — scan your database for metadata left behind by uninstalled plugins and remove it.
* **Manual run** — every tool has a "Run now" button with live item count.
* **Risk labels** — each tool is clearly marked Safe or Moderate so you know what you are doing.
* **Activity log** — keep a history of every cleanup performed.
* **Bilingual** — Spanish and English included.

= Why EHERO Cleaner? =

Other cleanup plugins either do too little (just transients and revisions) or way too much (dangerous bulk deletes with no safety). EHERO Cleaner focuses on **safe**, **transparent** cleanups with a modern UI and a detector that tells you *which plugins left trash behind*.

= EHERO Plugin Ecosystem =

EHERO Cleaner is part of a family of WordPress and WooCommerce plugins for agencies and power users. When installed, a unified "EHERO" admin menu lets you manage all EHERO plugins from one place.

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/ehero-cleaner` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the "Plugins" screen in WordPress.
3. Go to **EHERO → Cleaner** in your admin menu.
4. Run your first cleanup from the Dashboard or configure Scheduled cleanup in Settings.

== Frequently Asked Questions ==

= Is it safe to delete transients? =

Yes. Expired transients serve no purpose — WordPress would eventually delete them anyway. Deleting all transients is safe but may cause a brief slowdown while caches regenerate.

= Can I lose content? =

No. The tools only remove content that is already trashed, marked as spam, or technically unnecessary (orphaned metadata, auto-drafts). Your published content is never touched.

= Do I need WooCommerce? =

No. EHERO Cleaner works with any WordPress installation, with or without WooCommerce. WooCommerce-specific tools (sessions, download logs) only appear if WooCommerce is active.

= Can I schedule automatic cleanups? =

Yes. In Settings you can enable scheduled cleanup and choose frequency (twice daily, daily or weekly) and which tools to run.

= Does this plugin connect to any external service? =

The plugin's cleanup functionality is entirely local — no external calls are made for any cleanup operation. However, a newsletter opt-in banner displayed on the plugin's admin pages connects to consultoriaehero.com to retrieve coupon information and to process voluntary subscriptions. See the "External services" section for full details. The banner can be permanently dismissed by any administrator.

= What happens to Action Scheduler data? =

The plugin offers dedicated tools to clean Action Scheduler: completed actions older than 30 days, failed actions, cancelled actions and orphan logs. On busy WooCommerce stores this alone can reclaim hundreds of MB.

== Screenshots ==

1. Dashboard with all cleanup tools as cards
2. Settings with scheduled cleanup configuration
3. Advanced Tools — Plugin Metadata Detector, bulk delete by filter and empty data groups
4. Metadata viewer on a WooCommerce product showing all meta grouped by origin

== Changelog ==

= 1.0.1 =
* Updated plugin logo.

= 1.0.0 =
* Initial release.
* 20+ cleanup tools (transients, revisions, orphaned meta, Action Scheduler…).
* Scheduled cleanup (daily / weekly / twice daily).
* Metadata viewer on posts, products and taxonomy terms.
* Plugin metadata detector.
* Bilingual documentation (Spanish / English).

== Upgrade Notice ==

= 1.0.0 =
Initial release.

== External services ==

This plugin includes a newsletter opt-in banner displayed on the plugin's admin pages. This banner is used to offer administrators a discount coupon in exchange for subscribing to the EHERO newsletter. It can be permanently dismissed with a single click.

= Coupon information retrieval =

When the banner is displayed, the plugin sends a GET request to the following endpoint to retrieve the current discount amount:
`https://consultoriaehero.com/wp-json/ehero-leads/v1/coupon-info`
No personal data is transmitted in this request. The response is cached for 12 hours.

= Newsletter subscription =

When a user voluntarily subscribes through the banner, the following data is sent via POST to:
`https://consultoriaehero.com/wp-json/ehero-leads/v1/subscribe`

Data sent: email address, first name, site URL, and language preference.

This service is provided by Consultoría EHERO S.L.U:
* [Terms of service](https://consultoriaehero.com/terminos-y-condiciones/)
* [Privacy policy](https://consultoriaehero.com/politica-de-privacidad/)

The banner can be permanently dismissed by any administrator, after which no further external requests are made.
