=== Admin Shortcuts ===
Contributors: anilsuwal16
Donate link: https://buymeacoffee.com/anilsuwal
Demo link: https://playground.wordpress.net/?plugin=anilsuwal-admin-shortcuts
Tags: dashboard, admin, analytics, views, comments, site-health, quick-links, chart
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 1.0.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Your WordPress dashboard, supercharged. Quick actions, site health, interactive view analytics for posts and pages, recent users, and updates — all in one place.

== Description ==

Admin Shortcuts replaces the cluttered default WordPress dashboard with a clean, unified hub. Everything you need — from quick actions to view analytics — is visible at a glance.

**Features:**

* **Quick Actions** — Pinned at the top of the dashboard for instant access. One-click buttons for New Post, New Page, Upload Media, and up to five custom links you configure yourself.
* **Admin Bar Shortcuts** — An "Admin Shortcuts" dropdown in the WordPress toolbar gives you a Dashboard link and a Check PageSpeed link (opens Google PageSpeed Insights for your homepage in a new tab — no API key needed).
* **Page & Post View Analytics** — Tracks visits to your posts and pages in your own database with no third-party service. Views are split into separate **Posts** and **Pages** panels, each showing:
  * An interactive **Chart.js line chart** with date labels on the bottom axis and view counts on the left axis.
  * Smooth curves, gradient fill, and visible data-point markers with hover tooltips.
  * A trend indicator (% change vs the previous period).
  * A scrollable top-content list with proportional bar indicators.
* **Recent Users Sidebar** — The most recently registered users are shown in the right sidebar with their name and role. Includes a total user count and an Add User shortcut.
* **System Overview Sidebar** — Site Health score with a visual gauge and metric list, plus server information (PHP version, memory limit, database version), all in the right sidebar.
* **Updates Available** — Plugin and theme update cards with one-click Update and Update All buttons, inline status badges, and active-theme warnings.
* **Recent Comments** — Pending comments with inline Approve, Spam, and Trash actions powered by the WordPress REST API — no page reload required.
* **At a Glance** — Post, page, comment, and user counts with direct links.
* **Dark / Light Mode** — Toggle dashboard appearance; preference saved per user.
* **Clean Dashboard** — Hides core WordPress dashboard widgets when Admin Shortcuts is enabled; third-party widgets remain visible.
* **Custom Quick Links** — Configure up to five quick-link slots (label, URL, enabled) under Settings > Admin Shortcuts.
* **View Tracking Settings** — Choose which post types to track, set a data-retention window (default 90 days, or keep forever), and optionally count logged-in user visits.

== Installation ==

1. Upload the `admin-shortcuts` folder to the `/wp-content/plugins/` directory, or install through the WordPress Plugins screen.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Visit the **Dashboard** to see the Admin Shortcuts interface.
4. Configure quick links and plugin options under **Settings > Admin Shortcuts**.

== Frequently Asked Questions ==

= Where does the Admin Shortcuts dashboard appear? =

It replaces the default WordPress Dashboard page. Quick Actions are at the top, followed by at-a-glance stats, page view analytics, updates, and recent comments. Recent Users and System Overview live in the right sidebar.

= What is the Admin Shortcuts toolbar menu? =

An "Admin Shortcuts" dropdown is added to the WordPress admin bar. It contains a **Dashboard** link and a **Check PageSpeed** link. Check PageSpeed opens Google PageSpeed Insights for your homepage in a new tab — no API key required.

= How does page view tracking work? =

A lightweight JavaScript beacon fires when a visitor views a singular post or page and stores the visit in a custom database table on your server. The dashboard shows views in separate Posts and Pages panels with interactive Chart.js line charts, trend indicators, and scrollable top-content lists.

= Does the view counter use cookies or external services? =

No. Views are recorded with a JavaScript beacon that posts to your own WordPress AJAX endpoint. Everything is stored in a custom table (`wp_anilsuwal_post_views`) on your server. No cookies, no third-party tracking.

= Will my own admin visits inflate the view count? =

No. By default, views from logged-in users are not counted. You can enable this under Settings > Admin Shortcuts > View Tracking.

= How long is view data kept? =

The default retention period is 90 days. Records older than that are deleted automatically each week. You can change the window — or set it to "Keep forever" — under Settings > Admin Shortcuts > View Tracking > Data retention.

= How do I add custom quick links? =

Go to Settings > Admin Shortcuts > General and fill in the Quick link slots table. Each row supports a label, URL, and an enabled toggle.

= Can I disable Admin Shortcuts entirely? =

Yes. Turn off "Enable Admin Shortcuts" under Plugin status on the General tab. Core WordPress dashboard widgets will be restored.

= Does dark mode affect the entire WordPress admin? =

No. Dark mode only styles the Admin Shortcuts dashboard. Your preference is saved per user.

== Screenshots ==

1. Screenshot 1
2. Screenshot 2
3. Screenshot 3
4. Screenshot 4

== Changelog ==

= 1.0.2 =
* Admin bar dropdown with Dashboard and Check PageSpeed links.
* Page views split into Posts and Pages panels with Chart.js line charts.
* Recent Users moved to the right sidebar.
* Quick Actions pinned to the top of the dashboard.
* Removed PageSpeed API integration and device-type tracking.

= 1.0.1 =
* UI changes in Dashboard and Settings Page.

= 1.0.0 =
* Initial release with quick links, users shortcut, comment moderation, site health, update notices, theme toggle, recent posts, and custom link settings.

== Upgrade Notice ==

= 1.0.2 =
Adds an admin bar shortcut menu, Chart.js-powered view analytics split by post type, Recent Users in the sidebar, and Quick Actions at the top. Removes the PageSpeed API integration and device-type tracking — no data migration needed.

= 1.0.1 =
Settings page UI polish.

= 1.0.0 =
Initial release of Admin Shortcuts.
