awsmug / torro-forms-plugin-boilerplate
Plugin Boilerplate for Torro Forms.
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 4
Forks: 1
Open Issues: 1
Type:wordpress-plugin
pkg:composer/awsmug/torro-forms-plugin-boilerplate
Requires
- php: >=5.6.0
- composer/installers: ~1.0
Requires (Dev)
- phpunit/phpunit: >4.8.20 <6.0
- squizlabs/php_codesniffer: 3.*
- wimg/php-compatibility: ^8
- wp-coding-standards/wpcs: 0.14.*
This package is auto-updated.
Last update: 2025-10-07 22:12:30 UTC
README
Torro Forms Plugin Boilerplate
This is a plugin boilerplate for a Torro Forms extension. It is highly encouraged to use this boilerplate when building any extension for Torro Forms.
Getting Started
To create your own plugin, download this repository. For the next steps, let's assume your plugin should be called Torro Super Extension.
- Rename the directory to
torro-super-extension. - Rename the plugin main file to
torro-super-extension.php. - Open
gulpfile.jsand scroll to the bottom. - Replace every value in the
replacementsobject with your new plugin name or plugin author data in the appropriate format. For example, replacemy-new-plugin-namewithtorro-super-extension,MY_NEW_PLUGIN_NAMEwithTORRO_SUPER_EXTENSIONand so on. Replace the plugin namespace vendor, plugin URL, author name, author email and author URL with your respective data. - Save the changes.
- Run
npm installin the console. - Run
gulp init-replacein the console. - Open
gulpfile.jsagain and remove the entire bottom section that starts withINITIAL SETUP TASK, save the file afterwards. - Check the
composer.jsonandpackage.jsonfiles. You might wanna update some details to your preferences. - Check the top of
gulpfile.js, containing theconfigobject. You might wanna update some details to your preferences. - Run
gulp buildonce to compile everything.
Now you're good to go! One more thing: If you want to publish the plugin on wordpress.org, it's recommended to remove the /languages directory, plus set the config.domainPath to false and remove the pot task in gulpfile.js. Then, remove the now unnecessary arguments from the Extension::load_textdomain() method accordingly.
Actual Development
Adjust the src/extension.php file to your needs. This is where your extension will get bootstrapped. You can instantiate the services your extension needs here, setup hooks (which will then be automatically invoked by the Torro Forms main plugin) and more.
All further classes and assets in the boilerplate is optional and simply sample code. Just bear in mind, you should stick to the directory structure used in the boilerplate - it is oriented after the Torro Forms base plugin.
Common Gulp Tasks
gulp sass: Compiles CSS/Sassgulp js: Compiles JavaScriptgulp pot: Refreshes POT filegulp header-replace: Replaces the plugin header with latest datagulp readme-replace: Replaces the header and description in the readme with latest datagulp build: Runs all of the above tasks