PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 3.06.06
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v3.06.06
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | deprecated/FrmDeprecated.php +322 -95 6.5.33.06.06 View file →
@@ -1,8 +1,5 @@
1 1 <?php
2 -if ( ! defined( 'ABSPATH' ) ) {
3 - die( 'You are not allowed to call this page directly.' );
4 -}
5 2
6 3 /**
7 4 * Class FrmDeprecated
8 5 *
@@ -18,66 +15,8 @@
18 15 _deprecated_function( $function, $version );
19 16 }
20 17
21 18 /**
22 - * @deprecated 4.0
23 - */
24 - public static function new_form( $values = array() ) {
25 - _deprecated_function( __FUNCTION__, '4.0', 'FrmFormsController::edit' );
26 -
27 - FrmAppHelper::permission_check( 'frm_edit_forms' );
28 -
29 - $action = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action';
30 - $action = empty( $values ) ? FrmAppHelper::get_param( $action, '', 'get', 'sanitize_title' ) : $values[ $action ];
31 -
32 - if ( $action === 'create' ) {
33 - FrmFormsController::update( $values );
34 - return;
35 - }
36 -
37 - $values = FrmFormsHelper::setup_new_vars( $values );
38 - $id = FrmForm::create( $values );
39 - $values['id'] = $id;
40 -
41 - FrmFormsController::edit( $values );
42 - }
43 -
44 - /**
45 - * @deprecated 4.0
46 - */
47 - public static function update_order() {
48 - _deprecated_function( __FUNCTION__, '4.0' );
49 - FrmAppHelper::permission_check( 'frm_edit_forms' );
50 - check_ajax_referer( 'frm_ajax', 'nonce' );
51 -
52 - $fields = FrmAppHelper::get_post_param( 'frm_field_id' );
53 - foreach ( (array) $fields as $position => $item ) {
54 - FrmField::update( absint( $item ), array( 'field_order' => absint( $position ) ) );
55 - }
56 - wp_die();
57 - }
58 -
59 - /**
60 - * @deprecated 4.0
61 - * @param array $values - The form array
62 - */
63 - public static function builder_submit_button( $values ) {
64 - _deprecated_function( __FUNCTION__, '4.0' );
65 - $page_action = FrmAppHelper::get_param( 'frm_action' );
66 - $label = ( $page_action == 'edit' || $page_action == 'update' ) ? __( 'Update', 'formidable' ) : __( 'Create', 'formidable' );
67 -
68 - ?>
69 - <div class="postbox">
70 - <p class="inside">
71 - <button class="frm_submit_<?php echo esc_attr( ( isset( $values['ajax_load'] ) && $values['ajax_load'] ) ? '' : 'no_' ); ?>ajax button-primary frm_button_submit" type="button">
72 - <?php echo esc_html( $label ); ?>
73 - </button>
74 - </p>
75 - </div>
76 - <?php
77 - }
78 -
79 - /**
80 19 * @deprecated 3.04.03
81 20 */
82 21 public static function get_licenses() {
83 22 _deprecated_function( __FUNCTION__, '3.04.03' );
@@ -166,19 +105,8 @@
166 105 return $api->get_pro_updater();
167 106 }
168 107
169 108 /**
170 - * @since 4.06.02
171 - * @deprecated 4.09.01
172 - * @codeCoverageIgnore
173 - */
174 - public static function ajax_multiple_addons() {
175 - _deprecated_function( __FUNCTION__, '4.09.01', 'FrmProAddonsController::' . __METHOD__ );
176 - echo json_encode( __( 'Your plugin has been not been installed. Please update Formidable Pro to get downloads.', 'formidable' ) );
177 - wp_die();
178 - }
179 -
180 - /**
181 109 * @since 3.04.03
182 110 * @deprecated 3.06
183 111 * @codeCoverageIgnore
184 112 * @return array
@@ -194,9 +122,9 @@
194 122 * @deprecated 3.06
195 123 */
196 124 public static function reset_cached_addons( $license = '' ) {
197 125 _deprecated_function( __FUNCTION__, '3.06', 'FrmFormApi::reset_cached' );
198 - $api = new FrmFormApi( $license );
126 + $api = new FrmFormApi( $this->license );
199 127 $api->reset_cached();
200 128 }
201 129
202 130 /**
@@ -205,9 +133,9 @@
205 133 * @return string
206 134 */
207 135 public static function get_cache_key( $license ) {
208 136 _deprecated_function( __FUNCTION__, '3.06', 'FrmFormApi::get_cache_key' );
209 - $api = new FrmFormApi( $license );
137 + $api = new FrmFormApi( $this->license );
210 138 return $api->get_cache_key();
211 139 }
212 140
213 141 /**
@@ -264,8 +192,41 @@
264 192 return $filename;
265 193 }
266 194
267 195 /**
196 + * Filter shortcodes in text widgets
197 + *
198 + * @deprecated 2.5.4
199 + */
200 + public static function widget_text_filter( $content ) {
201 + _deprecated_function( __FUNCTION__, '2.5.4' );
202 + $regex = '/\[\s*(formidable|display-frm-data|frm-stats|frm-graph|frm-entry-links|formresults|frm-search)\s+.*\]/';
203 + return preg_replace_callback( $regex, 'FrmAppHelper::widget_text_filter_callback', $content );
204 + }
205 +
206 + /**
207 + * Used to filter shortcode in text widgets
208 + *
209 + * @deprecated 2.5.4
210 + */
211 + public static function widget_text_filter_callback( $matches ) {
212 + _deprecated_function( __FUNCTION__, '2.5.4' );
213 + return do_shortcode( $matches[0] );
214 + }
215 +
216 + /**
217 + * Deprecated in favor of wpmu_upgrade_site
218 + *
219 + * @deprecated 2.3
220 + */
221 + public static function front_head() {
222 + _deprecated_function( __FUNCTION__, '2.3' );
223 + if ( is_multisite() && FrmAppController::needs_update() ) {
224 + FrmAppController::install();
225 + }
226 + }
227 +
228 + /**
268 229 * @deprecated 3.0.04
269 230 */
270 231 public static function activation_install() {
271 232 _deprecated_function( __FUNCTION__, '3.0.04', 'FrmAppController::install' );
@@ -290,8 +251,32 @@
290 251 return $content;
291 252 }
292 253
293 254 /**
255 + * @deprecated 1.07.05
256 + */
257 + public static function get_form_shortcode( $atts ) {
258 + _deprecated_function( __FUNCTION__, '1.07.05', 'FrmFormsController::get_form_shortcode()' );
259 + return FrmFormsController::get_form_shortcode( $atts );
260 + }
261 +
262 + /**
263 + * @deprecated 1.07.05
264 + */
265 + public static function show_form( $id = '', $key = '', $title = false, $description = false ) {
266 + _deprecated_function( __FUNCTION__, '1.07.05', 'FrmFormsController::show_form()' );
267 + return FrmFormsController::show_form( $id, $key, $title, $description );
268 + }
269 +
270 + /**
271 + * @deprecated 1.07.05
272 + */
273 + public static function get_form( $filename, $form, $title, $description ) {
274 + _deprecated_function( __FUNCTION__, '1.07.05', 'FrmFormsController::get_form()' );
275 + return FrmFormsController::get_form( $form, $title, $description );
276 + }
277 +
278 + /**
294 279 * @deprecated 3.0
295 280 */
296 281 public static function edit_name( $field = 'name', $id = '' ) {
297 282 _deprecated_function( __FUNCTION__, '3.0' );
@@ -318,9 +303,9 @@
318 303 FrmField::update( $id, array( $field => $value ) );
319 304
320 305 do_action( 'frm_after_update_field_' . $field, compact( 'id', 'value' ) );
321 306
322 - echo stripslashes( wp_kses_post( $value ) );
307 + echo stripslashes( wp_kses_post( $value ) ); // WPCS: XSS ok.
323 308 wp_die();
324 309 }
325 310
326 311 /**
@@ -357,8 +342,18 @@
357 342 return __( 'Form template was Successfully Created', 'formidable' );
358 343 }
359 344
360 345 /**
346 + * @deprecated 2.03
347 + */
348 + public static function register_pro_scripts() {
349 + _deprecated_function( __FUNCTION__, '2.03', 'FrmProEntriesController::register_scripts' );
350 + if ( FrmAppHelper::pro_is_installed() ) {
351 + FrmProEntriesController::register_scripts();
352 + }
353 + }
354 +
355 + /**
361 356 * @deprecated 3.0
362 357 */
363 358 public static function edit_key() {
364 359 _deprecated_function( __FUNCTION__, '3.0' );
@@ -395,8 +390,50 @@
395 390 return $values;
396 391 }
397 392
398 393 /**
394 + * @deprecated 1.07.05
395 + */
396 + public static function add_default_templates( $path, $default = true, $template = true ) {
397 + _deprecated_function( __FUNCTION__, '1.07.05', 'FrmXMLController::add_default_templates()' );
398 +
399 + $path = untrailingslashit( trim( $path ) );
400 + $templates = glob( $path . '/*.php' );
401 +
402 + for ( $i = count( $templates ) - 1; $i >= 0; $i-- ) {
403 + $filename = str_replace( '.php', '', str_replace( $path . '/', '', $templates[ $i ] ) );
404 + $template_query = array( 'form_key' => $filename );
405 + if ( $template ) {
406 + $template_query['is_template'] = 1;
407 + }
408 + if ( $default ) {
409 + $template_query['default_template'] = 1;
410 + }
411 + $form = FrmForm::getAll( $template_query, '', 1 );
412 +
413 + $values = FrmFormsHelper::setup_new_vars();
414 + $values['form_key'] = $filename;
415 + $values['is_template'] = $template;
416 + $values['status'] = 'published';
417 +
418 + include( $templates[ $i ] );
419 +
420 + //get updated form
421 + if ( isset( $form ) && ! empty( $form ) ) {
422 + $old_id = $form->id;
423 + $form = FrmForm::getOne( $form->id );
424 + } else {
425 + $old_id = false;
426 + $form = FrmForm::getAll( $template_query, '', 1 );
427 + }
428 +
429 + if ( $form ) {
430 + do_action( 'frm_after_duplicate_form', $form->id, (array) $form, array( 'old_id' => $old_id ) );
431 + }
432 + }
433 + }
434 +
435 + /**
399 436 * @deprecated 3.01
400 437 */
401 438 public static function sanitize_array( &$values ) {
402 439 _deprecated_function( __FUNCTION__, '3.01', 'FrmAppHelper::sanitize_value' );
@@ -403,8 +440,184 @@
403 440 FrmAppHelper::sanitize_value( 'wp_kses_post', $values );
404 441 }
405 442
406 443 /**
444 + * Prepare and save settings in styles and actions
445 + *
446 + * @param array $settings
447 + * @param string $group
448 + *
449 + * @since 2.0.6
450 + * @deprecated 2.05.06
451 + */
452 + public static function save_settings( $settings, $group ) {
453 + _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
454 + return FrmDb::save_settings( $settings, $group );
455 + }
456 +
457 + /**
458 + * Since actions are JSON encoded, we don't want any filters messing with it.
459 + * Remove the filters and then add them back in case any posts or views are
460 + * also being imported.
461 + *
462 + * Used when saving form actions and styles
463 + *
464 + * @since 2.0.4
465 + * @deprecated 2.05.06
466 + */
467 + public static function save_json_post( $settings ) {
468 + _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
469 + return FrmDb::save_json_post( $settings );
470 + }
471 +
472 + /**
473 + * Check cache before fetching values and saving to cache
474 + *
475 + * @since 2.0
476 + * @deprecated 2.05.06
477 + *
478 + * @param string $cache_key The unique name for this cache
479 + * @param string $group The name of the cache group
480 + * @param string $query If blank, don't run a db call
481 + * @param string $type The wpdb function to use with this query
482 + * @return mixed $results The cache or query results
483 + */
484 + public static function check_cache( $cache_key, $group = '', $query = '', $type = 'get_var', $time = 300 ) {
485 + _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
486 + return FrmDb::check_cache( $cache_key, $group, $query, $type, $time );
487 + }
488 +
489 + /**
490 + * @deprecated 2.05.06
491 + */
492 + public static function set_cache( $cache_key, $results, $group = '', $time = 300 ) {
493 + _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
494 + FrmDb::set_cache( $cache_key, $results, $group, $time );
495 + }
496 +
497 + /**
498 + * Keep track of the keys cached in each group so they can be deleted
499 + * in Redis and Memcache
500 + * @deprecated 2.05.06
501 + */
502 + public static function add_key_to_group_cache( $key, $group ) {
503 + _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
504 + FrmDb::add_key_to_group_cache( $key, $group );
505 + }
506 +
507 + /**
508 + * @deprecated 2.05.06
509 + */
510 + public static function get_group_cached_keys( $group ) {
511 + _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
512 + return FrmDb::get_group_cached_keys( $group );
513 + }
514 +
515 + /**
516 + * @since 2.0
517 + * @deprecated 2.05.06
518 + * @param string $cache_key
519 + */
520 + public static function delete_cache_and_transient( $cache_key, $group = 'default' ) {
521 + _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
522 + FrmDb::delete_cache_and_transient( $cache_key, $group );
523 + }
524 +
525 + /**
526 + * @since 2.0
527 + * @deprecated 2.05.06
528 + *
529 + * @param string $group The name of the cache group
530 + */
531 + public static function cache_delete_group( $group ) {
532 + _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
533 + FrmDb::cache_delete_group( $group );
534 + }
535 +
536 + /**
537 + * Added for < WP 4.0 compatability
538 + *
539 + * @since 1.07.10
540 + * @deprecated 2.05.06
541 + *
542 + * @param string $term The value to escape
543 + * @return string The escaped value
544 + */
545 + public static function esc_like( $term ) {
546 + _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
547 + return FrmDb::esc_like( $term );
548 + }
549 +
550 + /**
551 + * @param string $order_query
552 + * @deprecated 2.05.06
553 + */
554 + public static function esc_order( $order_query ) {
555 + _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
556 + return FrmDb::esc_order( $order_query );
557 + }
558 +
559 + /**
560 + * Make sure this is ordering by either ASC or DESC
561 + * @deprecated 2.05.06
562 + */
563 + public static function esc_order_by( &$order_by ) {
564 + _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
565 + FrmDb::esc_order_by( $order_by );
566 + }
567 +
568 + /**
569 + * @param string $limit
570 + * @deprecated 2.05.06
571 + */
572 + public static function esc_limit( $limit ) {
573 + _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
574 + return FrmDb::esc_limit( $limit );
575 + }
576 +
577 + /**
578 + * Get an array of values ready to go through $wpdb->prepare
579 + * @since 2.0
580 + * @deprecated 2.05.06
581 + */
582 + public static function prepare_array_values( $array, $type = '%s' ) {
583 + _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
584 + return FrmDb::prepare_array_values( $array, $type );
585 + }
586 +
587 + /**
588 + * @deprecated 2.05.06
589 + */
590 + public static function prepend_and_or_where( $starts_with = ' WHERE ', $where = '' ) {
591 + _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
592 + return FrmDb::prepend_and_or_where( $starts_with, $where );
593 + }
594 +
595 + /**
596 + * @deprecated 2.05.06
597 + */
598 + public static function upgrade() {
599 + $db = new FrmDbDeprecated();
600 + $db->upgrade();
601 + }
602 +
603 + /**
604 + * @deprecated 2.05.06
605 + */
606 + public static function collation() {
607 + $db = new FrmDbDeprecated();
608 + return $db->collation();
609 + }
610 +
611 + /**
612 + * @deprecated 2.05.06
613 + */
614 + public static function uninstall() {
615 + $db = new FrmDbDeprecated();
616 + $db->uninstall();
617 + }
618 +
619 + /**
407 620 * @deprecated 3.0
408 621 *
409 622 * @param string $html
410 623 * @param array $field
@@ -435,8 +648,24 @@
435 648 return $field_options;
436 649 }
437 650
438 651 /**
652 + * @deprecated 2.02.07
653 + */
654 + public static function dropdown_categories( $args ) {
655 + _deprecated_function( __FUNCTION__, '2.02.07', 'FrmProPost::get_category_dropdown' );
656 +
657 + if ( FrmAppHelper::pro_is_installed() ) {
658 + $args['location'] = 'front';
659 + $dropdown = FrmProPost::get_category_dropdown( $args['field'], $args );
660 + } else {
661 + $dropdown = '';
662 + }
663 +
664 + return $dropdown;
665 + }
666 +
667 + /**
439 668 * @deprecated 3.0
440 669 */
441 670 public static function remove_inline_conditions( $no_vars, $code, $replace_with, &$html ) {
442 671 _deprecated_function( __FUNCTION__, '3.0', 'FrmShortcodeHelper::remove_inline_conditions' );
@@ -514,13 +743,27 @@
514 743 */
515 744 public static function jquery_css_url( $theme_css ) {
516 745 _deprecated_function( __FUNCTION__, '3.02.03', 'FrmProStylesController::jquery_css_url' );
517 746
518 - if ( ! is_callable( 'FrmProStylesController::jquery_css_url' ) ) {
519 - return;
520 - }
747 + if ( $theme_css == -1 ) {
748 + return;
749 + }
521 750
522 - return FrmProStylesController::jquery_css_url( $theme_css );
751 + if ( ! $theme_css || $theme_css == '' || $theme_css == 'ui-lightness' ) {
752 + $css_file = FrmAppHelper::plugin_url() . '/css/ui-lightness/jquery-ui.css';
753 + } elseif ( preg_match( '/^http.?:\/\/.*\..*$/', $theme_css ) ) {
754 + $css_file = $theme_css;
755 + } else {
756 + $uploads = FrmStylesHelper::get_upload_base();
757 + $file_path = '/formidable/css/' . $theme_css . '/jquery-ui.css';
758 + if ( file_exists( $uploads['basedir'] . $file_path ) ) {
759 + $css_file = $uploads['baseurl'] . $file_path;
760 + } else {
761 + $css_file = FrmAppHelper::jquery_ui_base_url() . '/themes/' . $theme_css . '/jquery-ui.min.css';
762 + }
763 + }
764 +
765 + return $css_file;
523 766 }
524 767
525 768 /**
526 769 * @deprecated 3.02.03
@@ -591,22 +834,6 @@
591 834 return;
592 835 }
593 836
594 837 FrmEntryValidate::validate_field_types( $errors, $field, '', $args );
595 - }
596 -
597 - /**
598 - * @deprecated 2.02.07
599 - */
600 - public static function dropdown_categories( $args ) {
601 - _deprecated_function( __FUNCTION__, '2.02.07', 'FrmProPost::get_category_dropdown' );
602 -
603 - if ( FrmAppHelper::pro_is_installed() ) {
604 - $args['location'] = 'front';
605 - $dropdown = FrmProPost::get_category_dropdown( $args['field'], $args );
606 - } else {
607 - $dropdown = '';
608 - }
609 -
610 - return $dropdown;
611 838 }
612 839 }