WP Manifestindependent plugin directory
manifest / email / sls-form-plugin

SLS Forms

This is a custom form plugin for wordpress.

by Starlabs · github.com/starlabs-technology/sls-form-plugin

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/starlabs-technology/sls-form-plugin/archive/refs/heads/main.zip

A lightweight, modern WordPress form builder with templates, AJAX submissions, entry management, and email notifications.

Author: Star Labs Technology Text Domain: sls-forms


Table of Contents


Overview

SLS Forms is a modern, lightweight WordPress form builder designed for developers and site owners who need a clean, extensible solution without the bloat of heavyweight form plugins. It features a visual field builder, multiple templates, AJAX-powered submissions, spam protection, entry management with export capabilities, and configurable email notifications — all in a lean package.


The Problem It Solves

Most WordPress form plugins are either too bloated (slow, heavy JavaScript, dozens of unused features) or too basic (no entry management, no email control, no templates). SLS Forms bridges this gap by providing:

  • A clean, fast form builder that doesn't slow down your site
  • Template-based rendering so forms look polished out of the box
  • Built-in entry management so you never lose a submission
  • Spam protection without relying on external services like reCAPTCHA
  • Full email control with customizable admin notifications and user autoresponders
  • Popup/modal support for lead capture without extra plugins
  • Export capabilities (CSV & JSON) for integrating data with external systems
  • UTM tracking built in so you can trace where leads come from

Key Features

Feature Description
Visual Field Builder Drag-and-drop field ordering, add/remove fields with one click, 10 field types
4 Built-in Templates One Page, Two Column, Two Step Wizard, Two Column with Background Image
AJAX Submissions No-reload form submissions with real-time validation and status feedback
Entry Management 3-level drill-down: forms overview → entries per form → individual entry detail
CSV & JSON Export Bulk export entries from the admin UI
Email Notifications Admin alerts + optional user autoresponder with token-based templates
Popup/Modal Mode Render any form as a popup dialog with overlay and ARIA accessibility
Spam Protection Honeypot field + timestamp-based speed detection (no external APIs)
Custom CSS Editor CodeMirror-powered CSS editor in the admin for per-site styling
UTM Tracking Automatically captures utm_source, utm_medium, utm_campaign
Context Capture Records IP address, page URL, and user agent per submission
Dark Mode Automatic dark mode support via prefers-color-scheme
Responsive & Accessible ARIA attributes, keyboard navigation, focus management
Extensible Filters and actions throughout; register custom templates easily

How It Works

Architecture

SLS Forms follows a modular, singleton-based architecture:

  1. Bootstrap → WordPress loads sls-forms.php on plugins_loaded
  2. Plugin class instantiates all modules (Admin, Forms, Entries, Render, Templates, Ajax, etc.)
  3. Admin UI provides a visual form builder where you define fields, choose a template, and configure settings
  4. Forms are stored in a custom database table (wp_sls_forms) as JSON-encoded field definitions
  5. Shortcode [sls_form] triggers front-end rendering using the selected template
  6. AJAX handler processes submissions, validates data, applies spam checks, stores entries, and sends email notifications
  7. Entries are stored in a second custom table (wp_sls_entries) and viewable/exportable from the admin

Supported Field Types

Type Description
text Single-line text input
email Email address input with validation
tel Phone number input
url URL input with validation
number Numeric input
textarea Multi-line text area
select Dropdown select menu
checkbox Checkbox (single or group)
radio Radio button group
hidden Hidden field (for tracking data)

Installation

  1. Download or clone the plugin into your WordPress /wp-content/plugins/ directory
  2. Ensure the folder is named sls-forms
  3. Go to WordPress Admin → Plugins and activate SLS Forms
  4. The plugin will automatically create its database tables on activation
  5. Navigate to SLS Forms in the admin sidebar to start building forms

Usage

Creating a Form

  1. Go to SLS Forms → Forms in the admin menu
  2. Click Create New Form
  3. Enter a form name and select a template
  4. Use the field builder to add fields:
    • Choose a field type (text, email, select, etc.)
    • Set the field label, name (slug), and placeholder
    • Mark fields as required if needed
    • Drag to reorder fields
  5. Configure template-specific settings (e.g., background image for the Two Column BG template)
  6. Click Save Form

Embedding with Shortcodes

Place the shortcode on any page, post, or widget area:

[sls_form id="1"]

Override the template:

[sls_form id="1" template="two-column"]

Add a custom CSS class:

[sls_form id="1" class="my-custom-form"]

Popup / Modal Mode

Render any form as a popup dialog:

[sls_form id="1" display="popup"]

The popup includes:

  • A semi-transparent overlay
  • A centered modal dialog
  • A close button
  • Full ARIA accessibility (focus trap, role="dialog", aria-modal)

Managing Entries

  1. Go to SLS Forms → Entries
  2. The overview shows all forms with their entry counts
  3. Click a form to see all entries for that form
  4. Click an individual entry to see the full submission details
  5. Use the Export buttons to download entries as CSV or JSON

Email Notifications

Configure email settings under SLS Forms → Settings:

  • Admin Notification Email — Where to send form submission alerts
  • From Name / Email — Customize the sender identity
  • Autoresponder — Toggle automatic replies to the person who submitted the form
  • Autoresponder Subject & Body — Use tokens like {{field:name}}, {{site_name}}, {{form_name}}

Custom CSS

Go to SLS Forms → Custom CSS to add custom styles using the built-in CodeMirror editor. Styles are only loaded on pages where a form is present, keeping your site lightweight.


Templates

Template Slug Description
One Page (1 Column) one-page Simple single-column layout — great for contact forms
Two Column two-column Side-by-side field groups for longer forms
Two Step Wizard two-step Multi-step form with animated progress bar
Two Column with BG Image two-column-bg Split layout with image panel, overlay text, and form

Registering Custom Templates

Developers can add custom templates using the sls_forms_register_templates action:

add_action('sls_forms_register_templates', function($registry) {
    $registry->register('my-template', [
        'label' => 'My Custom Template',
        'file'  => __DIR__ . '/templates/my-template.php',
    ]);
});

Settings

Setting Description
Notification Email Admin email address for form submission alerts
From Name Display name for outgoing emails
From Email Sender email address
Autoresponder Enable Toggle user confirmation emails on/off
User Email Field Which form field contains the submitter's email (default: email)
Autoresponder Subject Email subject line (supports tokens)
Autoresponder Body Email body content (supports tokens, HTML via wpautop)

Shortcode Reference

[sls_form id="ID" template="SLUG" display="MODE" class="CSS_CLASS"]
Attribute Default Description
id (required) The form ID
template (from form settings) Override the template slug
display inline inline or popup
class "" Additional CSS classes on the form wrapper

Developer Reference

Filters

Filter Description
sls_forms_form_classes Modify the CSS classes on the <form> element
sls_forms_template_handle_map Override template JS handles
sls_forms_cleanup_autop Toggle wpautop cleanup (default: true)
sls_forms_cleanup_autop_patterns Customize cleanup regex patterns
sls_forms_cleanup_autop_containers Extend cleanup scope selectors
sls_forms_current_url Override current URL detection
sls_forms_render_template_file Override the template file path at render time
sls_forms_hide_on_success Control whether the form hides after successful submission
sls_forms_success_message Customize the success message text
sls_forms_form_data_attrs Add or change data-* attributes on the <form> element

Actions

Action Description
sls_forms_register_templates Register custom templates with the template registry
sls_forms_before_form Hook before form fields render
sls_forms_after_form Hook after form fields render

Email Tokens

Use these tokens in autoresponder subject and body:

Token Replaced With
{{field:FIELD_NAME}} Value of the named field from the submission
{{site_name}} The WordPress site name
{{form_name}} The form's name
{{entry_id}} The entry's database ID

File Structure

sls-forms/
├── sls-forms.php                    # Main plugin bootstrap
├── README.md                        # This file
├── assets/
│   ├── css/
│   │   ├── admin.css                # Admin panel styles
│   │   ├── editor-inline.css        # Editor inline styles
│   │   └── frontend.css             # Front-end form styles
│   ├── images/
│   │   └── sls-light-logo.png       # Star Labs branding logo
│   └── js/
│       ├── admin-builder.js         # Field builder (add/remove/sort)
│       ├── admin-media.js           # WP Media modal helper
│       ├── admin.js                 # General admin JavaScript
│       ├── core/
│       │   ├── forms-core.js        # Core runtime (AJAX submit, event bus)
│       │   └── modal.js             # Modal/popup controller
│       └── templates/
│           ├── one-page.js          # One-page template module
│           ├── two-step.js          # Two-step template module
│           ├── two-column.js        # Two-column template module
│           └── two-column-bg.js     # Two-column-bg template module
├── includes/
│   ├── helpers.php                  # Admin branding helpers
│   ├── class-activator.php          # Database table creation
│   ├── class-admin.php              # Admin orchestrator (menus, routing)
│   ├── class-ajax.php               # AJAX endpoints
│   ├── class-entries.php            # Entry CRUD and export
│   ├── class-forms.php              # Form CRUD (Form_Store)
│   ├── class-frontend-custom-css.php # Frontend custom CSS output
│   ├── class-notifications.php      # Email notifications + autoresponder
│   ├── class-plugin.php             # Plugin bootstrapper
│   ├── class-render.php             # Shortcode handler
│   ├── class-settings.php           # WP Settings API
│   ├── class-spam.php               # Spam detection
│   ├── class-templates.php          # Template registry
│   └── admin/
│       ├── class-admin-assets.php   # Admin asset enqueue
│       ├── class-admin-custom-css.php # Custom CSS page
│       ├── class-admin-entries.php  # Entries admin UI
│       ├── class-admin-forms.php    # Form builder admin UI
│       ├── class-admin-help.php     # Help page
│       └── class-admin-settings.php # Settings page
└── templates/
    ├── one-page.php                 # One-page template
    ├── two-column.php               # Two-column template
    ├── two-column-bg.php            # Two-column-bg template
    ├── two-step.php                 # Two-step template
    └── partials/
        ├── actions.php              # Form actions partial
        ├── field.php                # Field rendering partial
        └── progress.php             # Progress bar partial

Database Tables

The plugin creates two custom tables on activation:

wp_sls_forms — Form Definitions

Column Type Description
id INT AUTO_INCREMENT Primary key
name VARCHAR Form name
slug VARCHAR (UNIQUE) URL-friendly identifier
template VARCHAR Template slug
template_settings LONGTEXT (JSON) Template-specific configuration
fields LONGTEXT (JSON) Field definitions
created_at DATETIME Creation timestamp
updated_at DATETIME Last update timestamp

wp_sls_entries — Form Submissions

Column Type Description
id INT AUTO_INCREMENT Primary key
form_id INT Foreign key to wp_sls_forms
data LONGTEXT (JSON) Submitted field values
utm TEXT (JSON) UTM tracking parameters
ip VARCHAR Submitter's IP address
page_url TEXT Page where the form was submitted
user_agent TEXT Browser user agent string
is_spam TINYINT Spam flag (0 = clean, 1 = spam)
created_at DATETIME Submission timestamp

Security

  • Nonce verification on all form submissions and admin actions
  • Capability checks (manage_options) on all admin pages and data exports
  • Input sanitization using sanitize_text_field, sanitize_key, sanitize_email, wp_kses_post
  • Output escaping using esc_attr, esc_html, esc_url throughout
  • Honeypot spam protection — invisible field that bots fill out
  • Timing-based spam detection — submissions under 2 seconds are flagged as spam
  • No external API dependencies for spam protection

Requirements

  • WordPress 6.0 or higher
  • PHP 7.4 or higher
  • No external dependencies — uses only WordPress core APIs

License

This plugin is licensed under the GNU General Public License v2.0 or later.


Built with ❤️ by Star Labs Technology