@@ -7,8 +7,8 @@ discard block |
||
| 7 | 7 | public $entry_metas; |
| 8 | 8 | |
| 9 | 9 | public function __construct() { |
| 10 | - if ( ! defined('ABSPATH') ) { |
|
| 11 | - die('You are not allowed to call this page directly.'); |
|
| 10 | + if ( ! defined( 'ABSPATH' ) ) { |
|
| 11 | + die( 'You are not allowed to call this page directly.' ); |
|
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | global $wpdb; |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | $frm_db_version = FrmAppHelper::$db_version; |
| 30 | 30 | $old_db_version = (float) $old_db_version; |
| 31 | 31 | if ( ! $old_db_version ) { |
| 32 | - $old_db_version = get_option('frm_db_version'); |
|
| 32 | + $old_db_version = get_option( 'frm_db_version' ); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | if ( $frm_db_version != $old_db_version ) { |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); |
| 40 | 40 | |
| 41 | 41 | $this->create_tables(); |
| 42 | - $this->migrate_data($frm_db_version, $old_db_version); |
|
| 42 | + $this->migrate_data( $frm_db_version, $old_db_version ); |
|
| 43 | 43 | |
| 44 | 44 | /***** SAVE DB VERSION *****/ |
| 45 | 45 | update_option( 'frm_db_version', FrmAppHelper::plugin_version() . '-' . $frm_db_version ); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - do_action('frm_after_install'); |
|
| 55 | + do_action( 'frm_after_install' ); |
|
| 56 | 56 | |
| 57 | 57 | $frm_vars['doing_upgrade'] = false; |
| 58 | 58 | |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | global $wpdb; |
| 167 | 167 | $wpdb->query( $q . $charset_collate ); |
| 168 | 168 | } |
| 169 | - unset($q); |
|
| 169 | + unset( $q ); |
|
| 170 | 170 | } |
| 171 | 171 | } |
| 172 | 172 | |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | public function uninstall() { |
| 202 | 202 | if ( ! current_user_can( 'administrator' ) ) { |
| 203 | 203 | $frm_settings = FrmAppHelper::get_settings(); |
| 204 | - wp_die($frm_settings->admin_permission); |
|
| 204 | + wp_die( $frm_settings->admin_permission ); |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | global $wpdb, $wp_roles; |
@@ -211,8 +211,8 @@ discard block |
||
| 211 | 211 | $wpdb->query( 'DROP TABLE IF EXISTS ' . $this->entries ); |
| 212 | 212 | $wpdb->query( 'DROP TABLE IF EXISTS ' . $this->entry_metas ); |
| 213 | 213 | |
| 214 | - delete_option('frm_options'); |
|
| 215 | - delete_option('frm_db_version'); |
|
| 214 | + delete_option( 'frm_options' ); |
|
| 215 | + delete_option( 'frm_db_version' ); |
|
| 216 | 216 | |
| 217 | 217 | //delete roles |
| 218 | 218 | $frm_roles = FrmAppHelper::frm_capabilities(); |
@@ -220,11 +220,11 @@ discard block |
||
| 220 | 220 | foreach ( $frm_roles as $frm_role => $frm_role_description ) { |
| 221 | 221 | foreach ( $roles as $role => $details ) { |
| 222 | 222 | $wp_roles->remove_cap( $role, $frm_role ); |
| 223 | - unset($role, $details); |
|
| 223 | + unset( $role, $details ); |
|
| 224 | 224 | } |
| 225 | - unset($frm_role, $frm_role_description); |
|
| 225 | + unset( $frm_role, $frm_role_description ); |
|
| 226 | 226 | } |
| 227 | - unset($roles, $frm_roles); |
|
| 227 | + unset( $roles, $frm_roles ); |
|
| 228 | 228 | |
| 229 | 229 | // delete actions, views, and styles |
| 230 | 230 | |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | |
| 247 | 247 | $wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE %s OR option_name LIKE %s', '_transient_timeout_frm_form_fields_%', '_transient_frm_form_fields_%' ) ); |
| 248 | 248 | |
| 249 | - do_action('frm_after_uninstall'); |
|
| 249 | + do_action( 'frm_after_uninstall' ); |
|
| 250 | 250 | return true; |
| 251 | 251 | } |
| 252 | 252 | |
@@ -307,8 +307,8 @@ discard block |
||
| 307 | 307 | |
| 308 | 308 | $updated = 0; |
| 309 | 309 | foreach ( $fields as $f ) { |
| 310 | - $f->field_options = maybe_unserialize($f->field_options); |
|
| 311 | - if ( empty($f->field_options['size']) || ! is_numeric($f->field_options['size']) ) { |
|
| 310 | + $f->field_options = maybe_unserialize( $f->field_options ); |
|
| 311 | + if ( empty( $f->field_options['size'] ) || ! is_numeric( $f->field_options['size'] ) ) { |
|
| 312 | 312 | continue; |
| 313 | 313 | } |
| 314 | 314 | |
@@ -316,27 +316,27 @@ discard block |
||
| 316 | 316 | $f->field_options['size'] .= 'px'; |
| 317 | 317 | $u = FrmField::update( $f->id, array( 'field_options' => $f->field_options ) ); |
| 318 | 318 | if ( $u ) { |
| 319 | - $updated++; |
|
| 319 | + $updated ++; |
|
| 320 | 320 | } |
| 321 | - unset($f); |
|
| 321 | + unset( $f ); |
|
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | // Change the characters in widgets to pixels |
| 325 | - $widgets = get_option('widget_frm_show_form'); |
|
| 326 | - if ( empty($widgets) ) { |
|
| 325 | + $widgets = get_option( 'widget_frm_show_form' ); |
|
| 326 | + if ( empty( $widgets ) ) { |
|
| 327 | 327 | return; |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | - $widgets = maybe_unserialize($widgets); |
|
| 330 | + $widgets = maybe_unserialize( $widgets ); |
|
| 331 | 331 | foreach ( $widgets as $k => $widget ) { |
| 332 | - if ( ! is_array($widget) || ! isset($widget['size']) ) { |
|
| 332 | + if ( ! is_array( $widget ) || ! isset( $widget['size'] ) ) { |
|
| 333 | 333 | continue; |
| 334 | 334 | } |
| 335 | 335 | $size = round( $pixel_conversion * (int) $widget['size'] ); |
| 336 | 336 | $size .= 'px'; |
| 337 | - $widgets[ $k ]['size'] = $size; |
|
| 337 | + $widgets[$k]['size'] = $size; |
|
| 338 | 338 | } |
| 339 | - update_option('widget_frm_show_form', $widgets); |
|
| 339 | + update_option( 'widget_frm_show_form', $widgets ); |
|
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | /** |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | // Format form options |
| 386 | - $form_options = maybe_unserialize($form->options); |
|
| 386 | + $form_options = maybe_unserialize( $form->options ); |
|
| 387 | 387 | |
| 388 | 388 | // Migrate settings to actions |
| 389 | 389 | FrmXMLHelper::migrate_form_settings_to_actions( $form_options, $form->id ); |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | private function migrate_to_11() { |
| 394 | 394 | global $wpdb; |
| 395 | 395 | |
| 396 | - $forms = FrmDb::get_results( $this->forms, array(), 'id, options'); |
|
| 396 | + $forms = FrmDb::get_results( $this->forms, array(), 'id, options' ); |
|
| 397 | 397 | |
| 398 | 398 | $sending = __( 'Sending', 'formidable' ); |
| 399 | 399 | $img = FrmAppHelper::plugin_url() . '/images/ajax_loader.gif'; |
@@ -404,13 +404,13 @@ discard block |
||
| 404 | 404 | <img class="frm_ajax_loading" src="$img" alt="$sending" style="visibility:hidden;" /> |
| 405 | 405 | </div> |
| 406 | 406 | DEFAULT_HTML; |
| 407 | - unset($sending, $img); |
|
| 407 | + unset( $sending, $img ); |
|
| 408 | 408 | |
| 409 | - $new_default_html = FrmFormsHelper::get_default_html('submit'); |
|
| 409 | + $new_default_html = FrmFormsHelper::get_default_html( 'submit' ); |
|
| 410 | 410 | $draft_link = FrmFormsHelper::get_draft_link(); |
| 411 | 411 | foreach ( $forms as $form ) { |
| 412 | - $form->options = maybe_unserialize($form->options); |
|
| 413 | - if ( ! isset($form->options['submit_html']) || empty($form->options['submit_html']) ) { |
|
| 412 | + $form->options = maybe_unserialize( $form->options ); |
|
| 413 | + if ( ! isset( $form->options['submit_html'] ) || empty( $form->options['submit_html'] ) ) { |
|
| 414 | 414 | continue; |
| 415 | 415 | } |
| 416 | 416 | |
@@ -421,9 +421,9 @@ discard block |
||
| 421 | 421 | $form->options['submit_html'] = preg_replace( '~\<\/div\>(?!.*\<\/div\>)~', $draft_link . "\r\n</div>", $form->options['submit_html'] ); |
| 422 | 422 | $wpdb->update( $this->forms, array( 'options' => serialize( $form->options ) ), array( 'id' => $form->id ) ); |
| 423 | 423 | } |
| 424 | - unset($form); |
|
| 424 | + unset( $form ); |
|
| 425 | 425 | } |
| 426 | - unset($forms); |
|
| 426 | + unset( $forms ); |
|
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | private function migrate_to_6() { |
@@ -452,17 +452,17 @@ discard block |
||
| 452 | 452 | </div> |
| 453 | 453 | DEFAULT_HTML; |
| 454 | 454 | |
| 455 | - $new_default_html = FrmFieldsHelper::get_default_html('text'); |
|
| 455 | + $new_default_html = FrmFieldsHelper::get_default_html( 'text' ); |
|
| 456 | 456 | foreach ( $fields as $field ) { |
| 457 | - $field->field_options = maybe_unserialize($field->field_options); |
|
| 457 | + $field->field_options = maybe_unserialize( $field->field_options ); |
|
| 458 | 458 | $html = FrmField::get_option( $field, 'custom_html' ); |
| 459 | 459 | if ( $html == $default_html || $html == $old_default_html ) { |
| 460 | 460 | $field->field_options['custom_html'] = $new_default_html; |
| 461 | 461 | $wpdb->update( $this->fields, array( 'field_options' => maybe_serialize( $field->field_options ) ), array( 'id' => $field->id ) ); |
| 462 | 462 | } |
| 463 | - unset($field); |
|
| 463 | + unset( $field ); |
|
| 464 | 464 | } |
| 465 | - unset($default_html, $old_default_html, $fields); |
|
| 465 | + unset( $default_html, $old_default_html, $fields ); |
|
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | private function migrate_to_4() { |