Completed
Push — master ( 9572ed...c0d504 )
by Stephanie
22s queued 10s
created

FrmAddonsController::check_update()   B

Complexity

Conditions 10
Paths 24

Size

Total Lines 43

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 10
nc 24
nop 1
dl 0
loc 43
rs 7.6666
c 0
b 0
f 0

How to fix   Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
class FrmAddonsController {
4
5
	public static function menu() {
6
		add_submenu_page( 'formidable', 'Formidable | ' . __( 'Add-Ons', 'formidable' ), __( 'Add-Ons', 'formidable' ), 'frm_view_forms', 'formidable-addons', 'FrmAddonsController::list_addons' );
7
8
		if ( ! FrmAppHelper::pro_is_installed() ) {
9
			add_submenu_page( 'formidable', 'Formidable | ' . __( 'Upgrade to Pro', 'formidable' ), __( 'Upgrade to Pro', 'formidable' ), 'frm_view_forms', 'formidable-pro-upgrade', 'FrmAddonsController::upgrade_to_pro' );
10
		}
11
	}
12
13
	public static function list_addons() {
14
		$installed_addons = apply_filters( 'frm_installed_addons', array() );
15
16
		$addons = self::get_api_addons();
17
		$errors = self::get_error_from_response( $addons );
18
		if ( isset( $addons['error'] ) ) {
19
			unset( $addons['error'] );
20
		}
21
		self::prepare_addons( $addons );
22
23
		$pricing = FrmAppHelper::admin_upgrade_link( 'addons' );
24
25
		include( FrmAppHelper::plugin_path() . '/classes/views/addons/list.php' );
26
	}
27
28
	public static function license_settings() {
29
		$plugins = apply_filters( 'frm_installed_addons', array() );
30
		if ( empty( $plugins ) ) {
31
			esc_html_e( 'There are no plugins on your site that require a license', 'formidable' );
32
			return;
33
		}
34
35
		ksort( $plugins );
36
37
		include( FrmAppHelper::plugin_path() . '/classes/views/addons/settings.php' );
38
	}
39
40
	private static function get_api_addons() {
41
		$license = '';
42
		$edd_update = self::get_pro_updater();
43
		if ( ! empty( $edd_update ) ) {
44
			$license = $edd_update->license;
45
		}
46
47
		$addons = self::get_addon_info( $license );
48
49
		if ( empty( $addons ) ) {
50
			$addons = self::fallback_plugin_list();
51
		} else {
52
			foreach ( $addons as $k => $addon ) {
53
				if ( empty( $addon['excerpt'] ) && $k !== 'error' ) {
54
					unset( $addons[ $k ] );
55
				}
56
			}
57
		}
58
59
		return $addons;
60
	}
61
62
	/**
63
	 * @since 3.04.03
64
	 */
65
	public static function get_pro_updater() {
66
		if ( FrmAppHelper::pro_is_installed() && is_callable( 'FrmProAppHelper::get_updater' ) ) {
67
			return FrmProAppHelper::get_updater();
68
		}
69
70
		return false;
71
	}
72
73
	/**
74
	 * If the API is unable to connect, show something on the addons page
75
	 *
76
	 * @since 3.04.03
77
	 * @return array
78
	 */
79
	private static function fallback_plugin_list() {
80
		return array(
81
			'formidable-pro' => array(
82
				'title'   => 'Formidable Pro',
83
				'link'    => 'pricing/',
84
				'docs'    => '',
85
				'excerpt' => 'Enhance your basic Formidable forms with a plethora of Pro field types and features. Create advanced forms and data-driven applications in minutes.',
86
			),
87
			'mailchimp' => array(
88
				'title'   => 'MailChimp Forms',
89
				'excerpt' => 'Get on the path to more sales and leads in a matter of minutes. Add leads to a MailChimp mailing list when they submit forms and update their information along with the entry.',
90
			),
91
			'registration' => array(
92
				'title'   => 'User Registration Forms',
93
				'link'    => 'downloads/user-registration/',
94
				'excerpt' => 'Give new users access to your site as quickly and painlessly as possible. Allow users to register, edit and be able to login to their profiles on your site from the front end in a clean, customized registration form.',
95
			),
96
			'paypal' => array(
97
				'title'   => 'PayPal Standard Forms',
98
				'link'    => 'downloads/paypal-standard/',
99
				'excerpt' => 'Automate your business by collecting instant payments from your clients. Collect information, calculate a total, and send them on to PayPal. Require a payment before publishing content on your site.',
100
			),
101
			'stripe' => array(
102
				'title'   => 'Stripe Forms',
103
				'docs'    => 'knowledgebase/stripe/',
104
				'excerpt' => 'Any Formidable forms on your site can accept credit card payments without users ever leaving your site.',
105
			),
106
			'authorize-net' => array(
107
				'title'   => 'Authorize.net AIM Forms',
108
				'link'    => 'downloads/authorize-net-aim/',
109
				'docs'    => 'knowledgebase/authorize-net-aim/',
110
				'excerpt' => 'Accept one-time payments directly on your site, using Authorize.net AIM.',
111
			),
112
			'woocommerce' => array(
113
				'title'   => 'WooCommerce Forms',
114
				'excerpt' => 'Use a Formidable form on your WooCommerce product pages.',
115
			),
116
			'autoresponder' => array(
117
				'title'   => 'Form Action Automation',
118
				'docs'    => 'knowledgebase/schedule-autoresponder/',
119
				'excerpt' => 'Schedule email notifications, SMS messages, and API actions.',
120
			),
121
			'modal' => array(
122
				'title'   => 'Bootstrap Modal Forms',
123
				'link'    => 'downloads/bootstrap-modal/',
124
				'docs'    => 'knowledgebase/bootstrap-modal/',
125
				'excerpt' => 'Open a view or form in a Bootstrap popup.',
126
			),
127
			'bootstrap' => array(
128
				'title'   => 'Bootstrap Style Forms',
129
				'excerpt' => 'Instantly add Bootstrap styling to all your Formidable forms.',
130
			),
131
			'zapier' => array(
132
				'title'   => 'Zapier Forms',
133
				'excerpt' => 'Connect with hundreds of different applications through Zapier. Insert a new row in a Google docs spreadsheet, post on Twitter, or add a new Dropbox file with your form.',
134
			),
135
			'signature' => array(
136
				'title'   => 'Digital Signature Forms',
137
				'excerpt' => 'Add a signature field to your form. The user may write their signature with a trackpad/mouse or just type it.',
138
			),
139
			'api' => array(
140
				'title'   => 'Formidable Forms API',
141
				'link'    => 'downloads/formidable-api/',
142
				'excerpt' => 'Send entry results to any other site that has a Rest API. This includes the option of sending entries from one Formidable site to another.',
143
			),
144
			'twilio' => array(
145
				'title'   => 'Twilio SMS Forms',
146
				'docs'    => 'knowledgebase/twilio-add-on/',
147
				'excerpt' => 'Allow users to text their votes for polls created by Formidable Forms, or send SMS notifications when entries are submitted or updated.',
148
			),
149
		);
150
	}
151
152
	/**
153
	 * @since 3.04.03
154
	 * @return array
155
	 */
156
	public static function get_addon_info( $license = '' ) {
157
		$addons = array();
0 ignored issues
show
Unused Code introduced by
$addons is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
158
		$url = 'https://formidableforms.com/wp-json/s11edd/v1/updates/';
159
		if ( ! empty( $license ) ) {
160
			$url .= '?l=' . urlencode( base64_encode( $license ) );
161
		}
162
163
		$addons = self::get_cached_addons( $license );
164
		if ( ! empty( $addons ) ) {
165
			return $addons;
166
		}
167
168
		$response = wp_remote_get( $url );
169
		if ( is_array( $response ) && ! is_wp_error( $response ) ) {
170
		    $addons = $response['body'];
171
			if ( ! empty( $addons ) ) {
172
				$addons = json_decode( $addons, true );
173
174
				$skip_categories = array( 'WordPress Form Templates', 'WordPress Form Style Templates' );
175
				foreach ( $addons as $k => $addon ) {
176
					if ( ! isset( $addon['categories'] ) ) {
177
						continue;
178
					}
179
					$cats = array_intersect( $skip_categories, $addon['categories'] );
180
					if ( ! empty( $cats ) ) {
181
						unset( $addons[ $k ] );
182
					}
183
				}
184
185
				self::set_cached_addons( $addons, $license );
186
			}
187
		}
188
189
		return $addons;
190
	}
191
192
	/**
193
	 * @since 3.04.03
194
	 * @return array
195
	 */
196
	private static function get_cached_addons( $license = '' ) {
197
		$cache_key = self::get_cache_key( $license );
198
		$cache     = get_option( $cache_key );
199
200 View Code Duplication
		if ( empty( $cache ) || empty( $cache['timeout'] ) || current_time( 'timestamp' ) > $cache['timeout'] ) {
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...
201
			return false; // Cache is expired
0 ignored issues
show
Bug Best Practice introduced by
The return type of return false; (false) is incompatible with the return type documented by FrmAddonsController::get_cached_addons of type array.

If you return a value from a function or method, it should be a sub-type of the type that is given by the parent type f.e. an interface, or abstract method. This is more formally defined by the Lizkov substitution principle, and guarantees that classes that depend on the parent type can use any instance of a child type interchangably. This principle also belongs to the SOLID principles for object oriented design.

Let’s take a look at an example:

class Author {
    private $name;

    public function __construct($name) {
        $this->name = $name;
    }

    public function getName() {
        return $this->name;
    }
}

abstract class Post {
    public function getAuthor() {
        return 'Johannes';
    }
}

class BlogPost extends Post {
    public function getAuthor() {
        return new Author('Johannes');
    }
}

class ForumPost extends Post { /* ... */ }

function my_function(Post $post) {
    echo strtoupper($post->getAuthor());
}

Our function my_function expects a Post object, and outputs the author of the post. The base class Post returns a simple string and outputting a simple string will work just fine. However, the child class BlogPost which is a sub-type of Post instead decided to return an object, and is therefore violating the SOLID principles. If a BlogPost were passed to my_function, PHP would not complain, but ultimately fail when executing the strtoupper call in its body.

Loading history...
202
		}
203
204
		return json_decode( $cache['value'], true );
205
	}
206
207
	/**
208
	 * @since 3.04.03
209
	 */
210 View Code Duplication
	private static function set_cached_addons( $addons, $license = '' ) {
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...
211
		$cache_key = self::get_cache_key( $license );
212
		$data = array(
213
			'timeout' => strtotime( '+6 hours', current_time( 'timestamp' ) ),
214
			'value'   => json_encode( $addons ),
215
		);
216
217
		update_option( $cache_key, $data, 'no' );
218
	}
219
220
	/**
221
	 * @since 3.04.03
222
	 */
223
	public static function reset_cached_addons( $license = '' ) {
224
		delete_option( self::get_cache_key( $license ) );
225
	}
226
227
	/**
228
	 * @since 3.04.03
229
	 * @return string
230
	 */
231
	public static function get_cache_key( $license ) {
232
		return 'frm_addons_l' . ( empty( $license ) ? '' : md5( $license ) );
233
	}
234
235
	/**
236
	 * @since 3.04.03
237
	 * @return array
238
	 */
239
	public static function error_for_license( $license ) {
240
		$errors = array();
241
		if ( ! empty( $license ) ) {
242
			$addons = self::get_addon_info( $license );
243
			$errors = self::get_error_from_response( $addons );
244
		}
245
		return $errors;
246
	}
247
248
	/**
249
	 * @since 3.04.03
250
	 * @return array
251
	 */
252
	private static function get_error_from_response( $addons ) {
253
		$errors = array();
254
		if ( isset( $addons['error'] ) ) {
255
			$errors[] = $addons['error']['message'];
256
			do_action( 'frm_license_error', $addons['error'] );
257
		}
258
		return $errors;
259
	}
260
261
	/**
262
	 * @since 3.04.03
263
	 */
264
	public static function check_update( $transient ) {
265
		if ( ! is_object( $transient ) ) {
266
			$transient = new stdClass;
267
		}
268
269
		$installed_addons = apply_filters( 'frm_installed_addons', array() );
270
		if ( empty( $installed_addons ) ) {
271
			return $transient;
272
		}
273
274
		$version_info = self::fill_update_addon_info( $installed_addons );
275
276
		$transient->last_checked = time();
277
278
		$wp_plugins = get_plugins();
279
280
		foreach ( $version_info as $id => $plugin ) {
281
			$plugin = (object) $plugin;
282
283
			if ( ! isset( $plugin->new_version ) || ! isset( $plugin->package ) ) {
284
				continue;
285
			}
286
287
			$folder = $plugin->plugin;
288
			if ( empty( $folder ) ) {
289
				continue;
290
			}
291
292
			$wp_plugin  = isset( $wp_plugins[ $folder ] ) ? $wp_plugins[ $folder ] : array();
293
			$wp_version = isset( $wp_plugin['Version'] ) ? $wp_plugin['Version'] : '1.0';
294
295
			if ( version_compare( $wp_version, $plugin->new_version, '<' ) ) {
296
				$slug = explode( '/', $folder );
297
				$plugin->slug = $slug[0];
298
				$transient->response[ $folder ] = $plugin;
299
			}
300
301
			$transient->checked[ $folder ] = $wp_version;
302
303
		}
304
305
		return $transient;
306
	}
307
308
	/**
309
	 * @since 3.04.03
310
	 *
311
	 * @param array $installed_addons
312
	 *
313
	 * @return array
314
	 */
315
	private static function fill_update_addon_info( $installed_addons ) {
316
		$checked_licenses = array();
317
		$version_info     = array();
318
319
		foreach ( $installed_addons as $addon ) {
320
			if ( $addon->store_url !== 'https://formidableforms.com' ) {
321
				// check if this is a third-party addon
322
				continue;
323
			}
324
325
			$new_license = $addon->license;
326
			if ( empty( $new_license ) || in_array( $new_license, $checked_licenses ) ) {
327
				continue;
328
			}
329
330
			$checked_licenses[] = $new_license;
331
332
			if ( empty( $version_info ) ) {
333
				$version_info = self::get_addon_info( $new_license );
334
				continue;
335
			}
336
337
			$plugin = self::get_addon_for_license( $version_info, $addon );
338
			if ( empty( $plugin ) ) {
339
				continue;
340
			}
341
342
			$download_id = isset( $plugin['id'] ) ? $plugin['id'] : 0;
343
			if ( ! empty( $download_id ) && ! isset( $version_info[ $download_id ]['package'] ) ) {
344
				// if this addon is using its own license, get the update url
345
				$addon_info = self::get_addon_info( $new_license );
346
347
				$version_info[ $download_id ] = $addon_info[ $download_id ];
348
				if ( isset( $addon_info['error'] ) ) {
349
					$version_info[ $download_id ]['error'] = array(
350
						'message' => $addon_info['error']['message'],
351
						'code'    => $addon_info['error']['code'],
352
					);
353
				}
354
			}
355
		}
356
357
		return $version_info;
358
	}
359
360
	/**
361
	 * @since 3.04.03
362
	 * @param array $addons
363
	 * @param object $license The FrmAddon object
364
	 * @return array
365
	 */
366
	public static function get_addon_for_license( $addons, $license ) {
367
		$download_id = $license->download_id;
368
		$plugin = array();
369
		if ( empty( $download_id ) ) {
370
			foreach ( $addons as $addon ) {
371
				if ( strtolower( $license->plugin_name ) == strtolower( $addon['title'] ) ) {
372
					return $addon;
373
				}
374
			}
375
		} elseif ( isset( $addons[ $download_id ] ) ) {
376
			$plugin = $addons[ $download_id ];
377
		}
378
379
		return $plugin;
380
	}
381
382
	private static function prepare_addons( &$addons ) {
383
		$activate_url = '';
384
		if ( current_user_can( 'activate_plugins' ) ) {
385
			$activate_url = add_query_arg( array( 'action' => 'activate' ), admin_url( 'plugins.php' ) );
386
		}
387
388
		$loop_addons = $addons;
389
		foreach ( $loop_addons as $id => $addon ) {
390
			if ( is_numeric( $id ) ) {
391
				$slug = str_replace( array( '-wordpress-plugin', '-wordpress' ), '', $addon['slug'] );
392
				$file_name = $addon['plugin'];
393
			} else {
394
				$slug = $id;
395
				if ( isset( $addon['file'] ) ) {
396
					$base_file = $addon['file'];
397
				} else {
398
					$base_file = 'formidable-' . $slug;
399
				}
400
				$file_name = $base_file . '/' . $base_file . '.php';
401
			}
402
403
			$addon['installed']    = file_exists( WP_PLUGIN_DIR . '/' . $file_name );
404
			$addon['activate_url'] = '';
405
406
			if ( $addon['installed'] && ! empty( $activate_url ) && ! is_plugin_active( $file_name ) ) {
407
				$addon['activate_url'] = add_query_arg(
408
					array(
409
						'_wpnonce'    => wp_create_nonce( 'activate-plugin_' . $file_name ),
410
						'plugin'      => $file_name,
411
					),
412
					$activate_url
413
				);
414
			}
415
416
			if ( ! isset( $addon['docs'] ) ) {
417
				$addon['docs'] = 'knowledgebase/formidable-' . $slug . '/';
418
			}
419
			self::prepare_addon_link( $addon['docs'] );
420
421
			if ( ! isset( $addon['link'] ) ) {
422
				$addon['link'] = 'downloads/' . $slug . '/';
423
			}
424
			self::prepare_addon_link( $addon['link'] );
425
426
			self::set_addon_status( $addon );
427
			$addons[ $id ] = $addon;
428
		}
429
	}
430
431
	/**
432
	 * @since 3.04.02
433
	 */
434
	private static function prepare_addon_link( &$link ) {
435
		$site_url = 'https://formidableforms.com/';
436
		if ( strpos( $link, 'http' ) !== 0 ) {
437
			$link = $site_url . $link;
438
		}
439
		$link = FrmAppHelper::make_affiliate_url( $link );
440
		$query_args = array(
441
			'utm_source'   => 'WordPress',
442
			'utm_medium'   => 'addons',
443
			'utm_campaign' => 'liteplugin',
444
		);
445
		$link = add_query_arg( $query_args, $link );
446
	}
447
448
	/**
449
	 * Add the status to the addon array. Status options are:
450
	 * installed, active, not installed
451
	 *
452
	 * @since 3.04.02
453
	 */
454
	private static function set_addon_status( &$addon ) {
455
		if ( ! empty( $addon['activate_url'] ) ) {
456
			$addon['status'] = array(
457
				'type'  => 'installed',
458
				'label' => __( 'Installed', 'formidable' ),
459
			);
460
		} elseif ( $addon['installed'] ) {
461
			$addon['status'] = array(
462
				'type'  => 'active',
463
				'label' => __( 'Active', 'formidable' ),
464
			);
465
		} else {
466
			$addon['status'] = array(
467
				'type'  => 'not-installed',
468
				'label' => __( 'Not Installed', 'formidable' ),
469
			);
470
		}
471
	}
472
473
	public static function upgrade_to_pro() {
474
		$pro_pricing = self::prepare_pro_info();
475
476
		include( FrmAppHelper::plugin_path() . '/classes/views/addons/upgrade_to_pro.php' );
477
	}
478
479
	private static function prepare_pro_info() {
480
		return array(
481
			'personal'     => array(
482
				'id'       => 2,
483
				'download' => 19367654,
484
				'price'    => '49.00',
485
				'name'     => 'Personal',
486
			),
487
			'professional' => array(
488
				'id'       => 0,
489
				'download' => 19367001,
490
				'price'    => '99.00',
491
				'name'     => 'Creator',
492
			),
493
			'smallbusiness' => array(
494
				'id'       => 0,
495
				'download' => 19366995,
496
				'price'    => '199.00',
497
				'name'     => 'Business',
498
			),
499
			'enterprise'   => array(
500
				'id'       => 0,
501
				'download' => 19366992,
502
				'price'    => '399.00',
503
				'name'     => 'Enterprise',
504
			),
505
		);
506
	}
507
508
	/**
509
	 * @since 3.04.02
510
	 */
511
	public static function ajax_install_addon() {
512
513
		self::install_addon_permissions();
514
515
		// Set the current screen to avoid undefined notices.
516
		global $hook_suffix;
517
		set_current_screen();
518
519
		self::maybe_show_cred_form();
520
521
		$installed = self::install_addon();
522
		self::maybe_activate_addon( $installed );
523
524
		// Send back a response.
525
		echo json_encode( true );
526
		wp_die();
527
	}
528
529
	/**
530
	 * @since 3.04.02
531
	 */
532
	private static function maybe_show_cred_form() {
533
		// Start output bufferring to catch the filesystem form if credentials are needed.
534
		ob_start();
535
536
		$show_form = false;
537
		$method = '';
538
		$url    = add_query_arg( array( 'page' => 'formidable-settings' ), admin_url( 'admin.php' ) );
539
		$url    = esc_url_raw( $url );
540
		$creds  = request_filesystem_credentials( $url, $method, false, false, null );
541
542
		if ( false === $creds ) {
543
			$show_form = true;
544
		} elseif ( ! WP_Filesystem( $creds ) ) {
545
			request_filesystem_credentials( $url, $method, true, false, null );
546
			$show_form = true;
547
		}
548
549
		if ( $show_form ) {
550
			$form = ob_get_clean();
0 ignored issues
show
Unused Code introduced by
$form is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
551
			//TODO: test this: echo json_encode( array( 'form' => $form ) );
552
			echo json_encode( array( 'form' => __( 'Sorry, you\'re site requires FTP authentication. Please install plugins manaully.', 'formidable' ) ) );
553
			wp_die();
554
		}
555
556
		ob_end_clean();
557
	}
558
559
	/**
560
	 * We do not need any extra credentials if we have gotten this far,
561
	 * so let's install the plugin.
562
	 *
563
	 * @since 3.04.02
564
	 */
565
	private static function install_addon() {
566
		require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
567
568
		$download_url = esc_url_raw( $_POST['plugin'] );
569
570
		// Create the plugin upgrader with our custom skin.
571
		$installer = new Plugin_Upgrader( new FrmInstallerSkin() );
572
		$installer->install( $download_url );
573
574
		// Flush the cache and return the newly installed plugin basename.
575
		wp_cache_flush();
576
		return $installer->plugin_info();
577
	}
578
579
	/**
580
	 * @since 3.04.02
581
	 */
582
	private static function maybe_activate_addon( $installed ) {
583
		if ( ! $installed ) {
584
			return;
585
		}
586
587
		$activate = activate_plugin( $installed );
588
		if ( is_wp_error( $activate ) ) {
589
			echo json_encode( array( 'error' => $activate->get_error_message() ) );
590
			wp_die();
591
		}
592
	}
593
594
	/**
595
	 * Run security checks before installing
596
	 *
597
	 * @since 3.04.02
598
	 */
599
	private static function install_addon_permissions() {
600
		check_ajax_referer( 'frm_ajax', 'nonce' );
601
602
		if ( ! current_user_can( 'activate_plugins' ) || ! isset( $_POST['plugin'] ) ) {
603
			echo json_encode( true );
604
			wp_die();
605
		}
606
	}
607
608
	/**
609
	 * @since 2.03.08
610
	 * @deprecated 3.04.03
611
	 * @codeCoverageIgnore
612
	 *
613
	 * @param boolean $return
614
	 * @param string $package
615
	 *
616
	 * @return boolean
617
	 */
618
	public static function add_shorten_edd_filename_filter( $return, $package ) {
619
		return FrmDeprecated::add_shorten_edd_filename_filter( $return, $package );
1 ignored issue
show
Deprecated Code introduced by
The method FrmDeprecated::add_shorten_edd_filename_filter() 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...
620
	}
621
622
	/**
623
	 * @since 2.03.08
624
	 * @deprecated 3.04.03
625
	 * @codeCoverageIgnore
626
	 *
627
	 * @param string $filename
628
	 * @param string $ext
629
	 *
630
	 * @return string
631
	 */
632
	public static function shorten_edd_filename( $filename, $ext ) {
633
		return FrmDeprecated::shorten_edd_filename( $filename, $ext );
1 ignored issue
show
Deprecated Code introduced by
The method FrmDeprecated::shorten_edd_filename() 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...
634
	}
635
636
	/**
637
	 * @deprecated 3.04.03
638
	 * @codeCoverageIgnore
639
	 */
640
	public static function get_licenses() {
641
		FrmDeprecated::get_licenses();
1 ignored issue
show
Deprecated Code introduced by
The method FrmDeprecated::get_licenses() 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...
642
	}
643
}
644