=== Buy in 1 Click for WooCommerce ===
Contributors: borisrazzr
Tags: ecommerce, buy, quick purchase, WooCommerce
Requires at least: 5.0
Tested up to: 6.9
Requires PHP: 7.0
Stable tag: 1.5.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: buy-in-1-click-for-woocommerce

Add a "Buy in 1 Click" button to WooCommerce product pages and let customers place orders instantly using only their phone number.

== Description ==
**Buy in 1 Click for WooCommerce** adds a fast and frictionless purchasing option to your WooCommerce store. Customers can submit an order directly from the product page by entering their phone number, without going through **the cart or checkout** pages. This significantly reduces checkout abandonment and improves **conversion rates**.

The plugin includes **a powerful admin settings panel** with live previews, giving store owners full control over button appearance and input styling — **no coding required**.

**Key Features:**
* Display a **"Buy in 1 Click"** button on product pages.
* Customers can enter their **phone number** to place an order in a single click.
* Automatically creates a WooCommerce order with the **phone number included**.
* Order notes include a clear description: `"Order placed via Buy in 1 Click. Phone: [customer number]"`.
* Fully **translation-ready**. All language phrases are stored in the plugin itself; the `.mo` files will be regenerated automatically if you remove the `languages` folder.
* Lightweight and easy to use, designed to **increase sales and reduce checkout friction**.
* Admin Settings Panel with the following options:
 - Phone mask configuration
 - Button text
 - Button color and hover color
 - Border color and border radius
 - Font weight and button text weight
 - Button font color
 - Button font size (10–30px)
 - Phone input font size (10–30px)
 - Button and input height 
* Live preview of the button and input fields in the admin panel before saving changes.

**Supported Languages:**
* English (en_US)
* Ukrainian (uk_UA)
* Russian (ru_RU)
* Polish (pl_PL)
* Estonian (et_EE)
* German (de_DE)
* Spanish (es_ES)
* French (fr_FR)
* Italian (it_IT)
* Dutch (nl_NL)
* Czech (cs_CZ)
* Portuguese (pt_PT)
* Romanian (ro_RO)
* Bulgarian (bg_BG)
* Swedish (sv_SE)
* Danish (da_DK)
* Greek (el_GR)
* Georgian (ka_GE)

== Installation ==
* Upload the plugin folder to the '/wp-content/plugins/' directory.
* Activate the plugin via the Plugins menu in WordPress.
* Ensure WooCommerce is installed and active.
* Configure appearance and behavior via the plugin's admin settings page.
* The **Buy in 1 Click button** will appear automatically on WooCommerce product pages.

== Frequently Asked Questions ==
= Does it work with WooCommerce? =
Yes, this plugin is designed specifically for WooCommerce products.
= Can I customize the button text and design? = 
Yes. The plugin includes a full admin settings panel where you can customize text, colors, fonts, sizes, borders, and dimensions. All changes can be previewed live before saving.
= Can I change fonts and styling manually? = 
Yes. Advanced users can further customize styles via the plugin's CSS file, but most styling needs can be handled directly from the admin panel.
= Is the plugin responsive? = 
Yes. The button and phone input are fully responsive and adapt automatically to mobile, tablet, and desktop screen sizes.

== Changelog ==
= 1.5.2 =
* Removed hardcoded WP_LANG_DIR constant - now using load_plugin_textdomain()
* Removed hardcoded WP_CONTENT_DIR fallback - now properly handles wp_upload_dir() errors

= 1.5.1 =
* Improved: Orders created via “Buy in 1 Click” now correctly trigger native WooCommerce status transition hooks.
* Fixed: Order number mismatch by using the WooCommerce display order number instead of internal order ID for frontend messages and integrations.
* Improved: Overall compatibility with WooCommerce notification, automation, and messaging plugins.

= 1.5 =
* Fixed translation system - .mo files now generate correctly on plugin activation
* Added complete MO file binary generation according to GNU gettext specification
* Added automatic translation file regeneration if missing or deleted
* Improved translation loading with proper priority (uploads → wp-content/languages → plugin directory)
* Added transient-based checking to prevent performance impact on every page load
* Enhanced error logging for translation generation debugging
* Translations now properly stored in wp-content/uploads/buy-in-1-click-for-woocommerce/languages/
* Added security measures: .htaccess and index.php files in translations directory

= 1.4 =
* Fixed all WordPress.org review issues:
- Changed architecture to use static CSS/JS files instead of dynamic generation
- Fixed proper escaping for all echoed variables using esc_html__(), esc_attr__(), etc.
- Fixed inline CSS generation with proper variable escaping using sprintf()
- Fixed core file loading (pomo/mo.php) with proper class existence check
- Removed WP_Filesystem complexity - now using standard static file approach
- Fixed admin notices to use esc_html__() instead of __()
- Improved compatibility with all hosting environments

= 1.3 =
* Fixed code quality issues based on WordPress.org review
* Improved WooCommerce dependency handling

= 1.2 =
* Added admin settings panel with extensive button and input customization options
* Added live preview for button and input fields in the admin area
* Added configurable phone mask option
* Improved code quality:
- Prefixed all declarations, globals, and stored data
- Proper script and style loading using wp_enqueue_*
- Improved WooCommerce dependency handling
- Improved UI consistency and responsiveness