@@ -1082,7 +1082,8 @@ |
||
1082 | 1082 | private static function maybe_get_form_to_show( $id ) { |
1083 | 1083 | $form = false; |
1084 | 1084 | |
1085 | - if ( ! empty( $id ) ) { // no form id or key set |
|
1085 | + if ( ! empty( $id ) ) { |
|
1086 | +// no form id or key set |
|
1086 | 1087 | $form = FrmForm::getOne( $id ); |
1087 | 1088 | if ( ! $form || $form->parent_form_id || $form->status == 'trash' ) { |
1088 | 1089 | $form = false; |
@@ -455,11 +455,11 @@ discard block |
||
455 | 455 | ), |
456 | 456 | ); |
457 | 457 | |
458 | - if ( ! isset( $available_status[ $status ] ) ) { |
|
458 | + if ( ! isset( $available_status[$status] ) ) { |
|
459 | 459 | return; |
460 | 460 | } |
461 | 461 | |
462 | - FrmAppHelper::permission_check( $available_status[ $status ]['permission'] ); |
|
462 | + FrmAppHelper::permission_check( $available_status[$status]['permission'] ); |
|
463 | 463 | |
464 | 464 | $params = FrmForm::list_page_params(); |
465 | 465 | |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | check_admin_referer( $status . '_form_' . $params['id'] ); |
468 | 468 | |
469 | 469 | $count = 0; |
470 | - if ( FrmForm::set_status( $params['id'], $available_status[ $status ]['new_status'] ) ) { |
|
470 | + if ( FrmForm::set_status( $params['id'], $available_status[$status]['new_status'] ) ) { |
|
471 | 471 | $count ++; |
472 | 472 | } |
473 | 473 | |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
485 | 485 | $available_status['trash']['message'] = sprintf( _n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ), $count, '<a href="' . esc_url( wp_nonce_url( '?page=formidable&frm_action=untrash&form_type=' . $form_type . '&id=' . $params['id'], 'untrash_form_' . $params['id'] ) ) . '">', '</a>' ); |
486 | 486 | |
487 | - $message = $available_status[ $status ]['message']; |
|
487 | + $message = $available_status[$status]['message']; |
|
488 | 488 | |
489 | 489 | self::display_forms_list( $params, $message ); |
490 | 490 | } |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | 'type' => 'request', |
506 | 506 | ) |
507 | 507 | ); |
508 | - $message = sprintf( |
|
508 | + $message = sprintf( |
|
509 | 509 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
510 | 510 | _n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ), |
511 | 511 | $count, |
@@ -870,11 +870,11 @@ discard block |
||
870 | 870 | } |
871 | 871 | |
872 | 872 | foreach ( $template['categories'] as $category ) { |
873 | - if ( ! isset( $templates_by_category[ $category ] ) ) { |
|
874 | - $templates_by_category[ $category ] = array(); |
|
873 | + if ( ! isset( $templates_by_category[$category] ) ) { |
|
874 | + $templates_by_category[$category] = array(); |
|
875 | 875 | } |
876 | 876 | |
877 | - $templates_by_category[ $category ][] = $template; |
|
877 | + $templates_by_category[$category][] = $template; |
|
878 | 878 | } |
879 | 879 | } |
880 | 880 | unset( $template ); |
@@ -903,7 +903,7 @@ discard block |
||
903 | 903 | $forms = FrmForm::get_published_forms( $where ); |
904 | 904 | $view_path = FrmAppHelper::plugin_path() . '/classes/views/frm-forms/'; |
905 | 905 | |
906 | - $templates_by_category[ $my_templates_translation ] = $custom_templates; |
|
906 | + $templates_by_category[$my_templates_translation] = $custom_templates; |
|
907 | 907 | |
908 | 908 | unset( $pricing, $license_type, $where ); |
909 | 909 | wp_enqueue_script( 'accordion' ); // register accordion for template groups |
@@ -1118,7 +1118,7 @@ discard block |
||
1118 | 1118 | $section['id'] = $section['anchor']; |
1119 | 1119 | } |
1120 | 1120 | |
1121 | - $sections[ $key ] = $section; |
|
1121 | + $sections[$key] = $section; |
|
1122 | 1122 | } |
1123 | 1123 | |
1124 | 1124 | return $sections; |
@@ -1211,7 +1211,7 @@ discard block |
||
1211 | 1211 | if ( ! empty( $user_fields ) ) { |
1212 | 1212 | $user_helpers = array(); |
1213 | 1213 | foreach ( $user_fields as $uk => $uf ) { |
1214 | - $user_helpers[ '|user_id| show="' . $uk . '"' ] = $uf; |
|
1214 | + $user_helpers['|user_id| show="' . $uk . '"'] = $uf; |
|
1215 | 1215 | unset( $uk, $uf ); |
1216 | 1216 | } |
1217 | 1217 | |
@@ -1341,7 +1341,7 @@ discard block |
||
1341 | 1341 | if ( ! isset( $frm_vars['js_validate_forms'] ) ) { |
1342 | 1342 | $frm_vars['js_validate_forms'] = array(); |
1343 | 1343 | } |
1344 | - $frm_vars['js_validate_forms'][ $form->id ] = $form; |
|
1344 | + $frm_vars['js_validate_forms'][$form->id] = $form; |
|
1345 | 1345 | } |
1346 | 1346 | |
1347 | 1347 | public static function get_email_html() { |
@@ -1462,7 +1462,7 @@ discard block |
||
1462 | 1462 | add_filter( 'frm_validate_form', 'FrmFormsController::json_error' ); |
1463 | 1463 | } else { |
1464 | 1464 | $vars = FrmAppHelper::json_to_array( $json_vars ); |
1465 | - $action = $vars[ $action ]; |
|
1465 | + $action = $vars[$action]; |
|
1466 | 1466 | unset( $_REQUEST['frm_compact_fields'], $_POST['frm_compact_fields'] ); |
1467 | 1467 | $_REQUEST = array_merge( $_REQUEST, $vars ); |
1468 | 1468 | $_POST = array_merge( $_POST, $_REQUEST ); |
@@ -1588,7 +1588,7 @@ discard block |
||
1588 | 1588 | $actions = array(); |
1589 | 1589 | foreach ( $frm_vars['forms_loaded'] as $form ) { |
1590 | 1590 | if ( is_object( $form ) ) { |
1591 | - $actions[ $form->id ] = $form->name; |
|
1591 | + $actions[$form->id] = $form->name; |
|
1592 | 1592 | } |
1593 | 1593 | unset( $form ); |
1594 | 1594 | } |
@@ -1797,8 +1797,8 @@ discard block |
||
1797 | 1797 | private static function get_saved_errors( $form, $params ) { |
1798 | 1798 | global $frm_vars; |
1799 | 1799 | |
1800 | - if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { |
|
1801 | - $errors = $frm_vars['created_entries'][ $form->id ]['errors']; |
|
1800 | + if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][$form->id] ) ) { |
|
1801 | + $errors = $frm_vars['created_entries'][$form->id]['errors']; |
|
1802 | 1802 | } else { |
1803 | 1803 | $errors = array(); |
1804 | 1804 | } |
@@ -1812,7 +1812,7 @@ discard block |
||
1812 | 1812 | public static function just_created_entry( $form_id ) { |
1813 | 1813 | global $frm_vars; |
1814 | 1814 | |
1815 | - return ( isset( $frm_vars['created_entries'] ) && isset( $frm_vars['created_entries'][ $form_id ] ) && isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) ? $frm_vars['created_entries'][ $form_id ]['entry_id'] : 0; |
|
1815 | + return ( isset( $frm_vars['created_entries'] ) && isset( $frm_vars['created_entries'][$form_id] ) && isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ) ? $frm_vars['created_entries'][$form_id]['entry_id'] : 0; |
|
1816 | 1816 | } |
1817 | 1817 | |
1818 | 1818 | /** |
@@ -1820,7 +1820,7 @@ discard block |
||
1820 | 1820 | */ |
1821 | 1821 | private static function get_confirmation_method( $atts ) { |
1822 | 1822 | $opt = 'success_action'; |
1823 | - $method = ( isset( $atts['form']->options[ $opt ] ) && ! empty( $atts['form']->options[ $opt ] ) ) ? $atts['form']->options[ $opt ] : 'message'; |
|
1823 | + $method = ( isset( $atts['form']->options[$opt] ) && ! empty( $atts['form']->options[$opt] ) ) ? $atts['form']->options[$opt] : 'message'; |
|
1824 | 1824 | $method = apply_filters( 'frm_success_filter', $method, $atts['form'], 'create' ); |
1825 | 1825 | |
1826 | 1826 | if ( $method != 'message' && ( ! $atts['entry_id'] || ! is_numeric( $atts['entry_id'] ) ) ) { |
@@ -1833,7 +1833,7 @@ discard block |
||
1833 | 1833 | public static function maybe_trigger_redirect( $form, $params, $args ) { |
1834 | 1834 | if ( ! isset( $params['id'] ) ) { |
1835 | 1835 | global $frm_vars; |
1836 | - $params['id'] = $frm_vars['created_entries'][ $form->id ]['entry_id']; |
|
1836 | + $params['id'] = $frm_vars['created_entries'][$form->id]['entry_id']; |
|
1837 | 1837 | } |
1838 | 1838 | |
1839 | 1839 | $conf_method = self::get_confirmation_method( |
@@ -1877,7 +1877,7 @@ discard block |
||
1877 | 1877 | $opt = ( ! isset( $args['action'] ) || $args['action'] == 'create' ) ? 'success' : 'edit'; |
1878 | 1878 | |
1879 | 1879 | $args['success_opt'] = $opt; |
1880 | - if ( $args['conf_method'] == 'page' && is_numeric( $args['form']->options[ $opt . '_page_id' ] ) ) { |
|
1880 | + if ( $args['conf_method'] == 'page' && is_numeric( $args['form']->options[$opt . '_page_id'] ) ) { |
|
1881 | 1881 | self::load_page_after_submit( $args ); |
1882 | 1882 | } elseif ( $args['conf_method'] == 'redirect' ) { |
1883 | 1883 | self::redirect_after_submit( $args ); |
@@ -1892,8 +1892,8 @@ discard block |
||
1892 | 1892 | private static function load_page_after_submit( $args ) { |
1893 | 1893 | global $post; |
1894 | 1894 | $opt = $args['success_opt']; |
1895 | - if ( ! $post || $args['form']->options[ $opt . '_page_id' ] != $post->ID ) { |
|
1896 | - $page = get_post( $args['form']->options[ $opt . '_page_id' ] ); |
|
1895 | + if ( ! $post || $args['form']->options[$opt . '_page_id'] != $post->ID ) { |
|
1896 | + $page = get_post( $args['form']->options[$opt . '_page_id'] ); |
|
1897 | 1897 | $old_post = $post; |
1898 | 1898 | $post = $page; |
1899 | 1899 | $content = apply_filters( 'frm_content', $page->post_content, $args['form'], $args['entry_id'] ); |
@@ -1911,11 +1911,11 @@ discard block |
||
1911 | 1911 | add_filter( 'frm_use_wpautop', '__return_false' ); |
1912 | 1912 | |
1913 | 1913 | $opt = $args['success_opt']; |
1914 | - $success_url = trim( $args['form']->options[ $opt . '_url' ] ); |
|
1914 | + $success_url = trim( $args['form']->options[$opt . '_url'] ); |
|
1915 | 1915 | $success_url = apply_filters( 'frm_content', $success_url, $args['form'], $args['entry_id'] ); |
1916 | 1916 | $success_url = do_shortcode( $success_url ); |
1917 | 1917 | |
1918 | - $success_msg = isset( $args['form']->options[ $opt . '_msg' ] ) ? $args['form']->options[ $opt . '_msg' ] : __( 'Please wait while you are redirected.', 'formidable' ); |
|
1918 | + $success_msg = isset( $args['form']->options[$opt . '_msg'] ) ? $args['form']->options[$opt . '_msg'] : __( 'Please wait while you are redirected.', 'formidable' ); |
|
1919 | 1919 | |
1920 | 1920 | $redirect_msg = self::get_redirect_message( $success_url, $success_msg, $args ); |
1921 | 1921 | |
@@ -2053,7 +2053,7 @@ discard block |
||
2053 | 2053 | 'description' => false, |
2054 | 2054 | 'reset' => false, |
2055 | 2055 | ); |
2056 | - $args = wp_parse_args( $args, $defaults ); |
|
2056 | + $args = wp_parse_args( $args, $defaults ); |
|
2057 | 2057 | } |
2058 | 2058 | |
2059 | 2059 | /** |
@@ -285,7 +285,7 @@ |
||
285 | 285 | 'type' => $field->type, |
286 | 286 | ); |
287 | 287 | |
288 | - $this->array_content[ $field->id ] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $array, $field ); |
|
288 | + $this->array_content[$field->id] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $array, $field ); |
|
289 | 289 | } |
290 | 290 | |
291 | 291 | /** |
@@ -7,17 +7,17 @@ discard block |
||
7 | 7 | <?php |
8 | 8 | foreach ( $type as $tb_type ) { |
9 | 9 | |
10 | - if ( ! isset( $tables[ $tb_type ] ) ) { |
|
10 | + if ( ! isset( $tables[$tb_type] ) ) { |
|
11 | 11 | do_action( 'frm_xml_import_' . $tb_type, $args ); |
12 | 12 | continue; |
13 | 13 | } |
14 | 14 | |
15 | 15 | //no records |
16 | - if ( ! isset( $records[ $tb_type ] ) ) { |
|
16 | + if ( ! isset( $records[$tb_type] ) ) { |
|
17 | 17 | continue; |
18 | 18 | } |
19 | 19 | |
20 | - $item_ids = $records[ $tb_type ]; |
|
20 | + $item_ids = $records[$tb_type]; |
|
21 | 21 | if ( in_array( $tb_type, array( 'styles', 'actions' ), true ) ) { |
22 | 22 | include( dirname( __FILE__ ) . '/posts_xml.php' ); |
23 | 23 | } elseif ( file_exists( dirname( __FILE__ ) . '/' . $tb_type . '_xml.php' ) ) { |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | include( FrmProAppHelper::plugin_path() . '/classes/views/xml/' . $tb_type . '_xml.php' ); |
27 | 27 | } |
28 | 28 | |
29 | - unset( $item_ids, $records[ $tb_type ], $tb_type ); |
|
29 | + unset( $item_ids, $records[$tb_type], $tb_type ); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | ?> |
@@ -136,12 +136,12 @@ discard block |
||
136 | 136 | * @return array |
137 | 137 | */ |
138 | 138 | private function prepare_array_property( $index, $atts ) { |
139 | - if ( isset( $atts[ $index ] ) && ! empty( $atts[ $index ] ) ) { |
|
139 | + if ( isset( $atts[$index] ) && ! empty( $atts[$index] ) ) { |
|
140 | 140 | |
141 | - if ( is_array( $atts[ $index ] ) ) { |
|
142 | - $property = $atts[ $index ]; |
|
141 | + if ( is_array( $atts[$index] ) ) { |
|
142 | + $property = $atts[$index]; |
|
143 | 143 | } else { |
144 | - $property = explode( ',', $atts[ $index ] ); |
|
144 | + $property = explode( ',', $atts[$index] ); |
|
145 | 145 | } |
146 | 146 | } else { |
147 | 147 | $property = array(); |
@@ -274,6 +274,6 @@ discard block |
||
274 | 274 | * @param stdClass $field |
275 | 275 | */ |
276 | 276 | protected function add_field_values( $field ) { |
277 | - $this->field_values[ $field->id ] = new FrmFieldValue( $field, $this->entry ); |
|
277 | + $this->field_values[$field->id] = new FrmFieldValue( $field, $this->entry ); |
|
278 | 278 | } |
279 | 279 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | //validate the number format |
45 | 45 | if ( ! is_numeric( $args['value'] ) && '' !== $args['value'] ) { |
46 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
46 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | // validate number settings |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | if ( $frm_settings->use_html && $maxnum !== '' && $minnum !== '' ) { |
56 | 56 | $value = (float) $args['value']; |
57 | 57 | if ( $value < $minnum ) { |
58 | - $errors[ 'field' . $args['id'] ] = __( 'Please select a higher number', 'formidable' ); |
|
58 | + $errors['field' . $args['id']] = __( 'Please select a higher number', 'formidable' ); |
|
59 | 59 | } elseif ( $value > $maxnum ) { |
60 | - $errors[ 'field' . $args['id'] ] = __( 'Please select a lower number', 'formidable' ); |
|
60 | + $errors['field' . $args['id']] = __( 'Please select a lower number', 'formidable' ); |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | */ |
22 | 22 | public function set_upgrader( &$upgrader ) { |
23 | 23 | if ( is_object( $upgrader ) ) { |
24 | - $this->upgrader =& $upgrader; |
|
24 | + $this->upgrader = & $upgrader; |
|
25 | 25 | } |
26 | 26 | } |
27 | 27 |
@@ -306,7 +306,8 @@ discard block |
||
306 | 306 | |
307 | 307 | if ( isset( $version_info->new_version ) && ! empty( $version_info->new_version ) ) { |
308 | 308 | $this->clear_old_plugin_version( $version_info ); |
309 | - if ( $version_info === false ) { // was cleared with timeout |
|
309 | + if ( $version_info === false ) { |
|
310 | +// was cleared with timeout |
|
310 | 311 | $transient = false; |
311 | 312 | } else { |
312 | 313 | $this->maybe_use_beta_url( $version_info ); |
@@ -393,7 +394,8 @@ discard block |
||
393 | 394 | } |
394 | 395 | |
395 | 396 | private function is_license_revoked() { |
396 | - if ( empty( $this->license ) || empty( $this->plugin_slug ) || isset( $_POST['license'] ) ) { // WPCS: CSRF ok. |
|
397 | + if ( empty( $this->license ) || empty( $this->plugin_slug ) || isset( $_POST['license'] ) ) { |
|
398 | +// WPCS: CSRF ok. |
|
397 | 399 | return; |
398 | 400 | } |
399 | 401 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | public function insert_installed_addon( $plugins ) { |
44 | - $plugins[ $this->plugin_slug ] = $this; |
|
44 | + $plugins[$this->plugin_slug] = $this; |
|
45 | 45 | |
46 | 46 | return $plugins; |
47 | 47 | } |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | public static function get_addon( $plugin_slug ) { |
50 | 50 | $plugins = apply_filters( 'frm_installed_addons', array() ); |
51 | 51 | $plugin = false; |
52 | - if ( isset( $plugins[ $plugin_slug ] ) ) { |
|
53 | - $plugin = $plugins[ $plugin_slug ]; |
|
52 | + if ( isset( $plugins[$plugin_slug] ) ) { |
|
53 | + $plugin = $plugins[$plugin_slug]; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | return $plugin; |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | } else { |
110 | 110 | $api = new FrmFormApi( $this->license ); |
111 | 111 | $plugins = $api->get_api_info(); |
112 | - $_data = $plugins[ $item_id ]; |
|
112 | + $_data = $plugins[$item_id]; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | $_data['sections'] = array( |
@@ -301,19 +301,19 @@ discard block |
||
301 | 301 | |
302 | 302 | if ( $this->is_current_version( $transient ) ) { |
303 | 303 | //make sure it doesn't show there is an update if plugin is up-to-date |
304 | - if ( isset( $transient->response[ $this->plugin_folder ] ) ) { |
|
305 | - unset( $transient->response[ $this->plugin_folder ] ); |
|
304 | + if ( isset( $transient->response[$this->plugin_folder] ) ) { |
|
305 | + unset( $transient->response[$this->plugin_folder] ); |
|
306 | 306 | } |
307 | - } elseif ( isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) ) { |
|
308 | - $this->prepare_update_details( $transient->response[ $this->plugin_folder ] ); |
|
307 | + } elseif ( isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) ) { |
|
308 | + $this->prepare_update_details( $transient->response[$this->plugin_folder] ); |
|
309 | 309 | |
310 | 310 | // if the transient has expired, clear the update and trigger it again |
311 | - if ( $transient->response[ $this->plugin_folder ] === false ) { |
|
311 | + if ( $transient->response[$this->plugin_folder] === false ) { |
|
312 | 312 | if ( ! $this->has_been_cleared() ) { |
313 | 313 | $this->cleared_plugins(); |
314 | 314 | $this->manually_queue_update(); |
315 | 315 | } |
316 | - unset( $transient->response[ $this->plugin_folder ] ); |
|
316 | + unset( $transient->response[$this->plugin_folder] ); |
|
317 | 317 | } |
318 | 318 | } |
319 | 319 | |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | } |
402 | 402 | |
403 | 403 | private function is_current_version( $transient ) { |
404 | - if ( empty( $transient->checked ) || ! isset( $transient->checked[ $this->plugin_folder ] ) ) { |
|
404 | + if ( empty( $transient->checked ) || ! isset( $transient->checked[$this->plugin_folder] ) ) { |
|
405 | 405 | return false; |
406 | 406 | } |
407 | 407 | |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | return true; |
411 | 411 | } |
412 | 412 | |
413 | - return isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) && $transient->checked[ $this->plugin_folder ] === $transient->response[ $this->plugin_folder ]->new_version; |
|
413 | + return isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) && $transient->checked[$this->plugin_folder] === $transient->response[$this->plugin_folder]->new_version; |
|
414 | 414 | } |
415 | 415 | |
416 | 416 | private function has_been_cleared() { |
@@ -491,8 +491,8 @@ discard block |
||
491 | 491 | $response['message'] = $response['status']; |
492 | 492 | } else { |
493 | 493 | $messages = $this->get_messages(); |
494 | - if ( is_string( $response['status'] ) && isset( $messages[ $response['status'] ] ) ) { |
|
495 | - $response['message'] = $messages[ $response['status'] ]; |
|
494 | + if ( is_string( $response['status'] ) && isset( $messages[$response['status']] ) ) { |
|
495 | + $response['message'] = $messages[$response['status']]; |
|
496 | 496 | } else { |
497 | 497 | $response['message'] = FrmAppHelper::kses( $response['status'], array( 'a' ) ); |
498 | 498 | } |
@@ -624,8 +624,8 @@ discard block |
||
624 | 624 | */ |
625 | 625 | public static function get_shortcode_tag( $shortcodes, $short_key, $args ) { |
626 | 626 | _deprecated_function( __FUNCTION__, '3.0', 'FrmShortcodeHelper::get_shortcode_tag' ); |
627 | - return FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key, $args ); |
|
628 | - } |
|
627 | + return FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key, $args ); |
|
628 | + } |
|
629 | 629 | |
630 | 630 | /** |
631 | 631 | * @deprecated 3.01 |
@@ -638,52 +638,52 @@ discard block |
||
638 | 638 | /** |
639 | 639 | * @deprecated 3.02.03 |
640 | 640 | */ |
641 | - public static function jquery_themes() { |
|
641 | + public static function jquery_themes() { |
|
642 | 642 | _deprecated_function( __FUNCTION__, '3.02.03', 'FrmProStylesController::jquery_themes' ); |
643 | 643 | |
644 | - $themes = array( |
|
645 | - 'ui-lightness' => 'UI Lightness', |
|
646 | - 'ui-darkness' => 'UI Darkness', |
|
647 | - 'smoothness' => 'Smoothness', |
|
648 | - 'start' => 'Start', |
|
649 | - 'redmond' => 'Redmond', |
|
650 | - 'sunny' => 'Sunny', |
|
651 | - 'overcast' => 'Overcast', |
|
652 | - 'le-frog' => 'Le Frog', |
|
653 | - 'flick' => 'Flick', |
|
644 | + $themes = array( |
|
645 | + 'ui-lightness' => 'UI Lightness', |
|
646 | + 'ui-darkness' => 'UI Darkness', |
|
647 | + 'smoothness' => 'Smoothness', |
|
648 | + 'start' => 'Start', |
|
649 | + 'redmond' => 'Redmond', |
|
650 | + 'sunny' => 'Sunny', |
|
651 | + 'overcast' => 'Overcast', |
|
652 | + 'le-frog' => 'Le Frog', |
|
653 | + 'flick' => 'Flick', |
|
654 | 654 | 'pepper-grinder' => 'Pepper Grinder', |
655 | - 'eggplant' => 'Eggplant', |
|
656 | - 'dark-hive' => 'Dark Hive', |
|
657 | - 'cupertino' => 'Cupertino', |
|
658 | - 'south-street' => 'South Street', |
|
659 | - 'blitzer' => 'Blitzer', |
|
660 | - 'humanity' => 'Humanity', |
|
661 | - 'hot-sneaks' => 'Hot Sneaks', |
|
662 | - 'excite-bike' => 'Excite Bike', |
|
663 | - 'vader' => 'Vader', |
|
664 | - 'dot-luv' => 'Dot Luv', |
|
665 | - 'mint-choc' => 'Mint Choc', |
|
666 | - 'black-tie' => 'Black Tie', |
|
667 | - 'trontastic' => 'Trontastic', |
|
668 | - 'swanky-purse' => 'Swanky Purse', |
|
669 | - ); |
|
655 | + 'eggplant' => 'Eggplant', |
|
656 | + 'dark-hive' => 'Dark Hive', |
|
657 | + 'cupertino' => 'Cupertino', |
|
658 | + 'south-street' => 'South Street', |
|
659 | + 'blitzer' => 'Blitzer', |
|
660 | + 'humanity' => 'Humanity', |
|
661 | + 'hot-sneaks' => 'Hot Sneaks', |
|
662 | + 'excite-bike' => 'Excite Bike', |
|
663 | + 'vader' => 'Vader', |
|
664 | + 'dot-luv' => 'Dot Luv', |
|
665 | + 'mint-choc' => 'Mint Choc', |
|
666 | + 'black-tie' => 'Black Tie', |
|
667 | + 'trontastic' => 'Trontastic', |
|
668 | + 'swanky-purse' => 'Swanky Purse', |
|
669 | + ); |
|
670 | 670 | |
671 | 671 | $themes = apply_filters( 'frm_jquery_themes', $themes ); |
672 | - return $themes; |
|
673 | - } |
|
672 | + return $themes; |
|
673 | + } |
|
674 | 674 | |
675 | 675 | /** |
676 | 676 | * @deprecated 3.02.03 |
677 | 677 | */ |
678 | - public static function enqueue_jquery_css() { |
|
678 | + public static function enqueue_jquery_css() { |
|
679 | 679 | _deprecated_function( __FUNCTION__, '3.02.03', 'FrmProStylesController::enqueue_jquery_css' ); |
680 | 680 | |
681 | 681 | $form = self::get_form_for_page(); |
682 | 682 | $theme_css = FrmStylesController::get_style_val( 'theme_css', $form ); |
683 | - if ( $theme_css != -1 ) { |
|
683 | + if ( $theme_css != -1 ) { |
|
684 | 684 | wp_enqueue_style( 'jquery-theme', self::jquery_css_url( $theme_css ), array(), FrmAppHelper::plugin_version() ); |
685 | - } |
|
686 | - } |
|
685 | + } |
|
686 | + } |
|
687 | 687 | |
688 | 688 | /** |
689 | 689 | * @deprecated 3.02.03 |
@@ -691,26 +691,26 @@ discard block |
||
691 | 691 | public static function jquery_css_url( $theme_css ) { |
692 | 692 | _deprecated_function( __FUNCTION__, '3.02.03', 'FrmProStylesController::jquery_css_url' ); |
693 | 693 | |
694 | - if ( $theme_css == -1 ) { |
|
695 | - return; |
|
696 | - } |
|
694 | + if ( $theme_css == -1 ) { |
|
695 | + return; |
|
696 | + } |
|
697 | 697 | |
698 | - if ( ! $theme_css || $theme_css == '' || $theme_css == 'ui-lightness' ) { |
|
699 | - $css_file = FrmAppHelper::plugin_url() . '/css/ui-lightness/jquery-ui.css'; |
|
698 | + if ( ! $theme_css || $theme_css == '' || $theme_css == 'ui-lightness' ) { |
|
699 | + $css_file = FrmAppHelper::plugin_url() . '/css/ui-lightness/jquery-ui.css'; |
|
700 | 700 | } elseif ( preg_match( '/^http.?:\/\/.*\..*$/', $theme_css ) ) { |
701 | - $css_file = $theme_css; |
|
702 | - } else { |
|
703 | - $uploads = FrmStylesHelper::get_upload_base(); |
|
701 | + $css_file = $theme_css; |
|
702 | + } else { |
|
703 | + $uploads = FrmStylesHelper::get_upload_base(); |
|
704 | 704 | $file_path = '/formidable/css/' . $theme_css . '/jquery-ui.css'; |
705 | 705 | if ( file_exists( $uploads['basedir'] . $file_path ) ) { |
706 | - $css_file = $uploads['baseurl'] . $file_path; |
|
707 | - } else { |
|
706 | + $css_file = $uploads['baseurl'] . $file_path; |
|
707 | + } else { |
|
708 | 708 | $css_file = FrmAppHelper::jquery_ui_base_url() . '/themes/' . $theme_css . '/jquery-ui.min.css'; |
709 | - } |
|
710 | - } |
|
709 | + } |
|
710 | + } |
|
711 | 711 | |
712 | - return $css_file; |
|
713 | - } |
|
712 | + return $css_file; |
|
713 | + } |
|
714 | 714 | |
715 | 715 | /** |
716 | 716 | * @deprecated 3.02.03 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | FrmAppHelper::permission_check( 'frm_edit_forms' ); |
25 | 25 | |
26 | 26 | $action = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action'; |
27 | - $action = empty( $values ) ? FrmAppHelper::get_param( $action, '', 'get', 'sanitize_title' ) : $values[ $action ]; |
|
27 | + $action = empty( $values ) ? FrmAppHelper::get_param( $action, '', 'get', 'sanitize_title' ) : $values[$action]; |
|
28 | 28 | |
29 | 29 | if ( $action === 'create' ) { |
30 | 30 | FrmFormsController::update( $values ); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | } |
33 | 33 | |
34 | 34 | $values = FrmFormsHelper::setup_new_vars( $values ); |
35 | - $id = FrmForm::create( $values ); |
|
35 | + $id = FrmForm::create( $values ); |
|
36 | 36 | $values['id'] = $id; |
37 | 37 | |
38 | 38 | FrmFormsController::edit( $values ); |
@@ -457,8 +457,8 @@ discard block |
||
457 | 457 | $path = untrailingslashit( trim( $path ) ); |
458 | 458 | $templates = glob( $path . '/*.php' ); |
459 | 459 | |
460 | - for ( $i = count( $templates ) - 1; $i >= 0; $i-- ) { |
|
461 | - $filename = str_replace( '.php', '', str_replace( $path . '/', '', $templates[ $i ] ) ); |
|
460 | + for ( $i = count( $templates ) - 1; $i >= 0; $i -- ) { |
|
461 | + $filename = str_replace( '.php', '', str_replace( $path . '/', '', $templates[$i] ) ); |
|
462 | 462 | $template_query = array( 'form_key' => $filename ); |
463 | 463 | if ( $template ) { |
464 | 464 | $template_query['is_template'] = 1; |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | $values['is_template'] = $template; |
474 | 474 | $values['status'] = 'published'; |
475 | 475 | |
476 | - include( $templates[ $i ] ); |
|
476 | + include( $templates[$i] ); |
|
477 | 477 | |
478 | 478 | //get updated form |
479 | 479 | if ( isset( $form ) && ! empty( $form ) ) { |
@@ -297,11 +297,13 @@ |
||
297 | 297 | |
298 | 298 | global $frm_edd_plugin_data; |
299 | 299 | |
300 | - if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' !== $_REQUEST['edd_sl_action'] ) { // WPCS: CSRF ok. |
|
300 | + if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' !== $_REQUEST['edd_sl_action'] ) { |
|
301 | +// WPCS: CSRF ok. |
|
301 | 302 | return; |
302 | 303 | } |
303 | 304 | |
304 | - if ( empty( $_REQUEST['plugin'] ) || empty( $_REQUEST['slug'] ) ) { // WPCS: CSRF ok. |
|
305 | + if ( empty( $_REQUEST['plugin'] ) || empty( $_REQUEST['slug'] ) ) { |
|
306 | +// WPCS: CSRF ok. |
|
305 | 307 | return; |
306 | 308 | } |
307 | 309 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $this->beta = ! empty( $this->api_data['beta'] ) ? true : false; |
45 | 45 | $this->cache_key = md5( serialize( $this->slug . $this->version . $this->api_data['license'] . $this->beta ) ); |
46 | 46 | |
47 | - $frm_edd_plugin_data[ $this->slug ] = $this->api_data; |
|
47 | + $frm_edd_plugin_data[$this->slug] = $this->api_data; |
|
48 | 48 | |
49 | 49 | /** |
50 | 50 | * Fires after the $frm_edd_plugin_data is setup. |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $_transient_data = new stdClass(); |
94 | 94 | } |
95 | 95 | |
96 | - if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[ $this->name ] ) && false === $this->wp_override ) { |
|
96 | + if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[$this->name] ) && false === $this->wp_override ) { |
|
97 | 97 | return $_transient_data; |
98 | 98 | } |
99 | 99 | |
@@ -120,12 +120,12 @@ discard block |
||
120 | 120 | $version_info->plugin = $this->name; |
121 | 121 | } |
122 | 122 | |
123 | - $_transient_data->response[ $this->name ] = $version_info; |
|
123 | + $_transient_data->response[$this->name] = $version_info; |
|
124 | 124 | |
125 | 125 | } |
126 | 126 | |
127 | 127 | $_transient_data->last_checked = time(); |
128 | - $_transient_data->checked[ $this->name ] = $this->version; |
|
128 | + $_transient_data->checked[$this->name] = $this->version; |
|
129 | 129 | |
130 | 130 | } |
131 | 131 | |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | if ( isset( $_data->sections ) && ! is_array( $_data->sections ) ) { |
190 | 190 | $new_sections = array(); |
191 | 191 | foreach ( $_data->sections as $key => $value ) { |
192 | - $new_sections[ $key ] = $value; |
|
192 | + $new_sections[$key] = $value; |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | $_data->sections = $new_sections; |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | if ( isset( $_data->banners ) && ! is_array( $_data->banners ) ) { |
200 | 200 | $new_banners = array(); |
201 | 201 | foreach ( $_data->banners as $key => $value ) { |
202 | - $new_banners[ $key ] = $value; |
|
202 | + $new_banners[$key] = $value; |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | $_data->banners = $new_banners; |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | } |
317 | 317 | |
318 | 318 | $slug = sanitize_text_field( $_REQUEST['slug'] ); // WPCS: CSRF ok. |
319 | - $data = $frm_edd_plugin_data[ $slug ]; |
|
319 | + $data = $frm_edd_plugin_data[$slug]; |
|
320 | 320 | $beta = ! empty( $data['beta'] ) ? true : false; |
321 | 321 | $cache_key = md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_' . $beta . '_version_info' ); // WPCS: CSRF ok. |
322 | 322 | $version_info = $this->get_cached_version_info( $cache_key ); |