=== Laposta API ===
Contributors: miix, fredklopper
Donate link: https://miix.dev
Tags: newsletter, email, laposta, api, marketing
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1.9
License: GPL-2.0+
License URI: http://www.gnu.org/licenses/gpl-2.0.txt

Common Laposta API management for WordPress plugins to interact with Laposta's email marketing services.

== Description ==

Laposta API provides a common framework for WordPress to interact with Laposta's email marketing services. This plugin serves as a foundation for other plugins to leverage Laposta functionality without duplicating API code.

**Features include:**

* Manage multiple Laposta API keys
* Test API connections through a diagnostic interface
* Access Laposta lists, fields, subscribers, campaigns, and webhooks
* WordPress REST API endpoints for all Laposta resources
* AJAX endpoints for easy integration in themes and plugins

This plugin doesn't provide front-end functionality on its own. It's designed to be a common base for other Laposta-related WordPress plugins.

= Available Resources =

* **Lists** - Manage your Laposta mailing lists
* **Fields** - Access and configure list field definitions
* **Subscribers** - Manage mailing list subscribers
* **Campaigns** - Access information about your email campaigns
* **Webhooks** - Configure and manage webhooks for list events

= Developer Features =

* Clean, well-documented code following WordPress coding standards
* Well-defined class structure for easy extension
* Comprehensive error handling

== Installation ==

1. Upload the `laposta-api` folder to the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Configure your Laposta API key(s) under the 'Laposta API' menu in WordPress admin
4. Use the diagnostic tool to verify your API connection

== Frequently Asked Questions ==

= Where do I find my Laposta API key? =

Log in to your Laposta account, go to Settings > API, and create or retrieve your API key.

= Is this an official Laposta plugin? =

No, this is an independent implementation created to simplify working with the Laposta API in WordPress.

= Can I use this plugin on its own? =

This plugin provides administration tools to manage API keys and test connections, but it doesn't provide front-end functionality. It's designed to be a foundation for other plugins.

= What PHP version is required? =

The plugin requires PHP 7.4 or higher.

== Screenshots ==

1. API settings page for managing Laposta API keys
2. Diagnostic tool for testing Laposta API connections

== Changelog ==

= 1.1.9 =
* Fix: Laposta_API_Fields::create() and update() sent their parameters wrapped in a field[...] object, which the Laposta API rejects ("Missing required parameter list_id"). Parameters are now sent flat, matching the list and webhook endpoints.
* Fix: Laposta_API_Fields::delete() reported failure on successful deletion — the Laposta API returns the deleted field object, not a success flag.

= 1.1.8 =
* Performance: cached the remote update check in a site transient (12h on success, 5min on failure) so plugins.php no longer blocks on a ~2s HTTP POST to miix.dev for every page load
* Removed verbose error_log output from the updater

= 1.1.7 =
* Tested up to 7.0

= 1.1.6 =
* Added get_by_email() method to Subscribers class for finding subscribers by email address

= 1.1.5 =
* Added get_name_by_id() method to Lists class for retrieving list names by ID
* Enhanced Campaigns get_all() method with optional $format parameter to return raw API data
* Fixed issue where campaign dates were being localized causing parsing issues in automation plugins

= 1.1.4 =
* Improved plugin page links consistency
* Added Dutch translation for plugin site link

= 1.1.3 =
* Fixed update check mechanism to always include license key parameter
* Improved compatibility with remote license server

= 1.1.2 =
* Added settings link to plugins page for easier access

= 1.1.1 =
* Bug fixes

= 1.1.0 =
* Added support for licenses and updates

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 1.0.0 =
Initial release of the Laposta API plugin

== Developer Notes ==

This plugin follows WordPress coding standards and includes:

* Class-based structure for all functionality
* REST API endpoints for all Laposta resources
* Well-documented code with PHPDoc comments
* Proper sanitization and data validation
* Internationalization support

If you're developing with this plugin, see the CLAUDE.md file for detailed development guidelines.