=== CalendarDrop ===
Contributors: thejoshpenner
Tags: events, calendar, ai, import, flyer
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 1.3.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Turn flyers, PDFs, Word documents, and forwarded email text into draft events. Use your own AI key or optional CalendarDrop processing.

== Description ==

CalendarDrop takes the busywork out of building an events calendar. Upload a flyer, PDF, or Word document, or connect an inbound-email service to forward email text through the authenticated webhook. CalendarDrop reads the date, time, venue, and description and writes them up as a draft event for you to review.

The free plugin works through your own AI provider key (Bring Your Own Key). You pick the provider, enter your key, and pay that provider directly. All existing BYO features remain available. An optional CalendarDrop service connection provides a separate processing mode with an event allowance. Review current service availability and terms in your CalendarDrop account before using it. Installing or connecting this plugin does not start a paid subscription.

**What it does**

* Reads event details from flyer images, PDFs, Microsoft Word (.docx) document-body text, and email text received through the authenticated webhook.
* Creates events as drafts so you always review them before anything is published. Nothing goes live on its own.
* Works with The Events Calendar when it is active: your imports land as native events you can open and edit there. The Events Calendar is a separate plugin by StellarWP and is not required.
* Works independently: if you do not use an event plugin, CalendarDrop creates standard WordPress draft posts carrying the event details, so it runs on any WordPress site.
* Forward emails to import: use an inbound webhook service (like Mailgun or Postmark) to route forwarded emails to your site, and CalendarDrop reads them and drafts the event automatically.
* A customizable public or private dropzone (off by default) that lets people you trust submit a flyer without a WordPress login, matched to your site with custom colors, fonts, and a logo.
* Per-upload categories: assign a category to an upload and every event from it is filed under that category, so you can drive separate, filtered calendar views.
* Duplicate handling: ignore a match, flag it as a new draft for review, or merge details into an existing draft. Merge mode leaves published and other non-draft events unchanged and reports that the duplicate needs review.
* Pulls a featured image from the flyer when one is available.
* In BYO mode, a built-in AI diagnostic assistant that helps you check your connection and troubleshoot setup in plain language.

Word imports read the main document text. They do not read embedded images, headers, or footers; export designed Word flyers as PDF. Native PDF processing sends the complete PDF in subscription or Gemini mode. Other BYO providers can use complete browser-extracted PDF text; scanned PDFs require a native-PDF provider. A first-page thumbnail is never substituted for the document.

**Choose your AI provider (Bring Your Own Key)**

* OpenAI and OpenAI-compatible chat endpoints (including Azure OpenAI and local/self-hosted endpoints)
* Google Gemini (native API)
* Anthropic Claude (native API)

The site administrator chooses the provider, enters their own API key, selects a model, and clicks Test Connection. Keys are stored in your site's own WordPress options database, on your own server.

== Third-Party Services / Privacy ==

**Using your own AI key.** File and authenticated email/webhook imports, connection tests, diagnostics and AI edits send relevant content or prompts to your chosen provider. This may include event text, images, complete PDFs or extracted PDF/Word text. Your key stays in your WordPress database and is sent only to your configured provider, never to CalendarDrop.

**Optional CalendarDrop processing.** Opening **CalendarDrop > Subscription** sends your site URL to https://calendardrop.pennerstrategy.com, operated by Joshua Penner, for status and plans. Connecting sends your connection code or license key and stores a private site token for account checks. Connecting does not change your processing mode.

When you select subscription mode, imports send submitted text, images, complete PDFs or Word document-body text, plus your site URL, timezone and date/time, to CalendarDrop. The service forwards the material to Google Gemini to extract event details. It uses its own AI key.

**Payments.** Polar receives account email, customer identity and license/site details for checkout, billing and license verification. Card details are handled by Polar, not this plugin. [Polar privacy](https://polar.sh/legal/privacy-policy).

**Storage.** Your site retains uploads, drafts and import records; recovery records have no automatic cleanup. CalendarDrop retains account, usage and billing records, plus extracted results for recovery. See the [data-use and retention policy](https://calendardrop.pennerstrategy.com/privacy) and [service terms](https://calendardrop.pennerstrategy.com/terms).

Supported providers and their terms:

* OpenAI: https://openai.com: Terms: https://openai.com/policies/terms-of-use: Privacy: https://openai.com/policies/privacy-policy
* Google Gemini: https://ai.google.dev: Terms: https://ai.google.dev/gemini-api/terms: Privacy: https://policies.google.com/privacy
* Anthropic Claude: https://www.anthropic.com: Terms: https://www.anthropic.com/legal/consumer-terms: Privacy: https://www.anthropic.com/legal/privacy

**Google Places (optional).** If you supply your own Google Maps API key and an event has a venue name, CalendarDrop sends that venue/location name to the Google Places API to look up address details. Nothing is sent to Google Places unless you have configured a Google Maps key. Google Terms: https://cloud.google.com/maps-platform/terms: Privacy: https://policies.google.com/privacy

== Installation ==

1. Upload the `calendardrop` folder to `/wp-content/plugins/`, or upload the zip directly from Plugins > Add New > Upload Plugin.
2. Activate CalendarDrop through the Plugins menu.
3. Open **CalendarDrop** in the WordPress admin menu.
4. Choose your AI provider, enter your API key, pick a model, and click **Test Connection**. To use the optional CalendarDrop service, open **CalendarDrop > Subscription**, review service availability, connect the site, and explicitly select subscription mode instead.
5. Optional: install and activate The Events Calendar so imports become native calendar events. Without it, CalendarDrop creates standard draft posts instead.

== Frequently Asked Questions ==

= Can an AI assistant or another app send events to CalendarDrop? =

Yes. A site owner can configure an integration to send event text to the existing authenticated WordPress webhook. CalendarDrop uses the site's selected processing mode and creates drafts for review. Copy the Webhook Target URL from CalendarDrop > Settings > Advanced Integrations and store the webhook secret privately in your integration. The guide covers the exact request, limits, per-event results, duplicates and recovery. It does not require an AI assistant, and it does not provide a separate hosted extraction API.

[Setup and integration guide](https://calendardrop.pennerstrategy.com/integrations) | [Plain-text reference](https://calendardrop.pennerstrategy.com/integrations.md)

= Can CalendarDrop connect directly to Google Calendar or Outlook? =

The native destination is The Events Calendar, with ordinary WordPress draft posts as the fallback. For ordinary posts with event details, CalendarDrop includes an Add to Google Calendar link. Its per-event iCalendar export is restricted to public, unprotected posts and events. These are manual add/export features. CalendarDrop does not connect a Google or Outlook account, continuously synchronize calendars, or create drafts in other WordPress calendar plugins.

= Do I need an AI provider API key? =

BYO mode requires your own provider key. The optional CalendarDrop service uses its own provider credential, so you do not need a separate AI provider key for subscription processing. You must connect a site account, select subscription mode, and have an available allowance. Review current service availability in your account.

= Which AI providers are supported? =

OpenAI (and OpenAI-compatible endpoints such as Azure OpenAI and local/self-hosted endpoints), Google Gemini, and Anthropic Claude. You choose one, supply your own key, and select a model.

= Does it require The Events Calendar? =

No. CalendarDrop works best with The Events Calendar active, where imports become native events. If that plugin is not installed, CalendarDrop falls back to creating standard WordPress draft posts that carry the event details, so it runs on any site.

= Are events published automatically? =

No. Everything CalendarDrop creates is a draft. You review and publish each event yourself. Email and webhook imports are forced to draft status as well.

= What does CalendarDrop automate? =

CalendarDrop extracts event details and creates drafts from submitted files and authenticated email/webhook text. Subscription mode also has an event-text form. It does not monitor websites or poll calendar feeds. Review and publish each draft yourself. Pending subscription credit confirmations can retry in the background without repeating extraction.

= How does the public dropzone work? =

CalendarDrop can expose a public dropzone where someone can submit a flyer without logging in. It is off by default. When you enable it, the link is protected by a secret, uploads are rate-limited and validated server-side, and every submission still becomes a draft for your review.

= How do I set up email or webhook forwarding? =

CalendarDrop provides a secret-authenticated REST webhook URL on the Advanced Integrations tab. Point your inbound-email service at that URL (for example Postmark, Mailgun, or a SendGrid-style inbound parse) so forwarded emails POST to it. CalendarDrop reads the email body, drafts the event, and logs the result. Email forwarding requires a separately configured inbound-email service, which may charge its own fees. CalendarDrop does not provide an email inbox. Subscription mode has a separate event-text form that creates drafts for review. File uploads do not require an inbound-email service.

= How do categories work? =

You can assign a category to an upload. Every event imported from that upload is automatically filed under that category, which lets you build separate, filtered calendar views.

= Is it really free? =

Yes. The existing BYO plugin features remain free. You pay your chosen provider for its usage. The CalendarDrop service is optional and has its own allowance and billing. A CalendarDrop subscription is not required for BYO features.

= Where can I ask a question or share feedback? =

For CalendarDrop questions, bug reports, or feedback, email josh@pennerstrategy.com. Include your WordPress and CalendarDrop versions and a short description of what happened.

= Where is my API key stored, and is it sent to you? =

Your BYO provider key lives in your site's WordPress options database. It is sent only to the AI provider you configure, never to the CalendarDrop subscription service. Subscription mode stores a separate private site token for requests to its configured service.

Deleting the plugin removes local subscription credentials and job records. It does not cancel a service subscription or release unresolved service reservations. Resolve pending imports and manage billing from the service account before removing the plugin.

== Changelog ==

= 1.3.1 =
* Add a public setup and authenticated webhook reference for site owners, integrations and AI assistants.
* Clarify supported calendar destinations, manual exports and the absence of automatic calendar synchronization.
* Correct stale scheduled-feed wording. Website monitoring and feed polling are not supported.

= 1.3.0 =
* Keep complete native PDF bytes, reject preview-only PDF imports, bound expanded Word XML, and show clear repeated/empty import results.
* Remove local subscription secrets and receipts on plugin deletion.
* Add an optional CalendarDrop service connection with a private site token, draft-based credits, and pending settlement recovery. Service availability and purchases are managed separately in the CalendarDrop account.
* Preserve direct AI provider mode and draft review requirements.


= 1.2.4 =
* Require editorial review for all imports, including sites with an older automatic-publish setting.
* Keep published and other non-draft events unchanged when a duplicate import requests a merge.
* Clarify supported imports and duplicate-review behavior.

= 1.2.3 =
* Correct the description and upload error messages to match the supported file-upload and authenticated email/webhook import paths.
* Clarify the separate inbound-email service requirement and the absence of a paste-text import screen.

= 1.2.2 =
* Prevent calendar-property injection by escaping all newline forms in exported event text at output.

= 1.2.1 =
* Prevent public calendar exports from disclosing draft, private, pending, scheduled, trashed, or password-protected event content.
* Reject malformed export IDs and verify post visibility before reading event data.
* Update compatibility metadata after local WordPress 7.1 activation and calendar-export regression checks.

= 1.2.0 =
* Enqueue all scripts/styles per WordPress.org guidelines.

= 1.1.9 =
* Removed the website-import reader so the plugin only processes flyers, PDFs, Word documents, and forwarded email/webhook text.

= 1.1.8 =
* Events now pull a featured image from the flyer (image files and PDF page 1).
* Added the built-in AI diagnostic assistant with formatted, plain-language responses.
* Added per-upload categories for filtered calendar views.
* All assets are now bundled locally (no external CDN or font requests); public credit attribution defaults to off.
* Hardened the public upload and email/webhook paths (rate limiting, server-side validation, secret authentication).
