Completed
Push — master ( e99028...923363 )
by Stephanie
02:53 queued 10s
created

FrmAppController::ajax_install()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
if ( ! defined( 'ABSPATH' ) ) {
3
	die( 'You are not allowed to call this page directly.' );
4
}
5
6
class FrmAppController {
7
8
	public static function menu() {
9
		FrmAppHelper::maybe_add_permissions();
10
		if ( ! current_user_can( 'frm_view_forms' ) ) {
11
			return;
12
		}
13
14
		$menu_name = FrmAppHelper::get_menu_name();
15
		add_menu_page( 'Formidable', $menu_name, 'frm_view_forms', 'formidable', 'FrmFormsController::route', self::menu_icon(), self::get_menu_position() );
16
	}
17
18
	private static function get_menu_position() {
19
		return apply_filters( 'frm_menu_position', '29.3' );
20
	}
21
22
	/**
23
	 * @since 3.05
24
	 */
25
	private static function menu_icon() {
26
		$icon = FrmAppHelper::svg_logo(
27
			array(
28
				'fill'   => '#a0a5aa',
29
				'orange' => '#a0a5aa',
30
			)
31
		);
32
		$icon = 'data:image/svg+xml;base64,' . base64_encode( $icon );
33
34
		return apply_filters( 'frm_icon', $icon );
35
	}
36
37
	/**
38
	 * @since 3.0
39
	 */
40
	public static function add_admin_class( $classes ) {
41
		if ( self::is_white_page() ) {
42
			$classes .= ' frm-white-body ';
43
			$classes .= self::get_os();
44
45
			$page = str_replace( 'formidable-', '', FrmAppHelper::simple_get( 'page', 'sanitize_title' ) );
46
			if ( empty( $page ) || $page === 'formidable' ) {
47
				$action = FrmAppHelper::simple_get( 'frm_action', 'sanitize_title' );
48
				if ( in_array( $action, array( 'settings', 'edit', 'list' ) ) ) {
49
					$page .= $action;
50
				} else {
51
					$page = $action;
52
				}
53
			}
54
			if ( ! empty( $page ) ) {
55
				$classes .= ' frm-admin-page-' . $page;
56
			}
57
		}
58
59
		if ( FrmAppHelper::is_full_screen() ) {
60
			$classes .= apply_filters( 'frm_admin_full_screen_class', ' frm-full-screen folded' );
61
		}
62
63
		return $classes;
64
	}
65
66
	/**
67
	 * @since 4.0
68
	 */
69
	private static function get_os() {
70
		$agent = strtolower( FrmAppHelper::get_server_value( 'HTTP_USER_AGENT' ) );
71
		$os    = '';
72
		if ( strpos( $agent, 'mac' ) !== false ) {
73
			$os = ' osx';
74
		} elseif ( strpos( $agent, 'linux' ) !== false ) {
75
			$os = ' linux';
76
		} elseif ( strpos( $agent, 'windows' ) !== false ) {
77
			$os = ' windows';
78
		}
79
		return $os;
80
	}
81
82
	/**
83
	 * @since 3.0
84
	 */
85
	private static function is_white_page() {
86
		$white_pages = array(
87
			'formidable',
88
			'formidable-entries',
89
			'formidable-views',
90
			'formidable-pro-upgrade',
91
			'formidable-addons',
92
			'formidable-import',
93
			'formidable-settings',
94
			'formidable-styles',
95
			'formidable-styles2',
96
			'formidable-inbox',
97
		);
98
99
		$get_page      = FrmAppHelper::simple_get( 'page', 'sanitize_title' );
100
		$is_white_page = in_array( $get_page, $white_pages );
101
102
		if ( ! $is_white_page ) {
103
			$screen        = get_current_screen();
104
			$is_white_page = ( $screen && strpos( $screen->id, 'frm_display' ) !== false );
105
		}
106
107
		return $is_white_page;
108
	}
109
110
	public static function load_wp_admin_style() {
111
		FrmAppHelper::load_font_style();
112
	}
113
114
	public static function get_form_nav( $form, $show_nav = false, $title = 'show' ) {
115
		$show_nav = FrmAppHelper::get_param( 'show_nav', $show_nav, 'get', 'absint' );
116
		if ( empty( $show_nav ) || ! $form ) {
117
			return;
118
		}
119
120
		FrmForm::maybe_get_form( $form );
121
		if ( ! is_object( $form ) ) {
122
			return;
123
		}
124
125
		$id           = $form->id;
126
		$current_page = self::get_current_page();
127
		$nav_items    = self::get_form_nav_items( $form );
128
129
		include( FrmAppHelper::plugin_path() . '/classes/views/shared/form-nav.php' );
130
	}
131
132
	private static function get_current_page() {
133
		$page         = FrmAppHelper::simple_get( 'page', 'sanitize_title' );
134
		$post_type    = FrmAppHelper::simple_get( 'post_type', 'sanitize_title', 'None' );
135
		$current_page = isset( $_GET['page'] ) ? $page : $post_type;
136
137
		if ( FrmAppHelper::is_view_builder_page() ) {
138
			$current_page = 'frm_display';
139
		}
140
141
		return $current_page;
142
	}
143
144
	private static function get_form_nav_items( $form ) {
145
		$id = $form->parent_form_id ? $form->parent_form_id : $form->id;
146
147
		$nav_items = array(
148
			array(
149
				'link'       => FrmForm::get_edit_link( $id ),
150
				'label'      => __( 'Build', 'formidable' ),
151
				'current'    => array( 'edit', 'new', 'duplicate' ),
152
				'page'       => 'formidable',
153
				'permission' => 'frm_edit_forms',
154
			),
155
			array(
156
				'link'       => admin_url( 'admin.php?page=formidable&frm_action=settings&id=' . absint( $id ) ),
157
				'label'      => __( 'Settings', 'formidable' ),
158
				'current'    => array( 'settings' ),
159
				'page'       => 'formidable',
160
				'permission' => 'frm_edit_forms',
161
			),
162
			array(
163
				'link'       => admin_url( 'admin.php?page=formidable-entries&frm-full=1&frm_action=list&form=' . absint( $id ) ),
164
				'label'      => __( 'Entries', 'formidable' ),
165
				'current'    => array(),
166
				'page'       => 'formidable-entries',
167
				'permission' => 'frm_view_entries',
168
			),
169
		);
170
171
		// Let people know reports and views exist.
172
		if ( ! FrmAppHelper::pro_is_installed() ) {
173
			$nav_items[] = array(
174
				'link'    => admin_url( 'admin.php?page=formidable-views&frm-full=1&form=' . absint( $id ) ),
175
				'label'   => __( 'Views', 'formidable' ),
176
				'current' => array(),
177
				'page'    => 'formidable-views',
178
				'permission' => 'frm_view_entries',
179
				'atts'    => array(
180
					'class' => 'frm_noallow',
181
				),
182
			);
183
			$nav_items[] = array(
184
				'link'    => admin_url( 'admin.php?page=formidable&frm_action=lite-reports&frm-full=1&form=' . absint( $id ) ),
185
				'label'   => __( 'Reports', 'formidable' ),
186
				'current' => array( 'reports' ),
187
				'page'    => 'formidable',
188
				'permission' => 'frm_view_entries',
189
				'atts'    => array(
190
					'class' => 'frm_noallow',
191
				),
192
			);
193
		}
194
195
		$nav_args = array(
196
			'form_id' => $id,
197
			'form'    => $form,
198
		);
199
200
		return apply_filters( 'frm_form_nav_list', $nav_items, $nav_args );
201
	}
202
203
	// Adds a settings link to the plugins page
204
	public static function settings_link( $links ) {
205
		$settings = '<a href="' . esc_url( admin_url( 'admin.php?page=formidable' ) ) . '">' . __( 'Build a Form', 'formidable' ) . '</a>';
206
		array_unshift( $links, $settings );
207
208
		return $links;
209
	}
210
211
	public static function pro_get_started_headline() {
212
		self::review_request();
213
		FrmAppHelper::min_pro_version_notice( '4.0' );
214
	}
215
216
	/**
217
	 * Add admin notices as needed for reviews
218
	 *
219
	 * @since 3.04.03
220
	 */
221
	private static function review_request() {
222
		$reviews = new FrmReviews();
223
		$reviews->review_request();
224
	}
225
226
	/**
227
	 * Save the request to hide the review
228
	 *
229
	 * @since 3.04.03
230
	 */
231
	public static function dismiss_review() {
232
		FrmAppHelper::permission_check( 'frm_change_settings' );
233
		check_ajax_referer( 'frm_ajax', 'nonce' );
234
235
		$reviews = new FrmReviews();
236
		$reviews->dismiss_review();
237
	}
238
239
	/**
240
	 * @since 3.04.02
241
	 */
242
	public static function include_upgrade_overlay() {
243
		wp_enqueue_script( 'jquery-ui-dialog' );
244
		wp_enqueue_style( 'jquery-ui-dialog' );
245
246
		add_action( 'admin_footer', 'FrmAppController::upgrade_overlay_html' );
247
	}
248
249
	/**
250
	 * @since 3.06.03
251
	 */
252
	public static function upgrade_overlay_html() {
253
		$is_pro       = FrmAppHelper::pro_is_installed();
254
		$upgrade_link = array(
255
			'medium'  => 'builder',
256
			'content' => 'upgrade',
257
		);
258
		$default_link = FrmAppHelper::admin_upgrade_link( $upgrade_link );
259
		$plugin_path  = FrmAppHelper::plugin_path();
260
		$shared_path  = $plugin_path . '/classes/views/shared/';
261
262
		include $shared_path . 'upgrade_overlay.php';
263
		include $shared_path . 'confirm-overlay.php';
264
265 View Code Duplication
		if ( FrmAppHelper::is_admin_page( 'formidable' ) && in_array( FrmAppHelper::get_param( 'frm_action' ), array( '', 'list', 'trash' ), true ) ) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
266
			self::new_form_overlay_html();
267
		}
268
	}
269
270
	private static function new_form_overlay_html() {
271
		FrmFormsController::before_list_templates();
272
273
		$plugin_path      = FrmAppHelper::plugin_path();
274
		$path             = $plugin_path . '/classes/views/frm-forms/';
275
		$expired          = FrmFormsController::expired();
276
		$expiring         = FrmAddonsController::is_license_expiring();
277
		$user             = wp_get_current_user(); // $user used in leave-email.php to determine a default value for field
278
		$view_path        = $path . 'new-form-overlay/';
279
		$modal_class      = '';
280
		$upgrade_link     = FrmAppHelper::admin_upgrade_link(
281
			array(
282
				'medium'  => 'new-template',
283
				'content' => 'upgrade',
284
			)
285
		);
286
		$renew_link       = FrmAppHelper::admin_upgrade_link(
287
			array(
288
				'medium'  => 'new-template',
289
				'content' => 'renew',
290
			)
291
		);
292
		$blocks_to_render = array();
293
294
		if ( ! FrmAppHelper::pro_is_installed() ) {
295
			// avoid rendering the email and code blocks for users who have upgraded or have a free license already
296
			$api = new FrmFormTemplateApi();
297
			if ( ! $api->get_free_license() ) {
298
				array_push( $blocks_to_render, 'email', 'code' );
299
			}
300
		}
301
302
		// avoid rendering the upgrade block for users with elite
303
		if ( 'elite' !== FrmAddonsController::license_type() ) {
304
			$blocks_to_render[] = 'upgrade';
305
		}
306
307
		// avoid rendering the renew block for users who are not currently expired
308
		if ( $expired ) {
309
			$blocks_to_render[] = 'renew';
310
			$modal_class        = 'frm-expired';
311
		} elseif ( $expiring ) {
312
			$modal_class = 'frm-expiring';
313
		}
314
315
		include $path . 'new-form-overlay.php';
316
	}
317
318
	public static function include_info_overlay() {
319
		wp_enqueue_script( 'jquery-ui-dialog' );
320
		wp_enqueue_style( 'jquery-ui-dialog' );
321
322
		add_action( 'admin_footer', 'FrmAppController::info_overlay_html' );
323
	}
324
325
	public static function info_overlay_html() {
326
		include( FrmAppHelper::plugin_path() . '/classes/views/shared/info-overlay.php' );
327
	}
328
329
	/**
330
	 * @since 3.04.02
331
	 */
332
	public static function remove_upsells() {
333
		remove_action( 'frm_before_settings', 'FrmSettingsController::license_box' );
334
		remove_action( 'frm_after_settings', 'FrmSettingsController::settings_cta' );
335
		remove_action( 'frm_add_form_style_tab_options', 'FrmFormsController::add_form_style_tab_options' );
336
		remove_action( 'frm_after_field_options', 'FrmFormsController::logic_tip' );
337
	}
338
339
	/**
340
	 * If there are CURL problems on this server, wp_remote_post won't work for installing
341
	 * Use a javascript fallback instead.
342
	 *
343
	 * @since 2.0.3
344
	 */
345
	public static function install_js_fallback() {
346
		FrmAppHelper::load_admin_wide_js();
347
		echo '<div id="hidden frm_install_message"></div><script type="text/javascript">jQuery(document).ready(function(){frm_install_now();});</script>';
348
	}
349
350
	/**
351
	 * Check if the database is outdated
352
	 *
353
	 * @since 2.0.1
354
	 * @return boolean
355
	 */
356
	public static function needs_update() {
357
		$needs_upgrade = self::compare_for_update(
358
			array(
359
				'option'             => 'frm_db_version',
360
				'new_db_version'     => FrmAppHelper::$db_version,
361
				'new_plugin_version' => FrmAppHelper::plugin_version(),
362
			)
363
		);
364
365
		if ( ! $needs_upgrade ) {
366
			$needs_upgrade = apply_filters( 'frm_db_needs_upgrade', $needs_upgrade );
367
		}
368
369
		return $needs_upgrade;
370
	}
371
372
	/**
373
	 * Check both version number and DB number for changes
374
	 *
375
	 * @since 3.0.04
376
	 */
377
	public static function compare_for_update( $atts ) {
378
		$db_version = get_option( $atts['option'] );
379
380
		if ( strpos( $db_version, '-' ) === false ) {
381
			$needs_upgrade = true;
382
		} else {
383
			$last_upgrade     = explode( '-', $db_version );
384
			$needs_db_upgrade = (int) $last_upgrade[1] < (int) $atts['new_db_version'];
385
			$new_version      = version_compare( $last_upgrade[0], $atts['new_plugin_version'], '<' );
386
			$needs_upgrade    = $needs_db_upgrade || $new_version;
387
		}
388
389
		return $needs_upgrade;
390
	}
391
392
	/**
393
	 * Check for database update and trigger js loading
394
	 *
395
	 * @since 2.0.1
396
	 */
397
	public static function admin_init() {
398
		new FrmPersonalData(); // register personal data hooks
399
400
		if ( ! FrmAppHelper::doing_ajax() && self::needs_update() ) {
401
			self::network_upgrade_site();
402
		}
403
404
		if ( ! FrmAppHelper::doing_ajax() ) {
405
			// don't continue during ajax calls
406
			self::admin_js();
407
		}
408
409 View Code Duplication
		if ( FrmAppHelper::is_admin_page( 'formidable' ) && in_array( FrmAppHelper::get_param( 'frm_action' ), array( 'add_new', 'list_templates' ), true ) ) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
410
			wp_safe_redirect( admin_url( 'admin.php?page=formidable&triggerNewFormModal=1' ) );
411
			exit;
412
		}
413
	}
414
415
	public static function admin_js() {
416
		$version = FrmAppHelper::plugin_version();
417
		FrmAppHelper::load_admin_wide_js();
418
419
		$dependecies = array(
420
			'formidable_admin_global',
421
			'jquery',
422
			'jquery-ui-core',
423
			'jquery-ui-draggable',
424
			'jquery-ui-sortable',
425
			'bootstrap_tooltip',
426
			'bootstrap-multiselect',
427
		);
428
429
		if ( FrmAppHelper::is_admin_page( 'formidable-styles' ) || FrmAppHelper::is_admin_page( 'formidable-styles2' ) ) {
430
			$dependecies[] = 'wp-color-picker';
431
		}
432
433
		wp_register_script( 'formidable_admin', FrmAppHelper::plugin_url() . '/js/formidable_admin.js', $dependecies, $version, true );
434
		wp_register_style( 'formidable-admin', FrmAppHelper::plugin_url() . '/css/frm_admin.css', array(), $version );
435
		wp_register_script( 'bootstrap_tooltip', FrmAppHelper::plugin_url() . '/js/bootstrap.min.js', array( 'jquery' ), '3.3.4' );
436
		wp_register_style( 'formidable-grids', FrmAppHelper::plugin_url() . '/css/frm_grids.css', array(), $version );
437
438
		// load multselect js
439
		$depends_on = array( 'jquery', 'bootstrap_tooltip' );
440
		wp_register_script( 'bootstrap-multiselect', FrmAppHelper::plugin_url() . '/js/bootstrap-multiselect.js', $depends_on, '0.9.8', true );
441
442
		$page      = FrmAppHelper::simple_get( 'page', 'sanitize_title' );
443
		$post_type = FrmAppHelper::simple_get( 'post_type', 'sanitize_title' );
444
445
		global $pagenow;
446
		if ( strpos( $page, 'formidable' ) === 0 || ( $pagenow == 'edit.php' && $post_type == 'frm_display' ) ) {
447
448
			wp_enqueue_script( 'admin-widgets' );
449
			wp_enqueue_style( 'widgets' );
450
			wp_enqueue_script( 'formidable_admin' );
451
			FrmAppHelper::localize_script( 'admin' );
452
453
			wp_enqueue_style( 'formidable-admin' );
454
			if ( 'formidable-styles' !== $page && 'formidable-styles2' !== $page ) {
455
				wp_enqueue_style( 'formidable-grids' );
456
				wp_enqueue_style( 'formidable-dropzone' );
457
			} else {
458
				$settings = FrmAppHelper::get_settings();
459
				if ( empty( $settings->old_css ) ) {
460
					wp_enqueue_style( 'formidable-grids' );
461
				}
462
			}
463
464
			if ( 'formidable-entries' === $page ) {
465
				// Load front end js for entries.
466
				wp_enqueue_script( 'formidable' );
467
			}
468
469
			do_action( 'frm_enqueue_builder_scripts' );
470
			self::include_upgrade_overlay();
471
			self::include_info_overlay();
472
		} elseif ( FrmAppHelper::is_view_builder_page() ) {
473
			if ( isset( $_REQUEST['post_type'] ) ) {
474
				$post_type = sanitize_title( wp_unslash( $_REQUEST['post_type'] ) );
475
			} elseif ( isset( $_REQUEST['post'] ) && absint( $_REQUEST['post'] ) ) {
476
				$post = get_post( absint( wp_unslash( $_REQUEST['post'] ) ) );
477
				if ( ! $post ) {
478
					return;
479
				}
480
				$post_type = $post->post_type;
481
			} else {
482
				return;
483
			}
484
485
			if ( $post_type == 'frm_display' ) {
486
				wp_enqueue_style( 'formidable-grids' );
487
				wp_enqueue_script( 'jquery-ui-draggable' );
488
				wp_enqueue_script( 'formidable_admin' );
489
				wp_enqueue_style( 'formidable-admin' );
490
				FrmAppHelper::localize_script( 'admin' );
491
				self::include_info_overlay();
492
			}
493
		}
494
	}
495
496
	public static function load_lang() {
497
		load_plugin_textdomain( 'formidable', false, FrmAppHelper::plugin_folder() . '/languages/' );
498
	}
499
500
	/**
501
	 * Check if the styles are updated when a form is loaded on the front-end
502
	 *
503
	 * @since 3.0.1
504
	 */
505
	public static function maybe_update_styles() {
506
		if ( self::needs_update() ) {
507
			self::network_upgrade_site();
508
		}
509
	}
510
511
	/**
512
	 * @since 3.0
513
	 */
514
	public static function create_rest_routes() {
515
		$args = array(
516
			'methods'  => 'GET',
517
			'callback' => 'FrmAppController::api_install',
518
			'permission_callback' => __CLASS__ . '::can_update_db',
519
		);
520
521
		register_rest_route( 'frm-admin/v1', '/install', $args );
522
523
		$args = array(
524
			'methods'  => 'GET',
525
			'callback' => 'FrmAddonsController::install_addon_api',
526
			'permission_callback' => 'FrmAddonsController::can_install_addon_api',
527
		);
528
529
		register_rest_route( 'frm-admin/v1', '/install-addon', $args );
530
	}
531
532
	/**
533
	 * Make sure the install is only being run when we tell it to.
534
	 * We don't want to run manually by people calling the API.
535
	 *
536
	 * @since 4.06.02
537
	 */
538
	public static function can_update_db() {
539
		return get_transient( 'frm_updating_api' );
540
	}
541
542
	/**
543
	 * Run silent upgrade on each site in the network during a network upgrade.
544
	 * Update database settings for all sites in a network during network upgrade process.
545
	 *
546
	 * @since 2.0.1
547
	 *
548
	 * @param int $blog_id Blog ID.
549
	 */
550
	public static function network_upgrade_site( $blog_id = 0 ) {
551
		// Flag to check if install is happening as intended.
552
		set_transient( 'frm_updating_api', true, MINUTE_IN_SECONDS );
553
		$request = new WP_REST_Request( 'GET', '/frm-admin/v1/install' );
554
555
		if ( $blog_id ) {
556
			switch_to_blog( $blog_id );
557
			$response = rest_do_request( $request );
558
			restore_current_blog();
559
		} else {
560
			$response = rest_do_request( $request );
561
		}
562
563
		if ( $response->is_error() ) {
564
			// if the remove post fails, use javascript instead
565
			add_action( 'admin_notices', 'FrmAppController::install_js_fallback' );
566
		}
567
	}
568
569
	/**
570
	 * @since 3.0
571
	 */
572
	public static function api_install() {
573
		delete_transient( 'frm_updating_api' );
574
		if ( self::needs_update() ) {
575
			$running = get_option( 'frm_install_running' );
576
			if ( false === $running || $running < strtotime( '-5 minutes' ) ) {
577
				update_option( 'frm_install_running', time(), 'no' );
578
				self::install();
579
				delete_option( 'frm_install_running' );
580
			}
581
		}
582
583
		return true;
584
	}
585
586
	/**
587
	 * Silent database upgrade (no redirect).
588
	 * Called via ajax request during network upgrade process.
589
	 *
590
	 * @since 2.0.1
591
	 */
592
	public static function ajax_install() {
593
		self::api_install();
594
		wp_die();
595
	}
596
597
	public static function install() {
598
		$frmdb = new FrmMigrate();
599
		$frmdb->upgrade();
600
	}
601
602
	public static function uninstall() {
603
		FrmAppHelper::permission_check( 'administrator' );
604
		check_ajax_referer( 'frm_ajax', 'nonce' );
605
606
		$frmdb = new FrmMigrate();
607
		$frmdb->uninstall();
608
609
		//disable the plugin and redirect after uninstall so the tables don't get added right back
610
		$plugins = array( FrmAppHelper::plugin_folder() . '/formidable.php', 'formidable-pro/formidable-pro.php' );
611
		deactivate_plugins( $plugins, false, false );
612
		echo esc_url_raw( admin_url( 'plugins.php?deactivate=true' ) );
613
614
		wp_die();
615
	}
616
617
	public static function drop_tables( $tables ) {
618
		global $wpdb;
619
		$tables[] = $wpdb->prefix . 'frm_fields';
620
		$tables[] = $wpdb->prefix . 'frm_forms';
621
		$tables[] = $wpdb->prefix . 'frm_items';
622
		$tables[] = $wpdb->prefix . 'frm_item_metas';
623
624
		return $tables;
625
	}
626
627
	public static function deauthorize() {
628
		FrmAppHelper::permission_check( 'frm_change_settings' );
629
		check_ajax_referer( 'frm_ajax', 'nonce' );
630
631
		delete_option( 'frmpro-credentials' );
632
		delete_option( 'frmpro-authorized' );
633
		delete_site_option( 'frmpro-credentials' );
634
		delete_site_option( 'frmpro-authorized' );
635
		wp_die();
636
	}
637
638
	public static function set_footer_text( $text ) {
639
		if ( FrmAppHelper::is_formidable_admin() ) {
640
			$text = '';
641
		}
642
643
		return $text;
644
	}
645
646
	/**
647
	 * @deprecated 1.07.05
648
	 * @codeCoverageIgnore
649
	 */
650
	public static function get_form_shortcode( $atts ) {
651
		return FrmDeprecated::get_form_shortcode( $atts );
652
	}
653
654
	/**
655
	 * @deprecated 2.5.4
656
	 * @codeCoverageIgnore
657
	 */
658
	public static function widget_text_filter( $content ) {
659
		return FrmDeprecated::widget_text_filter( $content );
660
	}
661
662
	/**
663
	 * Deprecated in favor of wpmu_upgrade_site
664
	 *
665
	 * @deprecated 2.3
666
	 * @codeCoverageIgnore
667
	 */
668
	public static function front_head() {
669
		FrmDeprecated::front_head();
670
	}
671
672
	/**
673
	 * @deprecated 3.0.04
674
	 * @codeCoverageIgnore
675
	 */
676
	public static function activation_install() {
677
		FrmDeprecated::activation_install();
678
	}
679
680
	/**
681
	 * @deprecated 3.0
682
	 * @codeCoverageIgnore
683
	 */
684
	public static function page_route( $content ) {
685
		return FrmDeprecated::page_route( $content );
686
	}
687
}
688