Contact Form 7 Skins - Version 1.1.2

Version Description

  • 2016-03-10 =

  • FIX: Ensure CF7 Skins Styles are enqueued if Contact Form 7 styles are de-registered

  • FIX: Ensure update version checking is operating

  • FIX: Remove undefined index notice when updating multiple plugins

  • FIX: Skins Metabox toggle not sticking

Download this release

Release Info

Developer buzztone
Plugin Icon 128x128 Contact Form 7 Skins
Version 1.1.2
Comparing to
See all releases

Code changes from version 1.1.1 to 1.1.2

includes/admin.php CHANGED
@@ -53,6 +53,11 @@ class CF7_Skins_Admin {
53
  if( isset( $_POST['cf7s-style'] ) )
54
  update_post_meta( $form_id, 'cf7s_style', esc_attr( $_POST['cf7s-style'] ) );
55
 
 
 
 
 
 
56
  // Add action while saving the contact form 7
57
  do_action( 'cf7s_update', $cf7 );
58
  }
@@ -125,13 +130,17 @@ class CF7_Skins_Admin {
125
  * @param $post contact form object
126
  * @since 1.0.1
127
  */
128
- function add_meta_boxes_42( $post ) {
129
  if (version_compare(WPCF7_VERSION, '4.2') >= 0) {
130
-
 
 
 
131
  // Create the container id for javascript pointer
132
  // This is added if using add_meta_box() function
133
  echo '<div class="wrap">';
134
- echo '<div id="cf7skins-42" class="postbox">';
 
135
  echo '<div title="'. __('Click to toggle', CF7SKINS_TEXTDOMAIN ) .'" class="handlediv"><br></div>';
136
  echo '<h3 class="hndle"><span>'. __('Skins', CF7SKINS_TEXTDOMAIN ) .'</span></h3>';
137
  echo '<div class="inside">';
53
  if( isset( $_POST['cf7s-style'] ) )
54
  update_post_meta( $form_id, 'cf7s_style', esc_attr( $_POST['cf7s-style'] ) );
55
 
56
+
57
+ // Update metabox state
58
+ if( isset( $_POST['cf7s-postbox'] ) )
59
+ update_post_meta( $form_id, 'cf7s_postbox', $_POST['cf7s-postbox'] );
60
+
61
  // Add action while saving the contact form 7
62
  do_action( 'cf7s_update', $cf7 );
63
  }
130
  * @param $post contact form object
131
  * @since 1.0.1
132
  */
133
+ function add_meta_boxes_42( $cf7 ) {
134
  if (version_compare(WPCF7_VERSION, '4.2') >= 0) {
135
+
136
+ $postbox_meta = get_post_meta( $cf7->id(), 'cf7s_postbox', true );
137
+ $postbox_class = isset( $postbox_meta[CF7SKINS_OPTIONS] ) ? $postbox_meta[CF7SKINS_OPTIONS] : '';
138
+
139
  // Create the container id for javascript pointer
140
  // This is added if using add_meta_box() function
141
  echo '<div class="wrap">';
142
+ echo '<div id="cf7skins-42" class="postbox '. $postbox_class .'">';
143
+ echo '<input type="hidden" value="'.$postbox_class.'" class="cf7skins-42 cf7s-postbox" name="cf7s-postbox['. CF7SKINS_OPTIONS .']" />'; // postbox expand/collapse
144
  echo '<div title="'. __('Click to toggle', CF7SKINS_TEXTDOMAIN ) .'" class="handlediv"><br></div>';
145
  echo '<h3 class="hndle"><span>'. __('Skins', CF7SKINS_TEXTDOMAIN ) .'</span></h3>';
146
  echo '<div class="inside">';
includes/contact.php CHANGED
@@ -99,6 +99,22 @@ class CF7_Skins_Contact {
99
  }
100
 
101
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  /**
103
  * Enqueue cf7s-framework + selected skin style .css file to the frontend.
104
  *
@@ -108,11 +124,11 @@ class CF7_Skins_Contact {
108
  function enqueue_style( $style ) {
109
  wp_enqueue_style( "cf7s-framework-normalize",
110
  CF7SKINS_URL . 'css/framework/cf7s-normalize.css',
111
- array('contact-form-7'), CF7SKINS_VERSION, 'all' );
112
 
113
  wp_enqueue_style( "cf7s-framework-default",
114
  CF7SKINS_URL . 'css/framework/cf7s-default.css',
115
- array('contact-form-7'), CF7SKINS_VERSION, 'all' );
116
 
117
  /**
118
  * Filter hook action enqueue styles after CF7 Skins Framework
@@ -129,14 +145,14 @@ class CF7_Skins_Contact {
129
  * @var $style - cf7skins style slug name applied to current CF7 form
130
  * @since 1.1
131
  */
132
- function skins_style( $style ) {
133
  $skins = CF7_Skin_Style::cf7s_get_style_list(); // get all skins
134
 
135
  if ( isset( $skins[$style] ) ) // check if skin is exists
136
  wp_enqueue_style( "cf7s-$style", $skins[$style]['url'] . trailingslashit( $skins[$style]['dir'] ) . $skins[$style]['index'],
137
- array('contact-form-7'), CF7SKINS_VERSION, 'all' );
138
  }
139
-
140
 
141
  /**
142
  * Add cf7skins classes to the CF7 HTML form class
99
  }
100
 
101
 
102
+ /**
103
+ * Stylesheet dependencies
104
+ * Check if CF7 default stylesheet is still registered
105
+ *
106
+ * @param none
107
+ * @since 1.1.1
108
+ */
109
+ public static function stylesheet_dependencies() {
110
+ $deps = array();
111
+ if ( wp_style_is( 'contact-form-7', 'registered' ) )
112
+ $deps = array( 'contact-form-7' );
113
+
114
+ return $deps;
115
+ }
116
+
117
+
118
  /**
119
  * Enqueue cf7s-framework + selected skin style .css file to the frontend.
120
  *
124
  function enqueue_style( $style ) {
125
  wp_enqueue_style( "cf7s-framework-normalize",
126
  CF7SKINS_URL . 'css/framework/cf7s-normalize.css',
127
+ $this->stylesheet_dependencies(), CF7SKINS_VERSION, 'all' );
128
 
129
  wp_enqueue_style( "cf7s-framework-default",
130
  CF7SKINS_URL . 'css/framework/cf7s-default.css',
131
+ $this->stylesheet_dependencies(), CF7SKINS_VERSION, 'all' );
132
 
133
  /**
134
  * Filter hook action enqueue styles after CF7 Skins Framework
145
  * @var $style - cf7skins style slug name applied to current CF7 form
146
  * @since 1.1
147
  */
148
+ function skins_style( $style ) {
149
  $skins = CF7_Skin_Style::cf7s_get_style_list(); // get all skins
150
 
151
  if ( isset( $skins[$style] ) ) // check if skin is exists
152
  wp_enqueue_style( "cf7s-$style", $skins[$style]['url'] . trailingslashit( $skins[$style]['dir'] ) . $skins[$style]['index'],
153
+ $this->stylesheet_dependencies(), CF7SKINS_VERSION, 'all' );
154
  }
155
+
156
 
157
  /**
158
  * Add cf7skins classes to the CF7 HTML form class
includes/settings.php CHANGED
@@ -163,6 +163,14 @@ class CF7_Skins_Settings {
163
  'detail' => $styles,
164
  'description' => __( 'Enqueue selected styles for whole site pages header.', $this->textdomain ),
165
  ),
 
 
 
 
 
 
 
 
166
  */
167
  'display_log' => array(
168
  'section' => 'advanced',
@@ -276,7 +284,7 @@ class CF7_Skins_Settings {
276
  $id, $k, isset( $value[$k] ) ? 'checked="checked"' : '', $v );
277
 
278
  } else {
279
- $value = isset( $this->options[$id] ) ? $this->options[$id] : false;
280
  printf( '<label><input id="%1$s" name="'.$this->slug.'[%1$s]" type="checkbox" value="1" %2$s />%3$s</label>',
281
  $id, $value ? 'checked="checked"' : '', $detail );
282
  }
163
  'detail' => $styles,
164
  'description' => __( 'Enqueue selected styles for whole site pages header.', $this->textdomain ),
165
  ),
166
+
167
+ 'cf7_stylesheet_dependency' => array(
168
+ 'section' => 'advanced',
169
+ 'label' => __( 'Stylesheet Dependency', $this->textdomain ),
170
+ 'type' => 'checkbox',
171
+ 'default' => false,
172
+ 'detail' => __( 'Remove CF7 default CSS stylesheet dependency.', $this->textdomain ),
173
+ ),
174
  */
175
  'display_log' => array(
176
  'section' => 'advanced',
284
  $id, $k, isset( $value[$k] ) ? 'checked="checked"' : '', $v );
285
 
286
  } else {
287
+ $value = isset( $this->options[$id] ) ? $this->options[$id] : $this->fields[$id]['default'];
288
  printf( '<label><input id="%1$s" name="'.$this->slug.'[%1$s]" type="checkbox" value="1" %2$s />%3$s</label>',
289
  $id, $value ? 'checked="checked"' : '', $detail );
290
  }
index.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Contact Form 7 Skins
4
  * Plugin URI: http://cf7skins.com
5
  * Description: Adds Skins including Templates & Styles to Contact Form 7. Requires Contact Form 7.
6
- * Version: 1.1.1
7
  * Author: Neil Murray
8
  * Author URI: http://cf7skins.com
9
  * License: GPL-2.0+
@@ -44,7 +44,7 @@ if ( ! defined( 'ABSPATH' ) )
44
  *
45
  * @since 0.0.1
46
  */
47
- define( 'CF7SKINS_VERSION', '1.1.1' );
48
  define( 'CF7SKINS_OPTIONS', 'cf7skins' );
49
  define( 'CF7SKINS_TEXTDOMAIN', 'cf7skins' );
50
  define( 'CF7SKINS_FEATURE_FILTER', false ); // @since 0.4.0
@@ -78,16 +78,30 @@ function cf7skins_activation_hook() {
78
 
79
 
80
  /**
81
- * Delete plugin version after upgrading
82
  *
83
  * See https://github.com/WordPress/WordPress/blob/master/wp-admin/includes/class-wp-upgrader.php#L615
84
  * @param $instance WP upgrader class object
85
- * @param $args array( plugin => cf7skins/index.php, type => plugin, action => update )
 
 
 
 
 
 
 
86
  * @since 0.6.1
87
  */
88
  function cf7skins_upgrader_process_complete( $instance, $args ) {
89
- if( 'cf7skins/index.php' == $args['plugin'] && 'update' == $args['action'] )
90
- delete_option( 'cf7skins_version_installed' );
 
 
 
 
 
 
 
91
  }
92
 
93
 
3
  * Plugin Name: Contact Form 7 Skins
4
  * Plugin URI: http://cf7skins.com
5
  * Description: Adds Skins including Templates & Styles to Contact Form 7. Requires Contact Form 7.
6
+ * Version: 1.1.2
7
  * Author: Neil Murray
8
  * Author URI: http://cf7skins.com
9
  * License: GPL-2.0+
44
  *
45
  * @since 0.0.1
46
  */
47
+ define( 'CF7SKINS_VERSION', '1.1.2' );
48
  define( 'CF7SKINS_OPTIONS', 'cf7skins' );
49
  define( 'CF7SKINS_TEXTDOMAIN', 'cf7skins' );
50
  define( 'CF7SKINS_FEATURE_FILTER', false ); // @since 0.4.0
78
 
79
 
80
  /**
81
+ * Upgrade plugin version after upgrading
82
  *
83
  * See https://github.com/WordPress/WordPress/blob/master/wp-admin/includes/class-wp-upgrader.php#L615
84
  * @param $instance WP upgrader class object
85
+ * @param $args example array(
86
+ * [action] => update
87
+ * [type] => plugin
88
+ * [bulk] => 1
89
+ * [plugins] => Array(
90
+ * [0] => akismet/akismet.php
91
+ * [1] => cf7skins/index.php
92
+ * ))
93
  * @since 0.6.1
94
  */
95
  function cf7skins_upgrader_process_complete( $instance, $args ) {
96
+
97
+ // Bail early if this is not plugin update process.
98
+ if( 'update' != $args['action'] || 'plugin' != $args['type'] )
99
+ return;
100
+
101
+ // Check if cf7skins/index.php in the plugins list
102
+ // Update installed version option after updated.
103
+ if ( in_array( plugin_basename( __FILE__ ), $args['plugins'] ) )
104
+ update_option( 'cf7skins_version_installed', CF7SKINS_VERSION );
105
  }
106
 
107
 
js/jquery.admin.js CHANGED
@@ -21,6 +21,7 @@
21
  } else {
22
  $("#wpcf7-admin-form-element").append( $("#cf7s-template") );
23
  $("#wpcf7-admin-form-element").append( $("#cf7s-style") );
 
24
  }
25
 
26
  $("#cf7s .nav-tab:nth-child(1)").addClass("nav-tab-active");
@@ -84,7 +85,7 @@
84
  fallback: '', // fallback text to use when no tooltip text
85
  gravity: 'n', // gravity nw | n | ne | w | e | sw | s | se
86
  html: false, // is tooltip content HTML?
87
- live: false, // use live event support?
88
  offset: 0, // pixel offset of tooltip from element
89
  opacity: 1, // opacity of tooltip
90
  title: 'title', // attribute/callback containing tooltip text
@@ -123,7 +124,15 @@
123
  // Expand collapse skin box for CF7 >= 4.2
124
  $('#cf7skins-42 .handlediv').click( function(e) {
125
  e.stopPropagation();
126
- $(this).parent('.postbox').toggleClass('closed');
 
 
 
 
 
 
 
 
127
  });
128
  },
129
 
21
  } else {
22
  $("#wpcf7-admin-form-element").append( $("#cf7s-template") );
23
  $("#wpcf7-admin-form-element").append( $("#cf7s-style") );
24
+ $("#wpcf7-admin-form-element").append( $(".cf7s-postbox") );
25
  }
26
 
27
  $("#cf7s .nav-tab:nth-child(1)").addClass("nav-tab-active");
85
  fallback: '', // fallback text to use when no tooltip text
86
  gravity: 'n', // gravity nw | n | ne | w | e | sw | s | se
87
  html: false, // is tooltip content HTML?
88
+ live: true, // use live event support?
89
  offset: 0, // pixel offset of tooltip from element
90
  opacity: 1, // opacity of tooltip
91
  title: 'title', // attribute/callback containing tooltip text
124
  // Expand collapse skin box for CF7 >= 4.2
125
  $('#cf7skins-42 .handlediv').click( function(e) {
126
  e.stopPropagation();
127
+ var parent = $(this).parent('.postbox'),
128
+ postbox = parent.attr('id');
129
+ parent.toggleClass('closed');
130
+
131
+ // Update metabox closed/open state
132
+ if ( $(this).parent().hasClass("closed") )
133
+ $("input."+postbox).val('closed');
134
+ else
135
+ $("input."+postbox).val('');
136
  });
137
  },
138
 
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Contact Form 7 Skins ===
2
  Contributors: buzztone
3
  Tags: contact form 7, form, skin, template, style, html, css
4
- Requires at least: 4.1
5
- Tested up to: 4.4
6
- Stable tag: 1.1.1
7
  Author URI: http://cf7skins.com
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -21,7 +21,6 @@ Each Template acts as an easy to follow guide, which can be adapted to your part
21
  CF7 Skins is highly customizable and easy to learn, even for beginners.
22
 
23
  = CF7 Skins Features =
24
-
25
  Here are some of the things you can do with CF7 Skins:
26
 
27
  * Create a vast range of simple and complex forms using Contact Form 7.
@@ -59,21 +58,30 @@ Our [CF7 Skins Add-ons](http://cf7skins.com/add-ons/) bring the functionality av
59
  * **Thank You Tab** – extra page displayed only after completed form submission
60
  * **Design Matches CF7 Skins Style** – styling of multi-form elements matches selected CF7 Skins Style
61
 
62
- See: [Plugin Website](http://cf7skins.com/) | [Documentation](http://docs.cf7skins.com/) | [FAQs](http://kb.cf7skins.com/faq/) | [Pro Version](http://cf7skins.com/pro-version/) | [Add-ons](http://cf7skins.com/add-ons/)
63
 
64
- == Installation ==
 
 
 
 
 
65
 
66
- 1. Download the plugin's zip file and visit **Plugins &gt; Add New** in your WordPress admin area.
67
- 1. Click on the **Upload Plugin** button on top and then simply upload the zip file.
68
- 1. WordPress will now upload the zip file from your computer to your website, extract it, and install the plugin.
69
- 1. Click on the activate link to start using the plugin.
70
 
71
- *Alternate Installation Method*
72
 
73
  1. Visit *Plugins &gt; Add New* and search for Contact Form 7 Skins.
74
  1. Locate the plugin in search results.
75
  1. Click on the Install button to automatically download and install the plugin.
76
- 1. Activate plugin.
 
 
 
 
 
 
 
77
 
78
  Having trouble? Learn more about how to install plugins on [WordPress Codex](http://codex.wordpress.org/Managing_Plugins).
79
 
@@ -91,7 +99,10 @@ Yes, our in-depth [Documentation](http://docs.cf7skins.com/) is a great place to
91
 
92
  = How do I get started? =
93
 
94
- Their is a range of [Tutorials](http://kb.cf7skins.com/category/tutorials/) available to help you get started using CF7 Skins.
 
 
 
95
 
96
  = How do I get more Templates and Styles for CF7 Skins? =
97
 
@@ -119,8 +130,14 @@ Our [CF7 Skins Add-ons](http://cf7skins.com/add-ons/) bring the functionality av
119
  * **Thank You Tab** – extra page displayed only after completed form submission
120
  * **Design Matches CF7 Skins Style** – styling of multi-form elements matches selected CF7 Skins Style
121
 
122
- = Where can I find answers to Frequently Asked Questions? =
123
- Many questions have been answered on the [CF7 Skins FAQ](http://kb.cf7skins.com/faq/) on the plugin website.
 
 
 
 
 
 
124
 
125
  = Translations =
126
 
@@ -140,6 +157,13 @@ See: [Plugin Website](http://cf7skins.com/) | [Documentation](http://docs.cf7ski
140
 
141
  == Changelog ==
142
 
 
 
 
 
 
 
 
143
  = 1.1.1 - 2015-09-21 =
144
 
145
  * FEATURE: Add support for Ready styles
1
  === Contact Form 7 Skins ===
2
  Contributors: buzztone
3
  Tags: contact form 7, form, skin, template, style, html, css
4
+ Requires at least: 4.3
5
+ Tested up to: 4.5
6
+ Stable tag: 1.1.2
7
  Author URI: http://cf7skins.com
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
21
  CF7 Skins is highly customizable and easy to learn, even for beginners.
22
 
23
  = CF7 Skins Features =
 
24
  Here are some of the things you can do with CF7 Skins:
25
 
26
  * Create a vast range of simple and complex forms using Contact Form 7.
58
  * **Thank You Tab** – extra page displayed only after completed form submission
59
  * **Design Matches CF7 Skins Style** – styling of multi-form elements matches selected CF7 Skins Style
60
 
61
+ [CF7 Skins Logic](http://cf7skins.com/add-ons/logic/) provides Conditional Logic for Contact Form 7 forms:
62
 
63
+ * **Show or Hide** – fields
64
+ * **Criteria** – field, user and post info
65
+ * **Value** – equals, not equals, contains or changed
66
+ * **Compare** – numeric or text values
67
+ * **Multiple logic statements** – if all & if any
68
+ * **Multiple fields** with varying logic
69
 
70
+ See: [Plugin Website](http://cf7skins.com/) | [Documentation](http://docs.cf7skins.com/) | [FAQs](http://kb.cf7skins.com/faq/) | [Pro Version](http://cf7skins.com/pro-version/) | [Add-ons](http://cf7skins.com/add-ons/)
 
 
 
71
 
72
+ == Installation ==
73
 
74
  1. Visit *Plugins &gt; Add New* and search for Contact Form 7 Skins.
75
  1. Locate the plugin in search results.
76
  1. Click on the Install button to automatically download and install the plugin.
77
+ 1. Activate plugin.
78
+
79
+ *Alternate Installation Method*
80
+
81
+ 1. Download the plugin's zip file and visit **Plugins &gt; Add New** in your WordPress admin area.
82
+ 1. Click on the **Upload Plugin** button on top and then simply upload the zip file.
83
+ 1. WordPress will now upload the zip file from your computer to your website, extract it, and install the plugin.
84
+ 1. Click on the activate link to start using the plugin.
85
 
86
  Having trouble? Learn more about how to install plugins on [WordPress Codex](http://codex.wordpress.org/Managing_Plugins).
87
 
99
 
100
  = How do I get started? =
101
 
102
+ There is a range of [Tutorials](http://kb.cf7skins.com/category/tutorials/) available to help you get started using CF7 Skins.
103
+
104
+ = Where can I find answers to Frequently Asked Questions? =
105
+ Many questions have been answered on the [CF7 Skins FAQ](http://kb.cf7skins.com/faq/) on the plugin website.
106
 
107
  = How do I get more Templates and Styles for CF7 Skins? =
108
 
130
  * **Thank You Tab** – extra page displayed only after completed form submission
131
  * **Design Matches CF7 Skins Style** – styling of multi-form elements matches selected CF7 Skins Style
132
 
133
+ [CF7 Skins Logic](http://cf7skins.com/add-ons/logic/) provides Conditional Logic for Contact Form 7 forms:
134
+
135
+ * **Show or Hide** – fields
136
+ * **Criteria** – field, user and post info
137
+ * **Value** – equals, not equals, contains or changed
138
+ * **Compare** – numeric or text values
139
+ * **Multiple logic statements** – if all & if any
140
+ * **Multiple fields** with varying logic
141
 
142
  = Translations =
143
 
157
 
158
  == Changelog ==
159
 
160
+ = 1.1.2 - 2016-03-10 =
161
+
162
+ * FIX: Ensure CF7 Skins Styles are enqueued if Contact Form 7 styles are de-registered
163
+ * FIX: Ensure update version checking is operating
164
+ * FIX: Remove undefined index notice when updating multiple plugins
165
+ * FIX: Skins Metabox toggle not sticking
166
+
167
  = 1.1.1 - 2015-09-21 =
168
 
169
  * FEATURE: Add support for Ready styles