Contact Form 7 Redirection - Version 1.3.1

Version Description

  • Fixed a bug in legacy browsers: the Pro message keep showing.
Download this release

Release Info

Developer yuvalsabar
Plugin Icon 128x128 Contact Form 7 Redirection
Version 1.3.1
Comparing to
See all releases

Code changes from version 1.2.9 to 1.3.1

admin/wpcf7-redirect-admin-script.js CHANGED
@@ -1,52 +1,65 @@
1
  jQuery(document).ready(function($) {
 
2
  // field - open in a new tab
3
- jQuery( '#wpcf7-redirect-open-in-new-tab' ).change(function() {
4
- if ( jQuery( this ).is( ":checked" ) ) {
5
- jQuery( '.field-notice-alert' ).removeClass( 'field-notice-hidden' );
6
  } else {
7
- jQuery( '.field-notice-alert' ).addClass( 'field-notice-hidden' );
8
  }
9
  });
10
 
11
- if ( jQuery( '#wpcf7-redirect-open-in-new-tab' ).is( ":checked" ) ) {
12
- jQuery( '.field-notice-alert' ).removeClass( 'field-notice-hidden' );
13
  }
14
 
15
  // fields - http build query
16
- jQuery( '#wpcf7-redirect-http-build-query-selectively' ).change(function() {
17
- if ( jQuery( this ).is( ":checked" ) ) {
18
- jQuery( '#wpcf7-redirect-http-build-query-selectively-fields' ).removeClass( 'field-hidden' );
19
  }
20
  });
21
 
22
- jQuery( '#wpcf7-redirect-http-build-query' ).change(function() {
23
- if ( jQuery( this ).is( ":checked" ) ) {
24
- jQuery( '#wpcf7-redirect-http-build-query-selectively-fields' ).addClass( 'field-hidden' );
25
  }
26
  });
27
 
28
- if ( jQuery( '#wpcf7-redirect-http-build-query-selectively' ).is( ":checked" ) ) {
29
- jQuery( '#wpcf7-redirect-http-build-query-selectively-fields' ).removeClass( 'field-hidden' );
30
  }
31
 
32
- jQuery('.checkbox-radio-1').change(function() {
33
- var checked = jQuery(this).is(':checked');
34
- jQuery('.checkbox-radio-1').prop('checked', false);
35
  if ( checked ) {
36
- jQuery(this).prop('checked',true);
37
  }
38
  });
39
 
40
  // field - after sent script
41
- jQuery( '#wpcf7-redirect-after-sent-script' ).keyup(function(event) {
42
- if ( jQuery(this).val().length != 0 ) {
43
- jQuery( '.field-warning-alert' ).removeClass( 'field-notice-hidden' );
44
  } else {
45
- jQuery( '.field-warning-alert' ).addClass( 'field-notice-hidden' );
46
  }
47
  });
48
 
49
- if ( jQuery( '#wpcf7-redirect-after-sent-script' ).val() ) {
50
- jQuery( '.field-warning-alert' ).removeClass( 'field-notice-hidden' );
51
  }
 
 
 
 
 
 
 
 
 
 
 
 
52
  });
1
  jQuery(document).ready(function($) {
2
+
3
  // field - open in a new tab
4
+ $( '#wpcf7-redirect-open-in-new-tab' ).change(function() {
5
+ if ( $( this ).is( ":checked" ) ) {
6
+ $( '.field-notice-alert' ).removeClass( 'field-notice-hidden' );
7
  } else {
8
+ $( '.field-notice-alert' ).addClass( 'field-notice-hidden' );
9
  }
10
  });
11
 
12
+ if ( $( '#wpcf7-redirect-open-in-new-tab' ).is( ":checked" ) ) {
13
+ $( '.field-notice-alert' ).removeClass( 'field-notice-hidden' );
14
  }
15
 
16
  // fields - http build query
17
+ $( '#wpcf7-redirect-http-build-query-selectively' ).change(function() {
18
+ if ( $( this ).is( ":checked" ) ) {
19
+ $( '#wpcf7-redirect-http-build-query-selectively-fields' ).removeClass( 'field-hidden' );
20
  }
21
  });
22
 
23
+ $( '#wpcf7-redirect-http-build-query' ).change(function() {
24
+ if ( $( this ).is( ":checked" ) ) {
25
+ $( '#wpcf7-redirect-http-build-query-selectively-fields' ).addClass( 'field-hidden' );
26
  }
27
  });
28
 
29
+ if ( $( '#wpcf7-redirect-http-build-query-selectively' ).is( ":checked" ) ) {
30
+ $( '#wpcf7-redirect-http-build-query-selectively-fields' ).removeClass( 'field-hidden' );
31
  }
32
 
33
+ $('.checkbox-radio-1').change(function() {
34
+ var checked = $(this).is(':checked');
35
+ $('.checkbox-radio-1').prop('checked', false);
36
  if ( checked ) {
37
+ $(this).prop('checked',true);
38
  }
39
  });
40
 
41
  // field - after sent script
42
+ $( '#wpcf7-redirect-after-sent-script' ).keyup(function() {
43
+ if ( $(this).val().length != 0 ) {
44
+ $( '.field-warning-alert' ).removeClass( 'field-notice-hidden' );
45
  } else {
46
+ $( '.field-warning-alert' ).addClass( 'field-notice-hidden' );
47
  }
48
  });
49
 
50
+ if ( $( '#wpcf7-redirect-after-sent-script' ).val() ) {
51
+ $( '.field-warning-alert' ).removeClass( 'field-notice-hidden' );
52
  }
53
+
54
+ $('.wpcf7-redirect-pro-admin-notice .notice-dismiss').click(function(e) {
55
+ e.preventDefault();
56
+ sign = window.location.href.indexOf("?") > -1 ? '&' : '?';
57
+ location.href = window.location.href + sign + 'wpcf7_redirect_dismiss_notice=1';
58
+ });
59
+
60
+ $('#redirect-panel .banner-wrap .notice-dismiss').click(function(e) {
61
+ e.preventDefault();
62
+ sign = window.location.href.indexOf("?") > -1 ? '&' : '?';
63
+ location.href = window.location.href + sign + 'wpcf7_redirect_dismiss_banner=1';
64
+ });
65
  });
admin/wpcf7-redirect-admin-style.css CHANGED
@@ -1,3 +1,13 @@
 
 
 
 
 
 
 
 
 
 
1
  #redirect-panel .field-wrap {
2
  margin-bottom: 10px;
3
  }
@@ -52,3 +62,22 @@
52
  border-color: #ebccd1;
53
  background-color: #f2dede;
54
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #redirect-panel .banner-wrap {
2
+ position: relative;
3
+ padding: 15px 40px;
4
+ border: 1px solid #ddd;
5
+ }
6
+ #redirect-panel .banner-wrap img {
7
+ display: block;
8
+ max-width: 100%;
9
+ margin: auto;
10
+ }
11
  #redirect-panel .field-wrap {
12
  margin-bottom: 10px;
13
  }
62
  border-color: #ebccd1;
63
  background-color: #f2dede;
64
  }
65
+ #redirect-panel .get-pro-wrap {
66
+ direction: ltr;
67
+ text-align: center;
68
+ }
69
+ #redirect-panel .get-pro-wrap .get-pro {
70
+ display: inline-block;
71
+ padding: 15px;
72
+ color: #8a6d3b;
73
+ border: 1px solid #ddd;
74
+ background-color: #fff;
75
+ }
76
+ #redirect-panel .get-pro-wrap .get-pro .dashicons-star-filled {
77
+ color: #e7c201;
78
+ }
79
+ #redirect-panel .get-pro-wrap .get-pro a {
80
+ position: relative;
81
+ top: 2px;
82
+ margin: 0 8px;
83
+ }
img/banner-pro.png ADDED
Binary file
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Tags: contact form 7 redirect, contact form 7 thank you page, redirect cf7, redirect contact form 7, contact form 7 success page, cf7 redirect
3
  Contributors: yuvalsabar
4
  Requires at least: 4.7.0
5
- Tested up to: 5.0
6
- Stable tag: 1.2.9
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -24,6 +24,11 @@ Simply go to your form settings, choose the "Redirect Settings" tab and set the
24
  * Open page in a new tab
25
  * Run JavaScript after form submission (great for conversion management)
26
  * Pass fields from the form as URL query parameters
 
 
 
 
 
27
  * **[Pro]** Redirect rules
28
  * **[Pro]** Conditional logic for each action
29
  * **[Pro]** Manage email notifications by conditional logic
@@ -33,8 +38,11 @@ Simply go to your form settings, choose the "Redirect Settings" tab and set the
33
  * **[Pro]** Send RESTful POST/GET to remote servers
34
  * **[Pro]** Manage Facebook conversion pixels
35
  * **[Pro]** Manage Google Adwords conversion pixels
 
 
 
36
 
37
- > Note: some features are availible only in the Pro version. Which means you need Contact Form 7 Redirection Pro to unlock those features. You can [get Contact Form 7 Redirection Pro here](http://querysol.com/blog/product/contact-form-7-redirection/)!
38
 
39
  == Installation ==
40
 
@@ -61,6 +69,12 @@ No. One of the reasons we developed this plugin, is because on_send_ok is now de
61
 
62
  == Changelog ==
63
 
 
 
 
 
 
 
64
  = 1.2.9 =
65
  * Fixed a bug: when passing specific fields as URL query parameters, not all the fields were passed.
66
 
2
  Tags: contact form 7 redirect, contact form 7 thank you page, redirect cf7, redirect contact form 7, contact form 7 success page, cf7 redirect
3
  Contributors: yuvalsabar
4
  Requires at least: 4.7.0
5
+ Tested up to: 5.1.1
6
+ Stable tag: 1.3.0
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
24
  * Open page in a new tab
25
  * Run JavaScript after form submission (great for conversion management)
26
  * Pass fields from the form as URL query parameters
27
+
28
+ * **[Pro]** Create registration forms
29
+ * **[Pro]** Create login forms
30
+ * **[Pro]** Add to Mailchimp list
31
+ * **[Pro]** Conditional error managment
32
  * **[Pro]** Redirect rules
33
  * **[Pro]** Conditional logic for each action
34
  * **[Pro]** Manage email notifications by conditional logic
38
  * **[Pro]** Send RESTful POST/GET to remote servers
39
  * **[Pro]** Manage Facebook conversion pixels
40
  * **[Pro]** Manage Google Adwords conversion pixels
41
+ * **[Pro]** Leads Manager - save leads to database
42
+ * **[Pro]** PayPal Integration
43
+
44
 
45
+ > Note: some features are availible only in the Pro version. Which means you need Contact Form 7 Redirection Pro to unlock those features. You can [get Contact Form 7 Redirection Pro here](http://querysol.com/product/contact-form-7-redirection/)!
46
 
47
  == Installation ==
48
 
69
 
70
  == Changelog ==
71
 
72
+ = 1.3.1 =
73
+ * Fixed a bug in legacy browsers: the Pro message keep showing.
74
+
75
+ = 1.3.0 =
76
+ * Minor dev improvements.
77
+
78
  = 1.2.9 =
79
  * Fixed a bug: when passing specific fields as URL query parameters, not all the fields were passed.
80
 
wpcf7-redirect.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /**
3
  * Plugin Name: Contact Form 7 Redirection
4
- * Plugin URI: http://querysol.com/blog/product/contact-form-7-redirection/
5
  * Description: Contact Form 7 Add-on - Redirect after mail sent.
6
- * Version: 1.2.9
7
  * Author: Query Solutions
8
  * Author URI: http://querysol.com
9
  * Contributors: querysolutions, yuvalsabar
@@ -31,10 +31,25 @@ class WPCF7_Redirect {
31
  public function __construct() {
32
  $this->plugin_url = plugin_dir_url( __FILE__ );
33
  $this->plugin_path = plugin_dir_path( __FILE__ );
34
- $this->version = '1.2.9';
35
  $this->add_actions();
36
  }
37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  /**
39
  * Add Actions
40
  */
@@ -46,7 +61,9 @@ class WPCF7_Redirect {
46
  add_action( 'wpcf7_after_save', array( $this, 'store_meta' ) );
47
  add_action( 'wpcf7_after_create', array( $this, 'duplicate_form_support' ) );
48
  add_action( 'wpcf7_submit', array( $this, 'non_ajax_redirection' ) );
49
- add_action( 'admin_notices', array( $this, 'admin_notice' ) );
 
 
50
  }
51
 
52
  /**
@@ -254,7 +271,7 @@ class WPCF7_Redirect {
254
  /**
255
  * Verify CF7 dependencies.
256
  */
257
- public function admin_notice() {
258
  if ( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) {
259
  $wpcf7_path = plugin_dir_path( dirname( __FILE__ ) ) . 'contact-form-7/wp-contact-form-7.php';
260
  $wpcf7_data = get_plugin_data( $wpcf7_path, false, false );
@@ -290,6 +307,21 @@ class WPCF7_Redirect {
290
  }
291
  }
292
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
293
  /**
294
  * Add plugin support to browsers that don't support ajax
295
  */
@@ -342,6 +374,19 @@ class WPCF7_Redirect {
342
 
343
  $fields = $this->get_fields_values( $post->id() );
344
  ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
345
 
346
  <h2>
347
  <?php esc_html_e( 'Redirect Settings', 'wpcf7-redirect' );?>
@@ -421,9 +466,20 @@ class WPCF7_Redirect {
421
  <?php esc_html_e( 'This option is for developers only - use with caution. If the plugin does not redirect after you have added scripts, it means you have a problem with your script. Either fix the script, or remove it.', 'wpcf7-redirect' );?>
422
  </div>
423
  </fieldset>
 
 
 
 
 
 
 
 
424
 
425
  <?php
426
  }
427
  }
428
 
429
- $cf7_redirect = new WPCF7_Redirect();
 
 
 
1
  <?php
2
  /**
3
  * Plugin Name: Contact Form 7 Redirection
4
+ * Plugin URI: http://querysol.com
5
  * Description: Contact Form 7 Add-on - Redirect after mail sent.
6
+ * Version: 1.3.1
7
  * Author: Query Solutions
8
  * Author URI: http://querysol.com
9
  * Contributors: querysolutions, yuvalsabar
31
  public function __construct() {
32
  $this->plugin_url = plugin_dir_url( __FILE__ );
33
  $this->plugin_path = plugin_dir_path( __FILE__ );
34
+ $this->version = '1.3.1';
35
  $this->add_actions();
36
  }
37
 
38
+ static function install( $file ) {
39
+ update_option( 'wpcf7_redirect_admin_notice_dismiss', 0 );
40
+ update_option( 'wpcf7_redirect_banner_dismiss', 0 );
41
+ }
42
+
43
+ public function wpcf7_redirect_dismiss_ads() {
44
+ if ( isset( $_GET['wpcf7_redirect_dismiss_notice'] ) && $_GET['wpcf7_redirect_dismiss_notice'] == 1 ) {
45
+ update_option( 'wpcf7_redirect_admin_notice_dismiss', 1 );
46
+ }
47
+
48
+ if ( isset( $_GET['wpcf7_redirect_dismiss_banner'] ) && $_GET['wpcf7_redirect_dismiss_banner'] == 1 ) {
49
+ update_option( 'wpcf7_redirect_banner_dismiss', 1 );
50
+ }
51
+ }
52
+
53
  /**
54
  * Add Actions
55
  */
61
  add_action( 'wpcf7_after_save', array( $this, 'store_meta' ) );
62
  add_action( 'wpcf7_after_create', array( $this, 'duplicate_form_support' ) );
63
  add_action( 'wpcf7_submit', array( $this, 'non_ajax_redirection' ) );
64
+ add_action( 'admin_init', array( $this, 'wpcf7_redirect_dismiss_ads' ) );
65
+ add_action( 'admin_notices', array( $this, 'dependencies_notice' ) );
66
+ add_action( 'admin_notices', array( $this, 'pro_notice' ) );
67
  }
68
 
69
  /**
271
  /**
272
  * Verify CF7 dependencies.
273
  */
274
+ public function dependencies_notice() {
275
  if ( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) {
276
  $wpcf7_path = plugin_dir_path( dirname( __FILE__ ) ) . 'contact-form-7/wp-contact-form-7.php';
277
  $wpcf7_data = get_plugin_data( $wpcf7_path, false, false );
307
  }
308
  }
309
 
310
+ public function pro_notice() {
311
+ if ( ! get_option( 'wpcf7_redirect_admin_notice_dismiss' ) ) : ?>
312
+
313
+ <div class="wpcf7-redirect-pro-admin-notice updated notice is-dismissible">
314
+ <p>
315
+ <a href="https://querysol.com/product/contact-form-7-redirection/" target="_blank">
316
+ Contact Form 7 Redirection Pro - We've added exciting new features!
317
+ </a>
318
+ </p>
319
+ </div>
320
+
321
+ <?php endif;
322
+ }
323
+
324
+
325
  /**
326
  * Add plugin support to browsers that don't support ajax
327
  */
374
 
375
  $fields = $this->get_fields_values( $post->id() );
376
  ?>
377
+
378
+ <?php if ( ! get_option( 'wpcf7_redirect_banner_dismiss' ) ) : ?>
379
+
380
+ <div class="banner-wrap">
381
+ <button type="button" class="notice-dismiss">
382
+ <span class="screen-reader-text"><?php _e( 'Close Banner', 'qstheme' );?>.</span>
383
+ </button>
384
+ <a href="https://querysol.com/product/contact-form-7-redirection/" target="_blank">
385
+ <img src="<?php echo $this->plugin_url;?>/img/banner-pro.png" alt="<?php _e( 'Banner - Contact Form 7 Redirection Pro', 'wpcf7-redirect' );?>">
386
+ </a>
387
+ </div>
388
+
389
+ <?php endif;?>
390
 
391
  <h2>
392
  <?php esc_html_e( 'Redirect Settings', 'wpcf7-redirect' );?>
466
  <?php esc_html_e( 'This option is for developers only - use with caution. If the plugin does not redirect after you have added scripts, it means you have a problem with your script. Either fix the script, or remove it.', 'wpcf7-redirect' );?>
467
  </div>
468
  </fieldset>
469
+
470
+ <div class="get-pro-wrap">
471
+ <div class="get-pro">
472
+ <span class="dashicons dashicons-star-filled"></span>
473
+ <a href="https://querysol.com/product/contact-form-7-redirection/" target="_blank">Contact Form 7 Redirection Pro - We've added exciting new features!</a>
474
+ <span class="dashicons dashicons-star-filled"></span>
475
+ </div>
476
+ </div>
477
 
478
  <?php
479
  }
480
  }
481
 
482
+ register_activation_hook( __FILE__, array( 'WPCF7_Redirect', 'install' ) );
483
+
484
+ $cf7_redirect = new WPCF7_Redirect();
485
+