Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PCPI Gravity Tools

A collection of production-grade Gravity Forms utilities used internally by Pacific Coast Polygraph & Investigation Services (PCPI).

This plugin consolidates reusable helpers, validations, and UI enhancements that support a complex multi-form Gravity Forms workflow (Applicant → Questionnaire → Examiner Review → PDF).

It is intentionally code-driven, modular, and opinionated, designed to reduce fragile snippets and centralize Gravity Forms logic in one maintainable place.


Features

🧩 Modular Utility Includes

Each feature lives in its own file and can be enabled, extended, or removed without affecting others.

Current modules include:

  • Dynamic Year Dropdowns

    • Generates year options dynamically (no hard-coded ranges)
    • Prevents future-dated forms from aging out
  • Strict List-Field Date Validation

    • Validates mm/dd/yyyy format
    • Enforces real calendar dates
    • Applies to Gravity Forms List fields
    • Blocks invalid submissions server-side
  • No-Future Date Validation

    • Prevents future dates in standard date fields
    • Supports multiple forms
    • Safe for reuse across many date inputs
  • No-Future Month / Year Pair Validation

    • Client-side month disabling based on selected year
    • Server-side validation to prevent bypass
    • Designed for split Month / Year fields
    • Class-based grouping via CSS selectors
  • Multi-Page Progress Grid

    • Enhances Gravity Forms multi-page UI
    • Replaces linear steps with a responsive grid
    • Displays completed steps visually
    • Designed to work alongside Gravity Perks (GPMPN)

Design Goals

  • No snippets floating in functions.php
  • Explicit form targeting (no global magic)
  • Safe defaults, extensible via filters
  • Server-side validation first
  • Gravity Forms–native patterns

This plugin exists to make Gravity Forms more predictable, more defensive, and easier to reason about in large workflows.


Requirements

  • WordPress 6.0+
  • PHP 7.4+ (PHP 8.1+ recommended)
  • Gravity Forms 2.5+

(Some modules assume multi-page forms or List fields.)

Compatibility (Release Notes)

This plugin is designed to be safe to leave active even if Gravity Forms is temporarily disabled:

  • Modules register their hooks only when Gravity Forms is active.
  • No database tables are created.
  • No options/settings are stored.
  • No admin UI/settings page.

Installation

  1. Upload the plugin ZIP to Plugins → Add New → Upload Plugin
  2. Activate PCPI Gravity Tools
  3. Modules load automatically via includes/

No UI configuration required.


Included Modules

Dynamic Year Dropdowns

Located in:

includes/dynamic-year-dropdowns.php
  • Generates year options dynamically at render time
  • Eliminates stale dropdowns
  • Ideal for DOB, employment history, military service, etc.

List Field Date Validation

Located in:

includes/list-date-validation.php
  • Enforces strict date formats in List fields
  • Validates real calendar dates
  • Prevents malformed or impossible entries

No-Future Date Validation

Located in:

includes/validation-no-future-date.php
  • Prevents future dates for:

    • single Date fields
    • List field date columns
  • Supports multiple forms


No-Future Month/Year Pair Validation

Located in:

includes/no-future-monthyear-pair.php

Designed for:

  • Separate Month + Year fields
  • Conditional logic compatibility
  • Client + server validation

Uses CSS classes to group related fields:

Month: pcpi-my-month pcpi-my-group-1
Year:  pcpi-my-year  pcpi-my-group-1

Multi-Step Progress Grid

Located in:

includes/gf-multi-step-grid.php
  • Enhances Gravity Forms page steps UI
  • Displays completed steps with visual indicators
  • Designed to work with Gravity Perks Multi-Page Navigation

Folder Structure

pcpi-gravity-tools/
├── pcpi-gravity-tools.php
├── CHANGELOG.md
└── includes/
    ├── dynamic-year-dropdowns.php
    ├── rolling-year-dropdowns-last-n.php
    ├── list-date-validation.php
    ├── validation-no-future-date.php
    ├── no-future-monthyear-pair.php
    └── gf-multi-step-grid.php
    ├── gpmpn-checkmarks.php
    └── validation-date-from-to-pairs.php

Extensibility

Most modules expose filters to:

  • target specific form IDs
  • override defaults
  • reuse logic across multiple forms

Example:

add_filter( 'pcpi_my_no_future_forms', function () {
    return [ 2, 23 ];
} );

Intended Use

This plugin is designed for:

  • Complex Gravity Forms workflows
  • Multi-form relational data
  • Legal / compliance-sensitive submissions
  • Environments where bad data must never enter the system

It is not a general-purpose Gravity Forms enhancement plugin, but it is architected cleanly enough to evolve into one.


Philosophy

  • Validation belongs on the server
  • Forms should be future-proof
  • UI enhancements should never compromise data integrity
  • Gravity Forms is a framework — treat it like one

License

GPL-2.0 or later


Maintenance Notes

This plugin is actively maintained as part of the PCPI internal platform. Changes are tested against real-world Gravity Forms workflows before release.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages