Custom Contact Forms - Version 7.8.3

Version Description

  • Fix WooCommerce conflict
Download this release

Release Info

Developer tlovett1
Plugin Icon 128x128 Custom Contact Forms
Version 7.8.3
Comparing to
See all releases

Code changes from version 7.8.2 to 7.8.3

bin/production-ready.sh ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+
3
+ echo "Are you sure you want to do this? Uncommitted work could be lost. [y/n]"
4
+ read input_variable
5
+
6
+ if [ "$input_variable" == "y" ]; then
7
+ DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
8
+
9
+ cd "$DIR/../"
10
+
11
+ rm bin/install-wp-tests.sh > /dev/null 2>&1
12
+
13
+ rm -rf bower_components > /dev/null 2>&1
14
+ rm -rf node_modules > /dev/null 2>&1
15
+ rm -rf scss > /dev/null 2>&1
16
+ rm -rf tests > /dev/null 2>&1
17
+ rm -rf .sass-cache > /dev/null 2>&1
18
+
19
+ rm .travis.yml > /dev/null 2>&1
20
+ rm codeception.yml > /dev/null 2>&1
21
+ rm Gruntfile.js > /dev/null 2>&1
22
+ rm Dockunit.json > /dev/null 2>&1
23
+ rm composer.json > /dev/null 2>&1
24
+ rm Dockunit.json > /dev/null 2>&1
25
+ rm composer.lock > /dev/null 2>&1
26
+ rm phpunit.xml > /dev/null 2>&1
27
+ rm .jshintrc > /dev/null 2>&1
28
+
29
+ bower install --production > /dev/null 2>&1
30
+
31
+ echo "Done! Custom Contact Forms is cleaned up and production ready."
32
+ fi
bower_components/moment/.bower.json CHANGED
@@ -24,7 +24,7 @@
24
  "tag": "2.9.0",
25
  "commit": "8b35bc74c0e88c1a8c58ccb90117a9edc9f6a479"
26
  },
27
- "_source": "git://github.com/moment/moment.git",
28
  "_target": "~2.9.0",
29
  "_originalSource": "moment"
30
  }
24
  "tag": "2.9.0",
25
  "commit": "8b35bc74c0e88c1a8c58ccb90117a9edc9f6a479"
26
  },
27
+ "_source": "https://github.com/moment/moment.git",
28
  "_target": "~2.9.0",
29
  "_originalSource": "moment"
30
  }
classes/class-ccf-custom-contact-forms.php CHANGED
@@ -101,6 +101,18 @@ class CCF_Custom_Contact_Forms {
101
  load_plugin_textdomain( 'custom-contact-forms', false, dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/' );
102
  }
103
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  /**
105
  * Right now we are including the JSON REST API (http://github.com/wp-api/wp-api) in the plugin itself
106
  * since the API is not yet stable. Eventually, the API will be moved into WP and it will no longer need
@@ -117,12 +129,12 @@ class CCF_Custom_Contact_Forms {
117
 
118
  if ( ! empty( $_POST['checked'] ) ) {
119
  foreach ( $_POST['checked'] as $plugin ) {
120
- if ( preg_match( '#json-rest-api#i', $plugin ) ) {
121
  return;
122
  }
123
  }
124
  } elseif ( ! empty( $_GET['plugin'] ) ) {
125
- if ( preg_match( '#json-rest-api#i', $_GET['plugin'] ) ) {
126
  return;
127
  }
128
  }
@@ -130,6 +142,8 @@ class CCF_Custom_Contact_Forms {
130
  }
131
 
132
  if ( function_exists( 'create_initial_rest_routes' ) || class_exists( 'WP_REST_Controller' ) ) {
 
 
133
  return;
134
  }
135
 
101
  load_plugin_textdomain( 'custom-contact-forms', false, dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/' );
102
  }
103
 
104
+ /**
105
+ * Manually register rest scripts
106
+ *
107
+ * @since 7.8.3
108
+ */
109
+ public function rest_register_scripts_manual() {
110
+ wp_register_script( 'wp-api', plugins_url( 'wp-api.js', __FILE__ ), array( 'jquery', 'backbone', 'underscore' ), '1.1', true );
111
+
112
+ $settings = array( 'root' => esc_url_raw( get_rest_url() ), 'nonce' => wp_create_nonce( 'wp_rest' ) );
113
+ wp_localize_script( 'wp-api', 'WP_API_Settings', $settings );
114
+ }
115
+
116
  /**
117
  * Right now we are including the JSON REST API (http://github.com/wp-api/wp-api) in the plugin itself
118
  * since the API is not yet stable. Eventually, the API will be moved into WP and it will no longer need
129
 
130
  if ( ! empty( $_POST['checked'] ) ) {
131
  foreach ( $_POST['checked'] as $plugin ) {
132
+ if ( preg_match( '#(json-rest-api|wp-api|rest-api)#i', $plugin ) ) {
133
  return;
134
  }
135
  }
136
  } elseif ( ! empty( $_GET['plugin'] ) ) {
137
+ if ( preg_match( '#(json-rest-api|wp-api|rest-api)#i', $_GET['plugin'] ) ) {
138
  return;
139
  }
140
  }
142
  }
143
 
144
  if ( function_exists( 'create_initial_rest_routes' ) || class_exists( 'WP_REST_Controller' ) ) {
145
+ add_action( 'wp_enqueue_scripts', array( $this, 'rest_register_scripts_manual' ) );
146
+ add_action( 'admin_enqueue_scripts', array( $this, 'rest_register_scripts_manual' ) );
147
  return;
148
  }
149
 
custom-contact-forms.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: http://www.taylorlovett.com
5
  * Description: Build beautiful custom forms and manage submissions the WordPress way. View live previews of your forms while you build them. Contact forms, subscription forms, payment forms, etc.
6
  * Author: Taylor Lovett
7
- * Version: 7.8.2
8
  * Text Domain: custom-contact-forms
9
  * Domain Path: /languages
10
  * Author URI: http://www.taylorlovett.com
@@ -15,7 +15,7 @@
15
  */
16
 
17
 
18
- define( 'CCF_VERSION', '7.8.2' );
19
 
20
  require_once( dirname( __FILE__ ) . '/classes/class-ccf-constants.php' );
21
  require_once( dirname( __FILE__ ) . '/classes/class-ccf-custom-contact-forms.php' );
4
  * Plugin URI: http://www.taylorlovett.com
5
  * Description: Build beautiful custom forms and manage submissions the WordPress way. View live previews of your forms while you build them. Contact forms, subscription forms, payment forms, etc.
6
  * Author: Taylor Lovett
7
+ * Version: 7.8.3
8
  * Text Domain: custom-contact-forms
9
  * Domain Path: /languages
10
  * Author URI: http://www.taylorlovett.com
15
  */
16
 
17
 
18
+ define( 'CCF_VERSION', '7.8.3' );
19
 
20
  require_once( dirname( __FILE__ ) . '/classes/class-ccf-constants.php' );
21
  require_once( dirname( __FILE__ ) . '/classes/class-ccf-custom-contact-forms.php' );
readme.txt CHANGED
@@ -60,6 +60,9 @@ For full documentation, questions, feature requests, and support concerning the
60
 
61
  == Changelog ==
62
 
 
 
 
63
  = 7.8.2 =
64
  * Add $submission to ccf_email_subject filter, correct "Invalid Date" issue with datepicker. Props (quayzar)[https://github.com/quayzar]
65
  * Fix WooCommerce conflict
60
 
61
  == Changelog ==
62
 
63
+ = 7.8.3 =
64
+ * Fix WooCommerce conflict
65
+
66
  = 7.8.2 =
67
  * Add $submission to ccf_email_subject filter, correct "Invalid Date" issue with datepicker. Props (quayzar)[https://github.com/quayzar]
68
  * Fix WooCommerce conflict
wp-api/extras.php CHANGED
@@ -8,8 +8,8 @@
8
  * @subpackage JSON API
9
  */
10
 
11
- add_action( 'wp_enqueue_scripts', 'rest_register_scripts', -100 );
12
- add_action( 'admin_enqueue_scripts', 'rest_register_scripts', -100 );
13
 
14
  /**
15
  * Registers REST API JavaScript helpers.
8
  * @subpackage JSON API
9
  */
10
 
11
+ add_action( 'wp_enqueue_scripts', 'rest_register_scripts', 1000 );
12
+ add_action( 'admin_enqueue_scripts', 'rest_register_scripts', 1000 );
13
 
14
  /**
15
  * Registers REST API JavaScript helpers.