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. 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 Gravity PDF from the WordPress Plugin Directory.
development branch is considered our bleeding edge branch, with all new changes pushed to it. The
master branch is our latest stable version of Gravity PDF.
- Clone the repository using
git clone https://github.com/GravityPDF/gravity-pdf/
- Open your terminal / command prompt to the Gravity PDF root directory and run
composer install. This command will automatically download all the PHP and JS packages, and run the build tools.
- Copy the plugin to your WordPress plugin directory (if not there already) and active through your WordPress admin area
All documentation can be found at https://gravitypdf.com/documentation/.
You are more than welcome to contribute to Gravity PDF but we recommend you open a new issue on GitHub and discuss your use-case before creating a pull request.
There are a few guidelines that need to be followed to ensure a smooth pull request. These include:
- Adhere to the existing code standard which follows WordPress standards, with the exception of Yoda conditionals.
- All PRs must be to the
- Modifications of the existing codebase must pass all unit tests.
- Any additions to the plugin must have appropriate unit tests written.
- PRs that don't pass existing unit testing or do not have the proper tests to accompany the changes will not be merged.
- Once our team is happy with the PR we'll ask you to squash your branch into a single commit, rebase it onto the development branch and push the changes to GitHub. This ensures we keep a clean Git history.
If you are uncertain whether your PR meets all these requirements, don't worry! If there are problems our friendly team will guide you in the right direction.
Run Unit Tests
We use PHPUnit to test out all the PHP we write. The tests are located in
Installing the testing environment is best done using a flavour of Vagrant (try Varying Vagrant Vagrants).
- From your terminal SSH into your Vagrant box using the
cdinto the root of your Gravity PDF directory
bash tests/bin/install.sh gravitypdf_test root root localhostwhere
root rootis substituted for your mysql username and password (VVV users can run the command as is).
- Upon success you can run
vendor/bin/phpunit --group ajaxand
vendor/bin/phpunit --group slow-pdf-processes.
The tests are located in
Running the tests can easily be done with one of the following commands:
yarn run test– runs all the tests once in PhantomJS
yarn run test:watch– watches for changes to the tests and runs in PhantomJS
yarn run test:all– runs all tests in Firefox, Chrome and Internet Explorer
yarn run watch to automatically re-build the JS when changes are made.