=== Postomatic ===
Contributors: buildomatics
Tags: ai content generator, blog post generator, autopilot, woocommerce, seo
Requires at least: 5.8
Tested up to: 7.1
Stable tag: 1.2.75
Requires PHP: 7.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

AI-powered blog post generator with AutoPilot scheduling and automatic WooCommerce/EDD/SureCart product content. SEO-ready, free credits included.

== Description ==

**Postomatic writes SEO-ready blog posts for you, in one click or on a set schedule.**

Set a title or topic, choose a language, tone, and category, and let Postomatic's AI write a complete, structured, SEO-optimized post - automatically filled in for Yoast SEO, Rank Math, All in One SEO, SEOPress, The SEO Framework, and WP Meta SEO. Save time on content creation while keeping full editorial control: every post is saved as a draft first, so you can review before it goes live.

= Two ways to create content =

**Instant Generation** - Open "Add Post", enter a title or topic, pick your settings, and click Generate. Your post is ready in the time it takes to get a coffee.

**AutoPilot** - Set it up once and let Postomatic keep publishing on autopilot: choose a frequency (daily, weekly, bi-weekly, or monthly), a number of posts per run, a credit budget, and Postomatic takes care of the rest. Perfect for blogs and stores that want a steady stream of fresh content without daily manual work.

= Sell more with AI-written product content =

Running a store? Postomatic automatically detects **WooCommerce**, **Easy Digital Downloads**, or **SureCart** on your site - no configuration needed - and lets you generate content built specifically to sell:

* **Product Promotion** - a focused article about one product, pulling in its real name, price, description, and images.
* **Product Comparison** - compare up to 3 products side by side in a single, well-structured post.

= Everything you can control =

* **Content Goal** - Single post, Bulk posts (PRO), or Boost Product Sales (PRO)
* **Language** - write in the language your audience reads
* **Category** - pick manually or let AI auto-select the best fit
* **Voice / Speaker** - neutral, personal ("I"), team ("We"), direct ("You"), third-person, brand voice, or narrative/storytelling
* **Content Tone** - conversational, professional, academic, technical, persuasive, storytelling, or humorous
* **Content Length** - brief, standard, detailed, or comprehensive
* **Featured Image** - AI-generated (PRO) or your own custom upload
* **In-Body Images** - attach and describe your own images for the AI to place inside the article
* **Comments, Author, and Publish Status** - open/closed comments, choose the WordPress author, publish immediately or save as a draft

= Built to stay out of your way =

* Runs as a normal WordPress admin screen - no page builder or theme changes required
* Generated posts always start as a **draft**, so nothing goes live without your review
* Floating credit tracker keeps your available balance visible while you work
* Low-credit warnings before AutoPilot tasks run out of budget
* One-time credit purchases - no forced recurring subscription to get started

== Installation ==

1. Go to your WordPress dashboard, click on **Plugins > Add New**, search for "Postomatic", and click **Install Now**.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Open the new **Postomatic** menu in your WordPress admin sidebar.
4. Follow the on-screen setup to connect your site - this happens automatically the first time you open the plugin.
5. Start generating content with your free credits.

Note: This plugin requires an outbound connection to the Postomatic API to generate content. Your hosting environment must be able to make outbound HTTPS requests (true for virtually all standard hosting; local-only environments without a public URL are not supported).

== Requirements ==

* WordPress 5.8 or higher (tested up to WordPress 7.1)
* PHP 7.4 or higher (PHP 8.0+ recommended for optimal performance)
* Ability to make outbound HTTPS requests to external APIs
* A publicly reachable site (not required for pure `localhost`/offline development environments)
* Modern web browser (Chrome, Firefox, Safari, Edge) with JavaScript enabled
* Sufficient server memory (minimum 128MB PHP memory limit recommended)
* Optional: WooCommerce, Easy Digital Downloads, or SureCart if you want to use "Boost Product Sales"

== Screenshots ==

1. The Postomatic menu appears in your WordPress admin sidebar right after activation, alongside your credit balance and current plan.
2. The post generator: pick a content goal, enter a title, choose language/category/voice, then generate - with your recent posts listed right below.

== Features ==

* **AI-Powered Content Creation** - Generates complete, structured blog posts from just a title or topic.
* **AutoPilot Scheduling** - Set a frequency and post count once, and Postomatic keeps publishing new content on that schedule.
* **Automatic Store Detection for Product Content** - Detects WooCommerce, Easy Digital Downloads, or SureCart automatically; no setup needed to start writing product-focused content.
* **Product Promotion & Product Comparison** - Generate single-product sales copy or side-by-side comparisons of up to 3 products, with real prices, descriptions, and images pulled in automatically.
* **Built-in SEO Plugin Integration** - Automatically fills the SEO title, meta description, and focus/secondary keywords for Yoast SEO, Rank Math, All in One SEO, SEOPress, The SEO Framework, and WP Meta SEO - whichever you already have installed.
* **Multi-Language Content** - Generate posts directly in the language your readers use.
* **Voice & Tone Controls** - Choose who's "speaking" (personal, team, direct, brand, narrative) and the overall tone (conversational, professional, academic, technical, persuasive, humorous, storytelling).
* **Flexible Content Length** - From a brief 600+ word post to a comprehensive 2,500+ word deep dive.
* **Featured & In-Body Images** - Upload your own images for the featured spot and for placement inside the article body, each with its own description.
* **Draft-First Safety** - Every generated post is created as a draft (or published immediately, your choice) so you always review before publishing.
* **Free + Pay-As-You-Go Credits** - Start with free credits, then top up with one-time credit purchases or a plan - no forced recurring subscription.
* **Low-Credit Protection** - Get warned in the admin bar and before AutoPilot runs if your balance won't cover the next batch of posts.
* **Full Admin Panel Control** - Manage credits, plans, support tickets, and every generated post directly from the WordPress admin, without leaving your dashboard.

== Usage ==

= Instant Generation =

1. Open **Postomatic > Add Post** in your WordPress admin sidebar.
2. Choose your Content Goal: Single Title, Bulk Titles (PRO), or Boost Product Sales (PRO).
3. Enter your title/topic, then set language, category, voice, tone, and any images you want included.
4. Click **Generate Post**. Your new post appears as a draft, ready to review, tweak, and publish.

= AutoPilot (hands-off publishing) =

1. Open **Postomatic > AutoPilot**.
2. Choose "Boost Product Sales" or "SEO-Focused Content" as your goal.
3. Walk through the short setup wizard: goal details/keywords, budget, and publishing frequency.
4. Review the summary and create the task - Postomatic will keep generating and publishing on that schedule until you pause or delete it.

= Managing Credits and Plans =

1. Check your remaining credits anytime from the Postomatic dashboard or the floating credit tracker.
2. When credits run low, either purchase more credits or upgrade to a paid plan for a larger allotment and additional features.
3. Credit purchases and plans are one-time payments - no recurring billing surprises.

= Best Practices =

* Always review generated drafts before publishing - treat the AI as a strong first draft, not a final copy.
* Add your own images and internal links to strengthen the post.
* Use the Voice and Tone controls to keep content consistent with your brand.
* For product content, make sure your product has a clear name, description, and image set in WooCommerce/EDD/SureCart first - the AI writes from what's already there.
* For AutoPilot, start with a conservative frequency and post count until you're happy with the output quality, then scale up.

== External Service Notice ==

This plugin relies on an external service to function:

**Service Name**: Postomatic Content Generator by Buildomatics
**Service URL**: https://buildomatics.com/pages/postomatic/documentation
**Terms of Service**: https://buildomatics.com/pages/postomatic/agreement
**Privacy Policy**: https://buildomatics.com/pages/postomatic/privacy

The plugin connects to Postomatic's API when you generate content, purchase credits, activate plans, or request support. Only essential data (Such as your WordPress site URL, initialization token, admin email, and site name) is transmitted during these operations and only when initiated by you.

The plugin will not function without this connection. By using the plugin, you acknowledge and accept these external connections.

== Legal Information ==

* **Plugin Modification Disclaimer**: You are free to modify Postomatic under the terms of the GPL license. However, we cannot provide support or guarantee compatibility for modified versions of the plugin.
* **Hosting and Server Responsibility**: Users are responsible for ensuring their hosting environment is secure, up-to-date, and compatible with Postomatic. We are not responsible for any site issues resulting from misconfiguration or outdated environments.
* **AI Content Disclaimer**: The content generated by Postomatic is produced using AI models trained on publicly available data. We do not guarantee that the generated content is original or free from third-party copyright claims. Users are solely responsible for reviewing and editing all generated content before publishing.
* **External API Usage**: This plugin connects to the external Postomatic API (https://buildomatics.com/v1) to perform tasks such as post generation, subscription management, and credit tracking. Only the necessary data is transmitted and only when you initiate actions that require it.
* **Privacy and Data Protection**: We collect and process only the information necessary to operate the plugin and connect with your account. For details, please see our full Privacy Policy at: https://postomatic.com/privacy

== Frequently Asked Questions ==

= Does this plugin work without an external service? =
No. Postomatic requires a connection to the Postomatic API to generate content, manage plans, and perform key functions. This API connection is required and is clearly explained above.

= What are the payment options for Postomatic? =
Postomatic offers a free tier with free starter credits. After that, you can either purchase credits to continue using the free plan or upgrade to one of our paid plans. All paid plans are one-time payments with no recurring fees and include lifetime access to features and updates while Postomatic remains under active development.

= How does post generation work? =
Postomatic uses AI technology to generate blog posts based on your preferences. You can specify the title/topic, language, category, voice, tone, and length, plus any images you want included. The generated content is SEO-optimized and, if you have a supported SEO plugin installed, its title/description/keyword fields are filled in automatically.

= What is AutoPilot? =
AutoPilot lets you configure a content plan once - a topic/goal, a publishing frequency, and a credit budget - and Postomatic will keep generating and publishing new posts on that schedule without any further manual steps, until you pause or delete the task.

= Can Postomatic write content about my store's products? =
Yes. If your store runs on WooCommerce, Easy Digital Downloads, or SureCart, Postomatic detects it automatically and lets you generate a "Product Promotion" post about a single product, or a "Product Comparison" post about up to 3 products, both pulling in real product data (name, price, description, images).

= Can I review posts before they go live? =
Yes. You can choose to save generated posts as drafts, which allows you to review, edit, and add images before publishing. You can also schedule posts for future publishing dates.

= What information is shared with the Postomatic API? =
Only essential data like your WordPress site URL and initialization token is transmitted to the API, and only when you initiate actions like generating content, purchasing credits, or requesting support.

= Is the generated content unique and free from copyright issues? =
The content is generated using AI models trained on publicly available data. While the content is typically unique, we cannot guarantee it is free from third-party copyright claims. Users are responsible for reviewing and editing all generated content before publishing.

= How do I get support for Postomatic? =
Support is available through the WordPress admin panel (Postomatic > Support) or via your Postomatic account dashboard.


== Changelog ==

= 1.2.75 =
* Fixed: The "Important Notice" banner on the Buy Credit and Subscription screens no longer asks you to upgrade once you are on the highest available plan; notices that are not upgrade offers (such as renewal reminders) still appear

= 1.2.74 =
* Security: Activation now stages new credentials and only applies them after the site confirms ownership through the callback handshake, instead of applying them immediately
* Security: The callback handshake now verifies the activation code with a constant-time comparison and rejects any code it did not generate itself; each code is single-use and expires after 30 minutes
* Security: Activation codes and connection secrets are now generated with a cryptographically secure random source
* Security: Removed anonymous-access AJAX registrations from the support ticket and title-search handlers; every admin AJAX action now checks the user's capability, not just a nonce
* Security: The connection secret comparison in the callback handshake now uses a constant-time check
* Security: The site's connection key is no longer printed into admin page HTML; the blog-sync and agreement pages now call the API through the server instead of from the browser
* Improved: Connection renewal after an expired key now returns in about a second instead of blocking for 10-30 seconds, and no longer runs two renewals in parallel
* Improved: Pricing plan and credit package lookups are now cached for a few minutes instead of being fetched from the API on every page load
* Added: Cancelled posts can now be sent back into the queue individually or all at once from the Recent Posts list (regenerating a post spends credits again, since cancelling refunds them)
* Added: The "Upgrade Plan" prompt is now hidden once you are on the highest available plan
* Improved: API requests now handle rate-limit responses with a proper wait message instead of treating them as a failure or an invalid connection
* Improved: Generated posts now retain more of the data sent by the AI (excerpt, slug, multiple categories, alt text on images, social/Open Graph SEO fields) and no longer drop a post's category, tags, or comment settings under certain payloads
* Fixed: A returning payment confirmation page reloaded that no longer double-applies credits/plan; a repeat visit is now shown as already completed instead of an error

= 1.2.73 =
* Fixed: Removed emoji and other 4-byte Unicode characters from readme.txt/README.md that could make WordPress's update-check silently fail to store the new version on sites whose database still uses the older utf8 (non-utf8mb4) charset, leaving the Plugins list stuck on an old version number

= 1.2.72 =
* Added: Quick-access "Add Post", "AutoPilot", and "Buy Credits" links on the WordPress Plugins list screen, plus "Documentation" and "Support" links
* Improved: Rewrote the plugin description and full WordPress.org listing (features, usage, FAQ) to cover AutoPilot and the WooCommerce/Easy Digital Downloads/SureCart product content support added in 1.2.70

= 1.2.71 =
* Updated: Confirmed compatibility and marked "Tested up to" WordPress 7.1 (removes the "not tested with your current version of WordPress" warning)
* Updated: Minimum required PHP raised from 5.6 to 7.4 to match what the plugin's codebase already required and what WordPress core itself now requires

= 1.2.70 =
* Added: "Boost Product Sales" content goal now automatically detects and supports WooCommerce, Easy Digital Downloads, and SureCart (previously WooCommerce only)
* Added: Required "Goal Description" and "Keywords" fields for product-focused posts on the main post generator, matching AutoPilot
* Fixed: Product lookup no longer treats an unrelated "product" post type from other plugins/themes as a store product when no supported e-commerce plugin is active
* Fixed: Post creation could leave WordPress's own content sanitization filters disabled for the rest of the request after a successful save

= 1.2.69 =
* Fixed: Plugin shipped a malformed "languages " directory (trailing space) that could not be used for translations
* Fixed: Missing Text Domain and Domain Path headers, so translations were never loaded
* Maintenance: Re-issued release to correct the version advertised to sites

= 1.2.68 =
* Fixed: Checkboxes and radio buttons showed only a coloured box and a focus glow when selected, with no visible tick or dot
* Fixed: Generated posts were sometimes saved with no author; the selected author is now always resolved to a real user
* Fixed: Duplicate "Version" line in the plugin header that left the PHP requirement undeclared
* Improved: Checkbox and radio styling consolidated into a single stylesheet loaded on every plugin screen

= 1.2.67 =
* Maintenance: Version bump for release packaging. No functional changes.

= 1.2.63 =
* Improved: Localhost restriction screen now clearly explains that Postomatic requires an internet-accessible server to connect to the AI service, with bullet points listing what fails on localhost and a tip for developers using tunnel tools

= 1.2.62 =
* Fixed: Autopilot credit check now validates total credits needed (budget x post count) instead of per-post budget only
* Fixed: Autopilot creation now shows a clear low-credit warning dialog before submitting when balance is insufficient
* Fixed: API error messages containing internal batch-counter suffixes (e.g. "3:3") are now cleaned before display
* Improved: Admin notice shown on all Postomatic pages when credit balance drops below 10
* Improved: Autopilot task cards now show status pill (Active / Low Credits), a credit warning banner, author, and next run date
* Improved: Credit notice transient refreshed on every credit fetch to stay accurate

= 1.2.61 =
* Fixed: Autopilot credit check now validates total credits needed (budget x post count) instead of per-post budget only
* Fixed: Autopilot creation now shows a clear low-credit warning dialog before submitting when balance is insufficient
* Fixed: API error messages containing internal batch-counter suffixes (e.g. "3:3") are now cleaned before display
* Improved: Admin notice shown on all Postomatic pages when credit balance drops below 10
* Improved: Autopilot task cards now show status pill (Active / Low Credits), a credit warning banner, author, and next run date
* Improved: Credit notice transient refreshed on every credit fetch to stay accurate

= 1.2.55 =
* Fixed: 401 auto-recovery mechanism was not working (handler was never loaded)
* Fixed: API error messages now display correctly instead of generic fallback text
* Fixed: Post deletion failure is now surfaced to the user instead of silently ignored
* Fixed: Support ticket modal shows a proper error state on failure
* Fixed: Duplicate AJAX hook registrations for delete-post and blog-analyzer handlers
* Improved: Floating credit tracker no longer overflows on small screens
* Improved: Post details popup adapts to viewport width on mobile/tablet
* Improved: Setting-group grid no longer causes horizontal overflow
* Dev: Added WordPress Coding Standards tooling (PHPCS + WPCS 3.3)
* Dev: Codebase passes WPCS with zero errors

= 1.2.54 =
* Minor fixes and improvements

= 1.2.1 =
* Minor fixes

= 1.2.0 =
* Added improved screenshot images for WordPress.org plugin directory
* Enhanced UI for better user experience
* Improved API connection stability
* Added more detailed error messages for troubleshooting
* Updated compatibility with latest WordPress version (6.8)
* Performance optimizations for faster post generation

= 1.1.1 =
* Updated screenshots for better plugin representation
* Fixed minor UI issues in the admin dashboard

= 1.0.5 =
* Added support for WordPress 6.8
* Improved compatibility with PHP 8.0+

= 1.0.4 =
* Fixed compatibility issues with some themes
* Improved mobile responsiveness of the admin interface

= 1.0.3 =
* Fixed UI issues in the admin panel
* Enhanced error handling for API connections

= 1.0.2 =
* Fixed minor bugs
* Improved performance of post generation

= 1.0.1 =
* Fixed initial setup issues
* Improved activation process

= 1.0.0 =
* Initial release
* Basic AI-powered post generation functionality
* Free credits system
* Admin dashboard interface

== Upgrade Notice ==

= 1.2.75 =
Removes the leftover "upgrade your plan" notice for users who are already on the highest plan. Cosmetic only; update at your convenience.

= 1.2.74 =
Important security hardening for the activation/connection process, plus a new way to regenerate cancelled posts. Recommended for all users.

= 1.2.73 =
Fixes a bug where the Plugins list could get stuck showing an old version number on some database configurations. Recommended for everyone who saw a stale version number on the Plugins page.

= 1.2.72 =
Adds quick-access links (Add Post, AutoPilot, Buy Credits, Support) on the Plugins page and refreshes the plugin listing to reflect AutoPilot and multi-platform product content.

= 1.2.71 =
Confirms compatibility with WordPress 7.1 and clarifies the real minimum PHP version (7.4). Recommended for all users, especially if you saw a "not tested with your current version of WordPress" warning.

= 1.2.70 =
Boost Product Sales now works with WooCommerce, Easy Digital Downloads, or SureCart, and includes two new required fields to improve content quality. Recommended for all users.

= 1.2.69 =
Corrects the version advertised to sites, and fixes the plugin's translation directory and text domain headers.

= 1.2.68 =
Fixes checkboxes and radio buttons not showing a tick when selected, and posts occasionally being saved without an author. Recommended for all users.
