=== PVQ Dashboard ===
Contributors: learnandpermits
Tags: verification, identity, questions, membership, lms
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 5.0.38
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

PVQ Dashboard periodically verifies logged-in WordPress users with Personal Validation Questions.

== Description ==

PVQ Dashboard is a WordPress plugin for user portals, LMS sites, membership sites, eCommerce sites, and client dashboards. It lets administrators create a question bank, lets users complete PVQ setup by saving their own answers, and then displays a blocking verification modal when a user's verification has expired.

This version is packaged as a standalone PVQ Dashboard plugin with its own slug, settings, database tables, REST route, AJAX actions, and shortcodes.

Core features:

* Admin Dashboard with PVQ setup, verification, failure, lockout, and activity stats.
* Questions screen with create, edit, delete, archive, and duplicate actions.
* Users screen with PVQ setup status, last verified date, failed attempts, lockout status, reset, unlock, and require PVQ reset actions.
* Reports screen with CSV export limited to the last 7 days in the free plugin, date/user/role/result filters, pass/failure stats, average completion time, and most failed question IDs.
* Settings screen for verification rules, popup content, logging, cache duration, support email, and timezone selection.
* Top-tab admin navigation across Dashboard, Questions, Users, Reports, Settings, Help, and Upgrade to Pro.
* Help tab feedback/question form that emails the configured support email.
* PVQ setup screen through [dashboard_pvq_manage].
* Verification modal through automatic expiration checks or [dashboard_pvq_verify].
* Status screen through [dashboard_pvq_status].
* Standalone aliases: [dashboard_pvq_setup] and [dashboard_pvq_check].
* REST status endpoint at /wp-json/dashboard-pvq/v1/status.
* Answers are hashed and never stored as plaintext.

== Installation ==

1. Upload the ZIP file from Plugins > Add New > Upload Plugin.
2. Activate PVQ Dashboard.
3. Go to PVQ Dashboard > Questions and configure up to 5 questions in the free MVP.
4. Go to PVQ Dashboard > Settings and enable the plugin after reviewing verification rules.
5. Create a front-end page and add [dashboard_pvq_manage] for PVQ setup.
6. Optionally add [dashboard_pvq_status] to a dashboard page.

== Shortcodes ==

[dashboard_pvq_manage] - PVQ setup and answer management.
[dashboard_pvq_status] - User verification status.
[dashboard_pvq_verify] - Force a verification modal on the current page.
[dashboard_pvq_setup] - Standalone alias for [dashboard_pvq_manage].
[dashboard_pvq_check] - Standalone alias for [dashboard_pvq_verify].

== Security Notes ==

PVQ answers are normalized and hashed using WordPress password hashing. They are not stored as plaintext. The plugin uses nonces, capability checks, prepared SQL statements, input sanitization, and output escaping.

== Upgrade Notes ==

This build uses the standalone dashboard-pvq folder, dashboard-pvq.php main file, dashboard_pvq_* option/user-meta keys, dashboard_pvq_* tables, and dashboard-pvq text domain so it can install separately from the prior Learn and Permits PVQ plugin.

== Changelog ==

= 5.0.38 =
* Enforced a fixed free-plugin cap of 5 total created questions, including archived questions.
* Added a clearer Questions tab free-plan note and upgrade link.
* Limited free CSV exports to the last 7 days and added a Pro upgrade notice/alert for older export attempts.
* Replaced Checkpoint frequency with a disabled Pro add-on placeholder and removed free-plugin saving for that setting.
* Replaced Excluded content with a disabled Pro add-on placeholder and removed free-plugin excluded-content logic.
* Removed role-exclusion controls and Pro unlock/filter logic from the free plugin so premium behavior is not shipped and license-unlocked inside the WordPress.org package.

= 5.0.33 =
* Addressed Plugin Check warning items from the uploaded report around custom-table database calls, read-only admin filters, sanitized request values, and uninstall cleanup naming.

= 5.0.32 =
* Fixed Plugin Check errors from the uploaded report.
* Added GPL license headers, updated Tested up to, removed distributable test application files, replaced direct CSV filesystem output, and added translator comments for placeholder strings.

= 5.0.31 =
* Renamed the plugin to PVQ Dashboard.

= 5.0.29 =
* Removed Setup complete and Setup incomplete stat cards from the Dashboard tab.

= 5.0.28 =
* Improved Upgrade to Pro hero readability and added feature-card emojis.

= 5.0.27 =
* Added a hard free-plan cap of 5 created questions, including archived questions.
* Added User ID to the Users table and expanded user search to support name, email, or user ID.
* Added AJAX refresh for Reports summary cards so changing the period updates the cards without a full page reload.
* Limited the Settings timezone dropdown to a curated list of 39 timezone choices.
* Polished the Upgrade to Pro page with a more visual card layout.

= 5.0.26 =
* Replaced customer-facing and admin-facing Enrollment terminology with PVQ Setup terminology.
* Renamed setup status labels to Setup complete and Setup incomplete.
* Updated Users actions from Force Re-enrollment to Require PVQ reset.

= 5.0.25 =
* Tightened LearnDash checkpoint detection so earlier lessons and topics remain accessible before the setup shortcode checkpoint.
* Changed course-sequence gating to fail open when the plugin cannot confidently determine course order, preventing accidental lockouts of earlier content.

= 5.0.24 =
* Improved shortcode checkpoint gating so content after the PVQ setup checkpoint is blocked until setup is complete, while earlier content remains accessible.
* Changed PVQ setup gating to shortcode checkpoint mode by default, so earlier course lessons/pages can stay accessible until users reach the setup shortcode.
* Added a Settings option to choose shortcode-only or sitewide setup protection.
* Reloads a gated page after setup so the original content appears immediately after setup.

= 5.0.22 =
* Removed the PVQ setup popup gate.
* Required PVQ setup now uses the static setup form and replaces protected content until setup is complete.
* Users cannot view protected page content until they complete the static PVQ setup form.

= 5.0.21 =
* Updated Help tab intro wording.
* Help form now explicitly pre-fills name and email from the logged-in WordPress user when available.
* Added FAQ guidance explaining shortcodes and how to use them.

= 5.0.19 =
* Converted Settings into General, Verification, PVQ Setup Page, and Popup subtabs.
* Added settings validation that blocks invalid saves and shows a clear error message.
* Added seconds/minutes/hours unit selectors for time-based settings.
* Changed timezone to a dropdown, removed Category IDs and the separate Exclude administrators option.
* Renamed Required correct answers to Questions required per validation.

= 5.0.17 =
* Matched the Reports Filters header size to the Most failed questions header.
* Doubled the vertical spacing between Reports filters and the Summary cards controls.

= 5.0.16 =
* Added a Filters heading on the Reports tab.
* Increased spacing between report filters and summary cards selector.
* Renamed Last Year to Last year in the summary period dropdown.

= 5.0.15 =
* Horizontally aligned Users total count with the Search Users field.
* Restyled Users total count as header text with no bubble background.
* Moved Reports Apply Filters and Export CSV controls inline with the main filters.
* Improved Summary cards label/dropdown vertical alignment.
* Renamed the Reports summary period from Year to Last Year.

= 5.0.14 =
* Cleaned up Users tab display count so it only appears once.
* Restyled Users total count without a white bubble background.
* Updated Reports filters to support Email or User ID search.
* Converted Reports Role filter to a dropdown of available WordPress roles.
* Changed Reports button text to Apply Filters.
* Replaced IP Address column with User ID in Reports.
* Added Summary Cards period selector with Last 24 hours, Last 7 days, Last 30 days, Year, and Lifetime options.
* Reports summary cards now default to the past 7 days.

= 5.0.13 =
* Updated Users tab pagination to show 30 users per page.
* Added total user count and current display count to the Users tab.
* Added numbered Users pagination with arrows.
* Updated Last Verified in the Users tab to use the latest successful PVQ check instead of setup time.

= 5.0.12 =
* Updated Dashboard Plugin Status to save through AJAX and immediately show Enabled or Disabled.
* Styled the Upgrade to Pro tab with the primary blue accent.
* Removed the Dropdown question type; questions are now Multiple choice or Free response.
* Added a disabled Import CSV control with an Upgrade to Pro link.
* Added an Archived Questions section with Un-archive and Delete actions.
* Reworded free response matching language for clarity.
* Tightened Questions tab section spacing.

= 5.0.11 =
* Converted the Dashboard Plugin Status control to a simple inline auto-saving switch.
* Removed the Apply button from the Plugin Status toggle.
* Removed the white card/bubble background around the Plugin Status control.

= 5.0.10 =
* Updated Dashboard stat labels for consistency.
* Removed Plugin Version and Plugin Status stat cards.
* Added a top Dashboard enable/disable toggle.
* Added Recent Activity pagination with five pages and an All Activity link to Reports.
* Limited Dashboard Recent Activity to 10 entries per page.
* Display PVQ setup + passed as Completed and updated setup notes to PVQ setup complete.

= 5.0.9 =
* Added a repeatable testing suite for static package checks, WP-CLI smoke tests, optional Playwright browser tests, QA scenarios, and a manual release checklist.

= 5.0.8 =
* Enforced the free-version cap of 5 PVQ questions in settings, frontend setup, and AJAX validation.

= 5.0.7 =
* Updated the frontend setup required-question counter so it turns green once the minimum number of PVQ questions has been selected.

= 5.0.4 =
* Hid saved PVQ questions and answers from users after setup.
* Replaced the setup form immediately after successful save so users cannot continue viewing selected setup details.
* Added a secure setup-complete message for users with completed setup instead of showing the setup form.

= 5.0.3 =
* Applied visual styling refinements based on the reference PVQ plugin, including rounded cards, blue #0A369D accent states, refined modal styling, and improved admin dashboard spacing.

= 5.0.2 =
* Changed user setup to dropdown-based PVQ question selection with a required-question counter.
* Improved verification modal JavaScript responsiveness and double-submit protection.
* Matched frontend PVQ fonts to the native WordPress admin font stack.
* Added more spacing between dashboard card numbers and labels.

= 5.0.1 =
* Changed plugin navigation to top WordPress-style tabs across all PVQ Dashboard admin screens.
* Added Help tab feedback/question form with Question, Feedback, Bug Report, and Feature Request message types.
* Kept submenu pages hidden from the left admin menu so the plugin feels like a tabbed settings application.

= 5.0.0 =
* Repositioned plugin as generic PVQ Dashboard for native WordPress users.
* Added top-level PVQ Dashboard admin menu: Dashboard, Questions, Users, Reports, Settings, Help, and Upgrade to Pro.
* Added custom question table and verification log table.
* Added open-ended, dropdown, and multiple-choice question support.
* Added [dashboard_pvq_manage], [dashboard_pvq_status], and [dashboard_pvq_verify] shortcodes.
* Added blocking verification modal with timer, progress, retries, and lockout.
* Added CSV reports and REST status scaffold.

= 5.0.6 =
* Polished dashboard/report stat card typography, added Questions upgrade link, removed Role filter description, tightened Most Failed Questions spacing, and increased Settings section headings.

= 5.0.5 =
* Updated visual accent to #0A369D with lighter blue supporting states.
* Renamed Customers tab to Users.
* Reduced dashboard/report card corner radius and improved number/label spacing.
* Added explanatory text for Reports role filtering and Settings excluded user roles.
* Moved Export CSV controls lower on Reports and tightened Help section spacing.
