=== Undergroundact Project Planner ===
Contributors: btolman
Tags: project management, task management, todo list, planner, productivity
Requires at least: 7.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.2.69
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Undergroundact Project Planner organizes WordPress projects and tasks with filters, drag ordering, reports, and CSV export.

== Description ==

Undergroundact Project Planner is built for teams that want clarity without ceremony:

- Capture work quickly (bulk import / add task)
- Focus the list (filters + sorting)
- Execute (project view + ordering)
- Communicate (Project Status Report)
- Export CSV whenever you need portability

This plugin includes a Project Status Report designed to be copied/forwarded into email or docs.

= Core Features =

- Dashboard view with filters and sortable columns
- Project view with drag/drop ordering + Save Order
- To‑Do view (filtered task list)
- Project Status Report (forwardable executive summary)
- Bulk import (paste one task per line)
- CSV export for Dashboard, Project view, and Project Status Report
- Admin project Import / Export for moving a project and its tasks between Undergroundact Project Planner sites
- Admin management for recurring-task frequencies
- Simple access control (project + category View/Edit)
- Optional AI suggestions (off by default)

= What this plugin is NOT =

Undergroundact Project Planner intentionally does NOT include:

- Notifications/digests
- Slack/Teams/Calendar integrations
- Enterprise resource-loaded scheduling / critical-path planning
- Approvals/workflow engine
- Heavy audit/compliance logging

Those belong in optional add-ons so the open source core stays fast and calm.

== External Services ==

Undergroundact Project Planner has optional AI features, disabled by default. On WordPress 7.0+, it uses the native WordPress AI Client and the text-generation provider configured by the site owner in Settings > Connectors. The plugin does not connect directly to OpenAI or store new provider credentials.

- AI Suggestions: generates proposed improvements, missed steps and follow-up questions about an existing project.
- Statement of Work: generates a draft document from project goals and task details.

* What external service is used: Whichever compatible AI provider the site owner connects in WordPress Settings > Connectors (such as OpenAI, Anthropic or Google); providers and terms vary.
* What is sent: Project name, description and goals (when available), and the relevant task/step text including categories/subcategories, dependencies and notes. Only tasks the user can view are included.
* When information is sent: Only when the plugin's optional AI feature is enabled and a logged-in user explicitly requests an AI result. WordPress handles the provider API request using the site owner's configured credentials.
* Credentials: Configure the provider via Settings > Connectors. Old OpenAI keys in legacy Planner settings are not transferred to WordPress; they are removed from the legacy option on upgrade. No AI call is made merely by enabling AI or viewing an ordinary project page.
* Data retention: The plugin temporarily caches generated suggestions and Statements of Work for up to 12 hours; provider processing and retention depend on the provider's terms. The plugin does not promise a provider-independent equivalent of the old OpenAI `store: false` option.
* Provider terms/privacy: Review the policies of the provider you choose before activating AI. Examples: https://openai.com/policies/privacy-policy/ ; https://www.anthropic.com/legal/privacy ; https://policies.google.com/privacy .
* Costs: Any AI API charges are billed under the credentials configured in WordPress; Undergroundact Project Planner does not pay those charges. Administrators can view recent successful requests and provider-reported tokens in Planner AI Settings. The adjustable prompt-size guard measures bytes, not tokens or dollars; the existing 12-hour response cache avoids repeat requests, while refreshing makes another provider call. Recent usage metadata (not prompts or generated content) is stored in a bounded WordPress option, with entries older than 30 days pruned on the next successful request.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` (or install via the Plugins screen).
2. Activate the plugin.
3. Create a WordPress Page and place this shortcode in the content:

`[betpp_dashboard]`

4. In WP Admin, go to Undergroundact Project Planner → Getting Started.
5. Define your lookups (Projects, Categories, Subcategories, Statuses, Priorities, Frequencies, Owners).
6. Set User Access (who can view/edit by project + category).
7. Use Bulk Import to paste tasks and start running work.
8. Optional AI: go to Settings > Connectors and configure an AI provider, then enable AI under Undergroundact Project Planner > AI Settings. The site owner is responsible for AI service costs and policies.

== Frequently Asked Questions ==

= Will uninstall delete my tasks? =

No. By default, uninstall keeps data. A planner is a database of record; uninstall should not wipe your work.

= Does Undergroundact Project Planner use custom database tables? =

Yes. Undergroundact Project Planner stores planner data in custom database tables (vsl_plan_*). This keeps task/project data fast and structured without overloading postmeta.

Tables used include:

- vsl_plan_categories
- vsl_plan_frequencies
- vsl_plan_item_categories
- vsl_plan_item_subcategories
- vsl_plan_owners
- vsl_plan_priorities
- vsl_plan_projects
- vsl_plan_statuses
- vsl_plan_subcategories
- vsl_plan_tasks
- vsl_plan_time_entries
- vsl_plan_user_categories
- vsl_plan_vendors

These tables are created/updated via WordPress’s dbDelta() during activation/upgrade checks.

= How do I completely remove plugin data? =

By default, uninstall keeps data (see uninstall.php) to prevent accidental loss.

To remove all Undergroundact Project Planner data manually:

1. Deactivate and uninstall the plugin.
2. Using a database tool (e.g. phpMyAdmin), drop the vsl_plan_* tables listed above.

(An optional “delete data on uninstall” setting may be added in a future release; it would remain OFF by default.)

= How do I export to CSV? =

Each list view includes an Export CSV button. Exports respect your current filters and sorting.

= Can I use this without AI? =

Yes. AI suggestions are optional and disabled by default.

= Does this work with caching plugins? =

Yes. CSV exports are routed through a non-cacheable endpoint.


== Changelog ==

= 0.2.69 =
* Updated the WordPress installer description to reflect category-based access and AI features.
* Prefixed local AI usage-history display variables to satisfy WordPress coding standards. No functional or schema changes.

= 0.2.68 =
* Increased the AI Statement of Work maximum generated-output allowance from 2,400 to 6,000 tokens to accommodate larger projects and reasoning models.
* Retained the existing 2,000-token limit for AI Suggestions, request timeouts, prompt-size guard, cache, usage diagnostics, and SOW format. No automatic retries or schema changes.

= 0.2.67 =
* Set per-request Core AI Client HTTP timeouts to 60 seconds for AI Suggestions and 90 seconds for AI Statement of Work, without changing other plugins' timeout settings.
* Show a clearer message when provider requests time out while keeping the original provider error in administrator diagnostics. Hosting and proxy timeouts may still be shorter.
* Preserved existing prompts, token limits, caching and provider usage reporting; no database schema changes.

= 0.2.66 =
* Added administrator-only AI request diagnostics with provider/model, reported input/output/total tokens, prompt byte size and elapsed seconds (most recent 30 successful requests; only the past 30 days appear, with older entries pruned on subsequent requests).
* Added configurable, pre-flight 24,000-byte default maximum AI prompt size. Oversized requests are refused before contacting the provider; there are no token or cost guarantees.
* Preserved the existing 12-hour generated-content cache and refresh behavior. No schema changes or new provider credentials.

= 0.2.65 =
* Relabeled the frontend AI action buttons to "AI Suggestions" and "AI Statement of Work" without changing functionality.

= 0.2.64 =
* Migrated AI Suggestions and Statement of Work to WordPress 7.0+ Core AI Client using Settings > Connectors.
* Removed the plugin-managed OpenAI API key, model and temperature controls; legacy key is removed on upgrade rather than transferred.
* Updated provider-independent AI documentation and availability checks; retained existing project data, task permissions, and non-AI workflows.
* Minimum WordPress version increased from 6.2 to 7.0; no database schema changes.

= 0.2.63 =
* Enforced per-task edit permission checks for status changes, edits, deletes, and ordering.
* Restricted new task/category assignments and Project Builder submissions to editable categories.
* Corrected the WordPress.org readme short description length.
* No database schema changes.

= 0.2.62 =
* Rebranded as Undergroundact Project Planner (formerly B-Planner); plugin slug and translation domain updated.
* Preserved existing vsl_plan_* tables, betpp_* settings, shortcodes, and legacy SQL backup/restore support.
* No database schema changes.

= 0.2.61 =
* Reworked the Undergroundact Project Planner Admin Tools dashboard into a two-column tool-and-description table for clearer navigation.
* No database or schema changes.
