=== NaveenCodes Speed Analyzer ===
Contributors: shinu1503
Tags: performance, speed, bottleneck, admin, optimization
Requires at least: 5.9
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 1.1.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Demo URI: https://playground.wordpress.net/?plugin=naveencodes-speed-analyzer

Identify WordPress bottlenecks — slow admin pages, heavy autoloads, stuck cron jobs — and fix them with one click from wp-admin.

== Description ==

💛 This plugin is dedicated to my mother. Every update carries her blessings.

NaveenCodes Speed Analyzer helps you understand where WordPress is spending time on your site. It runs entirely inside your hosting environment — no external service, no cloud dashboard, no account required.

The plugin is designed to remain fully free:

* No locked features
* No artificial limits
* No ads
* No tracking
* No upsells

= Page Load Logger =

Records how long each wp-admin page takes to generate, how much memory it uses, and how many database queries it runs. Entries are stored locally and displayed in a sortable log so you can identify which pages are consistently slow.

= Autoload Options Audit =

WordPress loads all autoloaded options on every single page request. Large autoloaded data adds overhead to every page — even if the visitor is just reading a post. The Autoload Audit shows your total autoloaded payload size and the top options by size. You can remove individual orphaned options or clear all expired transients with one click.

= Cron Jobs Viewer =

Shows every scheduled WP-Cron event with its hook name, schedule frequency, next run time, and whether the job is overdue. Overdue jobs may indicate that WP-Cron is not firing correctly or that a job is stuck. You can delete individual stuck cron jobs directly from the viewer.

= Dashboard Summary =

Seven-day averages for page generation time, peak memory, and database queries per page. The Slowest Pages table shows which URLs are consistently the most expensive.

= Settings =

Control how long log data is kept (7, 14, 30, or 90 days), set your own threshold for what counts as a slow page, and enable or disable logging at any time.

= No External Service =

All data is stored in a single table on your own server. Nothing is sent to any external service, analytics platform, or third-party host.

== Installation ==

1. Upload the `naveencodes-speed-analyzer` folder to `/wp-content/plugins/`, or install the ZIP from `Plugins > Add New > Upload Plugin`.
2. Activate the plugin through the `Plugins` screen in WordPress.
3. Open **Speed Analyzer → Dashboard** from the wp-admin sidebar.
4. Browse some wp-admin pages normally — the plugin logs each request in the background.
5. Return to the Dashboard to see your first performance summary.

== Frequently Asked Questions ==

= Does the plugin slow down my site? =

The logging overhead is minimal — one small database insert per admin page load. Frontend pages are not logged in version 1.0.0, so visitors are not affected at all.

= What database table does it create? =

One table: `{prefix}ncsa_page_log`. This table is removed cleanly when the plugin is uninstalled through the WordPress Plugins screen.

= Does it require WP-Cron to be enabled? =

WP-Cron is used for daily cleanup of old log entries. If WP-Cron is disabled on your server, old entries will accumulate until you clear the log manually from the Settings page.

= Does it conflict with caching plugins? =

When a full-page cache serves a cached response, WordPress does not execute, so there is nothing for Speed Analyzer to log. That is expected and correct — a cached page is fast by design.

= What does the Autoload Audit measure? =

It measures the total size of all WordPress options stored with `autoload = yes` in the options table. WordPress loads all of these on every request. If the total is several hundred kilobytes or more, it may be worth reviewing which plugins are autoloading large amounts of data.

= Is it multisite compatible? =

Yes. Each site in a multisite network gets its own log table using the standard WordPress table prefix.

== Screenshots ==

1. Dashboard showing 7-day summary cards and the Slowest Admin Pages table.
2. Page Log with full entry history, pagination, and a Clear Log button.
3. Autoload Audit showing total autoloaded payload size and the top options.
4. Cron Jobs viewer with hook, schedule, next run time, and overdue status.
5. Settings page — retention period, slow-page threshold, and log data controls.

== Changelog ==

= 1.1.1 =
* Security: `remove_option` AJAX handler now restricted to autoloaded options only, preventing arbitrary option deletion.
* Code: Replaced non-enqueued `<link>` / `<style>` tags in admin with proper `wp_enqueue_style()` and `wp_add_inline_style()`.
* Code: Replaced inline `<script>` in review notice with `wp_add_inline_script()`.
* Readme: Updated description to accurately reflect one-click fix actions.

= 1.1.0 =
* Added one-click fix actions: clean expired transients, optimize DB tables, delete revisions/spam/trash.
* Added Cron Manager page — detect and delete stuck/zombie cron jobs.
* Added Database Health page — table sizes, overhead, and cleanup tools.
* Added Autoload bulk-remove with plugin ownership detection.
* Premium Maa Lab admin UI across all 6 pages.
* Bumped minimum PHP to 8.0 and minimum WP to 5.9.

= 1.0.0 =
* Initial release.
* Added admin page load logger — records generation time, memory, and query count per request.
* Added Dashboard with 7-day summary cards and Slowest Pages table.
* Added Page Log with full entry history, pagination, and clear button.
* Added Autoload Options Audit — total payload size and top-20 options by size.
* Added Cron Jobs Viewer — all scheduled events with next-run time and overdue status.
* Added Settings: log retention (7/14/30/90 days), slow-page threshold, enable/disable toggle.
* Zero external calls. All data stored locally in a single custom table.
* Maa tribute ❤️

== Upgrade Notice ==

= 1.1.0 =
Adds one-click fix actions, Database Health, Cron Manager, Autoload bulk-remove, and premium admin UI.

= 1.0.0 =
Initial release of NaveenCodes Speed Analyzer.
