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.example
to.env
, then replace00000000000000000000000000000000
with a valid Gravity Forms license key - Run
yarn && yarn build:production
- Start Docker and then run
yarn env:install
to setup the local development environment - Access a local development site at
http://localhost:8888
with the loginadmin
andpassword
.
If you shut down Docker and want to fire up the environment later, use yarn wp-env start
. 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.0. 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 would rather use your own development environment, you can build Gravity PDF using the following commands.
- Clone the repository using
git clone https://github.com/GravityPDF/gravity-pdf/
- Run
yarn && yarn build:production
- Run
composer install
- Run
composer run prefix
If you are making changes to any of the JavaScript or CSS, run yarn build:dev
to ensure the files automatically gets built when you make changes on the file system.
To lint your JS code use yarn lint:js
, and to try automatically fix it use yarn lint:js:fix
.
To lint your PHP code, use composer lint
, and to try automatically fix it use 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.