=== Native Performance ===
Contributors: edintique, quecodig
Donate link: https://www.paypal.me/quecodig
Tags: performance, optimization, speed, heartbeat, cleanup
Requires at least: 6.0
Tested up to: 7.2
Stable tag: 2.0.0
Requires PHP: 7.4
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Improve WordPress performance with surgical, native optimizations, safe one-click profiles, and a modern WordPress 7.2 settings interface.

== Description ==

Native Performance 2.0 improves WordPress loading speed and reduces server overhead using clean, native WordPress APIs without bloat or intrusive banners.

Choose from curated one-click profiles (**Recommended**, **Maximum speed**, or **Minimal cleanup**) or toggle each optimization individually from the new settings workspace aligned with WordPress 7.2 design tokens.

= Key Features =

* **Document Head & HTML Cleanup**
  * Disable WordPress emoji scripts, styles, TinyMCE plugin, and feed/email filters
  * Hide WordPress generator version tag in HTML and RSS feeds
  * Remove RSD (EditURI) and redundant shortlink tags/headers
  * Clean REST and oEmbed discovery tags without breaking the Block Editor
  * Surgically remove only the `s.w.org` DNS prefetch hint (preserving other resource hints and canonical SEO links)
  * Optional RSS feed link removal
* **Scripts & Asset Delivery**
  * Disable Dashicons on the frontend for logged-out visitors
  * Strip only `?ver=` query strings from frontend assets while preserving other parameters and admin cache busting
  * Safe JavaScript `defer` using `WP_HTML_Tag_Processor` (automatically excludes wp-admin, login, jQuery core, async scripts, and `type="module"` scripts for the Interactivity API)
  * Optional jQuery Migrate removal on frontend (with WordPress 7.2 / jQuery 4 compatibility guidance)
  * Disable `capital_P_dangit` filter and self-pingbacks
* **System & APIs**
  * Control Heartbeat API (default, 60-second optimized interval, or editor-only)
  * Limit stored post revisions cleanly without editing `wp-config.php`
  * Disable XML-RPC and `X-Pingback` header
  * Optional REST API restriction for anonymous visitors (keeping Block Editor and Site Health intact)
* **Media & Images**
  * Disable server-side PDF fallback preview thumbnails
  * Ensure `loading="lazy"` and `decoding="async"` on user avatars without breaking Gravatar query parameters
  * Optional toggle to disable the 2560px big image threshold
* **Third-Party Integrations**
  * Conditional WooCommerce asset cleanup on non-store pages (preserving Cart, Checkout, My Account, and WooCommerce blocks)
  * Conditional Contact Form 7 asset loading only on singular pages containing a CF7 shortcode or block

== Installation ==

= From within WordPress =

1. Visit **Plugins > Add New**.
2. Search for **Native Performance**.
3. Install and activate **Native Performance**.
4. Open **Native Performance** in the WordPress admin menu to review your active profile or fine-tune individual optimizations.

= Manually =

1. Upload the `native-performance` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the **Plugins** menu in WordPress.

== Frequently Asked Questions ==

= Does Native Performance work out of the box? =

Yes. Upon activation, Native Performance applies the **Recommended** profile automatically with safe, tested defaults. You can switch profiles or customize any individual setting at any time.

= Is it compatible with WordPress 7.2 and PHP 8.6? =

Yes. Version 2.0.0 is built and tested for WordPress 7.2 (including inline SVG admin icons, Interactivity API ES modules, client-side media processing, and jQuery Migrate 3.6.0) and PHP 7.4 through PHP 8.6.

= Will enabling JavaScript defer or REST API restriction break my site? =

Options that may depend on third-party themes or plugins are disabled by default and clearly marked in the settings screen. JavaScript defer automatically skips wp-admin, core jQuery handles, and ES modules.

= Does disabling the plugin erase my settings? =

No. Deactivating the plugin preserves your configuration. Settings are only removed if you uninstall (delete) the plugin.

== Changelog ==

= 2.0.0 =
* New: Modern WordPress 7.2-aligned settings interface using WPDS design tokens, accessible tabs, native switch controls, quick profiles, and instant AJAX saving with server-side fallback.
* New: Granular control for every optimization plus new native tweaks (XML-RPC disable, self-pingback prevention, post revision limits, avatar lazy-loading, and big image threshold toggle).
* New: Clean `uninstall.php` and non-destructive deactivation (preserves user settings on temporary deactivation).
* Fix: Corrected inverted Contact Form 7 conditional logic and added Gutenberg block detection for both CF7 and WooCommerce.
* Fix: Replaced unsafe `clean_url` JS defer hack with `WP_HTML_Tag_Processor` via `script_loader_tag`, skipping wp-admin, jQuery core, and `type="module"` scripts.
* Fix: Stopped removing `rel_canonical` and non-emoji `wp_resource_hints`; fixed `?ver=` stripping with `remove_query_arg()`; stopped stripping Gravatar sizing parameters.
* Fix: Unified text domain to `native-performance`, removed unnecessary `upgrade.php` include, scoped admin CSS/JS and footer text strictly to the plugin page.
* Compatibility: Declared full support for WordPress 7.2 and PHP 8.6.

= 1.2.10 =
* Tested up to: 6.8

= 1.2.9 =
* Tested up to: 6.2.2

= 1.2.8 =
* Tested up to: 5.9.9

= 1.2.7 =
* Fixed for Google Site Kit

= 1.2.6 =
* Tested up to: 5.5

= 1.2.5 =
* Tested up to: 5.3

= 1.2.4 =
* Correction of minor faults

= 1.2.3 =
* Core improvements
* Correction of minor faults
* Improvement REST API
* Improvement of remove Emojis
* Optimization for WooCommerce & Contact Form 7

= 1.2 =
* Bug fixes
* Resolution of major problems
* Incorporation of collaborators

= 1.1 =
* Correction of minor faults
* Incorporation of new contributors
* Core improvements

= 1.0 =
* Initial release

== Upgrade Notice ==

= 2.0.0 =
Major release introducing the WordPress 7.2 settings interface, granular toggles, critical compatibility fixes for Contact Form 7, WooCommerce, ES modules, and full WordPress 7.2 / PHP 8.6 support.
