=== Aelia Foundation Classes for Easy Digital Downloads ===
Contributors: daigo75, aelia
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=F8ND89AA8B8QJ
Tags: easy digital downloads, utility
Requires at least: 4.0
Tested up to: 5.7
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Adds a set of convenience classes that can simplify the development of other plugins for Easy Digital Downloads.

== Description ==
The Aelia Foundation Classes add several classes that can simplify the development of plugins for Easy Digital Downloads. Some of the available classes are listed below.

**Namespace `Aelia\EDD`**

* `IP2Location`. Implements methods to determine visitor's country. Library relies on MaxMind GeoLite2 library.
* `Order`. An extended Order class, which includes methods to retrieve attributes of orders generated in multi-currency setups.
* `Settings`. Allows to manage the settings of a plugin. The class does not rely on Easy Digital Downloads Settings API.
* `Settings_Renderer`. Allows to render the settings interface for a plugin. The can automatically render a tabbed interface, using jQuery UI.
* `Logger`. A convenience Logger class.
* `Aelia_Plugin`. A base plugin class, which other plugins can extend. The class implements convenience methods to access plugin settings, Easy Digital Downloads settings, common paths and URLs, and automatically load CSS and JavaScript files when needed.
* `Semaphore`. Implements a simple semaphore logic, which can be used to prevent race conditions in operations that cannot run concurrently.

**Global namespace**

* Aelia_EDD_RequirementsChecks. Implements the logic to use for requirement checking. When requirements are not met, a message is displayed to the site administrators and the plugin doesn't run. Everything is handled gracefully, and displayed messages are clear also to non-technical users.

This product includes GeoLite2 data created by MaxMind, available from
[http://www.maxmind.com](http://www.maxmind.com).

##Requirements
* WordPress 4.0 or later.
* PHP 7.0 or later.
* Easy Digital Downloads 1.9.6 or later

## Notes
* This plugin is provided as-is, and it's not automatically covered by free support. See FAQ for more details.

== Frequently Asked Questions ==

= What plugins used this library? =

Most of our free and premium plugins use this library. We released it to the public as many of our customers and collaborators expressed interest in using it.

= What is the support policy for this plugin? =

As indicated in the Description section, we offer this plugin **free of charge**, but we cannot afford to also provide free, direct support for it as we do for our paid products.
Should you encounter any difficulties with this plugin, and need support, you have several options:

1. **[Contact us](https://aelia.co/contact) to report the issue**, and we will look into it as soon as possible. This option is **free of charge**, and it's offered on a best effort basis. Please note that we won't be able to offer hands-on troubleshooting on issues related to a specific site, such as incompatibilities with a specific environment or 3rd party plugins.
2. **If you need urgent support**, you can avail of our standard paid support. As part of paid support, you will receive direct assistance from our team, who will troubleshoot your site and help you to make it work smoothly. We can also help you with installation, customisation and development of new features.

= I have a question unrelated to support, where can I ask it? =

Should you have any question about this product, please feel free to [contact us](https://aelia.co/contact). We will deal with each enquiry as soon as possible.

== Installation ==

1. Extract the zip file and drop the contents in the ``wp-content/plugins/`` directory of your WordPress installation.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Done. No further configuration is required.

For more information about installation and management of plugins, please refer to [WordPress documentation](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins).

== Changelog ==

= 2.0.8.210310 =
* Updated GeoIP database.

= 2.0.7.201207 =
* Updated GeoIP database.

= 2.0.6.201008 =
* Updated GeoIP database.

= 2.0.5.200716 =
* Fix - Fixed auto-update logic for premium plugins.
* Updated GeoIP database.

= 2.0.4.200603 =
* Updated GeoIP database.

= 2.0.3.200330 =
* Tweak - Improved error handling during automatic updates of premium plugins.
* Tweak - Improved Session Manager class. Added logic to set secure cookies automatically and added filters for 3rd party integrations.

= 2.0.2.190613 =
* Tweak - Improved error handling during deactivation of a premium licence.
* Fix - Fixed URL to settings page on WordPress > Plugins page.

= 2.0.1.190510 =
* Updated GeoIP database.

= 2.0.0.190104 =
* Feature - Added automatic updates logic for free and premium plugins.

= 1.6.17.200226 =
* Updated GeoIP database.

= 1.6.16.191231 =
* Updated GeoIP database.

= 1.6.15.191213 =
* Updated GeoIP database.

= 1.6.14.190923 =
* Updated GeoIP database.

= 1.6.13.190722 =
* Updated GeoIP database.

= 1.6.12.190607 =
* Added filter `edd_aelia_afc_session_set_cookie`, to allow 3rd parties to alter cookies before they are set.
* Updated GeoIP database.

= 1.6.11.190510 =
* Updated GeoIP database.

= 1.6.10.190328 =
* Updated GeoIP database.

= 1.6.9.181212 =
* Tweak - Removed unnecessary calls to `register_activation_hook` and `register_uninstall_hook`.

= 1.6.8.180325 =
* Tweak - Improved logger.

= 1.6.7.170116 =
* Tweak - Optimized logic used to load order meta in order currency.
* Tweak - Added caching of EDD_Payment instances.

= 1.6.6.170106 =
* Tweak - Added checks to prevent warnings when a session property is being set, but the session has not been initialised.
* Bug fix - Fixed check for EDD_VERSION constant.

= 1.6.5.160513 =
* Fixed minor issue in the SQL for the creation of `aelia_dismissed_messages` table. The CREATE TABLE statement contained a field set as NULLable as part of the primary key, and this could cause an error in some MySQL configurations.

= 1.6.4.160209 =
* Added function `aelia_edd_version_is()`. The function allows to quickly compare the EDD version with an arbitrary value.

= 1.6.3.160112 =
* Imported classes from AFC for WooCommerce. The imported classes include the following new features:
	* Dismissable messages.
	* Improved database semaphore.
	* Improved installation classes.

= 1.6.2.160110 =
* Updated GeoIP database.
* Removed unneeded files.

= 1.6.1.160110 =
* Improved session manager. The class can now store and retrieve cookies.

= 1.6.0.160108 =
* Improved requirement checking class. The class can now install and activated required plugins automatically.

= 1.5.1.151001 =
* Added new `edd_aelia_ip2location_geoip_db_file` filter. The filter will allow to override the location of the GeoIP database.
* Fixed caching mechanism used for settings controllers. The logic can now handle multiple controllers correctly.

= 1.5.0.150928 =
* Optimised performance.
* Reduced amount of checks for plugin updates.
* Updated GeoIP library.

= 1.4.12.150512 =
* Updated GeoIP library.

= 1.4.11.150220 =
* Added Httpful library.
* Fixed bug in `Settings_Renderer::render_dropdown_field()`. The bug prevented the CSS class specified in field settings from being applied to the rendered element.
* Improved requirement checker class. Replaced absolute plugin path with `WP_PLUGIN_DIR` constant.
* Added `attributes` argument to `Settings_Renderer::render_text_field()`.
* Added `attributes` argument to `Settings_Renderer::render_checkbox_field()`.
* Added `Aelia_Install::column_exists()` method.
* Added `Aelia_Install::add_column()` method.
* Updated GeoIP database.

= 1.4.4.141224 =
* Fixed bug in auto-update mechanism that prevented external plugin from being able to call it.

= 1.4.2.141222 =
* Improved display of "missing requirements" messages.
* Improved performance in Admin sections. Admin pages now run initialisation code only when they are requested.
* Improved rendering of checkboxes. The new logic ensures that a value is always posted for a checkbox, whether it's ticked or unticked.
* Added new rendering methods for plugins' setting pages:
	* Added `Settings_Renderer::render_dropdown_field()` method.
	* Added `Aelia\EDD\Settings_Renderer::render_text_field()` method.
	* Added `Aelia\EDD\Settings_Renderer::render_checkbox_field()` method.
	* Added possibility to show a description below each field.
* Improved semaphore logic used during auto-updates to reduce race conditions.
* Updated GeoIP database.
* Fixed bug in `Settings_Renderer::default_settings()` method.

= 1.2.2.141023 =
* Improved checks in `Aelia\EDD\Settings::load()`. Method can now detect and ignore corrupt settings.

= 1.2.1.141020 =
* Fixed bug in session handling. The bug caused the user session to be reset (and the cart emptied) when a currency was selected.

= 1.2.0.141013 =
* Added `aelia_t()` function. The function integrates with WPML to translate dynamically generated text and plugin settings.

= 1.1.4.140929 =
* Fixed minor bug in `Aelia\EDD\Order::get_currency()`. The bug generated a notice due to a missing argument.

= 1.1.3.140910 =
* Added automatic update mechanism.
* Added `readme.txt`, required by automatic updates library.

= 1.0.12.140908 =
* Added logic to ensure that EDD session is started before it's used.

= 1.0.11.140825 =
* Fixed minor bug in `IP2Location` class that generated a notice message.

= 1.0.10.140819 =
* Fixed logic used to check and load plugin dependencies in `Aelia_EDD_RequirementsChecks` class.

= 1.0.9.140717 =
* Refactored semaphore class:
	* Optimised logic used for auto-updates to improve performance.
	* Fixed logic to determine the lock ID for the semaphore.

= 1.0.8.140711 =
* Improved semaphore used for auto-updates:
	* Reduced timeout to forcibly release a lock to 180 seconds.
* Modified loading of several classes to work around quirks of Opcode Caching extensions, such as APC and XCache.

= 1.0.7.140626 =
* Added geolocation resolution for IPv6 addresses.
* Updated Geolite database.

= 1.0.6.140619 =
* Modified loading of Aelia_EDD_RequirementsChecks class to work around quirks of Opcode Caching extensions, such as APC and XCache.

= 1.0.4.140611 =
* Corrected loading of plugin's text domain.

= 1.0.3.140530 =
* Optimised auto-update logic to reduce the amount of queries.

= 1.0.2.140511 =
* Improved logic to determine when to run auto-updates.

= 1.0.1.140509 =
* Updated Composer dependencies.
* Removed unneeded code.
* Fixed bug in geolocation resolution, which caused detected country code not to be returned correctly.

= 1.0.0.140508 =
* First public release

= 0.5.4.140507 =
* Extended Aelia_EDD_RequirementsChecks class to allow displaying extra information about missing plugins.
* Fixed URL for "js_admin" key in Aelia_Plugin class.

= 0.5.3.140507 =
* Improved parameter checking in semaphore class.

= 0.5.2.140504 =
* Added Aelia\EDD\Order::get_cart_items() method.
* Refactored Aelia\EDD\Logger class:
	* Class is now a proper object, rather than a collection of static methods.
	* Class requires a log ID, which is used to distinguish the log messages by originator.
* Added Aelia\EDD\Base_Class class. The class implements some common methods used by descendant classes.

= 0.5.1.140504 =
* Added Aelia\EDD\Order::get_currency() method.
* Fixed reference to order meta.

= 0.5.0.140503 =
* Added Aelia\EDD\Order class.

= 0.4.0.140502 =
* Added Aelia\EDD\Semaphore class.
* Refactored autoupdate logic to use the new semaphore class.

= 0.3.3.140502 =
* Added Aelia_Plugin::doing_ajax() method.

= 0.3.2.140501 =
* Corrected type of Aelia_EDD_RequirementsChecks::factory() method to "static".

= 0.3.1.140430 =
* Changed scope of Aelia_Plugin::trigger_error() to "public".

= 0.3.0.140427 =
* Extended base Aelia_Plugin class.
* Extended base Messages class.

= 0.2.2.140424 =
* Imported methods for Settings class from Currency Switcher.
* Imported IP2Location class.
* Imported Logger class.

= 0.2.0.140424 =
* Extracted base classes from template plugin.
* Implemented requirements checking.

= 0.1.0 =
* First version, derived from EDD Template plugin.
