=== RIACO Custom Order Status for WooCommerce ===
Contributors:          prototipo88
Tags:                  woocommerce custom order status, woocommerce order status manager, custom order status, woocommerce status colors, order management
Requires at least:     6.3
Tested up to:          7.0
Requires PHP:          7.4
Stable tag:            1.0.2
License:               GPLv2 or later
License URI:           https://www.gnu.org/licenses/gpl-2.0.html

Create and manage custom WooCommerce order statuses with colors and admin integration.

== Description ==

RIACO Custom Order Status allows you to:

- Add **unlimited custom order statuses** in WooCommerce.
- Assign **custom colors** for easy identification.
- Display them in the WooCommerce orders list.
- Integrate seamlessly with WooCommerce workflows.
- Developer-friendly hooks and filters for full customization.

This plugin is perfect if you need statuses like **Awaiting Pickup**, **Ready for Delivery**, or **On Hold - Payment Verification**.

**Features:**
- Manage custom statuses via a dedicated admin menu under WooCommerce.
- Assign background colors to statuses in the order list.
- Supports bulk editing and manual status changes.
- All statuses are stored as proper `wc-{slug}` order statuses.
- Fully translatable and compatible with WordPress coding standards.

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/riaco-custom-order-status` or install via the WordPress plugins screen.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Go to **WooCommerce → Order Statuses** to create your first custom status.
4. Assign colors and save.
5. Your new statuses will appear in the WooCommerce orders screen.

== Frequently Asked Questions ==

= Can I set custom colors for each status? =
Yes! Each custom status has a color picker in the editor screen.

= Will these statuses work with WooCommerce reports or emails? =
Statuses are registered as normal WooCommerce statuses, so they can be used in emails, filters, and reports. Some third-party plugins may need integration.

= How do I add more customization? =
Developers can use our actions and filters to extend functionality. See the **Developer Hooks** section below.

= Can I change the color of default WooCommerce order statuses? =
Not out of the box.  
This plugin only stores and applies colors to custom statuses you create through its interface (saved as `riaco_cos` custom post types).  
WooCommerce’s default statuses (like `Pending payment`, `Processing`, `Completed`, etc.) use styles from WooCommerce core CSS, which this plugin does not override.  
If you want to change their colors, you would need to add your own CSS or extend the plugin with custom code.

== Screenshots ==

1. **Admin list** of custom statuses with color labels.
2. **Order list** in WooCommerce with color-coded statuses.
3. **Edit status screen** with color picker.

== Changelog ==

= 1.0.2 =
* New: Added "Manage Statuses" quick link on the Plugins screen.
* Security: Added capability check (`edit_post`) before saving color meta.
* Security: Color meta is now sanitized with `sanitize_hex_color()` at read time to prevent CSS injection.
* Security: Invalid or empty color submissions no longer clear a previously saved color.
* Fix: Color contrast calculation now handles 3-digit hex shorthand (e.g. `#abc`).
* Fix: WooCommerce active check now covers multisite network-activated installations.
* Fix: Resolved WPCS linting violations (global variable prefixes, `label_count` array construction).
* Performance: `get_posts()` query in status loading and uninstall optimized with `no_found_rows` and disabled term/meta cache updates.

= 1.0.1 =
* Added dynamic inline CSS for order status label colors on the WooCommerce Orders screen.
* Fixed mismatched plugin header `Requires at least` value.

= 1.0.0 =
* Initial release.
* Add CPT for custom order statuses.
* Add color picker for status labels.
* Integrate with WooCommerce order list.
* Developer hooks for extending plugin.

== Developer Hooks ==

**Actions**
`
do_action( 'riaco_cos_cpt_registered', 'riaco_cos', $args );
do_action( 'riaco_cos_after_save_status', $post_id, $color );
do_action( 'riaco_cos_before_admin_list_styles', $posts );
do_action( 'riaco_cos_loaded', $this );
do_action( 'riaco_cos_after_register_custom_statuses', $statuses );
`

**Filters**
`
apply_filters( 'riaco_cos_get_statuses', $statuses );
`