Conditional Fields for Contact Form 7 - Version 2.0.8

Version Description

(2021-11-28) = * Check how code changes in CF7 related to wpcf7_contact_form_properties impact the plugin, and update TODO comments accordingly. * Fully tested with Contact Form 7 version 5.5.3 * Write additional tests for forms loaded via AJAX * only show compatibility notices to users with the update_plugins capabilities

Download this release

Release Info

Developer Jules Colle
Plugin Icon 128x128 Conditional Fields for Contact Form 7
Version 2.0.8
Comparing to
See all releases

Code changes from version 2.0.7 to 2.0.8

admin.php CHANGED
@@ -288,7 +288,6 @@ add_action('admin_notices', function () {
288
  $settings = wpcf7cf_get_settings();
289
 
290
  $nid = 'install-cf7';
291
-
292
  if (!defined('WPCF7_VERSION') && empty($settings['notice_dismissed_'.$nid])) {
293
  ?>
294
  <div class="wpcf7cf-admin-notice notice notice-warning is-dismissible" data-notice-id="<?php echo $nid ?>">
@@ -301,7 +300,7 @@ add_action('admin_notices', function () {
301
  }
302
 
303
  $nid = 'rollback-cf7-'.WPCF7CF_CF7_MAX_VERSION;
304
- if ( version_compare( WPCF7CF_CF7_MAX_VERSION, WPCF7_VERSION, '<' ) && empty($settings['notice_dismissed_'.$nid]) ) {
305
  ?>
306
  <div class="wpcf7cf-admin-notice notice notice-warning is-dismissible" data-notice-id="<?php echo $nid ?>">
307
  <p>
@@ -314,7 +313,7 @@ add_action('admin_notices', function () {
314
  }
315
 
316
  $nid = 'update-cf7-'.WPCF7CF_CF7_MAX_VERSION;
317
- if ( version_compare( WPCF7CF_CF7_MAX_VERSION, WPCF7_VERSION, '>' ) && empty($settings['notice_dismissed_'.$nid]) ) {
318
  ?>
319
  <div class="wpcf7cf-admin-notice notice notice-warning is-dismissible" data-notice-id="<?php echo $nid ?>">
320
  <p>
288
  $settings = wpcf7cf_get_settings();
289
 
290
  $nid = 'install-cf7';
 
291
  if (!defined('WPCF7_VERSION') && empty($settings['notice_dismissed_'.$nid])) {
292
  ?>
293
  <div class="wpcf7cf-admin-notice notice notice-warning is-dismissible" data-notice-id="<?php echo $nid ?>">
300
  }
301
 
302
  $nid = 'rollback-cf7-'.WPCF7CF_CF7_MAX_VERSION;
303
+ if ( version_compare( WPCF7CF_CF7_MAX_VERSION, WPCF7_VERSION, '<' ) && empty($settings['notice_dismissed_'.$nid]) && current_user_can('update_plugins') ) {
304
  ?>
305
  <div class="wpcf7cf-admin-notice notice notice-warning is-dismissible" data-notice-id="<?php echo $nid ?>">
306
  <p>
313
  }
314
 
315
  $nid = 'update-cf7-'.WPCF7CF_CF7_MAX_VERSION;
316
+ if ( version_compare( WPCF7CF_CF7_MAX_VERSION, WPCF7_VERSION, '>' ) && empty($settings['notice_dismissed_'.$nid]) && current_user_can('update_plugins') ) {
317
  ?>
318
  <div class="wpcf7cf-admin-notice notice notice-warning is-dismissible" data-notice-id="<?php echo $nid ?>">
319
  <p>
cf7cf.php CHANGED
@@ -389,8 +389,7 @@ new CF7CF;
389
  add_filter( 'wpcf7_contact_form_properties', 'wpcf7cf_properties', 10, 2 );
390
 
391
  function wpcf7cf_properties($properties, $wpcf7form) {
392
- // TODO: This function is called serveral times. The problem is that the filter is called each time we call get_properties() on a contact form.
393
- // TODO: I haven't found a better way to solve this problem yet, any suggestions or push requests are welcome. (same problem in PRO/repeater.php)
394
  if (!is_admin() || (defined('DOING_AJAX') && DOING_AJAX)) { // TODO: kind of hacky. maybe find a better solution. Needed because otherwise the group tags will be replaced in the editor as well.
395
  $form = $properties['form'];
396
 
389
  add_filter( 'wpcf7_contact_form_properties', 'wpcf7cf_properties', 10, 2 );
390
 
391
  function wpcf7cf_properties($properties, $wpcf7form) {
392
+ // Before CF7 5.5.3, this function was called each time we call get_properties() on a contact form. Since CF7 5.5.3 this function is called only once in the WPCF7_ContactForm
 
393
  if (!is_admin() || (defined('DOING_AJAX') && DOING_AJAX)) { // TODO: kind of hacky. maybe find a better solution. Needed because otherwise the group tags will be replaced in the editor as well.
394
  $form = $properties['form'];
395
 
contact-form-7-conditional-fields.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: http://bdwm.be/
5
  * Description: Adds support for conditional fields to Contact Form 7. This plugin depends on Contact Form 7.
6
  * Author: Jules Colle
7
- * Version: 2.0.7
8
  * Author URI: http://bdwm.be/
9
  * Text Domain: cf7-conditional-fields
10
  * License: GPL v2 or later
4
  * Plugin URI: http://bdwm.be/
5
  * Description: Adds support for conditional fields to Contact Form 7. This plugin depends on Contact Form 7.
6
  * Author: Jules Colle
7
+ * Version: 2.0.8
8
  * Author URI: http://bdwm.be/
9
  * Text Domain: cf7-conditional-fields
10
  * License: GPL v2 or later
init.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
 
3
- if (!defined('WPCF7CF_VERSION')) define( 'WPCF7CF_VERSION', '2.0.7' );
4
  if (!defined('WPCF7CF_CF7_MIN_VERSION')) define( 'WPCF7CF_CF7_MIN_VERSION', '5.4' );
5
- if (!defined('WPCF7CF_CF7_MAX_VERSION')) define( 'WPCF7CF_CF7_MAX_VERSION', '5.5.2' );
6
  if (!defined('WPCF7CF_REQUIRED_WP_VERSION')) define( 'WPCF7CF_REQUIRED_WP_VERSION', '4.1' );
7
  if (!defined('WPCF7CF_PLUGIN')) define( 'WPCF7CF_PLUGIN', __FILE__ );
8
  if (!defined('WPCF7CF_PLUGIN_BASENAME')) define( 'WPCF7CF_PLUGIN_BASENAME', plugin_basename( WPCF7CF_PLUGIN ) );
1
  <?php
2
 
3
+ if (!defined('WPCF7CF_VERSION')) define( 'WPCF7CF_VERSION', '2.0.8' );
4
  if (!defined('WPCF7CF_CF7_MIN_VERSION')) define( 'WPCF7CF_CF7_MIN_VERSION', '5.4' );
5
+ if (!defined('WPCF7CF_CF7_MAX_VERSION')) define( 'WPCF7CF_CF7_MAX_VERSION', '5.5.3' );
6
  if (!defined('WPCF7CF_REQUIRED_WP_VERSION')) define( 'WPCF7CF_REQUIRED_WP_VERSION', '4.1' );
7
  if (!defined('WPCF7CF_PLUGIN')) define( 'WPCF7CF_PLUGIN', __FILE__ );
8
  if (!defined('WPCF7CF_PLUGIN_BASENAME')) define( 'WPCF7CF_PLUGIN_BASENAME', plugin_basename( WPCF7CF_PLUGIN ) );
jsdoc-out/index.html CHANGED
@@ -56,7 +56,7 @@
56
  <br class="clear">
57
 
58
  <footer>
59
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.5</a> on Tue Oct 26 2021 07:48:22 GMT+0200 (Midden-Europese zomertijd)
60
  </footer>
61
 
62
  <script> prettyPrint(); </script>
56
  <br class="clear">
57
 
58
  <footer>
59
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.5</a> on Sun Nov 28 2021 22:27:58 GMT+0100 (Midden-Europese standaardtijd)
60
  </footer>
61
 
62
  <script> prettyPrint(); </script>
jsdoc-out/scripts_es6.js.html CHANGED
@@ -1571,7 +1571,7 @@ jQuery.fn.wpcf7ExclusiveCheckbox = function() {
1571
  <br class="clear">
1572
 
1573
  <footer>
1574
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.5</a> on Tue Oct 26 2021 07:48:22 GMT+0200 (Midden-Europese zomertijd)
1575
  </footer>
1576
 
1577
  <script> prettyPrint(); </script>
1571
  <br class="clear">
1572
 
1573
  <footer>
1574
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.5</a> on Sun Nov 28 2021 22:27:58 GMT+0100 (Midden-Europese standaardtijd)
1575
  </footer>
1576
 
1577
  <script> prettyPrint(); </script>
jsdoc-out/wpcf7cf.html CHANGED
@@ -1359,7 +1359,7 @@ Subs are either appended to or removed from the end of the repeater.</p>
1359
  <br class="clear">
1360
 
1361
  <footer>
1362
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.5</a> on Tue Oct 26 2021 07:48:22 GMT+0200 (Midden-Europese zomertijd)
1363
  </footer>
1364
 
1365
  <script> prettyPrint(); </script>
1359
  <br class="clear">
1360
 
1361
  <footer>
1362
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.5</a> on Sun Nov 28 2021 22:27:58 GMT+0100 (Midden-Europese standaardtijd)
1363
  </footer>
1364
 
1365
  <script> prettyPrint(); </script>
readme.txt CHANGED
@@ -5,8 +5,8 @@ Author: Jules Colle
5
  Website: http://bdwm.be
6
  Tags: wordpress, contact form 7, forms, conditional fields
7
  Requires at least: 5.0
8
- Tested up to: 5.8.1
9
- Stable tag: 2.0.7
10
  Requires PHP: 7.0
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -123,6 +123,12 @@ Make sure to also update CF7 to the latest version! (Version 2.0 is only compati
123
 
124
  == Changelog ==
125
 
 
 
 
 
 
 
126
  = 2.0.7 (2021-10-26) =
127
  * Fully tested with Contact Form 7 version 5.5.2 (and also make the warning message disappear if all plugins are up to date)
128
 
5
  Website: http://bdwm.be
6
  Tags: wordpress, contact form 7, forms, conditional fields
7
  Requires at least: 5.0
8
+ Tested up to: 5.8.2
9
+ Stable tag: 2.0.8
10
  Requires PHP: 7.0
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
123
 
124
  == Changelog ==
125
 
126
+ = 2.0.8 (2021-11-28) =
127
+ * Check how code changes in CF7 related to `wpcf7_contact_form_properties` impact the plugin, and update TODO comments accordingly.
128
+ * Fully tested with Contact Form 7 version 5.5.3
129
+ * Write additional tests for forms loaded via AJAX
130
+ * only show compatibility notices to users with the update_plugins capabilities
131
+
132
  = 2.0.7 (2021-10-26) =
133
  * Fully tested with Contact Form 7 version 5.5.2 (and also make the warning message disappear if all plugins are up to date)
134