Trex Forms
Trex Forms is a wordpress plugins which support searchable dropdown
by Raihan Ahmed Dip · github.com/raihan-ahmed-dip/trex-forms · website
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/raihan-ahmed-dip/trex-forms/archive/refs/heads/master.zipDescription
Trex Forms is a WordPress plugin that allows site administrators to create custom forms and embed them via shortcode. You can build forms with text fields, email, phone, checkboxes, radio buttons, select dropdowns (including searchable select for long lists), file uploads, consent checkboxes, and Google reCAPTCHA for spam protection.
Features:
- Drag-and-drop style form builder in the WordPress admin dashboard (no coding required).
- Supports common field types: single-line text, email, phone number, textarea, checkboxes, radio buttons, select dropdown (with optional search via Select2), file upload (with file type restrictions), consent/terms checkbox, and Google reCAPTCHA v2/v3.
- Each form can send email notifications to specified addresses when an entry is submitted.
- Entries are saved to the database and can be viewed in the admin area.
- Export entries to CSV format.
- Forms are added to pages via a simple shortcode
[trex_forms id="FORM_ID"].
The plugin follows WordPress coding standards and security best practices (using nonces, sanitization, escaping, etc.).
Installation
- Upload the
trex-formsfolder to the/wp-content/plugins/directory or install via the WordPress Plugins screen by searching for "Trex Forms". - Activate the plugin through the 'Plugins' menu in WordPress.
- Navigate to the 'Trex Forms' menu in the WordPress admin dashboard.
- Click "Add New Form" to create your first form. Add desired fields and settings, then save.
- Copy the shortcode provided (e.g.,
[trex_forms id="123"]) and paste it into any page or post where you want the form to appear. - On the front-end, fill out the form and submit. The data will be saved, and notifications will be sent as configured.
- To view submissions, go to 'Trex Forms' > 'Entries', select your form, and you'll see a list of entries. You can also export them as CSV.
Usage
After activating the plugin:
- Creating a Form: In the admin dashboard under 'Trex Forms', use "Add New Form". Provide a form name, notification email(s), and add fields. For each field, enter a label, choose a type, and if the type requires options (like select, radio, checkbox group), provide a comma-separated list of options. Mark the field as required if needed. If using reCAPTCHA, check "Enable reCAPTCHA" and enter your site and secret keys from Google.
- Embedding a Form: Once a form is created, note the shortcode (e.g.,
[trex_forms id="123"]). Edit a page or post and insert this shortcode where the form should appear. - Form Submission: When an end-user submits the form, the plugin will validate the input (any required fields, email format, captcha check, etc.), handle file uploads (saving files to the uploads directory), save the entry to the database, and send email notifications to the configured addresses. The user will see a success message or error messages if some fields were invalid.
- Viewing Entries: In the WordPress admin, go to 'Trex Forms' > 'Entries'. Select the form whose entries you want to view. You can search entries by keyword. Each entry shows its submission date and the data for each field. Use the "Export CSV" button to download all entries (or filtered entries) as a CSV file.
Security
Trex Forms is built with security in mind:
- All form inputs are sanitized and validated on submission (using WordPress functions like
sanitize_text_field,sanitize_email, etc.). - Output is escaped (using
esc_html,esc_attr, etc.) to prevent XSS. - Nonces are used in forms and admin actions to prevent CSRF oai_citation:5‡docs.wpvip.com.
- Only users with appropriate capability (e.g., administrators) can create forms or view entries.
- File uploads are restricted to certain file types and handled via WordPress APIs to ensure safety.
- Direct access to plugin PHP files is prevented (they exit if accessed outside WordPress).
- Follows WordPress coding standards and uses a unique prefix (
trex_) for all functions, classes, and database tables to avoid collisions oai_citation:6‡developer.wordpress.org.
Changelog
1.0.0
- Initial release with form builder, shortcode to display forms, and entries management.