Changeset 3043837
- Timestamp:
- 03/01/2024 10:17:13 PM (2 years ago)
- Location:
- fresh-forms-for-gravity
- Files:
-
- 5 added
- 3 edited
-
tags/1.4.16 (added)
-
tags/1.4.16/LICENSE (added)
-
tags/1.4.16/class-fresh-forms-for-gravity.php (added)
-
tags/1.4.16/fresh-forms-for-gravity.php (added)
-
tags/1.4.16/readme.txt (added)
-
trunk/class-fresh-forms-for-gravity.php (modified) (5 diffs)
-
trunk/fresh-forms-for-gravity.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
fresh-forms-for-gravity/trunk/class-fresh-forms-for-gravity.php
r3043598 r3043837 421 421 public function find_gf_shortcode( $post_content ) { 422 422 423 // Prevent fatal error if post content is not a string (as required by WordPress has_shortcode function). 424 // Which could happen for not supported embedding methods or when a third-party is altering the expected post content. 425 if ( ! is_string( $post_content ) ) { 426 $this->log_debug( __METHOD__ . '(): Post Content is not a string. Aborting...' ); 427 return false; 428 } 429 423 430 // Check for a GF shortcode. 424 431 if ( has_shortcode( $post_content, 'gravityform' ) ) { … … 462 469 */ 463 470 public function scan_content( $content, $value, $generator ) { 471 472 // Return without scanning if there's no content to scan. 473 if ( empty( $content ) ){ 474 $this->log_debug( __METHOD__ . "(): {$generator} content is empty. Nothing to scan." ); 475 return false; 476 } 477 464 478 $this->log_debug( __METHOD__ . "(): {$generator} content to scan: {$content} " ); 465 479 // Look for the gform_wrapper. … … 483 497 484 498 foreach ( $acf_fields as $acf_field ) { 499 //$this->log_debug( __METHOD__ . '(): ACF field properties: ' . print_r( $acf_field, true ) ); 500 485 501 if ( ! in_array( $acf_field['type'], $supported_acf_fields, true ) ) { 486 502 continue; … … 488 504 489 505 if ( 'text' === $acf_field['type'] || 'textarea' === $acf_field['type'] ) { // Look for a GF shortcode inside a standalone text or textarea fields. 490 if ( true === $this->find_gf_shortcode( $acf_field['value'], 'gform_wrapper') ) {506 if ( is_string( $acf_field['value'] ) && true === $this->find_gf_shortcode( $acf_field['value'] ) ) { 491 507 $this->log_debug( __METHOD__ . "(): ACF {$acf_field['type']} field has a GF form!" ); 492 508 return true; 493 509 } 494 510 } elseif ( 'wysiwyg' === $acf_field['type'] ) { // Look for a GF class inside a standalone wysiwyg field. 495 if ( true === $this->scan_content( $acf_field['value'], 'gform_wrapper', 'ACF' ) ) {511 if ( is_string( $acf_field['value'] ) && true === $this->scan_content( $acf_field['value'], 'gform_wrapper', 'ACF' ) ) { 496 512 $this->log_debug( __METHOD__ . "(): ACF {$acf_field['type']} field has a GF form!" ); 497 513 return true; … … 501 517 foreach ( $acf_field['value'] as $acf_subfield_array ) { 502 518 foreach ( $acf_subfield_array as $key => $value ) { 503 if ( true === $this->find_gf_shortcode( $value ) ) {519 if ( is_string( $value ) && true === $this->find_gf_shortcode( $value ) ) { 504 520 $this->log_debug( __METHOD__ . "(): ACF {$acf_field['type']} field has a GF form!" ); 505 521 return true; 506 } elseif ( true === $this->scan_content( $value, 'gform_wrapper', 'ACF' ) ) {522 } elseif ( is_string( $value ) && true === $this->scan_content( $value, 'gform_wrapper', 'ACF' ) ) { 507 523 $this->log_debug( __METHOD__ . "(): ACF {$acf_field['type']} field has a GF form!" ); 508 524 return true; -
fresh-forms-for-gravity/trunk/fresh-forms-for-gravity.php
r3043598 r3043837 4 4 * Description: Prevent posts and pages with a Gravity Forms shortcode or Gutenberg block from being cached. 5 5 * Author: Samuel Aguilera 6 * Version: 1.4.1 56 * Version: 1.4.16 7 7 * Author URI: https://www.samuelaguilera.com 8 8 * Text Domain: fresh-forms-for-gravity … … 27 27 */ 28 28 29 define( 'FRESH_FORMS_FOR_GRAVITY_VERSION', '1.4.1 5' );29 define( 'FRESH_FORMS_FOR_GRAVITY_VERSION', '1.4.16' ); 30 30 31 31 // Scripts handlers for plugins using them for exclusion filters (e.g. SG Optimizer or Hummingbird). - Defined here to allow WordPress functions to access them. -
fresh-forms-for-gravity/trunk/readme.txt
r3043806 r3043837 4 4 Requires at least: 4.9 5 5 Tested up to: 6.4.3 6 Stable tag: 1.4.1 56 Stable tag: 1.4.16 7 7 Requires PHP: 7.0 8 8 License: GPLv3 … … 56 56 * [Page Optimize](https://wordpress.org/plugins/page-optimize/) (Script concatenation only) 57 57 * Perfmatters (Delay JS exclusions only) 58 * S iteGround Optimizer58 * Speed Optimizer (by SiteGround, the plugin with more name changes in the history of WordPress!) 59 59 * Surge 60 60 * W3 Total Cache … … 167 167 == Changelog == 168 168 169 = 1.4.16 = 170 171 * Prevent fatal error if post content is not a string (as required by WordPress has_shortcode function). Which could happen for not supported embedding methods or when a third-party is altering the expected post content. 172 169 173 = 1.4.15 = 170 174
Note: See TracChangeset
for help on using the changeset viewer.