=== GrowthNation ===
Contributors: growthnation
Tags: GrowthNation, content, blog, scheduling, automation
Requires at least: 5.5
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.2.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Secure integration to create and publish blog posts from GrowthNation to your WordPress site.

== Description ==

GrowthNation provides a secure integration that allows you to create blog posts, as drafts or published, directly from the GrowthNation platform. Connect your site in seconds using a one-click pairing flow.

= Features =

- **One-Click Pairing**: Connect to GrowthNation seamlessly
- **Draft or Publish**: Create posts as drafts for review or publish them directly
- **Featured Images**: Automatically download and set featured images from URLs
- **Lightweight**: No external dependencies or complex libraries

= How it works =

1. Create a free account at [growthnation.ai](https://growthnation.ai)
2. Complete the onboarding and set up your first project
3. Install and activate this plugin on your WordPress site
4. Go to Settings > GrowthNation and click "Complete Connection"
5. Authorize the connection in the popup
6. Start creating and scheduling content from GrowthNation

== Requirements ==

- WordPress 5.5 or higher
- PHP 7.4 or higher
- A GrowthNation account ([sign up free](https://growthnation.ai))
- Administrator account

== Installation ==

1. Sign up for a GrowthNation account at [growthnation.ai](https://growthnation.ai) and complete the onboarding
2. Upload the `growthnation` folder to the `/wp-content/plugins/` directory, or install via the WordPress plugin directory
3. Activate the plugin through the 'Plugins' menu in WordPress
4. You will be automatically redirected to Settings > GrowthNation
5. Click "Complete Connection to GrowthNation" and authorize in the popup

== Security ==

- Token-based authentication: your WordPress password is never shared
- All input is sanitised before processing
- Featured images are validated and securely downloaded
- Only allows JPEG, PNG, GIF, and WebP image formats

== External Services ==

This plugin communicates with [GrowthNation](https://app.growthnation.ai).

- [Terms of Service](https://growthnation.ai/terms)
- [Privacy Policy](https://growthnation.ai/privacy)

== Frequently Asked Questions ==

= Do I need a GrowthNation account? =

Yes. Sign up for free at [growthnation.ai](https://growthnation.ai), complete the onboarding, then come back to connect the plugin.

= Is this plugin secure? =

Yes! The plugin uses token-based authentication with SHA-256 hashing. Your WordPress password is never shared with GrowthNation.

= How do I connect my site? =

After activating the plugin, go to Settings > GrowthNation and click "Complete Connection to GrowthNation". A popup will guide you through the pairing process.

= How do I disconnect? =

Go to Settings > GrowthNation and click "Disconnect". You will be asked to confirm before the connection is removed.

= Why can't I connect my WordPress.com site? =

If your WordPress.com site is set to "Private" visibility, it will block all external API access including GrowthNation. Go to Settings → Site Visibility in your WordPress.com dashboard and change your site to "Public" or "Hidden" (both allow API access). After changing visibility, return to Settings → GrowthNation and complete the connection again.

= What should I do if my connection code expired? =

Connection codes expire after 10 minutes for security. If you see an "expired code" message, simply close the popup window, return to Settings → GrowthNation in your WordPress admin, and click "Complete Connection" again to generate a fresh code.

= Can I use this with other plugins? =

Yes! This plugin has no external dependencies and won't conflict with other plugins.

= What permissions do I need? =

You need a WordPress Administrator account.

= Are posts published automatically? =

Only if you choose "Publish" in GrowthNation. You can also send posts as drafts and review them in WordPress before publishing.

= How does GrowthNation handle post categories? =

When publishing from GrowthNation, users can select a specific WordPress category for each article. If no category is selected, the post will be assigned to your WordPress default category.

To view or change your default category in WordPress:
1. Go to Settings → Writing
2. Find Default Post Category
3. Select your preferred default from the dropdown
4. Click Save Changes

= Can I include featured images? =

Yes! Simply include a featured image URL when creating posts from GrowthNation. The plugin will automatically download and set it as the featured image.

= Why am I seeing "A security plugin may be blocking GrowthNation"? =

Some WordPress security plugins block REST API access by default. If you're using AIOS (All-In-One Security), Wordfence, Sucuri, iThemes Security, or similar plugins, you may need to whitelist GrowthNation's endpoints.

**For AIOS (All-In-One Security):**
1. Go to WP Security → Firewall → PHP Rules → WP REST API
2. Disable "Disallow unauthorized REST requests" OR
3. Add an exception for the `growthnation` namespace

**For Wordfence:**
1. Go to Wordfence → Firewall → Manage Firewall
2. Add `/wp-json/growthnation/*` to the allowlist

**For other security plugins:**
Whitelist these endpoints in your firewall settings:
- `/wp-json/growthnation/v1/pair`
- `/wp-json/growthnation/v1/publish`

If you continue having issues, please contact hello@growthnation.ai

== Changelog ==

= 1.2.1 =
* Category selection when publishing from GrowthNation
* Improved connection status in admin settings
* Data access consent during connection setup

= 1.1.7 =
* Docs: FAQ for security plugin conflicts (AIOS, Wordfence, etc.)

= 1.1.5 =
* Docs: FAQ updates and semver support

= 1.1.4 =
* New: Featured image alt text support via `featured_image_alt` parameter

= 1.1.3 =
* New: One-click pairing: connect without entering WordPress credentials
* New: Publish or draft: `/post-blog` endpoint accepts a `status` field
* New: AJAX disconnect with confirmation dialog and spinner
* New: Public `/info` endpoint for plugin capability detection
* New: `plugin_version` included in `/test` response
* New: Settings shortcut on Plugins page

= 1.0.0 =
* Initial release
* REST API endpoints for connection testing and draft post creation
* Featured image support

== Support ==

For support, please contact us through [GrowthNation](https://growthnation.ai).
