=== FieldForge ===
Contributors: avakodeforge
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.25
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 31 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
* 31 field types — text, textarea, number, select, image, file, WYSIWYG, oEmbed, Gallery, Calculation, 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
* Local JSON sync (write field groups to disk for version control)
* Options-page values via `get_field()` / `update_field()`
* REST API field exposure

= Field Forge Pro =

Pro is a separate add-on plugin, distributed from https://fieldforgewp.com and not
included in this download. Everything listed above is part of this plugin and works
without it.

* Compound field types: Repeater, Group, Flexible Content, Clone
* Options pages management screen (creating and editing the pages themselves)
* 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
* Bulk JSON export / import

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.25 =
* Fixed a database error printed on every activation. The longtext and text columns were declared with DEFAULT '', which MySQL does not allow on BLOB/TEXT, so dbDelta kept trying to set it and failed loudly. Found by activating with WP_DEBUG on a clean install.


= 1.0.24 =
* Local JSON now writes only to the uploads directory. A theme folder is no longer a write target even when the developer created one — wp-content/themes is not a location a plugin may write to. Files already committed under a theme are still read, so existing setups keep working; a filtered save path that points at a theme, plugin or core directory falls back to uploads.
* The metabox save path no longer passes the whole request array on. Only this plugin's own submitted values are read, reduced to the fields that belong to the post, and each is sanitized by its declared field type before anything downstream sees it.
* Renamed the two ACF-migration options off the reserved "_fdf_" prefix onto "fieldforge_". Existing values, including the ACF-group id map, are carried over by a schema migration, so a site that already imported from ACF does not re-import duplicates.
* ACF's own hooks are consulted only when ACF is actually active.

= 1.0.23 =
* The Gallery field and the Calculation field are now part of this plugin with no restriction. Both were marked Pro while their implementations shipped here, which meant built-in functionality was gated — that was wrong and is fixed.
* Options-page values, the Import / Export screen and the ACF importer are likewise unrestricted. Nothing shipped in this download is withheld any more: features that genuinely belong to the separate Pro add-on are detected by whether that plugin is installed, not by a licence check.
* Field definitions received over AJAX and REST are now sanitized key by key before storage, instead of only their conditional-logic block.
* oEmbed previews are escaped at the output site with an explicit tag allowlist.
* Local JSON now writes to the uploads directory by default and never creates a directory inside a theme. An existing <theme>/fieldforge-json is still used when the developer has created one.
* Admin CSS moved out of inline <style> blocks into the enqueued stylesheet.
* Removed the red counter bubble on the License menu item — it reused core's update-notification styling.
* Field-group schema REST reads now require manage_options, and the aggregate endpoint no longer accepts an arbitrary post status.
* Dropped the load_plugin_textdomain() call; WordPress loads the translations by itself.

= 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.
