Completed
Pull Request — master (#100)
by Stephanie
03:13
created

FrmDeprecated::front_head()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
nc 2
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Class FrmDeprecated
5
 *
6
 * @since 3.04.03
7
 * @codeCoverageIgnore
8
 */
9
class FrmDeprecated {
10
11
	/**
12
	 * @deprecated 2.3
13
	 */
14
	public static function deprecated( $function, $version ) {
15
		_deprecated_function( $function, $version );
16
	}
17
18
	/**
19
	 * @deprecated 3.04.03
20
	 */
21
	public static function get_licenses() {
22
		_deprecated_function( __FUNCTION__, '3.04.03' );
23
24
		$allow_autofill = self::allow_autofill();
1 ignored issue
show
Deprecated Code introduced by
The method FrmDeprecated::allow_autofill() has been deprecated with message: 3.04.03

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
25
		$required_role = $allow_autofill ? 'setup_network' : 'frm_change_settings';
26
		FrmAppHelper::permission_check( $required_role );
27
		check_ajax_referer( 'frm_ajax', 'nonce' );
28
29
		if ( is_multisite() && get_site_option( 'frmpro-wpmu-sitewide' ) ) {
30
			$license = get_site_option( 'frmpro-credentials' );
31
		} else {
32
			$license = get_option( 'frmpro-credentials' );
33
		}
34
35
		if ( $license && is_array( $license ) && isset( $license['license'] ) ) {
36
			$url = 'https://formidableforms.com/frm-edd-api/licenses?l=' . urlencode( base64_encode( $license['license'] ) );
37
			$licenses = self::send_api_request(
1 ignored issue
show
Deprecated Code introduced by
The method FrmDeprecated::send_api_request() has been deprecated with message: 3.04.03

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
38
				$url,
39
				array(
40
					'name'    => 'frm_api_licence',
41
					'expires' => 60 * 60 * 5,
42
				)
43
			);
44
			echo json_encode( $licenses );
45
		}
46
47
		wp_die();
48
	}
49
50
51
	/**
52
	 * Don't allow subsite addon licenses to be fetched
53
	 * unless the current user has super admin permissions
54
	 *
55
	 * @since 2.03.10
56
	 * @deprecated 3.04.03
57
	 */
58
	private static function allow_autofill() {
59
		$allow_autofill = FrmAppHelper::pro_is_installed();
60
		if ( $allow_autofill && is_multisite() ) {
61
			$sitewide_activated = get_site_option( 'frmpro-wpmu-sitewide' );
62
			if ( $sitewide_activated ) {
63
				$allow_autofill = current_user_can( 'setup_network' );
64
			}
65
		}
66
		return $allow_autofill;
67
	}
68
69
	/**
70
	 * @deprecated 3.04.03
71
	 */
72
	private static function send_api_request( $url, $transient = array() ) {
73
		$data = get_transient( $transient['name'] );
74
		if ( $data !== false ) {
75
			return $data;
76
		}
77
78
		$arg_array = array(
79
			'body'      => array(
80
				'url'   => home_url(),
81
			),
82
			'timeout'   => 15,
83
			'user-agent' => 'Formidable/' . FrmAppHelper::$plug_version . '; ' . home_url(),
84
		);
85
86
		$response = wp_remote_post( $url, $arg_array );
87
		$body = wp_remote_retrieve_body( $response );
88
		$data = false;
89
		if ( ! is_wp_error( $response ) && ! is_wp_error( $body ) ) {
90
			$data = json_decode( $body, true );
91
			set_transient( $transient['name'], $data, $transient['expires'] );
92
		}
93
94
		return $data;
95
	}
96
97
	/**
98
	 * Add a filter to shorten the EDD filename for Formidable plugin, and add-on, updates
99
	 *
100
	 * @since 2.03.08
101
	 * @deprecated 3.04.03
102
	 *
103
	 * @param boolean $return
104
	 * @param string $package
105
	 *
106
	 * @return boolean
107
	 */
108
	public static function add_shorten_edd_filename_filter( $return, $package ) {
109
		_deprecated_function( __FUNCTION__, '3.04.03' );
110
111
		if ( strpos( $package, '/edd-sl/package_download/' ) !== false && strpos( $package, 'formidableforms.com' ) !== false ) {
112
			add_filter( 'wp_unique_filename', 'FrmDeprecated::shorten_edd_filename', 10, 2 );
113
		}
114
115
		return $return;
116
	}
117
118
	/**
119
	 * Shorten the EDD filename for automatic updates
120
	 * Decreases size of file path so file path limit is not hit on Windows servers
121
	 *
122
	 * @since 2.03.08
123
	 * @deprecated 3.04.03
124
	 *
125
	 * @param string $filename
126
	 * @param string $ext
127
	 *
128
	 * @return string
129
	 */
130
	public static function shorten_edd_filename( $filename, $ext ) {
131
		_deprecated_function( __FUNCTION__, '3.04.03' );
132
133
		$filename = substr( $filename, 0, 50 ) . $ext;
134
		remove_filter( 'wp_unique_filename', 'FrmDeprecated::shorten_edd_filename', 10 );
135
136
		return $filename;
137
	}
138
139
	/**
140
	 * Filter shortcodes in text widgets
141
	 *
142
	 * @deprecated 2.5.4
143
	 */
144
	public static function widget_text_filter( $content ) {
145
		_deprecated_function( __FUNCTION__, '2.5.4' );
146
		$regex = '/\[\s*(formidable|display-frm-data|frm-stats|frm-graph|frm-entry-links|formresults|frm-search)\s+.*\]/';
147
		return preg_replace_callback( $regex, 'FrmAppHelper::widget_text_filter_callback', $content );
148
	}
149
150
	/**
151
	 * Used to filter shortcode in text widgets
152
	 *
153
	 * @deprecated 2.5.4
154
	 */
155
	public static function widget_text_filter_callback( $matches ) {
156
		_deprecated_function( __FUNCTION__, '2.5.4' );
157
		return do_shortcode( $matches[0] );
158
	}
159
160
	/**
161
	 * Deprecated in favor of wpmu_upgrade_site
162
	 *
163
	 * @deprecated 2.3
164
	 */
165
	public static function front_head() {
166
		_deprecated_function( __FUNCTION__, '2.3' );
167
		if ( is_multisite() && FrmAppController::needs_update() ) {
168
			FrmAppController::install();
169
		}
170
	}
171
172
	/**
173
	 * @deprecated 3.0.04
174
	 */
175
	public static function activation_install() {
176
		_deprecated_function( __FUNCTION__, '3.0.04', 'FrmAppController::install' );
177
		FrmDb::delete_cache_and_transient( 'frm_plugin_version' );
178
		FrmFormActionsController::actions_init();
179
		FrmAppController::install();
180
	}
181
182
	/**
183
	 * Routes for wordpress pages -- we're just replacing content
184
	 *
185
	 * @deprecated 3.0
186
	 */
187
	public static function page_route( $content ) {
188
		_deprecated_function( __FUNCTION__, '3.0' );
189
		global $post;
190
191
		if ( $post && isset( $_GET['form'] ) ) {
192
			$content = FrmFormsController::page_preview();
193
		}
194
195
		return $content;
196
	}
197
198
	/**
199
	 * @deprecated 1.07.05
200
	 */
201
	public static function get_form_shortcode( $atts ) {
202
		_deprecated_function( __FUNCTION__, '1.07.05', 'FrmFormsController::get_form_shortcode()' );
203
		return FrmFormsController::get_form_shortcode( $atts );
204
	}
205
206
	/**
207
	 * @deprecated 1.07.05
208
	 */
209
	public static function show_form( $id = '', $key = '', $title = false, $description = false ) {
210
		_deprecated_function( __FUNCTION__, '1.07.05', 'FrmFormsController::show_form()' );
211
		return FrmFormsController::show_form( $id, $key, $title, $description );
212
	}
213
214
	/**
215
	 * @deprecated 1.07.05
216
	 */
217
	public static function get_form( $filename, $form, $title, $description ) {
218
		_deprecated_function( __FUNCTION__, '1.07.05', 'FrmFormsController::get_form()' );
219
		return FrmFormsController::get_form( $form, $title, $description );
220
	}
221
222
	/**
223
	 * @deprecated 3.0
224
	 */
225
	public static function edit_name( $field = 'name', $id = '' ) {
226
		_deprecated_function( __FUNCTION__, '3.0' );
227
228
		FrmAppHelper::permission_check( 'frm_edit_forms' );
229
		check_ajax_referer( 'frm_ajax', 'nonce' );
230
231
		if ( empty( $field ) ) {
232
			$field = 'name';
233
		}
234
235
		if ( empty( $id ) ) {
236
			$id = FrmAppHelper::get_post_param( 'element_id', '', 'sanitize_title' );
237
			$id = str_replace( 'field_label_', '', $id );
238
		}
239
240
		$value = FrmAppHelper::get_post_param( 'update_value', '', 'wp_kses_post' );
241
		$value = trim( $value );
242
		if ( trim( strip_tags( $value ) ) === '' ) {
243
			// set blank value if there is no content
244
			$value = '';
245
		}
246
247
		FrmField::update( $id, array( $field => $value ) );
248
249
		do_action( 'frm_after_update_field_' . $field, compact( 'id', 'value' ) );
250
251
		echo stripslashes( wp_kses_post( $value ) ); // WPCS: XSS ok.
252
		wp_die();
253
	}
254
255
	/**
256
	 * Load a single field in the form builder along with all needed variables
257
	 *
258
	 * @deprecated 3.0
259
	 *
260
	 * @param int $field_id
261
	 * @param array $values
262
	 * @param int $form_id
263
	 *
264
	 * @return array
265
	 */
266
	public static function include_single_field( $field_id, $values, $form_id = 0 ) {
267
		_deprecated_function( __FUNCTION__, '3.0', 'FrmFieldsController::load_single_field' );
268
269
		$field = FrmFieldsHelper::setup_edit_vars( FrmField::getOne( $field_id ) );
270
		FrmFieldsController::load_single_field( $field, $values, $form_id );
271
272
		return $field;
273
	}
274
275
	/**
276
	 * @deprecated 3.0
277
	 */
278
	public static function bulk_create_template( $ids ) {
279
		_deprecated_function( __FUNCTION__, '3.0', 'FrmForm::duplicate( $id, true, true )' );
280
		FrmAppHelper::permission_check( 'frm_edit_forms' );
281
282
		foreach ( $ids as $id ) {
283
			FrmForm::duplicate( $id, true, true );
284
		}
285
286
		return __( 'Form template was Successfully Created', 'formidable' );
287
	}
288
289
	/**
290
	 * @deprecated 2.03
291
	 */
292
	public static function register_pro_scripts() {
293
		_deprecated_function( __FUNCTION__, '2.03', 'FrmProEntriesController::register_scripts' );
294
		if ( FrmAppHelper::pro_is_installed() ) {
295
			FrmProEntriesController::register_scripts();
296
		}
297
	}
298
299
	/**
300
	 * @deprecated 3.0
301
	 */
302
	public static function edit_key() {
303
		_deprecated_function( __FUNCTION__, '3.0' );
304
		$values = self::edit_in_place_value( 'form_key' );
1 ignored issue
show
Deprecated Code introduced by
The method FrmDeprecated::edit_in_place_value() has been deprecated with message: 3.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
305
		echo wp_kses( stripslashes( FrmForm::get_key_by_id( $values['form_id'] ) ), array() );
306
		wp_die();
307
	}
308
309
	/**
310
	 * @deprecated 3.0
311
	 */
312
	public static function edit_description() {
313
		_deprecated_function( __FUNCTION__, '3.0' );
314
		$values = self::edit_in_place_value( 'description' );
1 ignored issue
show
Deprecated Code introduced by
The method FrmDeprecated::edit_in_place_value() has been deprecated with message: 3.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
315
		echo wp_kses_post( FrmAppHelper::use_wpautop( stripslashes( $values['description'] ) ) );
316
		wp_die();
317
	}
318
319
	/**
320
	 * @deprecated 3.0
321
	 */
322
	private static function edit_in_place_value( $field ) {
323
		_deprecated_function( __FUNCTION__, '3.0' );
324
		check_ajax_referer( 'frm_ajax', 'nonce' );
325
		FrmAppHelper::permission_check( 'frm_edit_forms', 'hide' );
326
327
		$form_id = FrmAppHelper::get_post_param( 'form_id', '', 'absint' );
328
		$value = FrmAppHelper::get_post_param( 'update_value', '', 'wp_filter_post_kses' );
329
330
		$values = array( $field => trim( $value ) );
331
		FrmForm::update( $form_id, $values );
332
		$values['form_id'] = $form_id;
333
334
		return $values;
335
	}
336
337
	/**
338
	 * @deprecated 1.07.05
339
	 */
340
	public static function add_default_templates( $path, $default = true, $template = true ) {
341
		_deprecated_function( __FUNCTION__, '1.07.05', 'FrmXMLController::add_default_templates()' );
342
343
		$path = untrailingslashit( trim( $path ) );
344
		$templates = glob( $path . '/*.php' );
345
346
		for ( $i = count( $templates ) - 1; $i >= 0; $i-- ) {
347
			$filename = str_replace( '.php', '', str_replace( $path . '/', '', $templates[ $i ] ) );
348
			$template_query = array( 'form_key' => $filename );
349
			if ( $template ) {
350
				$template_query['is_template'] = 1;
351
			}
352
			if ( $default ) {
353
				$template_query['default_template'] = 1;
354
			}
355
			$form = FrmForm::getAll( $template_query, '', 1 );
356
357
			$values = FrmFormsHelper::setup_new_vars();
358
			$values['form_key'] = $filename;
359
			$values['is_template'] = $template;
360
			$values['status'] = 'published';
361
			if ( $default ) {
362
				$values['default_template'] = 1;
363
			}
364
365
			include( $templates[ $i ] );
366
367
			//get updated form
368
			if ( isset( $form ) && ! empty( $form ) ) {
369
				$old_id = $form->id;
370
				$form = FrmForm::getOne( $form->id );
371
			} else {
372
				$old_id = false;
373
				$form = FrmForm::getAll( $template_query, '', 1 );
374
			}
375
376
			if ( $form ) {
377
				do_action( 'frm_after_duplicate_form', $form->id, (array) $form, array( 'old_id' => $old_id ) );
378
			}
379
		}
380
	}
381
382
	/**
383
	 * @deprecated 3.01
384
	 */
385
	public static function sanitize_array( &$values ) {
386
		_deprecated_function( __FUNCTION__, '3.01', 'FrmAppHelper::sanitize_value' );
387
		FrmAppHelper::sanitize_value( 'wp_kses_post', $values );
388
	}
389
390
	/**
391
	 * Prepare and save settings in styles and actions
392
	 *
393
	 * @param array $settings
394
	 * @param string $group
395
	 *
396
	 * @since 2.0.6
397
	 * @deprecated 2.05.06
398
	 */
399
	public static function save_settings( $settings, $group ) {
400
		_deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
401
		return FrmDb::save_settings( $settings, $group );
402
	}
403
404
	/**
405
	 * Since actions are JSON encoded, we don't want any filters messing with it.
406
	 * Remove the filters and then add them back in case any posts or views are
407
	 * also being imported.
408
	 *
409
	 * Used when saving form actions and styles
410
	 *
411
	 * @since 2.0.4
412
	 * @deprecated 2.05.06
413
	 */
414
	public static function save_json_post( $settings ) {
415
		_deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
416
		return FrmDb::save_json_post( $settings );
417
	}
418
419
	/**
420
	 * Check cache before fetching values and saving to cache
421
	 *
422
	 * @since 2.0
423
	 * @deprecated 2.05.06
424
	 *
425
	 * @param string $cache_key The unique name for this cache
426
	 * @param string $group The name of the cache group
427
	 * @param string $query If blank, don't run a db call
428
	 * @param string $type The wpdb function to use with this query
429
	 * @return mixed $results The cache or query results
430
	 */
431
	public static function check_cache( $cache_key, $group = '', $query = '', $type = 'get_var', $time = 300 ) {
432
		_deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
433
		return FrmDb::check_cache( $cache_key, $group, $query, $type, $time );
434
	}
435
436
	/**
437
	 * @deprecated 2.05.06
438
	 */
439
	public static function set_cache( $cache_key, $results, $group = '', $time = 300 ) {
440
		_deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
441
		FrmDb::set_cache( $cache_key, $results, $group, $time );
442
	}
443
444
	/**
445
	 * Keep track of the keys cached in each group so they can be deleted
446
	 * in Redis and Memcache
447
	 * @deprecated 2.05.06
448
	 */
449
	public static function add_key_to_group_cache( $key, $group ) {
450
		_deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
451
		FrmDb::add_key_to_group_cache( $key, $group );
452
	}
453
454
	/**
455
	 * @deprecated 2.05.06
456
	 */
457
	public static function get_group_cached_keys( $group ) {
458
		_deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
459
		return FrmDb::get_group_cached_keys( $group );
460
	}
461
462
	/**
463
	 * @since 2.0
464
	 * @deprecated 2.05.06
465
	 * @param string $cache_key
466
	 */
467
	public static function delete_cache_and_transient( $cache_key, $group = 'default' ) {
468
		_deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
469
		FrmDb::delete_cache_and_transient( $cache_key, $group );
470
	}
471
472
	/**
473
	 * @since 2.0
474
	 * @deprecated 2.05.06
475
	 *
476
	 * @param string $group The name of the cache group
477
	 */
478
	public static function cache_delete_group( $group ) {
479
		_deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
480
		FrmDb::cache_delete_group( $group );
481
	}
482
483
	/**
484
	 * Added for < WP 4.0 compatability
485
	 *
486
	 * @since 1.07.10
487
	 * @deprecated 2.05.06
488
	 *
489
	 * @param string $term The value to escape
490
	 * @return string The escaped value
491
	 */
492
	public static function esc_like( $term ) {
493
		_deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
494
		return FrmDb::esc_like( $term );
495
	}
496
497
	/**
498
	 * @param string $order_query
499
	 * @deprecated 2.05.06
500
	 */
501
	public static function esc_order( $order_query ) {
502
		_deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
503
		return FrmDb::esc_order( $order_query );
504
	}
505
506
	/**
507
	 * Make sure this is ordering by either ASC or DESC
508
	 * @deprecated 2.05.06
509
	 */
510
	public static function esc_order_by( &$order_by ) {
511
		_deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
512
		FrmDb::esc_order_by( $order_by );
513
	}
514
515
	/**
516
	 * @param string $limit
517
	 * @deprecated 2.05.06
518
	 */
519
	public static function esc_limit( $limit ) {
520
		_deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
521
		return FrmDb::esc_limit( $limit );
522
	}
523
524
	/**
525
	 * Get an array of values ready to go through $wpdb->prepare
526
	 * @since 2.0
527
	 * @deprecated 2.05.06
528
	 */
529
	public static function prepare_array_values( $array, $type = '%s' ) {
530
		_deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
531
		return FrmDb::prepare_array_values( $array, $type );
532
	}
533
534
	/**
535
	 * @deprecated 2.05.06
536
	 */
537
	public static function prepend_and_or_where( $starts_with = ' WHERE ', $where = '' ) {
538
		_deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
539
		return FrmDb::prepend_and_or_where( $starts_with, $where );
540
	}
541
542
	/**
543
	 * @deprecated 2.05.06
544
	 */
545
	public static function upgrade() {
546
		$db = new FrmDbDeprecated();
1 ignored issue
show
Deprecated Code introduced by
The class FrmDbDeprecated has been deprecated with message: 2.03.05

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
547
		$db->upgrade();
1 ignored issue
show
Deprecated Code introduced by
The method FrmDbDeprecated::upgrade() has been deprecated with message: 2.03.05

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
548
	}
549
550
	/**
551
	 * @deprecated 2.05.06
552
	 */
553
	public static function collation() {
554
		$db = new FrmDbDeprecated();
1 ignored issue
show
Deprecated Code introduced by
The class FrmDbDeprecated has been deprecated with message: 2.03.05

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
555
		return $db->collation();
1 ignored issue
show
Deprecated Code introduced by
The method FrmDbDeprecated::collation() has been deprecated with message: 2.03.05

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
556
	}
557
558
	/**
559
	 * @deprecated 2.05.06
560
	 */
561
	public static function uninstall() {
562
		$db = new FrmDbDeprecated();
1 ignored issue
show
Deprecated Code introduced by
The class FrmDbDeprecated has been deprecated with message: 2.03.05

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
563
		$db->uninstall();
1 ignored issue
show
Deprecated Code introduced by
The method FrmDbDeprecated::uninstall() has been deprecated with message: 2.03.05

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
564
	}
565
566
	/**
567
	 * @deprecated 3.0
568
	 *
569
	 * @param string $html
570
	 * @param array $field
571
	 * @param array $errors
572
	 * @param object $form
573
	 * @param array $args
574
	 *
575
	 * @return string
576
	 */
577
	public static function replace_shortcodes( $html, $field, $errors = array(), $form = false, $args = array() ) {
578
		_deprecated_function( __FUNCTION__, '3.0', 'FrmFieldType::prepare_field_html' );
579
		$field_obj = FrmFieldFactory::get_field_type( $field['type'], $field );
580
		return $field_obj->prepare_field_html( compact( 'errors', 'form' ) );
581
	}
582
583
	/**
584
	 * @deprecated 3.0
585
	 */
586
	public static function get_default_field_opts( $type, $field = null, $limit = false ) {
587
		if ( $limit ) {
588
			_deprecated_function( __FUNCTION__, '3.0', 'FrmFieldHelper::get_default_field_options' );
589
			$field_options = FrmFieldsHelper::get_default_field_options( $type );
590
		} else {
591
			_deprecated_function( __FUNCTION__, '3.0', 'FrmFieldHelper::get_default_field' );
592
			$field_options = FrmFieldsHelper::get_default_field( $type );
593
		}
594
595
		return $field_options;
596
	}
597
598
	/**
599
	 * @deprecated 2.02.07
600
	 */
601
	public static function dropdown_categories( $args ) {
602
		_deprecated_function( __FUNCTION__, '2.02.07', 'FrmProPost::get_category_dropdown' );
603
604
		if ( FrmAppHelper::pro_is_installed() ) {
605
			$args['location'] = 'front';
606
			$dropdown = FrmProPost::get_category_dropdown( $args['field'], $args );
607
		} else {
608
			$dropdown = '';
609
		}
610
611
		return $dropdown;
612
	}
613
614
	/**
615
	 * @deprecated 3.0
616
	 */
617
	public static function remove_inline_conditions( $no_vars, $code, $replace_with, &$html ) {
618
		_deprecated_function( __FUNCTION__, '3.0', 'FrmShortcodeHelper::remove_inline_conditions' );
619
		FrmShortcodeHelper::remove_inline_conditions( $no_vars, $code, $replace_with, $html );
620
	}
621
622
	/**
623
	 * @deprecated 3.0
624
	 */
625
	public static function get_shortcode_tag( $shortcodes, $short_key, $args ) {
626
		_deprecated_function( __FUNCTION__, '3.0', 'FrmShortcodeHelper::get_shortcode_tag' );
627
        return FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key, $args );
628
    }
629
630
	/**
631
	 * @deprecated 3.01
632
	 */
633
	public static function get_sigle_label_postitions() {
634
		_deprecated_function( __FUNCTION__, '3.01', 'FrmStylesHelper::get_single_label_positions' );
635
		return FrmStylesHelper::get_single_label_positions();
636
	}
637
638
	/**
639
	 * @deprecated 3.02.03
640
	 */
641
    public static function jquery_themes() {
642
		_deprecated_function( __FUNCTION__, '3.02.03', 'FrmProStylesController::jquery_themes' );
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',
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
        );
670
671
		$themes = apply_filters( 'frm_jquery_themes', $themes );
672
        return $themes;
673
    }
674
675
	/**
676
	 * @deprecated 3.02.03
677
	 */
678
    public static function enqueue_jquery_css() {
679
		_deprecated_function( __FUNCTION__, '3.02.03', 'FrmProStylesController::enqueue_jquery_css' );
680
681
		$form = self::get_form_for_page();
1 ignored issue
show
Deprecated Code introduced by
The method FrmDeprecated::get_form_for_page() has been deprecated with message: 3.02.03

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
682
		$theme_css = FrmStylesController::get_style_val( 'theme_css', $form );
683
        if ( $theme_css != -1 ) {
684
			wp_enqueue_style( 'jquery-theme', self::jquery_css_url( $theme_css ), array(), FrmAppHelper::plugin_version() );
1 ignored issue
show
Deprecated Code introduced by
The method FrmDeprecated::jquery_css_url() has been deprecated with message: 3.02.03

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
685
        }
686
    }
687
688
	/**
689
	 * @deprecated 3.02.03
690
	 */
691
	public static function jquery_css_url( $theme_css ) {
692
		_deprecated_function( __FUNCTION__, '3.02.03', 'FrmProStylesController::jquery_css_url' );
693
694
        if ( $theme_css == -1 ) {
695
            return;
696
        }
697
698
        if ( ! $theme_css || $theme_css == '' || $theme_css == 'ui-lightness' ) {
699
            $css_file = FrmAppHelper::plugin_url() . '/css/ui-lightness/jquery-ui.css';
700
		} elseif ( preg_match( '/^http.?:\/\/.*\..*$/', $theme_css ) ) {
701
            $css_file = $theme_css;
702
        } else {
703
            $uploads = FrmStylesHelper::get_upload_base();
704
			$file_path = '/formidable/css/' . $theme_css . '/jquery-ui.css';
705
			if ( file_exists( $uploads['basedir'] . $file_path ) ) {
706
                $css_file = $uploads['baseurl'] . $file_path;
707
            } else {
708
				$css_file = FrmAppHelper::jquery_ui_base_url() . '/themes/' . $theme_css . '/jquery-ui.min.css';
709
            }
710
        }
711
712
        return $css_file;
713
    }
714
715
	/**
716
	 * @deprecated 3.02.03
717
	 */
718
	public static function get_form_for_page() {
719
		_deprecated_function( __FUNCTION__, '3.02.03' );
720
721
		global $frm_vars;
722
		$form_id = 'default';
723
		if ( ! empty( $frm_vars['forms_loaded'] ) ) {
724
			foreach ( $frm_vars['forms_loaded'] as $form ) {
725
				if ( is_object( $form ) ) {
726
					$form_id = $form->id;
727
					break;
728
				}
729
			}
730
		}
731
		return $form_id;
732
	}
733
734
	/**
735
	 * @deprecated 3.0
736
	 */
737
	public static function validate_url_field( &$errors, $field, $value, $args ) {
738
		_deprecated_function( __FUNCTION__, '3.0', 'FrmFieldType::validate' );
739
740
		if ( $value == '' || ! in_array( $field->type, array( 'website', 'url' ) ) ) {
741
			return;
742
		}
743
744
		FrmEntryValidate::validate_field_types( $errors, $field, $value, $args );
745
	}
746
747
	/**
748
	 * @deprecated 3.0
749
	 */
750 View Code Duplication
	public static function validate_email_field( &$errors, $field, $value, $args ) {
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
751
		_deprecated_function( __FUNCTION__, '3.0', 'FrmFieldType::validate' );
752
753
		if ( $field->type != 'email' ) {
754
			return;
755
		}
756
757
		FrmEntryValidate::validate_field_types( $errors, $field, $value, $args );
758
	}
759
760
	/**
761
	 * @deprecated 3.0
762
	 */
763 View Code Duplication
	public static function validate_number_field( &$errors, $field, $value, $args ) {
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
764
		_deprecated_function( __FUNCTION__, '3.0', 'FrmFieldType::validate' );
765
766
		//validate the number format
767
		if ( $field->type != 'number' ) {
768
			return;
769
		}
770
771
		FrmEntryValidate::validate_field_types( $errors, $field, $value, $args );
772
	}
773
774
	/**
775
	 * @deprecated 3.0
776
	 */
777 View Code Duplication
	public static function validate_recaptcha( &$errors, $field, $args ) {
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
778
		_deprecated_function( __FUNCTION__, '3.0', 'FrmFieldType::validate' );
779
780
		if ( $field->type != 'captcha' ) {
781
			return;
782
		}
783
784
		FrmEntryValidate::validate_field_types( $errors, $field, '', $args );
785
	}
786
}
787