Gravity PDF is a GPLv2-licensed WordPress plugin that allows you to automatically generate, email and download PDF documents using the popular form-builder plugin, Gravity Forms (affiliate link). Find out more about Gravity PDF at https://gravitypdf.com.
This Git repository is for developers who want to contribute to Gravity PDF. Don't use it in production. For production use, download from GravityPDF.com.
The development branch is considered our bleeding edge branch, with all new changes pushed to it. All releases are tagged appropriately.
The Docker setup will create a fully functional development environment preconfigured for Gravity PDF.
- Clone the repository using
git clone https://github.com/GravityPDF/gravity-pdf/from the terminal - Copy and rename
.env.exampleto.env, then replace00000000000000000000000000000000with a valid Gravity Forms license key - Run
composer install - Run
yarn && yarn start - Access a local development site at
http://localhost:8888with the loginadminandpassword.
You can reset the database back to its original state with yarn wp-env clean all. When all else fails, delete everything and start again with yarn wp-env destroy.
See the WordPress Developer Handbook for more details about managing the docker environment.
X-Debug is enabled by default for step debugging and profiling. If you need to use other X-Debug modes you can manually start the environment and pass the appropriate modes in: yarn wp-env start --xdebug=profile,trace,debug.
The default version that will be configured is PHP8.3. If you want to change this you can adjust the phpVersion value in the .wp-env.json file and then stop and start the environment with yarn wp-env start.
If you are making changes to any of the JavaScript or CSS, run yarn dev to ensure the files automatically gets built when you make changes on the file system.
To lint your:
- JS code using
yarn lint:js - CSS code using
yarn lint:css - PHP code using
composer lint
You can auto-fix many issues with yarn format and composer lint:fix.
The automated test suite can only be run using Docker.
Useful commands include:
yarn test:e2e
yarn test:e2e:headless
Run full suite of tests using yarn test:php or yarn test:php:multisite.
The JavaScript unit tests can be run with yarn test:js
All documentation can be found at https://docs.gravitypdf.com.