=== Asgaros Thread Status Labels ===
Contributors: (none)
Tags: asgaros, forum, status, labels, marketplace
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 1.5.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Requires Plugins: asgaros-forum

Adds colored, fully customizable status labels (e.g. Open, Sold, Reserved) to Asgaros Forum threads.

== Description ==

This add-on for [Asgaros Forum](https://wordpress.org/plugins/asgaros-forum/) lets you attach a status label to any forum topic - useful for classifieds/marketplace-style forums (Open, Sold, Reserved...), support forums (In Progress, Resolved...), or any workflow where a topic needs a visible state.

**Features**

* Fully configurable labels from a dedicated admin screen (Forum > Status Labels): name, background color and text color, as many as you want.
* A status dropdown appears under the editor of any topic - restricted to admins, moderators, and the topic's own author.
* The current status is shown as a colored badge right next to the topic title on the topic page.
* The same badge appears next to each topic link in a forum's topic list.
* A status filter dropdown appears above a forum's topic list, letting visitors instantly narrow the list to a single status (client-side, no page reload), with a live count of topics per status.
* Everything adapts automatically to your site: the real WordPress database prefix, the real URL/permalink structure configured in Asgaros Forum, and the real slug used for topic views - nothing is hardcoded to a specific site.
* The required database column is created automatically when the plugin is activated (and self-heals if Asgaros Forum wasn't active yet at that time).
* Full translation support, shipped with English (base), French and German admin interfaces.
* Optional cleanup on uninstall: choose whether your labels and the database column should be removed or kept when you delete the plugin.

**Requirements**

* [Asgaros Forum](https://wordpress.org/plugins/asgaros-forum/) must be installed and active.

== Installation ==

1. Make sure Asgaros Forum is installed and active.
2. Upload the `asgaros-thread-status` folder to `/wp-content/plugins/`, or install the zip file directly via Plugins > Add New > Upload Plugin.
3. Activate the plugin. The required `status` database column is added automatically.
4. Go to Forum > Status Labels to create your labels (name, background color, text color).
5. Open any topic in edit mode: a "Status" dropdown will appear below the editor for admins, moderators, and the topic's author.

== Frequently Asked Questions ==

= Who can change a topic's status? =

Site administrators, forum moderators, and the original author of the topic.

= Does this work with any permalink structure? =

Yes. The plugin reads the actual URL slug for topics from your Asgaros Forum settings (Forum > Settings > URLs) instead of assuming a fixed value, so it adapts to whatever structure your site uses.

= What happens to my data if I delete the plugin? =

By default, nothing is removed - your status labels and the database column stay intact so you can reinstall the plugin later without losing anything. If you want a full cleanup instead, check the "Delete all plugin data" option on the Status Labels admin page before deleting the plugin.

= Can I use my own status names, not just the defaults? =

Yes. The default labels (Open, Sold, Done, For Sale) are only a starting point - add, rename, recolor or remove labels freely from Forum > Status Labels. Everything else in the plugin (badges, filter, counts) automatically adapts to whatever labels you define.

== Changelog ==

= 1.6.0 =
* Security hardening: the status submitted for a topic is now validated against the actual configured labels (rejecting anything else), instead of accepting any sanitized text.
* Security hardening: the automatic database column check/creation is now restricted to administrators (manage_options), instead of running for any logged-in user visiting wp-admin.

= 1.5.3 =
* Changed: author set to "Biker" (https://www.chopper-motorrad.de/).

= 1.5.2 =
* Fixed: the plugin description shown on the Plugins admin screen is now translatable (was missing from the language files).

= 1.5.1 =
* Changed: renamed the plugin from "Asgaros Forum - Thread Status Labels" to "Asgaros Thread Status Labels".

= 1.5.0 =
* Added: option to keep or delete plugin data (labels and the database column) when the plugin is uninstalled.
* Added: uninstall.php handling the cleanup based on that choice.

= 1.4.0 =
* Changed: the status badge on a topic page now appears right next to the topic title instead of above the page header.

= 1.3.0 =
* Added: live topic count next to each status in the filter dropdown, scoped to the forum being viewed.

= 1.2.0 =
* Added: client-side status filter dropdown above a forum's topic list.
* Fixed: the topic list badge now uses the same display rule as the topic page badge (shown for any status other than "Open"), instead of a separate hardcoded whitelist of status names.

= 1.1.0 =
* Added: the required "status" database column is now created automatically on plugin activation, using the real prefix of the current database, with a self-healing retry if Asgaros Forum wasn't active yet.

= 1.0.0 =
* Initial release, packaged as a standalone plugin with English (base), French and German translations.
* Status badges on the topic page and in the forum's topic list, both based on Asgaros Forum's own hooks so they adapt automatically to any URL structure.

== Upgrade Notice ==

= 1.6.0 =
* Security hardening: the status submitted for a topic is now validated against the actual configured labels (rejecting anything else), instead of accepting any sanitized text.
* Security hardening: the automatic database column check/creation is now restricted to administrators (manage_options), instead of running for any logged-in user visiting wp-admin.

= 1.5.3 =
* Changed: author set to "Biker" (https://www.chopper-motorrad.de/).

= 1.5.2 =
* Fixed: the plugin description shown on the Plugins admin screen is now translatable (was missing from the language files).

= 1.5.1 =
* Changed: renamed the plugin from "Asgaros Forum - Thread Status Labels" to "Asgaros Thread Status Labels".

= 1.5.0 =
Adds an uninstall data option. No action required - existing installs default to "keep data", matching previous behavior.
