Fluentform entries data

From Lonsdale201/wp-agent-skills · View interactive version

Fluentform entries data is an AI agent skill from the GitHub repository Lonsdale201/wp-agent-skills. Reads, relates, updates, and audits Fluent Forms forms, submissions, entry details, and submission meta from third-party plugins. Covers fluentFormApi, FormFieldsParser, Submission and SubmissionMeta models, form-scoped queries, response JSON versus normalized detail rows, pagination, capabilities,

How to use this skill

Skill file

Fluent Forms entries and data model

Use Fluent Forms' API/model layer after enforcing your own authorization. Keep

the canonical response snapshot, query projection, and addon metadata separate.

Read data-contract.md before writing entry data,

exposing it over REST, joining nested fields, or supporting Pro drafts/payments.

Availability contract

| Data/API | Availability in 6.2.7 |

|---|---|

| forms, submissions, entry details, form/submission meta | Free |

| fluentFormApi(), FormFieldsParser, Submission, SubmissionMeta | Free |

| draft/partial submissions | Pro |

| order items, transactions, payment subscriptions and coupons | Payment/Pro feature dependent |

The PHP helpers perform data access, not request authorization. A successful

fluentFormApi() call does not prove the current user may see the result.

Read one form's entries

use FluentForm\App\Modules\Acl\Acl;

$formId = absint($requestedFormId);

if (!$formId || !function_exists('fluentFormApi')) {
    return new WP_Error('acme_unavailable', __('Fluent Forms is unavailable.', 'acme-addon'));
}

if (!Acl::hasPermission('fluentform_entries_viewer', $formId)) {
    return new WP_Error('acme_forbidden', __('You cannot view these entries.', 'acme-addon'), [
        'status' => 403,
    ]);
}

$form = fluentFormApi('forms')->find($formId);
if (!$form) {
    return new WP_Error('acme_not_found', __('Form not found.', 'acme-addon'), [
        'status' => 404,
    ]);
}

$page    = max(1, absint($requestedPage));
$perPage = min(100, max(1, absint($requestedPerPage)));

$result = fluentFormApi('forms')->entryInstance($form)->entries([
    'page'       => $page,
    'per_page'   => $perPage,
    'entry_type' => 'all',
    'sort_type'  => 'DESC',
    'search'     => sanitize_text_field((string) $requestedSearch),
]);

Use the form-scoped entryInstance() for a known form. The global

fluentFormApi('submissions') methods are useful for trusted internal reports,

but callers must constrain form IDs, user IDs, status, and page size themselves.

Read a single form-scoped entry

$entryResult = fluentFormApi('forms')
    ->entryInstance($form)
    ->entry(absint($entryId), false);

if (!$entryResult) {
    return new WP_Error('acme_entry_not_found', __('Entry not found.', 'acme-addon'), [
        'status' => 404,
    ]);
}

$entry    = $entryResult['submission'];
$response = is_array($entry->response) ? $entry->response : [];

Do not fetch by entry ID globally and authorize with a different form ID. Scope

the database lookup and permission decision to the same normalized form ID.

Resolve field definitions and labels

use FluentForm\App\Modules\Form\FormFieldsParser;

$inputs = FormFieldsParser::getEntryInputs($form, ['admin_label', 'raw']);
$labels = FormFieldsParser::getAdminLabels($form, $inputs);

foreach ($response as $name => $value) {
    $label = $labels[$name] ?? $name;
    // Escape $label and $value for their actual output context.
}

attributes.name, not the visible label, connects the field definition to the

response. Labels and fields can change after old submissions were stored, so

always provide a fallback for historical/removed keys.

Store addon state as submission meta

use FluentForm\App\Helpers\Helper;

$entryId = absint($entryId);
$formId  = absint($formId);

// First verify the entry belongs to $formId and the current operation is allowed.
Helper::setSubmissionMeta($entryId, '_acme_delivery_state', [
    'status'     => 'queued',
    'updated_at' => current_time('mysql'),
], $formId);

$state = Helper::getSubmissionMeta($entryId, '_acme_delivery_state', []);

Namespace meta keys. Store bounded operational data, not credentials or copied

entry payloads. SubmissionMeta serializes values and is not encrypted.

Mutation policy

files, logs, details, queued actions, and payment-related cleanup are considered.

entry_details rows as one consistency boundary. Validate against the current

form, preserve unknown historical keys deliberately, update the timestamp, and

emit the appropriate audit hook/log.

read fluentform_submissions.response.

Security and performance rules

admin semantics, plus any domain-specific ownership rule your endpoint needs.

Use fluentform_manage_entries for mutations.

the capability/form-scope check.

source URLs, hidden fields, payment fields, and addon-injected values.

queries. Use detail rows or an addon-owned indexed table for frequent reports.

that it can mark unread entries as read by default in 6.2.7.

FluentForm\App\Models\Submission, while FluentForm\App\Api\Entry is the

form-scoped API wrapper.

Pro boundary

Pro partial entries live in fluentform_draft_submissions and have a different

ownership/hash lifecycle. Do not merge them into completed-submission queries by

ID alone. Pro/payment records link through submission_id, but payment access

requires fluentform_view_payments or fluentform_manage_payments and must use

verified payment status, not merely the presence of a row.

Cross-references

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.