=== BPOTech Text Formatter with TinyMCE ===
Contributors: wphuebpo
Tags: tinymce, font weight, text transform, typography
Requires at least: 5.0
Tested up to: 7.0
Stable tag: 1.0.1
Requires PHP: 8.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Extend TinyMCE & Gutenberg with custom font weights (100–900 + keywords) and text transform options. Works standalone.

== Description ==

BPOTech Text Formatter with TinyMCE is a lightweight WordPress plugin that extends text styling in both the Classic Editor and the Gutenberg Block Editor — no other plugins required.

It adds custom **Font-weight** and **Uppercase** controls directly to the editor toolbar, giving users granular control over typography without touching any code.

= Features =
*   **Deep Font Weight Selection**: Apply numeric weights (`100` Thin, `200` Extra Light, `300` Light, `400` Regular, `500` Medium, `600` Semi Bold, `700` Bold, `800` Extra Bold, `900` Black) as well as CSS keywords (`bold`, `bolder`, `lighter`, `normal`).
*   **Text Transform Options**: Easily apply case rules like UPPERCASE, lowercase, and Capitalize Words on selected text.
*   **Gutenberg Block Editor Support**: Works natively inside Gutenberg blocks (Paragraph, Heading, etc.) via `registerFormatType` — no Classic Block required.
*   **Google Fonts Integration**: Load fully-weighted Google Fonts (e.g. Inter, Roboto, Outfit, Montserrat) in both the editor and site front-end.
*   **Post Type Targeting**: Enable the toolbar controls only for specific post types (e.g. Posts, Pages, or custom types).
*   **Premium Options Screen**: A modern dashboard with visual toggles, checkbox grids, and a live font-weight preview.
*   **Compatible**: Works standalone. Optionally compatible with Advanced Editor Tools (TinyMCE Advanced).

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/bpotech-text-formatter-with-tinymce` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Use the **Settings → BPOTech Text Formatter** menu to configure options, toggle active font weights, and choose toolbar rows.

== Frequently Asked Questions ==

= Does it support Gutenberg? =
Yes! The plugin supports Gutenberg natively. It registers custom inline format types (`Font-weight` and `Uppercase`) directly inside the Block Editor toolbar using the `registerFormatType` API — no Classic Block required.

= Does it support the Classic Editor? =
Yes. The plugin adds **Font-weight** and **Uppercase** dropdown buttons to the TinyMCE toolbar when using the Classic Editor plugin.

= Do I need Advanced Editor Tools (TinyMCE Advanced)? =
No. The plugin works completely standalone. If you have Advanced Editor Tools installed, the buttons will also appear there and can be repositioned through its settings panel.

= Can I choose which post types show the toolbar buttons? =
Yes. In **Settings → BPOTech Text Formatter**, you can select exactly which post types (Posts, Pages, or any custom post type) should display the formatting controls.

== Third-Party Services ==

This plugin optionally connects to the **Google Fonts API** to load web fonts in the editor and on the front-end of your site. This feature is **disabled by default** to ensure GDPR/privacy compliance, and can be enabled at any time from **Settings → BPOTech Text Formatter** by checking "Load Google Font stylesheet".

When enabled, your site visitors' browsers will make requests to Google's servers to download font files. This means visitor IP addresses are transmitted to Google.

* **Service:** [Google Fonts](https://fonts.google.com/)
* **Terms of Service:** [https://developers.google.com/fonts/terms](https://developers.google.com/fonts/terms)
* **Privacy Policy:** [https://policies.google.com/privacy](https://policies.google.com/privacy)

If you need to comply with GDPR or similar privacy regulations, keep this feature disabled and self-host your fonts instead.


== Screenshots ==

1. This menu allows users to quickly change the font-weight of selected text directly within the TinyMCE editor without writing CSS manually.
2. This menu allows users to quickly transform the letter casing of selected text directly within the TinyMCE editor, making content formatting faster and more consistent.



== Changelog ==

= 1.0.1 =
* Updated plugin description to reflect standalone Gutenberg support.
* Added native Gutenberg Block Editor integration via `registerFormatType`.
* Added Post Type targeting — enable controls per post type.
* Fixed Active Font Weight Levels not saving correctly due to PHP integer key casting.
* Added `uninstall.php` to clean up all plugin data on deletion.
* Fixed admin notice contrast (white-on-white) on settings screen.
* Renamed toolbar buttons: "Weight" → "Font-weight", "Case" → "Uppercase".
* Updated tested up to WordPress 7.0.
* Extracted inline JavaScript to external enqueued file for CSP compliance.
* Added Third-Party Services disclosure for Google Fonts API.

= 1.0.0 =
* Initial Release.
* Added custom Font Weight and Text Transform dropdowns.
* Added standard keywords support (bold, bolder, lighter, normal).
* Implemented secure input sanitization and option validation for WordPress Store guidelines.

