Formidable Forms – Form Builder for WordPress - Version 2.0.20

Version Description

  • Added more styling options: box-shadow, font-weight, Form Title, and Form Description
  • Fixed a couple issues with activating and deactivating licences
  • A few improvements for importing styles
  • Add a hook for approved theme authors to add affiliate links. If the free version is packaged with a theme, the theme author can get commissions on upgrades.
  • Pro Features: *
  • Added Parent entry ID to view filters
  • Added a button to autofill addon licenses
  • Improve accuracy of time_ago for leap years
Download this release

Release Info

Developer sswells
Plugin Icon 128x128 Formidable Forms – Form Builder for WordPress
Version 2.0.20
Comparing to
See all releases

Code changes from version 2.0.19 to 2.0.20

classes/controllers/FrmAddonsController.php CHANGED
@@ -19,7 +19,6 @@ class FrmAddonsController {
19
  $addons = $addons['products'];
20
  }
21
  $addons = array_reverse( $addons );
22
- $append_affiliate = FrmAppHelper::affiliate();
23
 
24
  $plugin_names = array(
25
  'formidable-pro' => 'formidable/pro', 'wp-multilingual' => 'formidable-wpml',
@@ -48,6 +47,31 @@ class FrmAddonsController {
48
 
49
  $url = 'https://formidablepro.com/edd-api/products?number=40';
50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  $arg_array = array(
52
  'body' => array(
53
  'url' => home_url(),
@@ -59,14 +83,12 @@ class FrmAddonsController {
59
 
60
  $response = wp_remote_post( $url, $arg_array );
61
  $body = wp_remote_retrieve_body( $response );
 
62
  if ( ! is_wp_error( $response ) && ! is_wp_error( $body ) ) {
63
- $addons = json_decode( $body, true );
64
- set_transient( 'frm_api_addons', $addons, 60 * 60 * 24 * 5 ); // check every 5 days
65
- if ( is_array( $addons ) ) {
66
- return $addons;
67
- }
68
  }
69
 
70
- return false;
71
  }
72
  }
19
  $addons = $addons['products'];
20
  }
21
  $addons = array_reverse( $addons );
 
22
 
23
  $plugin_names = array(
24
  'formidable-pro' => 'formidable/pro', 'wp-multilingual' => 'formidable-wpml',
47
 
48
  $url = 'https://formidablepro.com/edd-api/products?number=40';
49
 
50
+ // check every 5 days
51
+ $addons = self::send_api_request( $url, array( 'name' => 'frm_api_addons', 'expires' => 60 * 60 * 24 * 5 ) );
52
+ if ( is_array( $addons ) ) {
53
+ return $addons;
54
+ }
55
+
56
+ return false;
57
+ }
58
+
59
+ public static function get_licenses() {
60
+ $license = get_option('frmpro-credentials');
61
+ if ( $license && is_array( $license ) && isset( $license['license'] ) ) {
62
+ $url = 'http://formidablepro.com/frm-edd-api/licenses?l='. urlencode( base64_encode( $license['license'] ) );
63
+ $licenses = self::send_api_request( $url, array( 'name' => 'frm_api_licence', 'expires' => 60 * 60 * 5 ) );
64
+ echo json_encode( $licenses );
65
+ }
66
+ wp_die();
67
+ }
68
+
69
+ private static function send_api_request( $url, $transient = array() ) {
70
+ $data = get_transient( $transient['name'] );
71
+ if ( $data !== false ) {
72
+ return $data;
73
+ }
74
+
75
  $arg_array = array(
76
  'body' => array(
77
  'url' => home_url(),
83
 
84
  $response = wp_remote_post( $url, $arg_array );
85
  $body = wp_remote_retrieve_body( $response );
86
+ $data = false;
87
  if ( ! is_wp_error( $response ) && ! is_wp_error( $body ) ) {
88
+ $data = json_decode( $body, true );
89
+ set_transient( $transient['name'], $data, $transient['expires'] );
 
 
 
90
  }
91
 
92
+ return $data;
93
  }
94
  }
classes/controllers/FrmAppController.php CHANGED
@@ -152,10 +152,47 @@ class FrmAppController {
152
  $action = FrmAppHelper::simple_get( 'action', 'sanitize_title' );
153
  if ( ! FrmAppHelper::doing_ajax() || $action == 'frm_import_choices' ) {
154
  // don't continue during ajax calls
 
155
  self::admin_js();
156
  }
157
  }
158
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  public static function admin_js() {
160
  $version = FrmAppHelper::plugin_version();
161
  FrmAppHelper::load_admin_wide_js( false );
152
  $action = FrmAppHelper::simple_get( 'action', 'sanitize_title' );
153
  if ( ! FrmAppHelper::doing_ajax() || $action == 'frm_import_choices' ) {
154
  // don't continue during ajax calls
155
+ self::load_tour();
156
  self::admin_js();
157
  }
158
  }
159
 
160
+ /**
161
+ * See if we should start our tour.
162
+ * @since 2.0.20
163
+ */
164
+ private static function load_tour() {
165
+ $restart_tour = filter_input( INPUT_GET, 'frm_restart_tour' );
166
+ if ( $restart_tour ) {
167
+ delete_user_meta( get_current_user_id(), 'frm_ignore_tour' );
168
+ }
169
+ self::ignore_tour();
170
+
171
+ if ( ! self::has_ignored_tour() ) {
172
+ add_action( 'admin_enqueue_scripts', array( 'FrmPointers', 'get_instance' ) );
173
+ }
174
+ }
175
+
176
+ /**
177
+ * Returns the value of the ignore tour.
178
+ *
179
+ * @return bool
180
+ */
181
+ private static function has_ignored_tour() {
182
+ $user_meta = get_user_meta( get_current_user_id(), 'frm_ignore_tour' );
183
+
184
+ return ! empty( $user_meta );
185
+ }
186
+
187
+ /**
188
+ * Listener for the ignore tour GET value. If this one is set, just set the user meta to true.
189
+ */
190
+ private static function ignore_tour() {
191
+ if ( filter_input( INPUT_GET, 'frm_ignore_tour' ) && wp_verify_nonce( filter_input( INPUT_GET, 'nonce' ), 'frm-ignore-tour' ) ) {
192
+ update_user_meta( get_current_user_id(), 'frm_ignore_tour', true );
193
+ }
194
+ }
195
+
196
  public static function admin_js() {
197
  $version = FrmAppHelper::plugin_version();
198
  FrmAppHelper::load_admin_wide_js( false );
classes/controllers/FrmEntriesController.php CHANGED
@@ -37,7 +37,7 @@ class FrmEntriesController {
37
 
38
  public static function contextual_help( $help, $screen_id, $screen ) {
39
  // Only add to certain screens. add_help_tab was introduced in WordPress 3.3
40
- if ( $screen_id != 'formidable_page_formidable-entries' || ! method_exists( $screen, 'add_help_tab' ) ) {
41
  return $help;
42
  }
43
 
@@ -46,6 +46,7 @@ class FrmEntriesController {
46
  if ( $page != 'formidable-entries' || ( ! empty( $action ) && $action != 'list' ) ) {
47
  return $help;
48
  }
 
49
  unset( $action, $page );
50
 
51
  $screen->add_help_tab( array(
@@ -56,8 +57,8 @@ class FrmEntriesController {
56
 
57
  $screen->set_help_sidebar(
58
  '<p><strong>' . esc_html__( 'For more information:', 'formidable' ) . '</strong></p>' .
59
- '<p><a href="http://formidablepro.com/knowledgebase/manage-entries-from-the-back-end/' . FrmAppHelper::affiliate() . '" target="_blank">' . esc_html__( 'Documentation on Entries', 'formidable' ) . '</a></p>' .
60
- '<p><a href="http://formidablepro.com/help-topics/' . FrmAppHelper::affiliate() . '" target="_blank">' . esc_html__( 'Support', 'formidable' ) . '</a></p>'
61
  );
62
 
63
  return $help;
@@ -129,8 +130,8 @@ class FrmEntriesController {
129
  }
130
 
131
  if ( empty( $prev_value ) ) {
132
- $prev_value = get_metadata('user', $object_id, $meta_key, true);
133
- }
134
 
135
  global $frm_vars;
136
  //add a check so we don't create a loop
37
 
38
  public static function contextual_help( $help, $screen_id, $screen ) {
39
  // Only add to certain screens. add_help_tab was introduced in WordPress 3.3
40
+ if ( ! method_exists( $screen, 'add_help_tab' ) ) {
41
  return $help;
42
  }
43
 
46
  if ( $page != 'formidable-entries' || ( ! empty( $action ) && $action != 'list' ) ) {
47
  return $help;
48
  }
49
+
50
  unset( $action, $page );
51
 
52
  $screen->add_help_tab( array(
57
 
58
  $screen->set_help_sidebar(
59
  '<p><strong>' . esc_html__( 'For more information:', 'formidable' ) . '</strong></p>' .
60
+ '<p><a href="' . esc_url( FrmAppHelper::make_affiliate_url( 'http://formidablepro.com/knowledgebase/manage-entries-from-the-back-end/' ) ) . '" target="_blank">' . esc_html__( 'Documentation on Entries', 'formidable' ) . '</a></p>' .
61
+ '<p><a href="'. esc_url( FrmAppHelper::make_affiliate_url( 'http://formidablepro.com/help-desk/' ) ) . '" target="_blank">' . esc_html__( 'Support', 'formidable' ) . '</a></p>'
62
  );
63
 
64
  return $help;
130
  }
131
 
132
  if ( empty( $prev_value ) ) {
133
+ $prev_value = get_metadata( 'user', $object_id, $meta_key, true );
134
+ }
135
 
136
  global $frm_vars;
137
  //add a check so we don't create a loop
classes/controllers/FrmFormsController.php CHANGED
@@ -413,7 +413,8 @@ class FrmFormsController {
413
  */
414
  public static function insert_form_button() {
415
  if ( current_user_can('frm_view_forms') ) {
416
- $content = '<a href="#TB_inline?width=50&height=50&inlineId=frm_insert_form" class="thickbox button add_media frm_insert_form" title="' . esc_attr__( 'Add forms and content', 'formidable' ) . '"><span class="frm-buttons-icon wp-media-buttons-icon"></span> Formidable</a>';
 
417
  echo wp_kses_post( $content );
418
  }
419
  }
413
  */
414
  public static function insert_form_button() {
415
  if ( current_user_can('frm_view_forms') ) {
416
+ $frm_settings = FrmAppHelper::get_settings();
417
+ $content = '<a href="#TB_inline?width=50&height=50&inlineId=frm_insert_form" class="thickbox button add_media frm_insert_form" title="' . esc_attr__( 'Add forms and content', 'formidable' ) . '"><span class="frm-buttons-icon wp-media-buttons-icon"></span> '. $frm_settings->menu .'</a>';
418
  echo wp_kses_post( $content );
419
  }
420
  }
classes/controllers/FrmHooksController.php CHANGED
@@ -140,9 +140,10 @@ class FrmHooksController {
140
  add_action( 'wp_ajax_frm_uninstall', 'FrmAppController::uninstall' );
141
  add_action( 'wp_ajax_frm_deauthorize', 'FrmAppController::deauthorize' );
142
 
143
- // Addons Controller
144
  add_action('wp_ajax_frm_addon_activate', 'FrmAddon::activate' );
145
  add_action('wp_ajax_frm_addon_deactivate', 'FrmAddon::deactivate' );
 
146
 
147
  // Fields Controller
148
  add_action( 'wp_ajax_frm_load_field', 'FrmFieldsController::load_field' );
140
  add_action( 'wp_ajax_frm_uninstall', 'FrmAppController::uninstall' );
141
  add_action( 'wp_ajax_frm_deauthorize', 'FrmAppController::deauthorize' );
142
 
143
+ // Addons
144
  add_action('wp_ajax_frm_addon_activate', 'FrmAddon::activate' );
145
  add_action('wp_ajax_frm_addon_deactivate', 'FrmAddon::deactivate' );
146
+ add_action( 'wp_ajax_frm_fill_licenses', 'FrmAddonsController::get_licenses' );
147
 
148
  // Fields Controller
149
  add_action( 'wp_ajax_frm_load_field', 'FrmFieldsController::load_field' );
classes/controllers/FrmStylesController.php CHANGED
@@ -317,6 +317,8 @@ class FrmStylesController {
317
  // setup meta boxes
318
  $meta_boxes = array(
319
  'general' => __( 'General', 'formidable' ),
 
 
320
  'field-labels' => __( 'Field Labels', 'formidable' ),
321
  'field-description' => __( 'Field Description', 'formidable' ),
322
  'field-colors' => __( 'Field Colors', 'formidable' ),
317
  // setup meta boxes
318
  $meta_boxes = array(
319
  'general' => __( 'General', 'formidable' ),
320
+ 'form-title' => __( 'Form Title', 'formidable' ),
321
+ 'form-description' => __( 'Form Description', 'formidable' ),
322
  'field-labels' => __( 'Field Labels', 'formidable' ),
323
  'field-description' => __( 'Field Description', 'formidable' ),
324
  'field-colors' => __( 'Field Colors', 'formidable' ),
classes/helpers/FrmAppHelper.php CHANGED
@@ -10,7 +10,7 @@ class FrmAppHelper {
10
  /**
11
  * @since 2.0
12
  */
13
- public static $plug_version = '2.0.19';
14
 
15
  /**
16
  * @since 1.07.02
@@ -57,8 +57,13 @@ class FrmAppHelper {
57
  return get_option('blogname');
58
  }
59
 
60
- public static function affiliate() {
61
- return '';
 
 
 
 
 
62
  }
63
 
64
  /**
@@ -1229,61 +1234,58 @@ class FrmAppHelper {
1229
  return date_i18n( $date_format, strtotime( $date ) );
1230
  }
1231
 
1232
- /**
1233
- * @return string The time ago in words
1234
- */
1235
- public static function human_time_diff( $from, $to = '' ) {
1236
- if ( empty($to) ) {
1237
- $to = time();
1238
- }
1239
-
1240
- // Array of time period chunks
1241
- $chunks = array(
1242
- array( 60 * 60 * 24 * 365, __( 'year', 'formidable' ), __( 'years', 'formidable' ) ),
1243
- array( 60 * 60 * 24 * 30, __( 'month', 'formidable' ), __( 'months', 'formidable' ) ),
1244
- array( 60 * 60 * 24 * 7, __( 'week', 'formidable' ), __( 'weeks', 'formidable' ) ),
1245
- array( 60 * 60 * 24, __( 'day', 'formidable' ), __( 'days', 'formidable' ) ),
1246
- array( 60 * 60, __( 'hour', 'formidable' ), __( 'hours', 'formidable' ) ),
1247
- array( 60, __( 'minute', 'formidable' ), __( 'minutes', 'formidable' ) ),
1248
- array( 1, __( 'second', 'formidable' ), __( 'seconds', 'formidable' ) ),
1249
- );
1250
-
1251
- // Difference in seconds
1252
- $diff = (int) ($to - $from);
1253
-
1254
- // Something went wrong with date calculation and we ended up with a negative date.
1255
- if ( $diff < 1 ) {
1256
- return '0 ' . __( 'seconds', 'formidable' );
1257
- }
1258
-
1259
- /**
1260
- * We only want to output one chunks of time here, eg:
1261
- * x years
1262
- * xx months
1263
- * so there's only one bit of calculation below:
1264
- */
1265
 
1266
- $count = 0;
 
1267
 
1268
- //Step one: the first chunk
1269
- for ( $i = 0, $j = count( $chunks ); $i < $j; $i++ ) {
1270
- $seconds = $chunks[ $i ][0];
1271
 
1272
- // Finding the biggest chunk (if the chunk fits, break)
1273
- if ( ( $count = floor($diff / $seconds) ) != 0 ) {
1274
- break;
1275
- }
1276
- }
 
 
1277
 
1278
- // Set output var
1279
- $output = ( 1 == $count ) ? '1 '. $chunks[ $i ][1] : $count . ' ' . $chunks[ $i ][2];
1280
 
1281
- if ( ! (int) trim( $output ) ) {
1282
- $output = '0 ' . __( 'seconds', 'formidable' );
1283
- }
1284
 
1285
- return $output;
1286
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1287
 
1288
  /**
1289
  * Added for < WP 4.0 compatability
10
  /**
11
  * @since 2.0
12
  */
13
+ public static $plug_version = '2.0.20';
14
 
15
  /**
16
  * @since 1.07.02
57
  return get_option('blogname');
58
  }
59
 
60
+ public static function make_affiliate_url( $url ) {
61
+ $affiliate_id = apply_filters( 'frm_affiliate_link', get_option('frm_aff') );
62
+ $allowed_affiliates = array( 'mojo' );
63
+ if ( in_array( strtolower( $affiliate_id ), $allowed_affiliates ) ) {
64
+ $url = add_query_arg( 'aff', $affiliate_id, $url );
65
+ }
66
+ return $url;
67
  }
68
 
69
  /**
1234
  return date_i18n( $date_format, strtotime( $date ) );
1235
  }
1236
 
1237
+ /**
1238
+ * Gets the time ago in words
1239
+ *
1240
+ * @param int $from in seconds
1241
+ * @param int|string $to in seconds
1242
+ * @return string $time_ago
1243
+ */
1244
+ public static function human_time_diff( $from, $to = '' ) {
1245
+ if ( empty( $to ) ) {
1246
+ $now = new DateTime;
1247
+ } else {
1248
+ $now = new DateTime( '@' . $to );
1249
+ }
1250
+ $ago = new DateTime( '@' . $from );
1251
+ $diff = $now->diff( $ago );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1252
 
1253
+ $diff->w = floor( $diff->d / 7 );
1254
+ $diff->d -= $diff->w * 7;
1255
 
1256
+ $time_strings = self::get_time_strings();
 
 
1257
 
1258
+ foreach ( $time_strings as $k => $v ) {
1259
+ if ( $diff->$k ) {
1260
+ $time_strings[ $k ] = $diff->$k . ' ' . ( $diff->$k > 1 ? $v[1] : $v[0] );
1261
+ } else {
1262
+ unset( $time_strings[ $k ] );
1263
+ }
1264
+ }
1265
 
1266
+ $time_strings = array_slice( $time_strings, 0, 1 );
1267
+ $time_ago_string = $time_strings ? implode( ', ', $time_strings ) : '0 ' . __( 'seconds', 'formidable' );
1268
 
1269
+ return $time_ago_string;
1270
+ }
 
1271
 
1272
+ /**
1273
+ * Get the translatable time strings
1274
+ *
1275
+ * @since 2.0.20
1276
+ * @return array
1277
+ */
1278
+ private static function get_time_strings() {
1279
+ return array(
1280
+ 'y' => array( __( 'year', 'formidable' ), __( 'years', 'formidable' ) ),
1281
+ 'm' => array( __( 'month', 'formidable' ), __( 'months', 'formidable' ) ),
1282
+ 'w' => array( __( 'week', 'formidable' ), __( 'weeks', 'formidable' ) ),
1283
+ 'd' => array( __( 'day', 'formidable' ), __( 'days', 'formidable' ) ),
1284
+ 'h' => array( __( 'hour', 'formidable' ), __( 'hours', 'formidable' ) ),
1285
+ 'i' => array( __( 'minute', 'formidable' ), __( 'minutes', 'formidable' ) ),
1286
+ 's' => array( __( 'second', 'formidable' ), __( 'seconds', 'formidable' ) )
1287
+ );
1288
+ }
1289
 
1290
  /**
1291
  * Added for < WP 4.0 compatability
classes/helpers/FrmFormsHelper.php CHANGED
@@ -263,7 +263,7 @@ SUBMIT_HTML;
263
  } else if ( $loc == 'before' ) {
264
  $default_html = <<<BEFORE_HTML
265
  <legend class="frm_hidden">[form_name]</legend>
266
- [if form_name]<h3>[form_name]</h3>[/if form_name]
267
  [if form_description]<div class="frm_description">[form_description]</div>[/if form_description]
268
  BEFORE_HTML;
269
  } else {
263
  } else if ( $loc == 'before' ) {
264
  $default_html = <<<BEFORE_HTML
265
  <legend class="frm_hidden">[form_name]</legend>
266
+ [if form_name]<h3 class="frm_form_title">[form_name]</h3>[/if form_name]
267
  [if form_description]<div class="frm_description">[form_description]</div>[/if form_description]
268
  BEFORE_HTML;
269
  } else {
classes/helpers/FrmXMLHelper.php CHANGED
@@ -145,6 +145,8 @@ class FrmXMLHelper {
145
 
146
  $form['options'] = FrmAppHelper::maybe_json_decode($form['options']);
147
 
 
 
148
  // if template, allow to edit if form keys match, otherwise, creation date must also match
149
  $edit_query = array( 'form_key' => $form['form_key'], 'is_template' => $form['is_template'] );
150
  if ( ! $form['is_template'] ) {
@@ -373,6 +375,38 @@ class FrmXMLHelper {
373
  }
374
  }
375
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
376
  public static function import_xml_views( $views, $imported ) {
377
  $imported['posts'] = array();
378
  $form_action_type = FrmFormActionsController::$action_post_type;
@@ -683,6 +717,34 @@ class FrmXMLHelper {
683
  $s_message[] = isset( $strings[ $type ] ) ? $strings[ $type ] : ' ' . $m . ' ' . ucfirst( $type );
684
  }
685
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
686
  public static function cdata( $str ) {
687
  $str = maybe_unserialize($str);
688
  if ( is_array($str) ) {
145
 
146
  $form['options'] = FrmAppHelper::maybe_json_decode($form['options']);
147
 
148
+ self::update_custom_style_setting_on_import( $form );
149
+
150
  // if template, allow to edit if form keys match, otherwise, creation date must also match
151
  $edit_query = array( 'form_key' => $form['form_key'], 'is_template' => $form['is_template'] );
152
  if ( ! $form['is_template'] ) {
375
  }
376
  }
377
 
378
+ /**
379
+ * Updates the custom style setting on import
380
+ *
381
+ * @since 2.0.19
382
+ * @param array $form
383
+ *
384
+ */
385
+ private static function update_custom_style_setting_on_import( &$form ) {
386
+ if ( is_numeric( $form['options']['custom_style'] ) ) {
387
+ // Set to default
388
+ $form['options']['custom_style'] = 1;
389
+ } else {
390
+ // Replace the style name with the style ID on import
391
+ global $wpdb;
392
+ $table = $wpdb->prefix . 'posts';
393
+ $where = array(
394
+ 'post_name' => $form['options']['custom_style'],
395
+ 'post_type' => 'frm_styles'
396
+ );
397
+ $select = 'ID';
398
+ $style_id = FrmDb::get_var( $table, $where, $select );
399
+
400
+ if ( $style_id ) {
401
+ $form['options']['custom_style'] = $style_id;
402
+ } else {
403
+ // Set to default
404
+ $form['options']['custom_style'] = 1;
405
+ }
406
+ }
407
+
408
+ }
409
+
410
  public static function import_xml_views( $views, $imported ) {
411
  $imported['posts'] = array();
412
  $form_action_type = FrmFormActionsController::$action_post_type;
717
  $s_message[] = isset( $strings[ $type ] ) ? $strings[ $type ] : ' ' . $m . ' ' . ucfirst( $type );
718
  }
719
 
720
+ /**
721
+ * Prepare the form options for export
722
+ *
723
+ * @since 2.0.19
724
+ * @param string $options
725
+ * @return string
726
+ */
727
+ public static function prepare_form_options_for_export( $options ) {
728
+ $options = maybe_unserialize( $options );
729
+ // Change custom_style to the post_name instead of ID
730
+ if ( isset( $options['custom_style'] ) && 1 !== $options['custom_style'] ) {
731
+ global $wpdb;
732
+ $table = $wpdb->prefix . 'posts';
733
+ $where = array( 'ID' => $options['custom_style'] );
734
+ $select = 'post_name';
735
+
736
+ $style_name = FrmDb::get_var( $table, $where, $select );
737
+
738
+ if ( $style_name ) {
739
+ $options['custom_style'] = $style_name;
740
+ } else {
741
+ $options['custom_style'] = 1;
742
+ }
743
+ }
744
+ $options = serialize( $options );
745
+ return self::cdata( $options );
746
+ }
747
+
748
  public static function cdata( $str ) {
749
  $str = maybe_unserialize($str);
750
  if ( is_array($str) ) {
classes/models/FrmAddon.php CHANGED
@@ -69,7 +69,10 @@ class FrmAddon {
69
  $api_data['item_id'] = $this->download_id;
70
  }
71
 
72
- new FrmEDD_SL_Plugin_Updater( $this->store_url, $this->plugin_file, $api_data );
 
 
 
73
 
74
  add_filter( 'site_transient_update_plugins', array( &$this, 'clear_expired_download' ) );
75
  }
@@ -202,9 +205,9 @@ class FrmAddon {
202
  public static function deactivate() {
203
  check_ajax_referer( 'frm_ajax', 'nonce' );
204
 
205
- $license = stripslashes( sanitize_text_field( $_POST['license'] ) );
206
  $plugin_slug = sanitize_text_field( $_POST['plugin'] );
207
  $this_plugin = self::get_addon( $plugin_slug );
 
208
 
209
  $response = array( 'success' => false, 'message' => '' );
210
  try {
@@ -212,7 +215,7 @@ class FrmAddon {
212
  $license_data = $this_plugin->send_mothership_request( 'deactivate_license', $license );
213
  if ( is_array( $license_data ) && $license_data['license'] == 'deactivated' ) {
214
  $response['success'] = true;
215
- $response['message'] = __( 'That license was removed successfully', 'helpdesk' );
216
  } else {
217
  $response['message'] = __( 'There was an error deactivating your license.', 'formidable' );
218
  }
69
  $api_data['item_id'] = $this->download_id;
70
  }
71
 
72
+ $edd = new FrmEDD_SL_Plugin_Updater( $this->store_url, $this->plugin_file, $api_data );
73
+ if ( $this->plugin_folder == 'formidable/formidable.php' ) {
74
+ remove_filter( 'plugins_api', array( $edd, 'plugins_api_filter' ), 10, 3 );
75
+ }
76
 
77
  add_filter( 'site_transient_update_plugins', array( &$this, 'clear_expired_download' ) );
78
  }
205
  public static function deactivate() {
206
  check_ajax_referer( 'frm_ajax', 'nonce' );
207
 
 
208
  $plugin_slug = sanitize_text_field( $_POST['plugin'] );
209
  $this_plugin = self::get_addon( $plugin_slug );
210
+ $license = $this_plugin->get_license();
211
 
212
  $response = array( 'success' => false, 'message' => '' );
213
  try {
215
  $license_data = $this_plugin->send_mothership_request( 'deactivate_license', $license );
216
  if ( is_array( $license_data ) && $license_data['license'] == 'deactivated' ) {
217
  $response['success'] = true;
218
+ $response['message'] = __( 'That license was removed successfully', 'formidable' );
219
  } else {
220
  $response['message'] = __( 'There was an error deactivating your license.', 'formidable' );
221
  }
classes/models/FrmEDD_SL_Plugin_Updater.php CHANGED
@@ -12,7 +12,7 @@ if ( ! defined( 'ABSPATH' ) ) {
12
  * Allows plugins to use their own update API.
13
  *
14
  * @author Pippin Williamson
15
- * @version 1.6
16
  */
17
  class FrmEDD_SL_Plugin_Updater {
18
  private $api_url = '';
@@ -32,15 +32,18 @@ class FrmEDD_SL_Plugin_Updater {
32
  * @param array $_api_data Optional data to send with API calls.
33
  */
34
  public function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
35
- $this->api_url = trailingslashit( $_api_url );
36
- $this->api_data = $_api_data;
37
- $this->name = plugin_basename( $_plugin_file );
38
- $this->slug = basename( $_plugin_file, '.php' );
39
- $this->version = $_api_data['version'];
40
-
41
- // Set up hooks.
42
- $this->init();
43
- add_action( 'admin_init', array( $this, 'show_changelog' ) );
 
 
 
44
  }
45
 
46
  /**
@@ -53,6 +56,7 @@ class FrmEDD_SL_Plugin_Updater {
53
  public function init() {
54
  add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
55
  add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
 
56
  }
57
 
58
  /**
@@ -220,28 +224,59 @@ class FrmEDD_SL_Plugin_Updater {
220
 
221
  public function show_changelog() {
222
 
223
- if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action'] ) {
224
- return;
225
- }
226
 
227
- if ( empty( $_REQUEST['plugin'] ) ) {
228
- return;
229
- }
230
 
231
- if ( empty( $_REQUEST['slug'] ) ) {
232
- return;
233
- }
234
 
235
- if ( ! current_user_can( 'update_plugins' ) ) {
236
- wp_die( __( 'You do not have permission to install plugin updates', 'edd' ), __( 'Error', 'edd' ), array( 'response' => 403 ) );
237
- }
238
 
239
- $response = $this->api_request( 'plugin_latest_version', array( 'slug' => $_REQUEST['slug'] ) );
 
 
240
 
241
- if ( $response && isset( $response->sections['changelog'] ) ) {
242
- echo '<div style="background:#fff;padding:10px;">' . $response->sections['changelog'] . '</div>';
243
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
244
 
245
- exit;
246
  }
247
  }
12
  * Allows plugins to use their own update API.
13
  *
14
  * @author Pippin Williamson
15
+ * @version 1.6.3
16
  */
17
  class FrmEDD_SL_Plugin_Updater {
18
  private $api_url = '';
32
  * @param array $_api_data Optional data to send with API calls.
33
  */
34
  public function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
35
+ global $frm_edd_plugin_data;
36
+
37
+ $this->api_url = trailingslashit( $_api_url );
38
+ $this->api_data = $_api_data;
39
+ $this->name = plugin_basename( $_plugin_file );
40
+ $this->slug = basename( $_plugin_file, '.php' );
41
+ $this->version = $_api_data['version'];
42
+
43
+ $frm_edd_plugin_data[ $this->slug ] = $this->api_data;
44
+
45
+ // Set up hooks.
46
+ $this->init();
47
  }
48
 
49
  /**
56
  public function init() {
57
  add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
58
  add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
59
+ add_action( 'admin_init', array( $this, 'show_changelog' ) );
60
  }
61
 
62
  /**
224
 
225
  public function show_changelog() {
226
 
227
+ global $frm_edd_plugin_data;
 
 
228
 
229
+ if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action'] ) {
230
+ return;
231
+ }
232
 
233
+ if ( empty( $_REQUEST['plugin'] ) ) {
234
+ return;
235
+ }
236
 
237
+ if ( empty( $_REQUEST['slug'] ) ) {
238
+ return;
239
+ }
240
 
241
+ if ( ! current_user_can( 'update_plugins' ) ) {
242
+ wp_die( __( 'You do not have permission to install plugin updates', 'formidable' ), __( 'Error', 'formidable' ), array( 'response' => 403 ) );
243
+ }
244
 
245
+ $data = $frm_edd_plugin_data[ $_REQUEST['slug'] ];
246
+ $cache_key = md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_version_info' );
247
+ $version_info = get_transient( $cache_key );
248
+
249
+ if ( false === $version_info ) {
250
+
251
+ $api_params = array(
252
+ 'edd_action' => 'get_version',
253
+ 'item_name' => isset( $data['item_name'] ) ? $data['item_name'] : false,
254
+ 'item_id' => isset( $data['item_id'] ) ? $data['item_id'] : false,
255
+ 'slug' => $_REQUEST['slug'],
256
+ 'author' => $data['author'],
257
+ 'url' => home_url()
258
+ );
259
+
260
+ $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
261
+
262
+ if ( ! is_wp_error( $request ) ) {
263
+ $version_info = json_decode( wp_remote_retrieve_body( $request ) );
264
+ }
265
+
266
+ if ( ! empty( $version_info ) && isset( $version_info->sections ) ) {
267
+ $version_info->sections = maybe_unserialize( $version_info->sections );
268
+ } else {
269
+ $version_info = false;
270
+ }
271
+
272
+ set_transient( $cache_key, $version_info, DAY_IN_SECONDS );
273
+
274
+ }
275
+
276
+ if( ! empty( $version_info ) && isset( $version_info->sections['changelog'] ) ) {
277
+ echo '<div style="background:#fff;padding:10px;">' . $version_info->sections['changelog'] . '</div>';
278
+ }
279
 
280
+ exit;
281
  }
282
  }
classes/models/FrmPointers.php ADDED
@@ -0,0 +1,346 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * This class handles the pointers used in the introduction tour.
5
+ */
6
+ class FrmPointers {
7
+
8
+ /**
9
+ * @var object Instance of this class
10
+ */
11
+ public static $instance;
12
+
13
+ /**
14
+ * @var array Holds the buttons to be put out
15
+ */
16
+ private $button_array;
17
+
18
+ /**
19
+ * @var array Holds the admin pages we have pointers for and the callback that generates the pointers content
20
+ */
21
+ private $admin_pages = array(
22
+ '' => 'forms_pointer',
23
+ 'entries' => 'entries_pointer',
24
+ 'styles' => 'styles_pointer',
25
+ 'import' => 'import_pointer',
26
+ 'settings' => 'settings_pointer',
27
+ 'addons' => 'addons_pointer',
28
+ );
29
+
30
+ /**
31
+ * Class constructor.
32
+ */
33
+ private function __construct() {
34
+ if ( current_user_can( 'manage_options' ) ) {
35
+
36
+ if ( ! get_user_meta( get_current_user_id(), 'frm_ignore_tour' ) ) {
37
+ wp_enqueue_style( 'wp-pointer' );
38
+ wp_enqueue_script( 'jquery-ui' );
39
+ wp_enqueue_script( 'wp-pointer' );
40
+ add_action( 'admin_print_footer_scripts', array( $this, 'intro_tour' ) );
41
+ }
42
+ }
43
+ }
44
+
45
+ /**
46
+ * Get the singleton instance of this class
47
+ *
48
+ * @return object
49
+ */
50
+ public static function get_instance() {
51
+ if ( ! ( self::$instance instanceof self ) ) {
52
+ self::$instance = new self();
53
+ }
54
+
55
+ return self::$instance;
56
+ }
57
+
58
+ /**
59
+ * Load the introduction tour
60
+ */
61
+ public function intro_tour() {
62
+ global $pagenow;
63
+
64
+ $page = preg_replace( '/^(formidable[-]?)/', '', filter_input( INPUT_GET, 'page' ) );
65
+
66
+ if ( 'admin.php' === $pagenow && array_key_exists( $page, $this->admin_pages ) ) {
67
+ $this->do_page_pointer( $page );
68
+ } else {
69
+ $this->start_tour_pointer();
70
+ }
71
+ }
72
+
73
+ /**
74
+ * Prints the pointer script
75
+ *
76
+ * @param string $selector The CSS selector the pointer is attached to.
77
+ * @param array $options The options for the pointer.
78
+ */
79
+ public function print_scripts( $selector, $options ) {
80
+ // Button1 is the close button, which always exists.
81
+ $default_button = array(
82
+ 'text' => false,
83
+ 'function' => '',
84
+ );
85
+ $button_array_defaults = array(
86
+ 'button2' => $default_button,
87
+ 'button3' => $default_button,
88
+ );
89
+ $this->button_array = wp_parse_args( $this->button_array, $button_array_defaults );
90
+ ?>
91
+ <script type="text/javascript">
92
+ //<![CDATA[
93
+ (function ($) {
94
+ // Don't show the tour on screens with an effective width smaller than 1024px or an effective height smaller than 768px.
95
+ if (jQuery(window).width() < 1024 || jQuery(window).availWidth < 1024) {
96
+ return;
97
+ }
98
+
99
+ var frm_pointer_options = <?php echo json_encode( $options ); ?>, setup;
100
+
101
+ frm_pointer_options = $.extend(frm_pointer_options, {
102
+ buttons: function (event, t) {
103
+ var button = jQuery('<a href="<?php echo $this->get_ignore_url(); ?>" id="pointer-close" style="margin:0 5px;" class="button-secondary">' + '<?php _e( 'Close', 'formidable' ) ?>' + '</a>');
104
+ button.bind('click.pointer', function () {
105
+ t.element.pointer('close');
106
+ });
107
+ return button;
108
+ },
109
+ close: function () {
110
+ }
111
+ });
112
+
113
+ setup = function () {
114
+ $('<?php echo $selector; ?>').pointer(frm_pointer_options).pointer('open');
115
+ var lastOpenedPointer = jQuery( '.wp-pointer').slice( -1 );
116
+ <?php
117
+ $this->button2();
118
+ $this->button3();
119
+ ?>
120
+ };
121
+
122
+ if (frm_pointer_options.position && frm_pointer_options.position.defer_loading)
123
+ $(window).bind('load.wp-pointers', setup);
124
+ else
125
+ $(document).ready(setup);
126
+ })(jQuery);
127
+ //]]>
128
+ </script>
129
+ <?php
130
+ }
131
+
132
+ /**
133
+ * Render button 2, if needed
134
+ */
135
+ private function button2() {
136
+ if ( $this->button_array['button2']['text'] ) {
137
+ ?>
138
+ lastOpenedPointer.find( '#pointer-close' ).after('<a id="pointer-primary" class="button-primary">' +
139
+ '<?php echo $this->button_array['button2']['text']; ?>' + '</a>');
140
+ lastOpenedPointer.find('#pointer-primary').click(function () {
141
+ <?php echo $this->button_array['button2']['function']; ?>
142
+ });
143
+ <?php
144
+ }
145
+ }
146
+
147
+ /**
148
+ * Render button 3, if needed. This is the previous button in most cases
149
+ */
150
+ private function button3() {
151
+ if ( $this->button_array['button3']['text'] ) {
152
+ ?>
153
+ lastOpenedPointer.find('#pointer-primary').after('<a id="pointer-ternary" style="float: left;" class="button-secondary">' +
154
+ '<?php echo $this->button_array['button3']['text']; ?>' + '</a>');
155
+ lastOpenedPointer.find('#pointer-ternary').click(function () {
156
+ <?php echo $this->button_array['button3']['function']; ?>
157
+ });
158
+ <?php }
159
+ }
160
+
161
+ /**
162
+ * Show a pointer that starts the tour
163
+ */
164
+ private function start_tour_pointer() {
165
+ $selector = 'li.toplevel_page_formidable';
166
+ $content = '<h3>' . __( 'Congratulations!', 'formidable' ) . '</h3>'
167
+ .'<p>' . sprintf( __( 'You&#8217;ve just installed new forms! Click &#8220;Start Tour&#8221; to view a quick introduction of this plugin&#8217;s core functionality.' ), 'formidable' ) . '</p>';
168
+ $opt_arr = array(
169
+ 'content' => $content,
170
+ 'position' => array( 'edge' => 'top', 'align' => 'center' ),
171
+ );
172
+
173
+ $this->button_array['button2']['text'] = __( 'Start Tour', 'formidable' );
174
+ $this->button_array['button2']['function'] = sprintf( 'document.location="%s";', admin_url( 'admin.php?page=formidable' ) );
175
+
176
+ $this->print_scripts( $selector, $opt_arr );
177
+ }
178
+
179
+ /**
180
+ * Shows a pointer on the proper pages
181
+ *
182
+ * @param string $page Admin page key.
183
+ */
184
+ private function do_page_pointer( $page ) {
185
+ $pointer = call_user_func( array( $this, $this->admin_pages[ $page ] ) );
186
+
187
+ $opt_arr = array(
188
+ 'content' => $pointer['content'],
189
+ 'position' => array(
190
+ 'edge' => 'top',
191
+ 'align' => ( is_rtl() ) ? 'right' : 'left',
192
+ ),
193
+ 'pointerWidth' => 450,
194
+ );
195
+
196
+ $selector = 'h2';
197
+ if ( isset( $pointer['selector'] ) ) {
198
+ $selector = $pointer['selector'];
199
+ }
200
+
201
+ if ( isset( $pointer['position'] ) ) {
202
+ $opt_arr['position'] = $pointer['position'];
203
+ }
204
+
205
+ if ( isset( $pointer['next_page'] ) ) {
206
+ if ( ! empty( $pointer['next_page'] ) ) {
207
+ $pointer['next_page'] = '-' . $pointer['next_page'];
208
+ }
209
+ $this->button_array['button2'] = array(
210
+ 'text' => __( 'Next', 'formidable' ),
211
+ 'function' => 'window.location="' . esc_url_raw( admin_url( 'admin.php?page=formidable' . $pointer['next_page'] ) ) . '";',
212
+ );
213
+ }
214
+ if ( isset( $pointer['prev_page'] ) ) {
215
+ if ( ! empty( $pointer['prev_page'] ) ) {
216
+ $pointer['prev_page'] = '-' . $pointer['prev_page'];
217
+ }
218
+ $this->button_array['button3'] = array(
219
+ 'text' => __( 'Previous', 'formidable' ),
220
+ 'function' => 'window.location="' . esc_url_raw( admin_url( 'admin.php?page=formidable' . $pointer['prev_page'] ) ) . '";',
221
+ );
222
+ }
223
+ $this->print_scripts( $selector, $opt_arr );
224
+ }
225
+
226
+ /**
227
+ * Returns the content of the Forms listing page pointer
228
+ *
229
+ * @return array
230
+ */
231
+ private function forms_pointer() {
232
+ global $current_user;
233
+
234
+ return array(
235
+ 'content' => '<h3>' . __( 'Forms', 'formidable' ) . '</h3>'
236
+ . '<p>' . __( 'All your forms will be listed on this page. Create your first form by clicking on the "Add New" button.', 'formidable' ) . '</p>'
237
+ . '<p><strong>' . __( 'Subscribe to our Newsletter', 'formidable' ) . '</strong><br/>'
238
+ . sprintf( __( 'If you would like to hear about new features and updates for %1$s, subscribe to our newsletter:', 'formidable' ), 'Formidable' ) . '</p>'
239
+ . '<form target="_blank" action="//formidablepro.us1.list-manage.com/subscribe/post?u=a4a913790ffb892daacc6f271&amp;id=7e7df15967" method="post" selector="newsletter-form" accept-charset="' . esc_attr( get_bloginfo( 'charset' ) ) . '">'
240
+ . '<p>'
241
+ . '<input style="margin: 5px; color:#666" name="EMAIL" value="' . esc_attr( $current_user->user_email ) . '" selector="newsletter-email" placeholder="' . esc_attr__( 'Email', 'formidable' ) . '"/>'
242
+ . '<input type="hidden" name="group[4505]" value="4" />'
243
+ . '<button type="submit" class="button-primary">' . esc_html__( 'Subscribe', 'formidable' ) . '</button>'
244
+ . '</p>'
245
+ . '</form>',
246
+ 'next_page' => 'entries',
247
+ );
248
+ }
249
+
250
+ /**
251
+ * Returns the content of the Entries listing page pointer
252
+ *
253
+ * @return array
254
+ */
255
+ private function entries_pointer() {
256
+ return array(
257
+ 'content' => '<h3>' . __( 'Entries', 'formidable' ) . '</h3>'
258
+ . '<p>' . __( 'Each time one of your forms is submitted, an entry is created. You will find every form submission listed here so you will always have a backup if an email fails.', 'formidable' ) . '</p>',
259
+ 'prev_page' => '',
260
+ 'next_page' => 'styles',
261
+ 'selector' => '.wp-list-table',
262
+ 'position' => array( 'edge' => 'bottom', 'align' => 'center' ),
263
+ );
264
+ }
265
+
266
+ /**
267
+ * Returns the content of the Styles page pointer
268
+ *
269
+ * @return array
270
+ */
271
+ private function styles_pointer() {
272
+ return array(
273
+ 'content' => '<h3>' . __( 'Styles', 'formidable' ) . '</h3>'
274
+ . '<p>' . __( 'Want to make changes to the way your forms look? Make all the changes you would like right here, and watch the sample form change before your eyes.', 'formidable' ) . '</p>',
275
+ 'prev_page' => 'entries',
276
+ 'next_page' => 'import',
277
+ 'selector' => '.general-style',
278
+ 'position' => array( 'edge' => 'left', 'align' => 'right' ),
279
+ );
280
+ }
281
+
282
+ /**
283
+ * Returns the content of the Import/Export page pointer
284
+ *
285
+ * @return array
286
+ */
287
+ private function import_pointer() {
288
+ return array(
289
+ 'content' => '<h3>' . __( 'Import/Export', 'formidable' ) . '</h3>'
290
+ . '<p>' . __( 'Import and export forms and styles when copying from one site to another or sharing with someone else. Your entries can be exported to a CSV as well. The Premium version also includes the option to import entries to your site from a CSV.', 'formidable' ) . '</p>',
291
+ 'prev_page' => 'styles',
292
+ 'next_page' => 'settings',
293
+ 'selector' => '.inside.with_frm_style',
294
+ 'position' => array( 'edge' => 'bottom', 'align' => 'top' ),
295
+ );
296
+ }
297
+
298
+ /**
299
+ * Returns the content of the advanced page pointer
300
+ *
301
+ * @return array
302
+ */
303
+ private function settings_pointer() {
304
+ return array(
305
+ 'content' => '<h3>' . __( 'Global Settings', 'formidable' ) . '</h3>'
306
+ . '<p><strong>' . __( 'General', 'formidable' ) . '</strong><br/>'
307
+ . __( 'Turn stylesheets and scripts off, set which user roles have access to change and create forms, setup your reCaptcha, and set default messages for new forms and fields.', 'formidable' )
308
+ . '<p><strong>' . __( 'Plugin Licenses', 'formidable' ) . '</strong><br/>'
309
+ . sprintf( __( 'Once you&#8217;ve purchased %1$s or any addons, you&#8217;ll have to enter a license key to get access to all of their powerful features. A Plugin Licenses tab will appear here for you to enter your license key.', 'formidable' ), 'Formidable Pro' )
310
+ . '</p>',
311
+ 'prev_page' => 'import',
312
+ 'next_page' => 'addons',
313
+ );
314
+ }
315
+
316
+ /**
317
+ * Returns the content of the extensions and licenses page pointer
318
+ *
319
+ * @return array
320
+ */
321
+ private function addons_pointer() {
322
+ return array(
323
+ 'content' => '<h3>' . __( 'Addons', 'formidable' ) . '</h3>'
324
+ . '<p>' . sprintf( __( 'The powerful functions of %1$s can be extended with %2$spremium plugins%3$s. You can read all about the Formidable Premium Plugins %2$shere%3$s.', 'formidable' ), 'Formidable', '<a target="_blank" href="' . esc_url( FrmAppHelper::make_affiliate_url( 'https://formidablepro.com/' ) ) . '">', '</a>' )
325
+ . '</p>'
326
+ . '<p><strong>' . __( 'Like this plugin?', 'formidable' ) . '</strong><br/>' . sprintf( __( 'So, we&#8217;ve come to the end of the tour. If you like the plugin, please %srate it 5 stars on WordPress.org%s!', 'formidable' ), '<a target="_blank" href="https://wordpress.org/plugins/formidable/">', '</a>' ) . '</p>'
327
+ . '<p>' . sprintf( __( 'Thank you for using our plugin and good luck with your forms!<br/><br/>Best,<br/>Team Formidable - %1$sformidablepro.com%2$s', 'formidable' ), '<a target="_blank" href="' . esc_url( FrmAppHelper::make_affiliate_url( 'https://formidablepro.com/' ) ) . '">', '</a>' ) . '</p>',
328
+ 'prev_page' => 'settings',
329
+ );
330
+ }
331
+
332
+ /**
333
+ * Extending the current page URL with two params to be able to ignore the tour.
334
+ *
335
+ * @return mixed
336
+ */
337
+ private function get_ignore_url() {
338
+ $arr_params = array(
339
+ 'frm_restart_tour' => false,
340
+ 'frm_ignore_tour' => '1',
341
+ 'nonce' => wp_create_nonce( 'frm-ignore-tour' ),
342
+ );
343
+
344
+ return esc_url( add_query_arg( $arr_params ) );
345
+ }
346
+ }
classes/models/FrmStyle.php CHANGED
@@ -371,8 +371,12 @@ class FrmStyle {
371
 
372
  'title_size' => '20px',
373
  'title_color' => '444444',
 
 
374
  'form_desc_size' => '14px',
375
  'form_desc_color' => '666666',
 
 
376
 
377
  'font' => '"Lucida Grande","Lucida Sans Unicode",Tahoma,sans-serif',
378
  'font_size' => '14px',
@@ -398,6 +402,7 @@ class FrmStyle {
398
  'auto_width' => false,
399
  'field_pad' => '6px 10px',
400
  'field_margin' => '20px',
 
401
  'text_color' => '555555',
402
  //'border_color_hv' => 'cccccc',
403
  'border_color' => 'cccccc',
@@ -406,8 +411,10 @@ class FrmStyle {
406
 
407
  'bg_color' => 'ffffff',
408
  //'bg_color_hv' => 'ffffff',
 
409
  'bg_color_active' => 'ffffff',
410
  'border_color_active' => '66afe9',
 
411
  'text_color_error' => '444444',
412
  'bg_color_error' => 'ffffff',
413
  'border_color_error' => 'B94A48',
371
 
372
  'title_size' => '20px',
373
  'title_color' => '444444',
374
+ 'title_margin_top' => '10px',
375
+ 'title_margin_bottom' => '10px',
376
  'form_desc_size' => '14px',
377
  'form_desc_color' => '666666',
378
+ 'form_desc_margin_top' => '10px',
379
+ 'form_desc_margin_bottom' => '25px',
380
 
381
  'font' => '"Lucida Grande","Lucida Sans Unicode",Tahoma,sans-serif',
382
  'font_size' => '14px',
402
  'auto_width' => false,
403
  'field_pad' => '6px 10px',
404
  'field_margin' => '20px',
405
+ 'field_weight' => 'normal',
406
  'text_color' => '555555',
407
  //'border_color_hv' => 'cccccc',
408
  'border_color' => 'cccccc',
411
 
412
  'bg_color' => 'ffffff',
413
  //'bg_color_hv' => 'ffffff',
414
+ 'remove_box_shadow' => '',
415
  'bg_color_active' => 'ffffff',
416
  'border_color_active' => '66afe9',
417
+ 'remove_box_shadow_active' => '',
418
  'text_color_error' => '444444',
419
  'bg_color_error' => 'ffffff',
420
  'border_color_error' => 'B94A48',
classes/views/addons/list.php CHANGED
@@ -1,5 +1,5 @@
1
  <div class="wrap">
2
- <h1><?php _e( 'Formidable AddOns', 'formidable' ) ?></h1>
3
 
4
  <div id="the-list" class="frm-addons">
5
  <?php foreach ( $addons as $addon ) {
@@ -13,7 +13,10 @@
13
  $installed = isset( $installed_addons[ $addon['info']['slug'] ] ) || is_dir( WP_PLUGIN_DIR . '/formidable-' . $addon['info']['slug'] );
14
  }
15
  $has_thumbnail = ! empty( $addon['info']['thumbnail'] );
16
- $addon['info']['link'] = $addon['info']['link'] . $append_affiliate;
 
 
 
17
 
18
  ?>
19
  <div class="plugin-card <?php echo esc_attr( $has_thumbnail ? '' : 'frm-no-thumb') ?>">
1
  <div class="wrap">
2
+ <h2><?php _e( 'Formidable AddOns', 'formidable' ) ?></h2>
3
 
4
  <div id="the-list" class="frm-addons">
5
  <?php foreach ( $addons as $addon ) {
13
  $installed = isset( $installed_addons[ $addon['info']['slug'] ] ) || is_dir( WP_PLUGIN_DIR . '/formidable-' . $addon['info']['slug'] );
14
  }
15
  $has_thumbnail = ! empty( $addon['info']['thumbnail'] );
16
+ if ( $addon['info']['slug'] == 'formidable-pro' ) {
17
+ $addon['info']['link'] = $pro_link;
18
+ }
19
+ $addon['info']['link'] = FrmAppHelper::make_affiliate_url( $addon['info']['link'] );
20
 
21
  ?>
22
  <div class="plugin-card <?php echo esc_attr( $has_thumbnail ? '' : 'frm-no-thumb') ?>">
classes/views/addons/settings.php CHANGED
@@ -3,6 +3,7 @@
3
 
4
  <?php
5
 
 
6
  foreach ( $plugins as $slug => $plugin ) {
7
  if ( $slug == 'formidable_pro' ) {
8
  continue;
@@ -11,6 +12,9 @@
11
  $license = get_option( 'edd_'. $slug .'_license_key' );
12
  $status = get_option( 'edd_'. $slug .'_license_active' );
13
  $activate = ( false !== $license && $status == 'valid' ) ? 'deactivate' : 'activate';
 
 
 
14
  $icon_class = ( empty( $license ) ) ? 'frm_hidden' : '';
15
  ?>
16
 
@@ -23,7 +27,7 @@
23
  <p class="frm_license_msg"></p>
24
  </div>
25
  <div class="edd_frm_unauthorized alignleft <?php echo esc_attr( $activate == 'deactivate' ) ? 'frm_hidden' : '' ?>">
26
- <input id="edd_<?php echo esc_attr( $slug ) ?>_license_key" name="edd_<?php echo esc_attr( $slug ) ?>_license_key" type="text" class="regular-text" value="" />
27
  <span class="frm_icon_font frm_action_icon frm_error_icon edd_frm_status_icon <?php echo esc_attr( $icon_class ); ?>"></span>
28
  <input type="button" class="button-secondary edd_frm_save_license" data-plugin="<?php echo esc_attr( $slug ) ?>" name="edd_<?php echo esc_attr( $slug ) ?>_license_activate" value="<?php esc_attr_e( 'Activate', 'formidable' ) ?>"/>
29
  <p class="frm_license_msg"></p>
@@ -31,5 +35,8 @@
31
 
32
  </div>
33
  <?php } ?>
34
-
 
 
 
35
  </div>
3
 
4
  <?php
5
 
6
+ $any_unauthorized = false;
7
  foreach ( $plugins as $slug => $plugin ) {
8
  if ( $slug == 'formidable_pro' ) {
9
  continue;
12
  $license = get_option( 'edd_'. $slug .'_license_key' );
13
  $status = get_option( 'edd_'. $slug .'_license_active' );
14
  $activate = ( false !== $license && $status == 'valid' ) ? 'deactivate' : 'activate';
15
+ if ( $activate == 'activate' ) {
16
+ $any_unauthorized = true;
17
+ }
18
  $icon_class = ( empty( $license ) ) ? 'frm_hidden' : '';
19
  ?>
20
 
27
  <p class="frm_license_msg"></p>
28
  </div>
29
  <div class="edd_frm_unauthorized alignleft <?php echo esc_attr( $activate == 'deactivate' ) ? 'frm_hidden' : '' ?>">
30
+ <input id="edd_<?php echo esc_attr( $slug ) ?>_license_key" name="edd_<?php echo esc_attr( $slug ) ?>_license_key" type="text" class="regular-text frm_addon_license_key" value="" />
31
  <span class="frm_icon_font frm_action_icon frm_error_icon edd_frm_status_icon <?php echo esc_attr( $icon_class ); ?>"></span>
32
  <input type="button" class="button-secondary edd_frm_save_license" data-plugin="<?php echo esc_attr( $slug ) ?>" name="edd_<?php echo esc_attr( $slug ) ?>_license_activate" value="<?php esc_attr_e( 'Activate', 'formidable' ) ?>"/>
33
  <p class="frm_license_msg"></p>
35
 
36
  </div>
37
  <?php } ?>
38
+ <?php if ( $any_unauthorized && FrmAppHelper::pro_is_installed() ) { ?>
39
+ <div class="clear"></div>
40
+ <p><a href="#" class="edd_frm_fill_license button-secondary"><?php _e( 'Autofill Licenses', 'formidable' ) ?></a></p>
41
+ <?php } ?>
42
  </div>
classes/views/frm-settings/license_box.php CHANGED
@@ -2,10 +2,10 @@
2
  <?php if ( ! is_multisite() || is_super_admin() ) { ?>
3
  <div class="postbox">
4
  <div class="inside">
5
- <p class="alignright"><?php printf( __( '%1$sClick here%2$s to get it now', 'formidable' ), '<a href="http://formidablepro.com' . esc_url( FrmAppHelper::affiliate() ) . '">', '</a>' ) ?> &#187;</p>
6
  <p><?php _e( 'Ready to take your forms to the next level?<br/>Formidable Forms will help you create views, manage data, and get reports.', 'formidable' ) ?></p>
7
 
8
- <p>Already signed up? <a href="https://formidablepro.com/knowledgebase/install-formidable-forms/<?php echo esc_url( FrmAppHelper::affiliate() ) ?>" target="_blank"><?php _e( 'Click here', 'formidable' ) ?></a> to get installation instructions and download the pro version.</p>
9
  </div>
10
  </div>
11
  <?php } ?>
2
  <?php if ( ! is_multisite() || is_super_admin() ) { ?>
3
  <div class="postbox">
4
  <div class="inside">
5
+ <p class="alignright"><?php printf( __( '%1$sClick here%2$s to get it now', 'formidable' ), '<a href="'. esc_url( FrmAppHelper::make_affiliate_url( 'http://formidablepro.com' ) ) . '">', '</a>' ) ?> &#187;</p>
6
  <p><?php _e( 'Ready to take your forms to the next level?<br/>Formidable Forms will help you create views, manage data, and get reports.', 'formidable' ) ?></p>
7
 
8
+ <p>Already signed up? <a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url( 'https://formidablepro.com/knowledgebase/install-formidable-forms/' ) ) ?>" target="_blank"><?php _e( 'Click here', 'formidable' ) ?></a> to get installation instructions and download the pro version.</p>
9
  </div>
10
  </div>
11
  <?php } ?>
classes/views/styles/_field-colors.php CHANGED
@@ -44,6 +44,12 @@
44
  </select>
45
  </div>
46
  <div class="clear"></div>
 
 
 
 
 
 
47
  </div><!-- /.tabs-panel -->
48
 
49
  <div id="tabs-panel-active-color" class="tabs-panel <?php
@@ -57,7 +63,13 @@
57
  <label><?php _e( 'Border', 'formidable' ) ?></label>
58
  <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('border_color_active') ) ?>" id="frm_border_color_active" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_active'] ) ?>" />
59
  </div>
60
- <div class="clear"></div>
 
 
 
 
 
 
61
  </div><!-- /.tabs-panel -->
62
 
63
  <div id="tabs-panel-active-error" class="tabs-panel <?php
44
  </select>
45
  </div>
46
  <div class="clear"></div>
47
+ <p class="frm_no_bottom_margin">
48
+ <label>
49
+ <input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('remove_box_shadow') ) ?>" id="frm_remove_box_shadow" value="1" <?php checked($style->post_content['remove_box_shadow'], 1) ?> />
50
+ <?php _e( 'Remove box shadow', 'formidable' ) ?>
51
+ </label>
52
+ </p>
53
  </div><!-- /.tabs-panel -->
54
 
55
  <div id="tabs-panel-active-color" class="tabs-panel <?php
63
  <label><?php _e( 'Border', 'formidable' ) ?></label>
64
  <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('border_color_active') ) ?>" id="frm_border_color_active" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_active'] ) ?>" />
65
  </div>
66
+ <div class="clear"></div>
67
+ <p class="frm_no_bottom_margin">
68
+ <label>
69
+ <input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('remove_box_shadow_active') ) ?>" id="frm_remove_box_shadow_active" value="1" <?php checked($style->post_content['remove_box_shadow_active'], 1) ?> />
70
+ <?php _e( 'Remove box shadow', 'formidable' ) ?>
71
+ </label>
72
+ </p>
73
  </div><!-- /.tabs-panel -->
74
 
75
  <div id="tabs-panel-active-error" class="tabs-panel <?php
classes/views/styles/_field-sizes.php CHANGED
@@ -33,3 +33,12 @@
33
  <label><?php _e( 'Corners', 'formidable' ) ?> <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'Formidable uses CSS3 border-radius for corner rounding, which is not currently supported by Internet Explorer.', 'formidable' ) ?>" ></span></label>
34
  <input type="text" value="<?php echo esc_attr( $style->post_content['border_radius'] ) ?>" name="<?php echo esc_attr( $frm_style->get_field_name('border_radius') ) ?>" id="frm_border_radius" />
35
  </div>
 
 
 
 
 
 
 
 
 
33
  <label><?php _e( 'Corners', 'formidable' ) ?> <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'Formidable uses CSS3 border-radius for corner rounding, which is not currently supported by Internet Explorer.', 'formidable' ) ?>" ></span></label>
34
  <input type="text" value="<?php echo esc_attr( $style->post_content['border_radius'] ) ?>" name="<?php echo esc_attr( $frm_style->get_field_name('border_radius') ) ?>" id="frm_border_radius" />
35
  </div>
36
+
37
+ <div class="field-group clearfix frm-first-row">
38
+ <label><?php _e( 'Weight', 'formidable' ) ?></label>
39
+ <select name="<?php echo esc_attr( $frm_style->get_field_name('field_weight') ) ?>" id="frm_field_weight">
40
+ <?php foreach ( FrmStyle::get_bold_options() as $value => $name ) { ?>
41
+ <option value="<?php echo esc_attr( $value ) ?>" <?php selected( $style->post_content['field_weight'], $value ) ?>><?php echo esc_attr( $name ) ?></option>
42
+ <?php } ?>
43
+ </select>
44
+ </div>
classes/views/styles/_form-description.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="field-group clearfix frm-half frm-first-row">
2
+ <label><?php _e( 'Size', 'formidable' ) ?></label>
3
+ <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('form_desc_size') ) ?>" id="frm_form_desc_size" value="<?php echo esc_attr( $style->post_content['form_desc_size'] ) ?>" />
4
+ </div>
5
+
6
+ <div class="field-group clearfix frm-half frm-first-row">
7
+ <label><?php _e( 'Color', 'formidable' ) ?></label>
8
+ <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('form_desc_color') ) ?>" id="frm_form_desc_color" class="hex" value="<?php echo esc_attr( $style->post_content['form_desc_color'] ) ?>" />
9
+ </div>
10
+ <div class="field-group clearfix frm-half">
11
+ <label><?php _e( 'Margin Top', 'formidable' ) ?></label>
12
+ <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('form_desc_margin_top') ) ?>" id="frm_form_desc_margin_top" value="<?php echo esc_attr( $style->post_content['form_desc_margin_top'] ) ?>" size="4" />
13
+ </div>
14
+ <div class="field-group clearfix frm-half">
15
+ <label><?php _e( 'Margin Bottom', 'formidable' ) ?></label>
16
+ <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('form_desc_margin_bottom') ) ?>" id="frm_form_desc_margin_bottom" value="<?php echo esc_attr( $style->post_content['form_desc_margin_bottom'] ) ?>" size="4" />
17
+ </div>
classes/views/styles/_form-title.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="field-group clearfix frm-half frm-first-row">
2
+ <label><?php _e( 'Size', 'formidable' ) ?></label>
3
+ <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('title_size') ) ?>" id="frm_title_size" value="<?php echo esc_attr( $style->post_content['title_size'] ) ?>" />
4
+ </div>
5
+
6
+ <div class="field-group clearfix frm-half frm-first-row">
7
+ <label><?php _e( 'Color', 'formidable' ) ?></label>
8
+ <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('title_color') ) ?>" id="frm_title_color" class="hex" value="<?php echo esc_attr( $style->post_content['title_color'] ) ?>" />
9
+ </div>
10
+ <div class="field-group clearfix frm-half">
11
+ <label><?php _e( 'Margin Top', 'formidable' ) ?></label>
12
+ <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('title_margin_top') ) ?>" id="frm_title_margin_top" value="<?php echo esc_attr( $style->post_content['title_margin_top'] ) ?>" size="4" />
13
+ </div>
14
+ <div class="field-group clearfix frm-half">
15
+ <label><?php _e( 'Margin Bottom', 'formidable' ) ?></label>
16
+ <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('title_margin_bottom') ) ?>" id="frm_title_margin_bottom" value="<?php echo esc_attr( $style->post_content['title_margin_bottom'] ) ?>" size="4" />
17
+ </div>
classes/views/styles/_general.php CHANGED
@@ -45,33 +45,12 @@
45
 
46
  <div class="field-group clearfix frm-half">
47
  <label><?php _e( 'Direction', 'formidable' ) ?></label>
48
- <select name="<?php echo esc_attr( $frm_style->get_field_name('direction') ) ?>" id="frm_form_align">
49
  <option value="ltr" <?php selected($style->post_content['direction'], 'ltr') ?>><?php _e( 'Left to Right', 'formidable' ) ?></option>
50
  <option value="rtl" <?php selected($style->post_content['direction'], 'rtl') ?>><?php _e( 'Right to Left', 'formidable' ) ?></option>
51
  </select>
52
  </div>
53
 
54
- <div class="clear"></div>
55
- <div class="field-group clearfix frm-half">
56
- <label><?php _e( 'Title Size', 'formidable' ) ?></label>
57
- <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('title_size') ) ?>" id="frm_title_size" value="<?php echo esc_attr( $style->post_content['title_size'] ) ?>" />
58
- </div>
59
-
60
- <div class="field-group clearfix frm-half">
61
- <label><?php _e( 'Color', 'formidable' ) ?></label>
62
- <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('title_color') ) ?>" id="frm_title_color" class="hex" value="<?php echo esc_attr( $style->post_content['title_color'] ) ?>" />
63
- </div>
64
-
65
- <div class="field-group clearfix frm-half">
66
- <label><?php _e( 'Description Size', 'formidable' ) ?></label>
67
- <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('form_desc_size') ) ?>" id="frm_form_desc_size" value="<?php echo esc_attr( $style->post_content['form_desc_size'] ) ?>" />
68
- </div>
69
-
70
- <div class="field-group clearfix frm-half">
71
- <label><?php _e( 'Color', 'formidable' ) ?></label>
72
- <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('form_desc_color') ) ?>" id="frm_form_desc_color" class="hex" value="<?php echo esc_attr( $style->post_content['form_desc_color'] ) ?>" />
73
- </div>
74
-
75
  <div class="clear"></div>
76
  <p class="frm_no_bottom_margin">
77
  <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('important_style') ) ?>" id="frm_important_style" value="1" <?php checked($style->post_content['important_style'], 1) ?> />
45
 
46
  <div class="field-group clearfix frm-half">
47
  <label><?php _e( 'Direction', 'formidable' ) ?></label>
48
+ <select name="<?php echo esc_attr( $frm_style->get_field_name('direction') ) ?>" id="frm_direction">
49
  <option value="ltr" <?php selected($style->post_content['direction'], 'ltr') ?>><?php _e( 'Left to Right', 'formidable' ) ?></option>
50
  <option value="rtl" <?php selected($style->post_content['direction'], 'rtl') ?>><?php _e( 'Right to Left', 'formidable' ) ?></option>
51
  </select>
52
  </div>
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  <div class="clear"></div>
55
  <p class="frm_no_bottom_margin">
56
  <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('important_style') ) ?>" id="frm_important_style" value="1" <?php checked($style->post_content['important_style'], 1) ?> />
classes/views/styles/_sample_form.php CHANGED
@@ -8,11 +8,10 @@
8
 
9
  <?php $pos_class = 'frm_pos_container frm_' . ( $style->post_content['position'] == 'none' ? 'top' : ( $style->post_content['position'] == 'no_label' ? 'none' : $style->post_content['position'] ) ) . '_container'; ?>
10
 
11
- <h3><?php _e( 'Form Title', 'formidable' ) ?></h3>
12
- <div class="frm_description"><p><?php _e( 'This is an example form description for styling purposes.', 'formidable' ) ?></p></div>
13
-
14
  <div class="frm_form_fields frm_sample_form">
15
  <fieldset>
 
 
16
  <div class="frm_form_field frm_first frm_half form-field <?php echo esc_attr( $pos_class ) ?>">
17
  <label class="frm_primary_label"><?php _e( 'Text field', 'formidable' ) ?> <span class="frm_required">*</span></label>
18
  <input type="text" value="<?php esc_attr_e( 'This is sample text', 'formidable' ) ?>"/>
8
 
9
  <?php $pos_class = 'frm_pos_container frm_' . ( $style->post_content['position'] == 'none' ? 'top' : ( $style->post_content['position'] == 'no_label' ? 'none' : $style->post_content['position'] ) ) . '_container'; ?>
10
 
 
 
 
11
  <div class="frm_form_fields frm_sample_form">
12
  <fieldset>
13
+ <h3 class="frm_form_title"><?php _e( 'Form Title', 'formidable' ) ?></h3>
14
+ <div class="frm_description"><p><?php _e( 'This is an example form description for styling purposes.', 'formidable' ) ?></p></div>
15
  <div class="frm_form_field frm_first frm_half form-field <?php echo esc_attr( $pos_class ) ?>">
16
  <label class="frm_primary_label"><?php _e( 'Text field', 'formidable' ) ?> <span class="frm_required">*</span></label>
17
  <input type="text" value="<?php esc_attr_e( 'This is sample text', 'formidable' ) ?>"/>
classes/views/xml/forms_xml.php CHANGED
@@ -21,7 +21,7 @@ while ( $next_set = array_splice( $item_ids, 0, 20 ) ) {
21
  <is_template><?php echo $form->is_template ?></is_template>
22
  <default_template><?php echo $form->default_template ?></default_template>
23
  <editable><?php echo $form->editable ?></editable>
24
- <options><?php echo FrmXMLHelper::cdata($form->options) ?></options>
25
  <status><?php echo FrmXMLHelper::cdata($form->status) ?></status>
26
  <parent_form_id><?php echo $form->parent_form_id ?></parent_form_id>
27
  <?php
21
  <is_template><?php echo $form->is_template ?></is_template>
22
  <default_template><?php echo $form->default_template ?></default_template>
23
  <editable><?php echo $form->editable ?></editable>
24
+ <options><?php echo FrmXMLHelper::prepare_form_options_for_export($form->options) ?></options>
25
  <status><?php echo FrmXMLHelper::cdata($form->status) ?></status>
26
  <parent_form_id><?php echo $form->parent_form_id ?></parent_form_id>
27
  <?php
css/_single_theme.css.php CHANGED
@@ -61,7 +61,8 @@ if ( ! isset( $center_form ) ) {
61
  }
62
 
63
  .<?php echo esc_html( $style_class ) ?>,
64
- .<?php echo esc_html( $style_class ) ?> form{
 
65
  text-align:<?php echo esc_html( $form_align . $important ) ?>;
66
  }
67
 
@@ -78,9 +79,13 @@ if ( ! isset( $center_form ) ) {
78
  background-color:<?php echo esc_html( empty($fieldset_bg_color) ? 'transparent' : '#'. $fieldset_bg_color ); ?>;
79
  }
80
 
81
- .<?php echo esc_html( $style_class ) ?> .frm-show-form > h3{
 
82
  font-size:<?php echo esc_html( $title_size . $important ) ?>;
83
  color:#<?php echo esc_html( $title_color . $important ) ?>;
 
 
 
84
  }
85
 
86
  .<?php echo esc_html( $style_class ) ?> .frm-show-form .frm_section_heading h3{
@@ -189,6 +194,9 @@ if ( ! isset( $center_form ) ) {
189
  .<?php echo esc_html( $style_class ) ?> .frm-show-form div.frm_description p{
190
  font-size:<?php echo esc_html( $form_desc_size . $important ) ?>;
191
  color:#<?php echo esc_html( $form_desc_color . $important ) ?>;
 
 
 
192
  }
193
 
194
 
@@ -340,8 +348,8 @@ if ( ! isset( $center_form ) ) {
340
  -moz-box-sizing:border-box;
341
  box-sizing:border-box;
342
  outline:none<?php echo esc_html( $important ) ?>;
343
- font-weight:normal;
344
- box-shadow:0 1px 1px rgba(0, 0, 0, 0.075) inset;
345
  }
346
 
347
  .<?php echo esc_html( $style_class ) ?> input[type=file]::-webkit-file-upload-button{
@@ -460,7 +468,11 @@ if ( ! isset( $center_form ) ) {
460
  .<?php echo esc_html( $style_class ) ?> .chosen-container-active .chosen-choices{
461
  background-color:#<?php echo esc_html( $bg_color_active . $important ) ?>;
462
  border-color:#<?php echo esc_html( $border_color_active . $important ) ?>;
 
 
 
463
  box-shadow:0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(<?php echo esc_html( FrmStylesHelper::hex2rgb( $border_color_active ) ) ?>, 0.6);
 
464
  }
465
 
466
  <?php
61
  }
62
 
63
  .<?php echo esc_html( $style_class ) ?>,
64
+ .<?php echo esc_html( $style_class ) ?> form,
65
+ .<?php echo esc_html( $style_class ) ?> .frm-show-form div.frm_description p {
66
  text-align:<?php echo esc_html( $form_align . $important ) ?>;
67
  }
68
 
79
  background-color:<?php echo esc_html( empty($fieldset_bg_color) ? 'transparent' : '#'. $fieldset_bg_color ); ?>;
80
  }
81
 
82
+ .<?php echo esc_html( $style_class ) ?> legend + h3,
83
+ .<?php echo esc_html( $style_class ) ?> h3.frm_form_title{
84
  font-size:<?php echo esc_html( $title_size . $important ) ?>;
85
  color:#<?php echo esc_html( $title_color . $important ) ?>;
86
+ font-family:<?php echo FrmAppHelper::kses( stripslashes( $font ) ) ?>;
87
+ margin-top:<?php echo esc_html( $title_margin_top . $important ) ?>;
88
+ margin-bottom:<?php echo esc_html( $title_margin_bottom . $important ) ?>;
89
  }
90
 
91
  .<?php echo esc_html( $style_class ) ?> .frm-show-form .frm_section_heading h3{
194
  .<?php echo esc_html( $style_class ) ?> .frm-show-form div.frm_description p{
195
  font-size:<?php echo esc_html( $form_desc_size . $important ) ?>;
196
  color:#<?php echo esc_html( $form_desc_color . $important ) ?>;
197
+ margin-top:<?php echo esc_html( $form_desc_margin_top . $important ) ?>;
198
+ margin-bottom:<?php echo esc_html( $form_desc_margin_bottom . $important ) ?>;
199
+
200
  }
201
 
202
 
348
  -moz-box-sizing:border-box;
349
  box-sizing:border-box;
350
  outline:none<?php echo esc_html( $important ) ?>;
351
+ font-weight:<?php echo esc_html( $field_weight ) ?>;
352
+ box-shadow:<?php echo esc_html( ( isset( $remove_box_shadow ) && $remove_box_shadow ) ? 'none' : '0 1px 1px rgba(0, 0, 0, 0.075) inset' )?>;
353
  }
354
 
355
  .<?php echo esc_html( $style_class ) ?> input[type=file]::-webkit-file-upload-button{
468
  .<?php echo esc_html( $style_class ) ?> .chosen-container-active .chosen-choices{
469
  background-color:#<?php echo esc_html( $bg_color_active . $important ) ?>;
470
  border-color:#<?php echo esc_html( $border_color_active . $important ) ?>;
471
+ <?php if ( isset( $remove_box_shadow_active ) && $remove_box_shadow_active ) { ?>
472
+ box-shadow:none;
473
+ <?php } else { ?>
474
  box-shadow:0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(<?php echo esc_html( FrmStylesHelper::hex2rgb( $border_color_active ) ) ?>, 0.6);
475
+ <?php } ?>
476
  }
477
 
478
  <?php
css/frm_admin.css CHANGED
@@ -2171,8 +2171,8 @@ Responsive Design
2171
  display:table-cell !important;
2172
  }
2173
 
2174
- .wp-list-table.formidable_page_formidable-entries th.frm_hidden,
2175
- .wp-list-table.formidable_page_formidable-entries td.frm_hidden{
2176
  display:none !important;
2177
  }
2178
 
2171
  display:table-cell !important;
2172
  }
2173
 
2174
+ #form_entries_page .wp-list-table th.frm_hidden,
2175
+ #form_entries_page .wp-list-table td.frm_hidden{
2176
  display:none !important;
2177
  }
2178
 
formidable.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Formidable
4
  Description: Quickly and easily create drag-and-drop forms
5
- Version: 2.0.19
6
  Plugin URI: http://formidablepro.com/
7
  Author URI: http://strategy11.com
8
  Author: Strategy11
2
  /*
3
  Plugin Name: Formidable
4
  Description: Quickly and easily create drag-and-drop forms
5
+ Version: 2.0.20
6
  Plugin URI: http://formidablepro.com/
7
  Author URI: http://strategy11.com
8
  Author: Strategy11
js/formidable_admin.js CHANGED
@@ -1744,6 +1744,32 @@ function frmAdminBuildJS(){
1744
  });
1745
  }
1746
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1747
  /* Import/Export page */
1748
  function validateExport(e){
1749
  e.preventDefault();
@@ -2287,8 +2313,6 @@ function frmAdminBuildJS(){
2287
 
2288
  wrapper = target.parents('.accordion-section-content').first();
2289
 
2290
- // upon changing tabs, we want to uncheck all checkboxes
2291
- jQuery('input', wrapper).removeAttr('checked');
2292
 
2293
  jQuery('.tabs-panel-active', wrapper).removeClass('tabs-panel-active').addClass('tabs-panel-inactive');
2294
  jQuery('#' + panelId, wrapper).removeClass('tabs-panel-inactive').addClass('tabs-panel-active');
@@ -2398,8 +2422,9 @@ function frmAdminBuildJS(){
2398
 
2399
  // activate addon licenses
2400
  jQuery('.edd_frm_save_license').click(saveAddonLicense);
 
2401
  },
2402
-
2403
  exportInit: function(){
2404
  jQuery(document.getElementById('frm_export_xml')).submit(validateExport);
2405
  jQuery('#frm_export_xml input, #frm_export_xml select').change(removeExportError);
1744
  });
1745
  }
1746
 
1747
+ function fillLicenses(){
1748
+ var emptyFields = jQuery('.frm_addon_license_key:visible');
1749
+ if ( emptyFields.length < 1 ){
1750
+ return false;
1751
+ }
1752
+
1753
+ jQuery.ajax({
1754
+ type:'POST',url:ajaxurl,dataType:'json',
1755
+ data:{action:'frm_fill_licenses', nonce:frmGlobal.nonce},
1756
+ success:function(json){
1757
+ var i;
1758
+ var licenses = json.licenses;
1759
+ for ( i in licenses ) {
1760
+ if (licenses.hasOwnProperty(i)) {
1761
+ var input = jQuery('#edd_'+ licenses[i].slug +'_license_key');
1762
+ if ( typeof input !== null && input.is(':visible') ) {
1763
+ input.val(licenses[i].key);
1764
+ jQuery('input[name="edd_'+ licenses[i].slug +'_license_activate"]').click();
1765
+ }
1766
+ }
1767
+ }
1768
+ }
1769
+ });
1770
+ return false;
1771
+ }
1772
+
1773
  /* Import/Export page */
1774
  function validateExport(e){
1775
  e.preventDefault();
2313
 
2314
  wrapper = target.parents('.accordion-section-content').first();
2315
 
 
 
2316
 
2317
  jQuery('.tabs-panel-active', wrapper).removeClass('tabs-panel-active').addClass('tabs-panel-inactive');
2318
  jQuery('#' + panelId, wrapper).removeClass('tabs-panel-inactive').addClass('tabs-panel-active');
2422
 
2423
  // activate addon licenses
2424
  jQuery('.edd_frm_save_license').click(saveAddonLicense);
2425
+ jQuery('.edd_frm_fill_license').click(fillLicenses);
2426
  },
2427
+
2428
  exportInit: function(){
2429
  jQuery(document.getElementById('frm_export_xml')).submit(validateExport);
2430
  jQuery('#frm_export_xml input, #frm_export_xml select').change(removeExportError);
languages/formidable-en_US.po CHANGED
@@ -1,9 +1,9 @@
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: Formidable v2.0.19\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: 2010-12-20\n"
6
- "PO-Revision-Date: 2016-01-05 20:06:21+0000\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
@@ -23,6 +23,7 @@ msgstr ""
23
  #: classes/controllers/FrmFormsController.php:6
24
  #: classes/controllers/FrmFormsController.php:524
25
  #: classes/controllers/FrmXMLController.php:59
 
26
  #: classes/models/FrmSettings.php:78
27
  #: classes/views/frm-forms/list.php:5
28
  #@ formidable
@@ -80,42 +81,42 @@ msgstr ""
80
  msgid "Settings Saved"
81
  msgstr ""
82
 
83
- #: classes/helpers/FrmAppHelper.php:574
84
  #@ formidable
85
  msgid "View Forms and Templates"
86
  msgstr ""
87
 
88
- #: classes/helpers/FrmAppHelper.php:576
89
  #@ formidable
90
  msgid "Delete Forms and Templates"
91
  msgstr ""
92
 
93
- #: classes/helpers/FrmAppHelper.php:577
94
  #@ formidable
95
  msgid "Access this Settings Page"
96
  msgstr ""
97
 
98
- #: classes/helpers/FrmAppHelper.php:578
99
  #@ formidable
100
  msgid "View Entries from Admin Area"
101
  msgstr ""
102
 
103
- #: classes/helpers/FrmAppHelper.php:587
104
  #@ formidable
105
  msgid "Edit Entries from Admin Area"
106
  msgstr ""
107
 
108
- #: classes/helpers/FrmAppHelper.php:579
109
  #@ formidable
110
  msgid "Delete Entries from Admin Area"
111
  msgstr ""
112
 
113
- #: classes/helpers/FrmAppHelper.php:588
114
  #@ formidable
115
  msgid "View Reports"
116
  msgstr ""
117
 
118
- #: classes/views/styles/_sample_form.php:71
119
  #@ formidable
120
  msgid "Section Heading"
121
  msgstr ""
@@ -239,7 +240,7 @@ msgid "Your responses were successfully submitted. Thank you!"
239
  msgstr ""
240
 
241
  #: classes/models/FrmSettings.php:90
242
- #: classes/views/styles/_sample_form.php:99
243
  #: pro/classes/views/frmpro-entries/show.php:34
244
  #@ formidable
245
  msgid "Submit"
@@ -261,6 +262,7 @@ msgstr ""
261
  msgid "Name cannot be blank"
262
  msgstr ""
263
 
 
264
  #: pro/classes/controllers/FrmProFormsController.php:55
265
  #: pro/classes/controllers/FrmProFormsController.php:267
266
  #@ formidable
@@ -282,12 +284,11 @@ msgstr ""
282
  msgid "Message"
283
  msgstr ""
284
 
285
- #: classes/controllers/FrmEntriesController.php:71
286
  #: classes/controllers/FrmFormsController.php:684
287
  #: classes/views/frm-entries/form.php:48
288
  #: classes/views/frm-entries/sidebar-shared.php:23
289
  #: pro/classes/helpers/FrmProFieldsHelper.php:2815
290
- #: pro/classes/views/displays/where_row.php:7
291
  #: pro/classes/views/xml/map_csv_fields.php:57
292
  #@ formidable
293
  msgid "Entry Key"
@@ -381,14 +382,14 @@ msgstr ""
381
  msgid "Update"
382
  msgstr ""
383
 
384
- #: pro/classes/controllers/FrmProEddController.php:141
385
  #@ formidable
386
  msgid "or"
387
  msgstr ""
388
 
389
- #: classes/helpers/FrmAppHelper.php:1735
390
  #: classes/views/frm-forms/_publish_box.php:75
391
- #: pro/classes/controllers/FrmProEddController.php:143
392
  #: pro/classes/controllers/FrmProEntriesController.php:1999
393
  #: pro/classes/views/frmpro-entries/sidebar-new.php:14
394
  #: pro/classes/views/frmpro-form-actions/_custom_field_row.php:31
@@ -422,6 +423,7 @@ msgstr ""
422
  msgid "Form Name"
423
  msgstr ""
424
 
 
425
  #: classes/views/frm-forms/mb_html_tab.php:35
426
  #@ formidable
427
  msgid "Form Description"
@@ -438,7 +440,7 @@ msgstr ""
438
  msgid "Field Name"
439
  msgstr ""
440
 
441
- #: classes/controllers/FrmStylesController.php:321
442
  #: classes/views/frm-forms/mb_html_tab.php:9
443
  #@ formidable
444
  msgid "Field Description"
@@ -474,7 +476,7 @@ msgstr ""
474
  msgid "Display form description"
475
  msgstr ""
476
 
477
- #: classes/helpers/FrmAppHelper.php:1722
478
  #: classes/helpers/FrmCSVExportHelper.php:111
479
  #: pro/classes/helpers/FrmProFieldsHelper.php:2835
480
  #: pro/classes/helpers/FrmProFieldsHelper.php:2850
@@ -486,9 +488,10 @@ msgstr ""
486
 
487
  #: classes/controllers/FrmAppController.php:74
488
  #: classes/controllers/FrmEntriesController.php:8
489
- #: classes/controllers/FrmEntriesController.php:119
490
  #: classes/controllers/FrmFormsController.php:517
491
  #: classes/controllers/FrmXMLController.php:59
 
492
  #: classes/views/frm-entries/list.php:3
493
  #: pro/classes/views/frmpro-fields/options-form.php:41
494
  #: pro/classes/views/frmpro-statistics/show.php:67
@@ -567,7 +570,7 @@ msgid "Create"
567
  msgstr ""
568
 
569
  #: classes/controllers/FrmFieldsController.php:322
570
- #: classes/helpers/FrmAppHelper.php:1730
571
  #: classes/views/frm-fields/single-option.php:6
572
  #: classes/views/frm-fields/single-option.php:8
573
  #: pro/classes/views/frmpro-fields/other-option.php:10
@@ -641,7 +644,7 @@ msgstr ""
641
  msgid "Submit Button"
642
  msgstr ""
643
 
644
- #: classes/helpers/FrmAppHelper.php:1728
645
  #@ formidable
646
  msgid "Are you sure you want to do this? Clicking OK will delete all forms, form data, and all other Formidable data. There is no Undo."
647
  msgstr ""
@@ -693,12 +696,12 @@ msgstr ""
693
  msgid "There was a problem duplicating that entry"
694
  msgstr ""
695
 
696
- #: classes/controllers/FrmEntriesController.php:364
697
  #@ formidable
698
  msgid "Entry was Successfully Destroyed"
699
  msgstr ""
700
 
701
- #: classes/controllers/FrmEntriesController.php:400
702
  #: pro/classes/controllers/FrmProEntriesController.php:385
703
  #@ formidable
704
  msgid "No entries were specified"
@@ -709,258 +712,258 @@ msgstr ""
709
  msgid "Duplicate Field"
710
  msgstr ""
711
 
712
- #: classes/helpers/FrmAppHelper.php:1782
713
  #@ formidable
714
  msgid "English/Western"
715
  msgstr ""
716
 
717
- #: classes/helpers/FrmAppHelper.php:1783
718
  #@ formidable
719
  msgid "Afrikaans"
720
  msgstr ""
721
 
722
- #: classes/helpers/FrmAppHelper.php:1783
723
  #@ formidable
724
  msgid "Albanian"
725
  msgstr ""
726
 
727
- #: classes/helpers/FrmAppHelper.php:1784
728
  #@ formidable
729
  msgid "Arabic"
730
  msgstr ""
731
 
732
- #: classes/helpers/FrmAppHelper.php:1784
733
  #@ formidable
734
  msgid "Armenian"
735
  msgstr ""
736
 
737
- #: classes/helpers/FrmAppHelper.php:1785
738
  #@ formidable
739
  msgid "Azerbaijani"
740
  msgstr ""
741
 
742
- #: classes/helpers/FrmAppHelper.php:1785
743
  #@ formidable
744
  msgid "Basque"
745
  msgstr ""
746
 
747
- #: classes/helpers/FrmAppHelper.php:1786
748
  #@ formidable
749
  msgid "Bosnian"
750
  msgstr ""
751
 
752
- #: classes/helpers/FrmAppHelper.php:1786
753
  #@ formidable
754
  msgid "Bulgarian"
755
  msgstr ""
756
 
757
- #: classes/helpers/FrmAppHelper.php:1787
758
  #@ formidable
759
  msgid "Catalan"
760
  msgstr ""
761
 
762
- #: classes/helpers/FrmAppHelper.php:1787
763
  #@ formidable
764
  msgid "Chinese Hong Kong"
765
  msgstr ""
766
 
767
- #: classes/helpers/FrmAppHelper.php:1788
768
  #@ formidable
769
  msgid "Chinese Simplified"
770
  msgstr ""
771
 
772
- #: classes/helpers/FrmAppHelper.php:1788
773
  #@ formidable
774
  msgid "Chinese Traditional"
775
  msgstr ""
776
 
777
- #: classes/helpers/FrmAppHelper.php:1789
778
  #@ formidable
779
  msgid "Croatian"
780
  msgstr ""
781
 
782
- #: classes/helpers/FrmAppHelper.php:1789
783
  #@ formidable
784
  msgid "Czech"
785
  msgstr ""
786
 
787
- #: classes/helpers/FrmAppHelper.php:1790
788
  #@ formidable
789
  msgid "Danish"
790
  msgstr ""
791
 
792
- #: classes/helpers/FrmAppHelper.php:1790
793
  #@ formidable
794
  msgid "Dutch"
795
  msgstr ""
796
 
797
- #: classes/helpers/FrmAppHelper.php:1791
798
  #@ formidable
799
  msgid "English/UK"
800
  msgstr ""
801
 
802
- #: classes/helpers/FrmAppHelper.php:1791
803
  #@ formidable
804
  msgid "Esperanto"
805
  msgstr ""
806
 
807
- #: classes/helpers/FrmAppHelper.php:1792
808
  #@ formidable
809
  msgid "Estonian"
810
  msgstr ""
811
 
812
- #: classes/helpers/FrmAppHelper.php:1792
813
  #@ formidable
814
  msgid "Faroese"
815
  msgstr ""
816
 
817
- #: classes/helpers/FrmAppHelper.php:1793
818
  #@ formidable
819
  msgid "Farsi/Persian"
820
  msgstr ""
821
 
822
- #: classes/helpers/FrmAppHelper.php:1794
823
  #@ formidable
824
  msgid "Finnish"
825
  msgstr ""
826
 
827
- #: classes/helpers/FrmAppHelper.php:1794
828
  #@ formidable
829
  msgid "French"
830
  msgstr ""
831
 
832
- #: classes/helpers/FrmAppHelper.php:1795
833
  #@ formidable
834
  msgid "French/Swiss"
835
  msgstr ""
836
 
837
- #: classes/helpers/FrmAppHelper.php:1796
838
  #@ formidable
839
  msgid "German"
840
  msgstr ""
841
 
842
- #: classes/helpers/FrmAppHelper.php:1797
843
  #@ formidable
844
  msgid "Greek"
845
  msgstr ""
846
 
847
- #: classes/helpers/FrmAppHelper.php:1798
848
  #@ formidable
849
  msgid "Hebrew"
850
  msgstr ""
851
 
852
- #: classes/helpers/FrmAppHelper.php:1799
853
  #@ formidable
854
  msgid "Hungarian"
855
  msgstr ""
856
 
857
- #: classes/helpers/FrmAppHelper.php:1800
858
  #@ formidable
859
  msgid "Icelandic"
860
  msgstr ""
861
 
862
- #: classes/helpers/FrmAppHelper.php:1801
863
  #@ formidable
864
  msgid "Italian"
865
  msgstr ""
866
 
867
- #: classes/helpers/FrmAppHelper.php:1801
868
  #@ formidable
869
  msgid "Japanese"
870
  msgstr ""
871
 
872
- #: classes/helpers/FrmAppHelper.php:1802
873
  #@ formidable
874
  msgid "Korean"
875
  msgstr ""
876
 
877
- #: classes/helpers/FrmAppHelper.php:1802
878
  #@ formidable
879
  msgid "Latvian"
880
  msgstr ""
881
 
882
- #: classes/helpers/FrmAppHelper.php:1803
883
  #@ formidable
884
  msgid "Lithuanian"
885
  msgstr ""
886
 
887
- #: classes/helpers/FrmAppHelper.php:1803
888
  #@ formidable
889
  msgid "Malaysian"
890
  msgstr ""
891
 
892
- #: classes/helpers/FrmAppHelper.php:1804
893
  #@ formidable
894
  msgid "Norwegian"
895
  msgstr ""