=== FieldForge ===
Contributors: avakode
Donate link: https://avakode.com
Tags: custom-fields, meta-fields, custom-table, relational-fields, builder
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.22
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Custom fields, ACF compatible, unlimited groups: custom-table storage and 24 field types including relational. ACF and Pods alternative.

== Description ==

**Field Forge** is a modern custom-fields plugin. Fields live in dedicated tables (`wp_fieldforge_values`) instead of the bloated `wp_postmeta`, so listing pages stay fast even with 50+ fields per post. Drag-drop the field group editor, then read values via PHP or REST.

= Free =
* Unlimited field groups
* 24 field types — text, textarea, number, select, image, file, WYSIWYG, oEmbed, date/time/color pickers, Google Map, link, and the relational set (Relationship, Post Object, Page Link, Taxonomy, User)
* Location rules (post type, taxonomy, template, user role)
* ACF compatibility layer (import existing ACF groups + values)
* Custom-table storage (not `wp_postmeta`)
* Migration UI from ACF Free
* Visual field group builder

= Pro =
* Compound field types: Repeater, Group, Flexible Content, Clone
* Gallery field
* Options pages (site-wide settings, not tied to a post)
* PHP Blocks (register Gutenberg blocks from field groups)
* AI schema generator (describe the data → generates a field group)
* Native WPGraphQL schema + resolvers (no add-on plugin needed)
* TypeScript / JSON sync (export field groups to your repo)
* Schema versioning + revisions for field values
* ACF value import + REST API field exposure

Part of the **Forge Suite** — bundle includes Lang Forge, SEO Forge, Form Forge.

== Third-Party Services ==

Field Forge connects to one third-party service:

* **Avakode API** (https://avakode.com) — validates your license and powers optional AI features. Your site URL and license key are sent when the license is checked; field or post content is sent only when you trigger an AI action. AI features require the separate Field Forge Pro add-on. Terms: https://avakode.com/terms — Privacy: https://avakode.com/privacy
* **Anonymous usage analytics (opt-in, OFF by default)** — Only if you explicitly opt in from the Field Forge settings, the plugin sends anonymous product-usage telemetry to the Avakode API (https://avakode.com/telemetry): a random install ID (UUID, not tied to your site URL or any account), your bucketed WordPress and PHP version ranges, the plugin version, and aggregate feature-usage event counters. It is sent ONLY after you opt in and can be disabled at any time. It never sends your site URL, email address, post or form content, or license key. Privacy: https://avakode.com/privacy

== Installation ==

1. Upload `fieldforge` to `/wp-content/plugins/`, or install via Plugins → Add New.
2. Activate the plugin.
3. Go to **Field Forge → Field Groups → New Field Group**.
4. Read values in PHP: `$value = get_field('my_field', $post_id);`
5. Or via REST: `GET /wp-json/wp/v2/posts/123/fieldforge`
6. Or via GraphQL: `posts { nodes { fieldforge { myField } } }`

== Frequently Asked Questions ==

= Can I migrate from ACF? =

Yes. Field Forge → Migration → ACF detects existing field groups + values and imports them into Field Forge tables. The ACF compat layer keeps your `get_field()` calls working during migration.

= Will it slow down my admin? =

The opposite — values are not autoloaded from `wp_postmeta`. Listing 100 posts with 50 fields each loads in ms instead of seconds.

= Is GraphQL support a separate add-on? =

No. Native WPGraphQL schema is built-in (Pro). You don't need "WPGraphQL for ACF" or similar bridge plugins.

== Screenshots ==

1. Field group editor
2. Repeater field on post edit (Pro)
3. Migration from ACF
4. GraphQL schema preview (Pro)
5. AI schema generator (Pro)

== Changelog ==

= 1.0.22 =
* Security hardening: all dynamic output is now escaped late at the output site with the context-appropriate function (esc_html/esc_attr/esc_url, esc_html__ for translated strings used as format strings, and wp_kses for trusted pre-built admin/field markup). No behavioural changes.

= 1.0.21 =
* Local JSON sync is now available on the Free plan (like ACF's Local JSON) — enabled by the setting alone, no license required.
* ACF value migration (importing existing ACF field values) is now available on the Free plan.
* Field values are now exposed on the standard REST post endpoints for every plan (opt-in per field).
* Removed the leftover license-gated field-group count limit and its "locked" UI — Free has always supported unlimited field groups.

= 1.0.17 =
* New: Support menu item that opens the Avakode support dashboard.
* New: Opt-in anonymous usage analytics (OFF by default) — see Third-Party Services.
* New: Contextual, dismissible Pro feature tips on the plugin dashboard (Free users only).
* New (Pro): Calculation field — compute a total from a formula over sibling fields ({price} * {qty}) or by summing a numeric sub-field across repeater rows, with number/currency/percentage formatting and a live per-keystroke preview.
* New (Free): [fieldforge_total] shortcode and fieldforge_aggregate_field() to total a numeric field across posts; REST /aggregate and GraphQL fieldForgeAggregate (Pro).


= 1.0.16 =
* Accessibility: Button Group field radios are now keyboard- and screen-reader-accessible. They were hidden with `display:none`, which removed them from the tab order and accessibility tree; they are now visually hidden the accessible way (the visible button label still toggles the selection).

= 1.0.14 =
* WordPress.org compliance and licensing hardening.
* Pro entitlement is now resolved by the Field Forge Pro add-on; the free plugin bundles no licensing SDK.
* readme metadata cleanup.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.17 =
Adds a Support menu, optional anonymous analytics (off by default), and dashboard Pro tips. New Pro Calculation field + cross-post totals.


= 1.0.16 =
Accessibility fix for the Button Group field (keyboard / screen-reader support).

= 1.0.14 =
Licensing and WordPress.org compliance improvements.

= 1.0.0 =
Initial release.
