Formidable Forms – Form Builder for WordPress - Version 1.06.07

Version Description

  • Added mb_split fallback for servers without mbstring installed
  • Changed menu position to prevent override from other plugins and themes
  • PRO: Fixed issue with the form shortcode showing if using multiple forms with default values on the same page
  • PRO: Fixed javascript error in frm-entry-update-field shortcode
  • PRO: Send the "read more" link to the single entry page instead of showing in-place for dynamic displays
Download this release

Release Info

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

Code changes from version 1.06.06 to 1.06.07

classes/controllers/FrmAppController.php CHANGED
@@ -86,7 +86,7 @@ class FrmAppController{
86
  if( $frm_update->pro_is_authorized() and !$frm_update->pro_is_installed() ){
87
  if (IS_WPMU and $frm_update->pro_wpmu and !FrmAppHelper::is_super_admin())
88
  return;
89
- $frm_update->queue_update(true);
90
  $inst_install_url = wp_nonce_url('update.php?action=upgrade-plugin&plugin=' . $plugin, 'upgrade-plugin_' . $plugin);
91
  ?>
92
  <td colspan="3" class="plugin-update"><div class="update-message" style="-moz-border-radius:5px;border:1px solid #CC0000;; margin:5px;background-color:#FFEBE8;padding:3px 5px;"><?php printf(__('Your Formidable Pro installation isn\'t quite complete yet.<br/>%1$sAutomatically Upgrade to Enable Formidable Pro%2$s', 'formidable'), '<a href="'.$inst_install_url.'">', '</a>'); ?></div></td>
@@ -124,7 +124,7 @@ success:function(msg){jQuery("#frm_install_message").fadeOut("slow");}
124
  }
125
 
126
  if( $frm_update->pro_is_authorized() and !$frm_update->pro_is_installed()){
127
- $frm_update->queue_update(true);
128
  $inst_install_url = wp_nonce_url('update.php?action=upgrade-plugin&plugin=' . $frm_update->plugin_name, 'upgrade-plugin_' . $frm_update->plugin_name);
129
  ?>
130
  <div class="error" style="padding:7px;"><?php printf(__('Your Formidable Pro installation isn\'t quite complete yet.<br/>%1$sAutomatically Upgrade to Enable Formidable Pro%2$s', 'formidable'), '<a href="'.$inst_install_url.'">', '</a>'); ?></div>
@@ -348,7 +348,6 @@ success:function(msg){jQuery("#frm_install_message").fadeOut("slow");}
348
  function get_form_shortcode($atts){
349
  global $frm_skip_shortcode;
350
  if($frm_skip_shortcode){
351
- $frm_skip_shortcode = false;
352
  $sc = '[formidable';
353
  foreach($atts as $k => $v)
354
  $sc .= ' '. $k .'="'. $v .'"';
86
  if( $frm_update->pro_is_authorized() and !$frm_update->pro_is_installed() ){
87
  if (IS_WPMU and $frm_update->pro_wpmu and !FrmAppHelper::is_super_admin())
88
  return;
89
+ $frm_update->manually_queue_update();
90
  $inst_install_url = wp_nonce_url('update.php?action=upgrade-plugin&plugin=' . $plugin, 'upgrade-plugin_' . $plugin);
91
  ?>
92
  <td colspan="3" class="plugin-update"><div class="update-message" style="-moz-border-radius:5px;border:1px solid #CC0000;; margin:5px;background-color:#FFEBE8;padding:3px 5px;"><?php printf(__('Your Formidable Pro installation isn\'t quite complete yet.<br/>%1$sAutomatically Upgrade to Enable Formidable Pro%2$s', 'formidable'), '<a href="'.$inst_install_url.'">', '</a>'); ?></div></td>
124
  }
125
 
126
  if( $frm_update->pro_is_authorized() and !$frm_update->pro_is_installed()){
127
+ $frm_update->manually_queue_update();
128
  $inst_install_url = wp_nonce_url('update.php?action=upgrade-plugin&plugin=' . $frm_update->plugin_name, 'upgrade-plugin_' . $frm_update->plugin_name);
129
  ?>
130
  <div class="error" style="padding:7px;"><?php printf(__('Your Formidable Pro installation isn\'t quite complete yet.<br/>%1$sAutomatically Upgrade to Enable Formidable Pro%2$s', 'formidable'), '<a href="'.$inst_install_url.'">', '</a>'); ?></div>
348
  function get_form_shortcode($atts){
349
  global $frm_skip_shortcode;
350
  if($frm_skip_shortcode){
 
351
  $sc = '[formidable';
352
  foreach($atts as $k => $v)
353
  $sc .= ' '. $k .'="'. $v .'"';
classes/helpers/FrmAppHelper.php CHANGED
@@ -484,11 +484,14 @@ class FrmAppHelper{
484
  function truncate($str, $length, $minword = 3, $continue = '...'){
485
  $length = (int)$length;
486
  $str = stripslashes(strip_tags($str));
 
487
 
488
- if($length == 0)
489
  return '';
490
- else if($length <= 10)
491
- return (function_exists('mb_substr')) ? mb_substr($str, 0, $length) : substr($str, 0, $length);
 
 
492
 
493
  $sub = '';
494
  $len = 0;
@@ -506,8 +509,7 @@ class FrmAppHelper{
506
 
507
  unset($total_len);
508
  }
509
-
510
- $original_len = (function_exists('mb_strlen')) ? mb_strlen($str) : strlen($str);
511
  return $sub . (($len < $original_len) ? $continue : '');
512
  }
513
 
484
  function truncate($str, $length, $minword = 3, $continue = '...'){
485
  $length = (int)$length;
486
  $str = stripslashes(strip_tags($str));
487
+ $original_len = (function_exists('mb_strlen')) ? mb_strlen($str) : strlen($str);
488
 
489
+ if($length == 0){
490
  return '';
491
+ }else if($length <= 10){
492
+ $sub = (function_exists('mb_substr')) ? mb_substr($str, 0, $length) : substr($str, 0, $length);
493
+ return $sub . (($length < $original_len) ? $continue : '');
494
+ }
495
 
496
  $sub = '';
497
  $len = 0;
509
 
510
  unset($total_len);
511
  }
512
+
 
513
  return $sub . (($len < $original_len) ? $continue : '');
514
  }
515
 
classes/models/FrmUpdate.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
 
3
  /** Okay, this class is not a pure model -- it contains all the functions
4
  * necessary to successfully provide an update mechanism for FormidablePro!
@@ -55,7 +56,9 @@ class FrmUpdate{
55
  $this->pro_wpmu_str = 'proplug-wpmu';
56
  $this->pro_mothership_xmlrpc_url = $this->pro_mothership . '/xmlrpc.php';
57
  $this->timeout = 10;
58
-
 
 
59
  // Retrieve Pro Credentials
60
  $this->pro_wpmu = false;
61
  if (IS_WPMU and get_site_option($this->pro_wpmu_store)){
@@ -68,11 +71,6 @@ class FrmUpdate{
68
  extract($creds);
69
  $this->pro_username = ((isset($username) and !empty($username))?$username:'');
70
  $this->pro_password = ((isset($password) and !empty($password))?$password:'');
71
-
72
- // Plugin Update Actions -- gotta make sure the right url is used with pro ... don't want any downgrades of course
73
- add_action('update_option__transient_update_plugins', array(&$this, 'check_for_update_now')); // for WordPress 2.8
74
- add_action('admin_init', array(&$this, 'periodically_check_for_update'));
75
- add_filter('pre_set_transient_update_plugins', array(&$this, 'force_pro_version') );
76
  }
77
  }
78
 
@@ -261,7 +259,7 @@ success:function(msg){jQuery("#frm_deauthorize_link").fadeOut("slow"); frm_show_
261
  $this->pro_password = (isset($password) and !empty($password)) ? $password : '';
262
 
263
  if(!$this->pro_is_installed())
264
- $this->queue_update(true);
265
  }
266
 
267
  return $user_authorized;
@@ -285,122 +283,62 @@ success:function(msg){jQuery("#frm_deauthorize_link").fadeOut("slow"); frm_show_
285
 
286
  return base64_decode($client->getResponse());
287
  }
288
-
289
- function get_current_version(){
290
  include_once( ABSPATH . 'wp-includes/class-IXR.php' );
291
 
292
  $client = new IXR_Client( $this->pro_mothership_xmlrpc_url, false, 80, $this->timeout );
293
 
294
- if( !$client->query( 'proplug.get_current_version', $this->plugin_nicename ) )
 
 
 
295
  return false;
296
 
297
  return $client->getResponse();
298
  }
299
 
300
- function queue_update($force=false){
301
- static $already_set_option, $already_set_transient;
302
- global $frm_version;
303
-
304
- if(!is_admin())
305
- return;
306
 
307
- // Make sure this method doesn't check back with the mothership too often
308
- if($already_set_option or $already_set_transient)
309
- return;
310
 
311
- if(!$this->pro_is_authorized())
312
- return;
313
-
314
- // If pro is authorized but not installed then we need to force an upgrade
315
- if(!$this->pro_is_installed())
316
- $force = true;
317
 
318
- $plugin_updates = (function_exists('get_site_transient')) ? get_site_transient('update_plugins') : get_transient('update_plugins');
319
- if(!$plugin_updates and function_exists('get_transient'))
320
- $plugin_updates = get_transient('update_plugins');
321
 
322
- $curr_version = $this->get_current_version();
323
- if(!$curr_version)
324
- return;
 
 
 
325
 
326
- if(!isset($plugin_updates->checked))
327
- $plugin_updates->checked = array();
328
- $installed_version = isset($plugin_updates->checked[$this->plugin_name]) ? $plugin_updates->checked[$this->plugin_name] : $frm_version;
329
-
330
- if( $force or version_compare( $curr_version, $installed_version, '>') ){
331
- $download_url = $this->get_download_url($curr_version);
332
-
333
- if(!empty($download_url) and $download_url and $this->user_allowed_to_download()){
334
- if(isset($plugin_updates->response[$this->plugin_name]))
335
- unset($plugin_updates->response[$this->plugin_name]);
336
-
337
- $plugin_updates->response[$this->plugin_name] = new stdClass();
338
- $plugin_updates->response[$this->plugin_name]->id = '0';
339
- $plugin_updates->response[$this->plugin_name]->slug = $this->plugin_slug;
340
- $plugin_updates->response[$this->plugin_name]->new_version = $curr_version;
341
- $plugin_updates->response[$this->plugin_name]->url = $this->plugin_url;
342
- $plugin_updates->response[$this->plugin_name]->package = $download_url;
343
- }
344
- }else{
345
- if(isset($plugin_updates->response[$this->plugin_name]))
346
- unset($plugin_updates->response[$this->plugin_name]);
347
- }
348
-
349
- if ( function_exists('set_site_transient') and !$already_set_transient ){
350
- $already_set_transient = true;
351
- set_site_transient('update_plugins', $plugin_updates); // for WordPress 2.9+
352
- }
353
-
354
- if( function_exists('set_transient') and !$already_set_option ){
355
- $already_set_option = true;
356
- set_transient('update_plugins', $plugin_updates); // for WordPress 2.8
357
- }
358
 
359
- }
360
-
361
- function check_for_update_now(){
362
- $this->queue_update();
363
- }
364
-
365
- function periodically_check_for_update(){
366
- $last_checked = get_option($this->pro_last_checked_store);
367
 
368
- if(!$last_checked or ((time() - $last_checked) >= $this->pro_check_interval)){
369
- $this->queue_update();
370
- update_option($this->pro_last_checked_store, time());
371
  }
 
 
372
  }
373
-
374
- //Check if free version will be downloaded. If so, switch it to the Pro version
375
- function force_pro_version($plugin_updates){
376
- if(is_object($plugin_updates) and isset($plugin_updates->response) and
377
- isset($plugin_updates->response[$this->plugin_name]) and $this->pro_is_authorized() and
378
- ($plugin_updates->response[$this->plugin_name] == 'latest'
379
- or $plugin_updates->response[$this->plugin_name]->url == 'http://wordpress.org/extend/plugins/'. $this->plugin_nicename .'/')){
380
- $curr_version = $this->get_current_version();
381
- if(!$curr_version)
382
- return;
383
-
384
- $installed_version = $plugin_updates->checked[$this->plugin_name];
385
-
386
- if( version_compare( $curr_version, $installed_version, '>') or !$this->pro_is_installed()){
387
- $download_url = $this->get_download_url($curr_version);
388
-
389
- if(!empty($download_url) and $download_url and $this->user_allowed_to_download()){
390
-
391
- if(isset($plugin_updates->response[$this->plugin_name]))
392
- unset($plugin_updates->response[$this->plugin_name]);
393
-
394
- $plugin_updates->response[$this->plugin_name] = new stdClass();
395
- $plugin_updates->response[$this->plugin_name]->id = '0';
396
- $plugin_updates->response[$this->plugin_name]->slug = $this->plugin_slug;
397
- $plugin_updates->response[$this->plugin_name]->new_version = $curr_version;
398
- $plugin_updates->response[$this->plugin_name]->url = $this->plugin_url;
399
- $plugin_updates->response[$this->plugin_name]->package = $download_url;
400
- }
401
- }
402
- }
403
- return $plugin_updates;
404
  }
405
  }
406
  ?>
1
  <?php
2
+ if(!defined('ABSPATH')) die('You are not allowed to call this page directly.');
3
 
4
  /** Okay, this class is not a pure model -- it contains all the functions
5
  * necessary to successfully provide an update mechanism for FormidablePro!
56
  $this->pro_wpmu_str = 'proplug-wpmu';
57
  $this->pro_mothership_xmlrpc_url = $this->pro_mothership . '/xmlrpc.php';
58
  $this->timeout = 10;
59
+
60
+ add_filter('pre_set_site_transient_update_plugins', array( &$this, 'queue_update' ) );
61
+
62
  // Retrieve Pro Credentials
63
  $this->pro_wpmu = false;
64
  if (IS_WPMU and get_site_option($this->pro_wpmu_store)){
71
  extract($creds);
72
  $this->pro_username = ((isset($username) and !empty($username))?$username:'');
73
  $this->pro_password = ((isset($password) and !empty($password))?$password:'');
 
 
 
 
 
74
  }
75
  }
76
 
259
  $this->pro_password = (isset($password) and !empty($password)) ? $password : '';
260
 
261
  if(!$this->pro_is_installed())
262
+ $this->manually_queue_update();
263
  }
264
 
265
  return $user_authorized;
283
 
284
  return base64_decode($client->getResponse());
285
  }
286
+
287
+ public function get_current_info($version, $force=false){
288
  include_once( ABSPATH . 'wp-includes/class-IXR.php' );
289
 
290
  $client = new IXR_Client( $this->pro_mothership_xmlrpc_url, false, 80, $this->timeout );
291
 
292
+ $force = $force ? 'true' : 'false';
293
+
294
+ if( !$client->query( 'proplug.get_current_info', $this->pro_username, $this->pro_password, $version, $force,
295
+ get_option('siteurl'), $this->plugin_nicename) )
296
  return false;
297
 
298
  return $client->getResponse();
299
  }
300
 
301
+ function get_current_version(){
302
+ include_once( ABSPATH . 'wp-includes/class-IXR.php' );
 
 
 
 
303
 
304
+ $client = new IXR_Client( $this->pro_mothership_xmlrpc_url, false, 80, $this->timeout );
 
 
305
 
306
+ if( !$client->query( 'proplug.get_current_version', $this->plugin_nicename ) )
307
+ return false;
 
 
 
 
308
 
309
+ return $client->getResponse();
310
+ }
 
311
 
312
+
313
+ //Check if free version will be downloaded. If so, switch it to the Pro version
314
+ function queue_update($transient, $force=false){
315
+
316
+ if(!is_object($transient))
317
+ return $transient;
318
 
319
+ //if not already checked or URL set to free version or Plugin marked at latest
320
+ if(!empty( $transient->checked ) or
321
+ (isset($transient->response) and isset($transient->response[$this->plugin_name]) and
322
+ (($transient->response[$this->plugin_name] == 'latest' and !$this->pro_is_installed())
323
+ or $transient->response[$this->plugin_name]->url == 'http://wordpress.org/extend/plugins/'. $this->plugin_nicename .'/'))){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
324
 
325
+ if( $this->pro_is_authorized() ) {
326
+ if( !$this->pro_is_installed() )
327
+ $force = true;
328
+
329
+ $update = $this->get_current_info( $transient->checked[ $this->plugin_name ], $force );
 
 
 
330
 
331
+ if( $update and !empty( $update ) )
332
+ $transient->response[ $this->plugin_name ] = (object) $update;
333
+ }
334
  }
335
+
336
+ return $transient;
337
  }
338
+
339
+ public function manually_queue_update() {
340
+ $transient = get_site_transient('update_plugins');
341
+ set_site_transient('update_plugins', $this->queue_update($transient, true));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
342
  }
343
  }
344
  ?>
formidable.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Formidable
4
  Description: Quickly and easily create drag-and-drop forms
5
- Version: 1.06.06
6
  Plugin URI: http://formidablepro.com/
7
  Author URI: http://strategy11.com
8
  Author: Strategy11
@@ -52,7 +52,7 @@ if (!defined ('IS_WPMU')){
52
  }
53
 
54
  global $frm_version, $frm_db_version;
55
- $frm_version = '1.06.06';
56
  $frm_db_version = 9;
57
 
58
  global $frm_ajax_url;
2
  /*
3
  Plugin Name: Formidable
4
  Description: Quickly and easily create drag-and-drop forms
5
+ Version: 1.06.07
6
  Plugin URI: http://formidablepro.com/
7
  Author URI: http://strategy11.com
8
  Author: Strategy11
52
  }
53
 
54
  global $frm_version, $frm_db_version;
55
+ $frm_version = '1.06.07';
56
  $frm_db_version = 9;
57
 
58
  global $frm_ajax_url;
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: sswells, srwells
3
  Donate link: http://formidablepro.com/donate
4
  Tags: admin, AJAX, captcha, contact, contact form, database, email, feedback, form, forms, javascript, jquery, page, plugin, poll, Post, spam, survey, template, widget, wpmu
5
- Requires at least: 2.9
6
  Tested up to: 3.5
7
- Stable tag: 1.06.05
8
 
9
  Quickly and easily build forms with a simple drag-and-drop interface and in-place editing.
10
 
@@ -61,6 +61,13 @@ A. Try clearing your browser cache. As plugin modifications are made, frequent j
61
  [See more FAQs](http://formidablepro.com/formidable-faqs/ "Formidable Pro FAQs")
62
 
63
  == Changelog ==
 
 
 
 
 
 
 
64
  = 1.06.06 =
65
  * Removed generic classes from input fields like "text" and "date"
66
  * Correctly jump down to form with error messages
2
  Contributors: sswells, srwells
3
  Donate link: http://formidablepro.com/donate
4
  Tags: admin, AJAX, captcha, contact, contact form, database, email, feedback, form, forms, javascript, jquery, page, plugin, poll, Post, spam, survey, template, widget, wpmu
5
+ Requires at least: 3.0
6
  Tested up to: 3.5
7
+ Stable tag: 1.06.07
8
 
9
  Quickly and easily build forms with a simple drag-and-drop interface and in-place editing.
10
 
61
  [See more FAQs](http://formidablepro.com/formidable-faqs/ "Formidable Pro FAQs")
62
 
63
  == Changelog ==
64
+ = 1.06.07 =
65
+ * Added mb_split fallback for servers without mbstring installed
66
+ * Changed menu position to prevent override from other plugins and themes
67
+ * PRO: Fixed issue with the form shortcode showing if using multiple forms with default values on the same page
68
+ * PRO: Fixed javascript error in frm-entry-update-field shortcode
69
+ * PRO: Send the "read more" link to the single entry page instead of showing in-place for dynamic displays
70
+
71
  = 1.06.06 =
72
  * Removed generic classes from input fields like "text" and "date"
73
  * Correctly jump down to form with error messages