@@ -234,6 +234,9 @@ discard block |
||
| 234 | 234 | $this->delete_cache(); |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | + /** |
|
| 238 | + * @param string|false $is_active |
|
| 239 | + */ |
|
| 237 | 240 | public function set_active( $is_active ) { |
| 238 | 241 | update_option( $this->option_name . 'active', $is_active ); |
| 239 | 242 | $this->delete_cache(); |
@@ -352,6 +355,7 @@ discard block |
||
| 352 | 355 | * Get the API info for this plugin |
| 353 | 356 | * |
| 354 | 357 | * @since 3.04.03 |
| 358 | + * @param string $license |
|
| 355 | 359 | */ |
| 356 | 360 | protected function get_api_info( $license ) { |
| 357 | 361 | $api = new FrmFormApi( $license ); |
@@ -483,6 +487,7 @@ discard block |
||
| 483 | 487 | |
| 484 | 488 | /** |
| 485 | 489 | * @since 4.08 |
| 490 | + * @param string $license |
|
| 486 | 491 | */ |
| 487 | 492 | public static function activate_license_for_plugin( $license, $plugin_slug ) { |
| 488 | 493 | $this_plugin = self::get_addon( $plugin_slug ); |
@@ -619,6 +624,9 @@ discard block |
||
| 619 | 624 | return $this_plugin; |
| 620 | 625 | } |
| 621 | 626 | |
| 627 | + /** |
|
| 628 | + * @param string $action |
|
| 629 | + */ |
|
| 622 | 630 | public function send_mothership_request( $action ) { |
| 623 | 631 | $api_params = array( |
| 624 | 632 | 'edd_action' => $action, |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | } else { |
| 75 | 75 | foreach ( $addons as $k => $addon ) { |
| 76 | 76 | if ( empty( $addon['excerpt'] ) && $k !== 'error' ) { |
| 77 | - unset( $addons[ $k ] ); |
|
| 77 | + unset( $addons[$k] ); |
|
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 | } |
@@ -335,16 +335,16 @@ discard block |
||
| 335 | 335 | continue; |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | - $wp_plugin = isset( $wp_plugins[ $folder ] ) ? $wp_plugins[ $folder ] : array(); |
|
| 338 | + $wp_plugin = isset( $wp_plugins[$folder] ) ? $wp_plugins[$folder] : array(); |
|
| 339 | 339 | $wp_version = isset( $wp_plugin['Version'] ) ? $wp_plugin['Version'] : '1.0'; |
| 340 | 340 | |
| 341 | 341 | if ( version_compare( $wp_version, $plugin->new_version, '<' ) ) { |
| 342 | 342 | $slug = explode( '/', $folder ); |
| 343 | 343 | $plugin->slug = $slug[0]; |
| 344 | - $transient->response[ $folder ] = $plugin; |
|
| 344 | + $transient->response[$folder] = $plugin; |
|
| 345 | 345 | } |
| 346 | 346 | |
| 347 | - $transient->checked[ $folder ] = $wp_version; |
|
| 347 | + $transient->checked[$folder] = $wp_version; |
|
| 348 | 348 | |
| 349 | 349 | } |
| 350 | 350 | |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | |
| 368 | 368 | $all_plugins = get_plugins(); |
| 369 | 369 | |
| 370 | - return isset( $all_plugins[ $plugin ] ); |
|
| 370 | + return isset( $all_plugins[$plugin] ); |
|
| 371 | 371 | } |
| 372 | 372 | |
| 373 | 373 | /** |
@@ -406,13 +406,13 @@ discard block |
||
| 406 | 406 | } |
| 407 | 407 | |
| 408 | 408 | $download_id = isset( $plugin['id'] ) ? $plugin['id'] : 0; |
| 409 | - if ( ! empty( $download_id ) && ! isset( $version_info[ $download_id ]['package'] ) ) { |
|
| 409 | + if ( ! empty( $download_id ) && ! isset( $version_info[$download_id]['package'] ) ) { |
|
| 410 | 410 | // if this addon is using its own license, get the update url |
| 411 | 411 | $addon_info = $api->get_api_info(); |
| 412 | 412 | |
| 413 | - $version_info[ $download_id ] = $addon_info[ $download_id ]; |
|
| 413 | + $version_info[$download_id] = $addon_info[$download_id]; |
|
| 414 | 414 | if ( isset( $addon_info['error'] ) ) { |
| 415 | - $version_info[ $download_id ]['error'] = array( |
|
| 415 | + $version_info[$download_id]['error'] = array( |
|
| 416 | 416 | 'message' => $addon_info['error']['message'], |
| 417 | 417 | 'code' => $addon_info['error']['code'], |
| 418 | 418 | ); |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | * @return array |
| 432 | 432 | */ |
| 433 | 433 | public static function install_link( $plugin ) { |
| 434 | - $link = array(); |
|
| 434 | + $link = array(); |
|
| 435 | 435 | $addons = self::get_api_addons(); |
| 436 | 436 | self::prepare_addons( $addons ); |
| 437 | 437 | |
@@ -482,8 +482,8 @@ discard block |
||
| 482 | 482 | return $addon; |
| 483 | 483 | } |
| 484 | 484 | } |
| 485 | - } elseif ( isset( $addons[ $download_id ] ) ) { |
|
| 486 | - $plugin = $addons[ $download_id ]; |
|
| 485 | + } elseif ( isset( $addons[$download_id] ) ) { |
|
| 486 | + $plugin = $addons[$download_id]; |
|
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | return $plugin; |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | self::prepare_addon_link( $addon['link'] ); |
| 535 | 535 | |
| 536 | 536 | self::set_addon_status( $addon ); |
| 537 | - $addons[ $id ] = $addon; |
|
| 537 | + $addons[$id] = $addon; |
|
| 538 | 538 | } |
| 539 | 539 | } |
| 540 | 540 | |
@@ -552,7 +552,7 @@ discard block |
||
| 552 | 552 | 'utm_medium' => 'addons', |
| 553 | 553 | 'utm_campaign' => 'liteplugin', |
| 554 | 554 | ); |
| 555 | - $link = add_query_arg( $query_args, $link ); |
|
| 555 | + $link = add_query_arg( $query_args, $link ); |
|
| 556 | 556 | } |
| 557 | 557 | |
| 558 | 558 | /** |
@@ -1038,7 +1038,7 @@ discard block |
||
| 1038 | 1038 | * @since 4.08 |
| 1039 | 1039 | */ |
| 1040 | 1040 | public static function install_addon_api() { |
| 1041 | - $post_url = FrmAppHelper::get_param( 'file_url', '', 'request', 'sanitize_text_field' ); |
|
| 1041 | + $post_url = FrmAppHelper::get_param( 'file_url', '', 'request', 'sanitize_text_field' ); |
|
| 1042 | 1042 | $_POST['plugin'] = $post_url; // Set for later use. |
| 1043 | 1043 | |
| 1044 | 1044 | $error = esc_html__( 'Could not install an upgrade. Please download from formidableforms.com and install manually.', 'formidable' ); |