Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
cd14c36
chore: bump version to 6.14.3
jakejackson1 May 19, 2026
b19ce88
fix: settings, view, and SCSS tweaks for WP 7.0 / PHP 8.5
jakejackson1 May 17, 2026
2233790
fix: font manager footer icons on Tools tab and WP 7.0 sizing
jakejackson1 May 18, 2026
7d706cb
fix: restore help-tab search result formatting
jakejackson1 May 18, 2026
1808645
fix: centre Select Template button text and more-details hover label
jakejackson1 May 18, 2026
1194bac
fix: keep template modal open and show inline error on invalid zip up…
jakejackson1 May 18, 2026
ab62738
fix: replace glob with scandir in unzip_and_verify_templates
jakejackson1 May 18, 2026
4513d14
refactor: use FilesystemIterator for unzipped template discovery
jakejackson1 May 18, 2026
2f7382e
refactor: drop find_template_files helper, extract getTabLocation, tr…
jakejackson1 May 19, 2026
7272f21
fix: switch to \GFForms::$version to address backwards version_compar…
jakejackson1 May 19, 2026
0709dba
fix: TinyMCE editor destroy/reload process on template swap
jakejackson1 May 19, 2026
d4af52c
refactor: remove unnecessary GFCache check in Helper_Abstract_Fields
jakejackson1 May 19, 2026
6da9a88
fix: preserve unsaved edits when switching PDF templates
jakejackson1 May 19, 2026
4df7ed4
docs: add 6.14.3 changelog entries for hot-patch fixes
jakejackson1 May 19, 2026
8dbacdc
fix: treat non-2xx core-fonts responses as failures
jakejackson1 May 18, 2026
342cdb0
test: cover templateUploadProcessing success path and full form-field…
jakejackson1 May 18, 2026
a49787d
fix: honour PDF Conditional Logic toggle so disabling it skips stale …
jakejackson1 May 19, 2026
1e9a021
fix: auto-restore the last-selected TinyMCE editor tab cleanly on tem…
jakejackson1 May 19, 2026
c7979cc
Finalize changelog for 6.14.3
jakejackson1 May 19, 2026
aef0273
Fix changelog formatting
jakejackson1 May 19, 2026
aa73a5b
Fix minor grammar error in changelog
jakejackson1 May 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 26 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,26 @@

## Gravity PDF

### 6.14.3
* 🧹 Housekeeping: WordPress 7.0 Compatibility
* 🧹 Housekeeping: Improved screen-reader support for admin pages
* 🧹 Housekeeping: Remove obsolete Gravity Forms cache workaround
* 🐞 Bug: Honor PDF Conditional Logic toggle setting, so disabling it in the UI skips stale conditional rules
* 🐞 Bug: Fix Rich Text Editor rendering error when switching PDF templates
* 🐞 Bug: Preserve unsaved edits to the Template fields if switching to a PDF template with the same fields (eg. Core / Invoice / Certificate)
* 🐞 Bug: Preserve the selected template when adding a new PDF
* 🐞 Bug: Fix Gravity Forms 2.6+ version detection on PDF form-settings pages
* 🐞 Bug: Fix regression in the Template Manager when an invalid .zip is uploaded
* 🐞 Bug: Minor UI fixes in the Template Manager
* 🐞 Bug: Fix regression in the Core Fonts installer when a download error occurs
* 🐞 Bug: Reset Gravity Wiz Nested Form field IDs after each group in PDFs

### 6.14.2
* 🐞Bug: Fix PHP warning caused by the GFCommon::get_lead_field_display() API change in Gravity Forms 2.9.29
* 🐞Bug: Fix merge tag rendering issue when switching between PDF templates
* 🐞Bug: Fix Font Manager to Font select field syncing issue
* 🐞Bug: Fix edge-case issue with the URL signing feature and improve verification/validation checks
* 🐞Bug: Rename Chinese language files so it is correctly used when the site language is set to the zh_CN locale.
* 🐞 Bug: Fix PHP warning caused by the GFCommon::get_lead_field_display() API change in Gravity Forms 2.9.29
* 🐞 Bug: Fix merge tag rendering issue when switching between PDF templates
* 🐞 Bug: Fix Font Manager to Font select field syncing issue
* 🐞 Bug: Fix edge-case issue with the URL signing feature and improve verification/validation checks
* 🐞 Bug: Rename Chinese language files so it is correctly used when the site language is set to the zh_CN locale.
* 🧹 Housekeeping: Improve template caching and performance
* 🧹 Housekeeping: Update PHP and Javascript dependencies
* 🧹 Housekeeping: Disable asset caching when `SCRIPT_DEBUG` constant enabled
Expand All @@ -17,24 +31,24 @@
### 6.14.1
* 🧹 Housekeeping: Add `gfpdf-{$type}` CSS class to the HTML mark-up when a field uses a different input type
* 🧹 Housekeeping: Use the field type (not input type) in the `gfpdf_pdf_field_content_{$type}` filter
* 🐞Bug: Fix PHP error if another plugin lazy loads the PSR/Log v1 library
* 🐞 Bug: Fix PHP error if another plugin lazy loads the PSR/Log v1 library

### 6.14.0
* 🎉 Feature: Rotate Gravity PDF log files when Gravity Forms logging is enabled. This prevents the log file getting to large.
* 🎉 Feature: Add support for using v1, v2, and v3 of the PSR/Log Composer library with Gravity PDF
* 🐞Bug: Fix PHP error if a third-party plugin loads PSR/Log v2 or v3
* 🐞 Bug: Fix PHP error if a third-party plugin loads PSR/Log v2 or v3

### 6.13.5
* 🐞Bug: Ensure background queue uses correct entry data when resending notifications
* 🐞Bug: Prevent plugins corrupting PDF data when viewing/downloading (via output buffer)
* 🐞 Bug: Ensure background queue uses correct entry data when resending notifications
* 🐞 Bug: Prevent plugins corrupting PDF data when viewing/downloading (via output buffer)

### 6.13.4
* 🐞Bug: Resolve PDF View/Download issue if both Event Espresso and LifterLMS plugin are installed
* 🐞 Bug: Resolve PDF View/Download issue if both Event Espresso and LifterLMS plugin are installed

### 6.13.3
* 🔒 Security: Remove the mPDF and Gravity PDF version numbers in the PDF metadata
* 🐞Bug: Resolve PHP error in 6.13.2 upgrade routine if the temporary PDF directory has been incorrectly set to a shared system folder
* 🐞Bug: Resolve PHP error if the `page` or `subview` admin URL parameters are arrays
* 🐞 Bug: Resolve PHP error in 6.13.2 upgrade routine if the temporary PDF directory has been incorrectly set to a shared system folder
* 🐞 Bug: Resolve PHP error if the `page` or `subview` admin URL parameters are arrays

### 6.13.2
* 🐞 Bug: Fix plugin build issue preventing the mPDF cache filesystem fix (6.13.0) from working
Expand Down
12 changes: 6 additions & 6 deletions pdf.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/*
Plugin Name: Gravity PDF
Version: 6.14.2
Description: Automatically generate highly-customizable PDF documents using Gravity Forms and WordPress (canonical)
Version: 6.14.3
Description: Automatically generate highly customizable PDF documents using Gravity Forms and WordPress (canonical)
Author: Blue Liquid Designs
Author URI: https://blueliquiddesigns.com.au
Plugin URI: https://gravitypdf.com
Expand Down Expand Up @@ -36,7 +36,7 @@
/*
* Set base constants we'll use throughout the plugin
*/
define( 'PDF_EXTENDED_VERSION', '6.14.2' ); /* the current plugin version */
define( 'PDF_EXTENDED_VERSION', '6.14.3' ); /* the current plugin version */
define( 'PDF_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); /* plugin directory path */
define( 'PDF_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); /* plugin directory url */
define( 'PDF_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); /* the plugin basename */
Expand Down Expand Up @@ -219,7 +219,7 @@ public function is_compatible_wordpress_version() {
public function check_gravity_forms() {

/* Gravity Forms version not compatible */
if ( ! class_exists( 'GFCommon' ) ) {
if ( ! class_exists( 'GFForms' ) ) {
$this->notices[] = static function () {
/* translators: 1. HTML Anchor Open Tag 2. HTML Anchor Open Tag 3. Html Anchor Close Tag */
return sprintf( esc_html__( '%1$sGravity Forms%3$s is required to use Gravity PDF. %2$sGet more information%3$s.', 'gravity-pdf' ), '<a href="https://gpdf.us/gf">', '<a href="https://docs.gravitypdf.com/v6/users/activation-errors#gravity-forms-is-required">', '</a>' );
Expand All @@ -228,7 +228,7 @@ public function check_gravity_forms() {
return false;
}

if ( ! version_compare( GFCommon::$version, $this->required_gf_version, '>=' ) ) {
if ( ! version_compare( GFForms::$version, $this->required_gf_version, '>=' ) ) {
$this->notices[] = function () {
/* translators: 1. HTML Anchor Open Tag 2. HTML Anchor Close Tag 3. Plugin version number 4. Html Anchor Open Tag */
return sprintf( esc_html__( '%1$sGravity Forms%2$s version %3$s or higher is required. %4$sGet more information%2$s.', 'gravity-pdf' ), '<a href="https://gpdf.us/gf">', '</a>', $this->required_gf_version, '<a href="https://docs.gravitypdf.com/v6/users/activation-errors#gravity-forms-version-x-is-required">' );
Expand Down Expand Up @@ -532,7 +532,7 @@ public function maybe_display_canonical_plugin_notice() {
]
);

\GFCommon::add_dismissible_message(
GFCommon::add_dismissible_message(
$message,
'gravity-pdf-canonical-plugin-notice',
'warning',
Expand Down
6 changes: 3 additions & 3 deletions src/Helper/Fields/Field_Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ public function html( $value = '', $label = true ) {
$this->field->id = "$field_id-$key";

$html .= parent::html( $markup );
}

/* Reset the ID back to the original value */
$this->field->id = $field_id;
/* Reset the ID back to the original value */
$this->field->id = $field_id;
}

return $html;
}
Expand Down
16 changes: 0 additions & 16 deletions src/Helper/Helper_Abstract_Fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use Exception;
use GF_Field;
use GFCache;
use GFCommon;
use GFFormsModel;
use GFPDF\Statics\Kses;

Expand Down Expand Up @@ -232,20 +230,6 @@ final public function remove_cache() {
*/
final public function get_value() {

/**
* Gravity Forms' GFCache function was thrashing the database, causing double the amount of time for the field_value() method to run.
* The reason is that the cache was checking against a field value stored in a transient every time `GFFormsModel::get_lead_field_value()` is called.
* We're forcing the cache to skip the extra database lookup and just get the value.
*
* @hack
* @since 4.0
* @credit Zack Katz (Gravity View author)
* @fixed Gravity Forms 1.9.13.25
*/
if ( class_exists( 'GFCache' ) && version_compare( GFCommon::$version, '1.9.13.25', '<' ) ) {
GFCache::set( 'GFFormsModel::get_lead_field_value_' . $this->entry['id'] . '_' . $this->field->id, false, false, 0 );
}

/*
* Get the Gravity Forms field value
*
Expand Down
2 changes: 1 addition & 1 deletion src/Helper/Helper_Abstract_Pdf_Shortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ protected function get_pdf_config( $entry_id, $pdf_id ) {
throw new GravityPdfShortcodePdfInactiveException();
}

if ( isset( $settings['conditionalLogic'] ) && ! $this->misc->evaluate_conditional_logic( $settings['conditionalLogic'], $entry ) ) {
if ( ! $this->misc->conditional_logic_passes( $settings, $entry ) ) {
throw new GravityPdfShortcodePdfConditionalLogicFailedException();
}

Expand Down
3 changes: 2 additions & 1 deletion src/Helper/Helper_Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use GFAPI;
use GFCommon;
use GFForms;
use GFFormsModel;
use WP_Error;

Expand Down Expand Up @@ -33,7 +34,7 @@ class Helper_Form extends Helper_Abstract_Form {
* @since 4.0
*/
public function get_version() {
return GFCommon::$version;
return GFForms::$version;
}

/**
Expand Down
33 changes: 33 additions & 0 deletions src/Helper/Helper_Misc.php
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,39 @@ public function update_deprecated_config( $value ) {
return $value;
}

/**
* Whether a PDF's saved settings should pass the entry through conditional-logic gating.
*
* The form-settings UI exposes two related fields: the `conditional` toggle (the user-visible
* on/off switch) and the `conditionalLogic` rules array. They can drift out of sync — the
* toggle gets disabled while the rules array keeps its previous value — so trusting only
* `conditionalLogic` makes the runtime disagree with what the UI shows.
*
* Returns true when the entry is allowed (toggle off, no rules, or rules pass), false when
* the toggle is on and rules explicitly reject the entry.
*
* The `conditional` key may be absent on very old settings; treat that as "no override,
* fall back to the rules" so legacy behaviour is preserved.
*
* @param array $settings The PDF settings array
* @param array $entry The Gravity Forms entry
*
* @return bool
*
* @since 6.14.3
*/
public function conditional_logic_passes( $settings, $entry ) {
if ( array_key_exists( 'conditional', $settings ) && empty( $settings['conditional'] ) ) {
return true;
}

if ( empty( $settings['conditionalLogic'] ) ) {
return true;
}

return $this->evaluate_conditional_logic( $settings['conditionalLogic'], $entry );
}

/**
* Determine if the logic should show or hide the item
*
Expand Down
5 changes: 3 additions & 2 deletions src/Helper/Helper_PDF_List_Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace GFPDF\Helper;

use GFForms;
use WP_List_Table;

/**
Expand Down Expand Up @@ -223,7 +224,7 @@ public function column_cb( $item ) {
$text = __( 'Inactive', 'gravity-pdf' );
}

$gf_less_than_288 = version_compare( \GFCommon::$version, '2.8.8', '<' );
$gf_less_than_288 = version_compare( GFForms::$version, '2.8.8', '<' );

?>

Expand Down Expand Up @@ -289,7 +290,7 @@ public function column_shortcode( $item ) {

ob_start();
/* If the current GF version is 2.6 or higher, use the new updated UI for the shortcode button or else use the pre GF 2.5 version. */
if ( version_compare( '2.6-rc-1', \GFCommon::$version, '<=' ) ):
if ( version_compare( GFForms::$version, '2.6.0', '>=' ) ):
?>
<button type="button"
class="gform-button gform-button--size-r gform-button--white gform-button--icon-leading gform-embed-form__shortcode-trigger btn-shortcode"
Expand Down
10 changes: 6 additions & 4 deletions src/Model/Model_Form_Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace GFPDF\Model;

use GFForms;
use GFFormsModel;
use GFCommon;
use GFPDF\Helper\Helper_Abstract_Form;
use GFPDF\Helper\Helper_Abstract_Model;
use GFPDF\Helper\Helper_Abstract_Options;
Expand Down Expand Up @@ -225,7 +225,7 @@ public function show_edit_view( $form_id, $pdf_id ) {

/* add custom classes to form */
$form_classes = '';
if ( version_compare( '2.6-rc-1', GFCommon::$version, '>=' ) ) {
if ( version_compare( GFForms::$version, '2.6.0', '>=' ) ) {
$form_classes .= 'gfpdf-gf-2-6';
}

Expand Down Expand Up @@ -627,6 +627,7 @@ public function get_template_name_from_current_page() {
/* phpcs:enable */

/* If we don't have a specific PDF we'll use the defaults */
$template = '';
if ( empty( $pid ) || empty( $form_id ) ) {
$template = $this->options->get_option( 'default_template', 'zadani' );
} else {
Expand All @@ -635,8 +636,9 @@ public function get_template_name_from_current_page() {

if ( ! is_wp_error( $pdf ) ) {
$template = $pdf['template'];
} else {
$template = '';
} elseif ( ! empty( $_POST['gfpdf_settings']['template'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
/* in the middle of creating a new PDF, and not yet saved in the DB. Grab from POST data */
$template = sanitize_html_class( $_POST['gfpdf_settings']['template'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Model/Model_Mergetags.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function process_pdf_mergetags( $text, $form, $entry, $url_encode ) {
/* Strip tag if config not valid, it isn't active or conditional logic is not met */
if ( is_wp_error( $config )
|| $config['active'] !== true
|| ( isset( $config['conditionalLogic'] ) && ! $this->misc->evaluate_conditional_logic( $config['conditionalLogic'], $entry ) )
|| ! $this->misc->conditional_logic_passes( $config, $entry )
) {
$error = 'Conditional logic did not pass';
if ( is_wp_error( $config ) ) {
Expand Down
4 changes: 2 additions & 2 deletions src/Model/Model_PDF.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ public function middle_active( $action, $entry, $settings ) {
public function middle_conditional( $action, $entry, $settings ) {

if ( ! is_wp_error( $action ) ) {
if ( isset( $settings['conditionalLogic'] ) && ! $this->misc->evaluate_conditional_logic( $settings['conditionalLogic'], $entry ) ) {
if ( ! $this->misc->conditional_logic_passes( $settings, $entry ) ) {
return new WP_Error( 'conditional_logic', esc_html__( 'PDF conditional logic requirements have not been met.', 'gravity-pdf' ) );
}
}
Expand Down Expand Up @@ -795,7 +795,7 @@ public function get_active_pdfs( $pdfs, $entry ) {
$form = apply_filters( 'gfpdf_current_form_object', $this->gform->get_form( $entry['form_id'] ), $entry, __FUNCTION__ );

foreach ( $pdfs as $pdf ) {
if ( $pdf['active'] && ( empty( $pdf['conditionalLogic'] ) || $this->misc->evaluate_conditional_logic( $pdf['conditionalLogic'], $entry ) ) ) {
if ( $pdf['active'] && $this->misc->conditional_logic_passes( $pdf, $entry ) ) {
$filtered[ $pdf['id'] ] = $pdf;
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/Model/Model_Templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function ajax_process_uploaded_template() {

/* Get the template headers now all the files are in the right location */
$this->templates->flush_template_transient_cache();
$headers = $this->get_template_info( glob( $unzipped_dir_name . '*.php', GLOB_NOSORT ) );
$headers = $this->get_template_info( $this->templates->get_all_templates_in_folder( $unzipped_dir_name ) );

/* Fix template path */
$headers = array_map(
Expand Down Expand Up @@ -356,8 +356,10 @@ public function unzip_and_verify_templates( $zip_path ) {
throw new Exception( esc_html( $results->get_error_message() ) );
}

/* Check unzipped templates for a valid v4 header, or v3 string pattern */
$files = glob( $dir . '*.php', GLOB_NOSORT );
/* Check unzipped templates for a valid v4 header, or v3 string pattern.
Avoid glob() here — it can return a stale (empty) listing when called
immediately after unzip_file() writes via the WP_Filesystem abstraction */
$files = $this->templates->get_all_templates_in_folder( $dir );

if ( ! is_array( $files ) || count( $files ) === 0 ) {
throw new Exception( esc_html__( 'No valid PDF template found in Zip archive.', 'gravity-pdf' ) );
Expand Down
53 changes: 38 additions & 15 deletions src/View/html/GravityForms/settings_field.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,43 @@

/** @var $args array */

$for = $args['callback_args']['type'] !== 'rich_editor' ?
'gfpdf_settings[' . $args['callback_args']['id'] . ']' :
'gfpdf_settings_' . $args['callback_args']['id'];

/* Group complex fields together into a fieldset */
?>

<div id="<?php echo esc_attr( $args['id'] ); ?>" class="<?php echo esc_attr( $args['class'] ); ?>">
<?php if ( ! empty( $args['title'] ) ): ?>
<div class='gform-settings-panel__title'>
<label for="gfpdf_settings[<?php echo esc_attr( $args['callback_args']['id'] ); ?>]">
<?php echo esc_html( $args['title'] ); ?>
</label>

<?php if ( ! empty( $args['tooltip'] ) ): ?>
<?php echo wp_kses_post( $args['tooltip'] ); ?>
<?php endif; ?>
</div>
<?php endif; ?>

<?php call_user_func( $args['callback'], $args['callback_args'] ); ?>
</div>
<?php if ( ! in_array( $args['callback_args']['type'], [ 'radio', 'multicheck', 'conditional_logic', 'paper_size' ], true ) ): ?>
<div id="<?php echo esc_attr( $args['id'] ); ?>" class="<?php echo esc_attr( $args['class'] ); ?>">
<?php if ( ! empty( $args['title'] ) ): ?>
<div class='gform-settings-panel__title'>
<label for="<?php echo esc_attr( $for ); ?>">
<?php echo esc_html( $args['title'] ); ?>
</label>

<?php if ( ! empty( $args['tooltip'] ) ): ?>
<?php echo wp_kses_post( $args['tooltip'] ); ?>
<?php endif; ?>
</div>
<?php endif; ?>

<?php call_user_func( $args['callback'], $args['callback_args'] ); ?>
</div>
<?php else: ?>
<fieldset id="<?php echo esc_attr( $args['id'] ); ?>" class="<?php echo esc_attr( $args['class'] ); ?>">
<?php if ( ! empty( $args['title'] ) ): ?>
<div class='gform-settings-panel__title'>
<legend>
<?php echo esc_html( $args['title'] ); ?>
</legend>

<?php if ( ! empty( $args['tooltip'] ) ): ?>
<?php echo wp_kses_post( $args['tooltip'] ); ?>
<?php endif; ?>
</div>
<?php endif; ?>

<?php call_user_func( $args['callback'], $args['callback_args'] ); ?>
</fieldset>
<?php endif; ?>
Loading
Loading