=== JR Field Generator For ACF ===
Contributors: jabir20
Tags: acf, advanced custom fields, ai, gemini, json
Stable tag: 1.0.0
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Requires PHP: 7.4
Requires at least: 5.5
Tested up to: 6.9

Generate ACF field groups using AI (Gemini) so you can build JSON exports in minutes instead of hours.

== Description ==

JR Field Generator For ACF is a small helper plugin for developers who use
Advanced Custom Fields (ACF) a lot and are tired of creating big field groups
by hand.

Instead of clicking through the ACF UI for every field, you:

1. Type the fields you want (one per line, for example `Title : text`).
2. The plugin sends this list to the Gemini AI API.
3. It returns a ready-to-import ACF JSON field group.

You can then import that JSON into ACF and adjust details as needed. The goal
is to turn hours of repetitive field creation into just a few minutes of
simple input and review.

**Important:** This plugin uses the Gemini API. Your list of field labels and
types is sent to Google’s servers as part of the AI request. Do not include
any sensitive data in the field list.

== Features ==

* Simple admin screen under **JR Field Generator**.
* Paste up to **70 fields** per generation.
* Uses Google Gemini to propose sensible ACF field definitions.
* Outputs valid ACF JSON that you can import via **Custom Fields → Tools**.
* Creates a new ACF field group JSON export on each generation run.
* Basic sanity checks and server-side validation to avoid broken JSON.
* Supports generating ACF field group JSON for a wide range of ACF field types.

== Installation ==

1. Upload the plugin folder to the `/wp-content/plugins/` directory, or install it via the WordPress plugin installer.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Make sure the **Advanced Custom Fields (ACF)** plugin is installed and active.
4. Go to **JR Field Generator → API Settings** in your WordPress admin.
5. Paste your **Gemini API key** and click **Save API Key**.

== How to use ==

1. In the WordPress admin, go to **JR Field Generator**.
2. In the large textarea, enter your fields, one per line, using this **exact format**:

   `Field Label : type`

   **⚠️ Important:** You must use the format `Label : type` (with a colon and space) for the plugin to work correctly.

   Example:

   * `Title : text`
   * `Description : textarea`
   * `Price : number`
   * `Product Gallery : image`
   * `Booking Status : select`
   * `Date of Birth : date_picker`

3. You can enter up to **70 fields** per generation. If you need more, split your list into smaller chunks and run the generator multiple times.
4. Click the **Generate ACF JSON** button.
5. Wait a few seconds while the plugin talks to Gemini and builds the JSON.
6. When it is done, you will see the JSON in the **Generated JSON** box.
7. Either:
   * Copy the JSON, paste it into a file, and save it as `.json`, or
   * Click the **Download JSON** button to download a file directly.
8. Go to **Custom Fields → Tools**.
9. Use the **Import Field Groups** tool to import the JSON file.

After import, you can edit the generated field group, change the location
rules, rearrange fields, or tweak any details inside ACF as usual.

== Limitations ==

* Maximum of **70 fields per generation run**.
* **Input format is critical:** You must use the exact format `Field Label : type` (with colon and space) 
  for the plugin to correctly parse and generate your fields.
* Generated output uses a default location rule (`post_type` equals `post`).
  You can adjust the group title, location rules, and field settings inside ACF after import.
* The plugin depends on the Gemini API being available and your API key having
  enough quota.
* The AI tries to guess sensible ACF settings, but you are still responsible
  for reviewing the result and making sure it matches your project needs.

== External Services ==

This plugin connects to the Google Gemini API to generate ACF field configurations using AI.
The AI reads the field labels/types you provide and returns suggested ACF-compatible JSON that you can review before import.

Service: Google Gemini (Generative Language API)
Purpose: To generate field group JSON based on user input.

Data Sent:
* Field descriptions entered by the user
* API key (stored locally, used for authentication)

When:
* Only when user clicks "Generate Fields"

No data is stored on our servers.

Terms of Service:
https://ai.google.dev/terms

Privacy Policy:
https://policies.google.com/privacy

== Frequently Asked Questions ==

= Do I need ACF Pro? =

You need the ACF plugin (free or Pro) to import and use the generated field
groups. This plugin does not include ACF itself.

Generated JSON is designed for import into ACF field groups. Depending on your exact setup, you may still want to review and fine-tune field settings after import.

= Where do I get a Gemini API key? =

You can create an API key in your Google AI / Gemini account. Once you have a
key, paste it into **JR Field Generator → API Settings**.

= Is my data sent to a third party? =

Yes. The field labels and types you enter are sent to the Gemini API so it can
generate field definitions. Do not put passwords, personal data or any other
sensitive information into the field list.

= Can I change the field group title or location rules? =

Yes. After you import the JSON into ACF, you can edit the generated field
group like any other ACF group and adjust all settings.

== Screenshots ==

1. Field input screen where you paste your list of fields.
2. Generated JSON area with download button.
3. Simple API settings screen for the Gemini key.

== Changelog ==

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
First public version of the plugin. Please review generated fields before using them on a live site.


