@@ -1892,7 +1892,7 @@ discard block |
||
| 1892 | 1892 | * |
| 1893 | 1893 | * @since 2.4.0 |
| 1894 | 1894 | * |
| 1895 | - * @return object The TGM_Plugin_Activation object. |
|
| 1895 | + * @return TGM_Plugin_Activation The TGM_Plugin_Activation object. |
|
| 1896 | 1896 | */ |
| 1897 | 1897 | public static function get_instance() { |
| 1898 | 1898 | if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) { |
@@ -2049,7 +2049,7 @@ discard block |
||
| 2049 | 2049 | * |
| 2050 | 2050 | * @since 2.5.0 |
| 2051 | 2051 | * |
| 2052 | - * @return array CSS classnames. |
|
| 2052 | + * @return string[] CSS classnames. |
|
| 2053 | 2053 | */ |
| 2054 | 2054 | public function get_table_classes() { |
| 2055 | 2055 | return array( 'widefat', 'fixed' ); |
@@ -1327,13 +1327,13 @@ |
||
| 1327 | 1327 | $key = preg_replace( '`[^A-Za-z0-9_-]`', '', $key ); |
| 1328 | 1328 | |
| 1329 | 1329 | /** |
| 1330 | - * Filter a sanitized key string. |
|
| 1331 | - * |
|
| 1332 | - * @since 3.0.0 |
|
| 1333 | - * |
|
| 1334 | - * @param string $key Sanitized key. |
|
| 1335 | - * @param string $raw_key The key prior to sanitization. |
|
| 1336 | - */ |
|
| 1330 | + * Filter a sanitized key string. |
|
| 1331 | + * |
|
| 1332 | + * @since 3.0.0 |
|
| 1333 | + * |
|
| 1334 | + * @param string $key Sanitized key. |
|
| 1335 | + * @param string $raw_key The key prior to sanitization. |
|
| 1336 | + */ |
|
| 1337 | 1337 | return apply_filters( 'tgmpa_sanitize_key', $key, $raw_key ); |
| 1338 | 1338 | } |
| 1339 | 1339 | |
@@ -971,7 +971,8 @@ discard block |
||
| 971 | 971 | if ( ! $automatic ) { |
| 972 | 972 | // Make sure message doesn't display again if bulk activation is performed |
| 973 | 973 | // immediately after a single activation. |
| 974 | - if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK. |
|
| 974 | + if ( ! isset( $_POST['action'] ) ) { |
|
| 975 | +// WPCS: CSRF OK. |
|
| 975 | 976 | echo '<div id="message" class="updated"><p>', esc_html( $this->strings['activated_successfully'] ), ' <strong>', esc_html( $this->plugins[ $slug ]['name'] ), '.</strong></p></div>'; |
| 976 | 977 | } |
| 977 | 978 | } else { |
@@ -992,7 +993,8 @@ discard block |
||
| 992 | 993 | if ( ! $automatic ) { |
| 993 | 994 | // Make sure message doesn't display again if bulk activation is performed |
| 994 | 995 | // immediately after a single activation. |
| 995 | - if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK. |
|
| 996 | + if ( ! isset( $_POST['action'] ) ) { |
|
| 997 | +// WPCS: CSRF OK. |
|
| 996 | 998 | echo '<div id="message" class="error"><p>', |
| 997 | 999 | sprintf( |
| 998 | 1000 | esc_html( $this->strings['plugin_needs_higher_version'] ), |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | */ |
| 256 | 256 | public function __construct() { |
| 257 | 257 | // Set the current WordPress version. |
| 258 | - $this->wp_version = $GLOBALS['wp_version']; |
|
| 258 | + $this->wp_version = $GLOBALS[ 'wp_version' ]; |
|
| 259 | 259 | |
| 260 | 260 | // Announce that the class is ready, and pass the object (for advanced use). |
| 261 | 261 | do_action_ref_array( 'tgmpa_init', array( $this ) ); |
@@ -442,15 +442,15 @@ discard block |
||
| 442 | 442 | public function add_plugin_action_link_filters() { |
| 443 | 443 | foreach ( $this->plugins as $slug => $plugin ) { |
| 444 | 444 | if ( false === $this->can_plugin_activate( $slug ) ) { |
| 445 | - add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_activate' ), 20 ); |
|
| 445 | + add_filter( 'plugin_action_links_'.$plugin[ 'file_path' ], array( $this, 'filter_plugin_action_links_activate' ), 20 ); |
|
| 446 | 446 | } |
| 447 | 447 | |
| 448 | - if ( true === $plugin['force_activation'] ) { |
|
| 449 | - add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_deactivate' ), 20 ); |
|
| 448 | + if ( true === $plugin[ 'force_activation' ] ) { |
|
| 449 | + add_filter( 'plugin_action_links_'.$plugin[ 'file_path' ], array( $this, 'filter_plugin_action_links_deactivate' ), 20 ); |
|
| 450 | 450 | } |
| 451 | 451 | |
| 452 | 452 | if ( false !== $this->does_plugin_require_update( $slug ) ) { |
| 453 | - add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_update' ), 20 ); |
|
| 453 | + add_filter( 'plugin_action_links_'.$plugin[ 'file_path' ], array( $this, 'filter_plugin_action_links_update' ), 20 ); |
|
| 454 | 454 | } |
| 455 | 455 | } |
| 456 | 456 | } |
@@ -465,7 +465,7 @@ discard block |
||
| 465 | 465 | * @return array |
| 466 | 466 | */ |
| 467 | 467 | public function filter_plugin_action_links_activate( $actions ) { |
| 468 | - unset( $actions['activate'] ); |
|
| 468 | + unset( $actions[ 'activate' ] ); |
|
| 469 | 469 | |
| 470 | 470 | return $actions; |
| 471 | 471 | } |
@@ -479,7 +479,7 @@ discard block |
||
| 479 | 479 | * @return array |
| 480 | 480 | */ |
| 481 | 481 | public function filter_plugin_action_links_deactivate( $actions ) { |
| 482 | - unset( $actions['deactivate'] ); |
|
| 482 | + unset( $actions[ 'deactivate' ] ); |
|
| 483 | 483 | |
| 484 | 484 | return $actions; |
| 485 | 485 | } |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | * @return array |
| 495 | 495 | */ |
| 496 | 496 | public function filter_plugin_action_links_update( $actions ) { |
| 497 | - $actions['update'] = sprintf( |
|
| 497 | + $actions[ 'update' ] = sprintf( |
|
| 498 | 498 | '<a href="%1$s" title="%2$s" class="edit">%3$s</a>', |
| 499 | 499 | esc_url( $this->get_tgmpa_status_url( 'update' ) ), |
| 500 | 500 | esc_attr__( 'This plugin needs to be updated to be compatible with your theme.', 'tgmpa' ), |
@@ -532,9 +532,9 @@ discard block |
||
| 532 | 532 | return; |
| 533 | 533 | } |
| 534 | 534 | |
| 535 | - if ( isset( $_REQUEST['tab'] ) && 'plugin-information' === $_REQUEST['tab'] ) { |
|
| 535 | + if ( isset( $_REQUEST[ 'tab' ] ) && 'plugin-information' === $_REQUEST[ 'tab' ] ) { |
|
| 536 | 536 | // Needed for install_plugin_information(). |
| 537 | - require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; |
|
| 537 | + require_once ABSPATH.'wp-admin/includes/plugin-install.php'; |
|
| 538 | 538 | |
| 539 | 539 | wp_enqueue_style( 'plugin-install' ); |
| 540 | 540 | |
@@ -562,7 +562,7 @@ discard block |
||
| 562 | 562 | * @since 2.1.0 |
| 563 | 563 | */ |
| 564 | 564 | public function thickbox() { |
| 565 | - if ( ! get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) ) { |
|
| 565 | + if ( ! get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_'.$this->id, true ) ) { |
|
| 566 | 566 | add_thickbox(); |
| 567 | 567 | } |
| 568 | 568 | } |
@@ -591,11 +591,11 @@ discard block |
||
| 591 | 591 | $args = apply_filters( |
| 592 | 592 | 'tgmpa_admin_menu_args', |
| 593 | 593 | array( |
| 594 | - 'parent_slug' => $this->parent_slug, // Parent Menu slug. |
|
| 595 | - 'page_title' => $this->strings['page_title'], // Page title. |
|
| 596 | - 'menu_title' => $this->strings['menu_title'], // Menu title. |
|
| 597 | - 'capability' => $this->capability, // Capability. |
|
| 598 | - 'menu_slug' => $this->menu, // Menu slug. |
|
| 594 | + 'parent_slug' => $this->parent_slug, // Parent Menu slug. |
|
| 595 | + 'page_title' => $this->strings[ 'page_title' ], // Page title. |
|
| 596 | + 'menu_title' => $this->strings[ 'menu_title' ], // Menu title. |
|
| 597 | + 'capability' => $this->capability, // Capability. |
|
| 598 | + 'menu_slug' => $this->menu, // Menu slug. |
|
| 599 | 599 | 'function' => array( $this, 'install_plugins_page' ), // Callback. |
| 600 | 600 | ) |
| 601 | 601 | ); |
@@ -616,9 +616,9 @@ discard block |
||
| 616 | 616 | } |
| 617 | 617 | |
| 618 | 618 | if ( 'themes.php' === $this->parent_slug ) { |
| 619 | - $this->page_hook = call_user_func( 'add_theme_page', $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] ); |
|
| 619 | + $this->page_hook = call_user_func( 'add_theme_page', $args[ 'page_title' ], $args[ 'menu_title' ], $args[ 'capability' ], $args[ 'menu_slug' ], $args[ 'function' ] ); |
|
| 620 | 620 | } else { |
| 621 | - $this->page_hook = call_user_func( 'add_submenu_page', $args['parent_slug'], $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] ); |
|
| 621 | + $this->page_hook = call_user_func( 'add_submenu_page', $args[ 'parent_slug' ], $args[ 'page_title' ], $args[ 'menu_title' ], $args[ 'capability' ], $args[ 'menu_slug' ], $args[ 'function' ] ); |
|
| 622 | 622 | } |
| 623 | 623 | } |
| 624 | 624 | |
@@ -687,37 +687,37 @@ discard block |
||
| 687 | 687 | * @return boolean True on success, false on failure. |
| 688 | 688 | */ |
| 689 | 689 | protected function do_plugin_install() { |
| 690 | - if ( empty( $_GET['plugin'] ) ) { |
|
| 690 | + if ( empty( $_GET[ 'plugin' ] ) ) { |
|
| 691 | 691 | return false; |
| 692 | 692 | } |
| 693 | 693 | |
| 694 | 694 | // All plugin information will be stored in an array for processing. |
| 695 | - $slug = $this->sanitize_key( urldecode( $_GET['plugin'] ) ); |
|
| 695 | + $slug = $this->sanitize_key( urldecode( $_GET[ 'plugin' ] ) ); |
|
| 696 | 696 | |
| 697 | 697 | if ( ! isset( $this->plugins[ $slug ] ) ) { |
| 698 | 698 | return false; |
| 699 | 699 | } |
| 700 | 700 | |
| 701 | 701 | // Was an install or upgrade action link clicked? |
| 702 | - if ( ( isset( $_GET['tgmpa-install'] ) && 'install-plugin' === $_GET['tgmpa-install'] ) || ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) ) { |
|
| 702 | + if ( ( isset( $_GET[ 'tgmpa-install' ] ) && 'install-plugin' === $_GET[ 'tgmpa-install' ] ) || ( isset( $_GET[ 'tgmpa-update' ] ) && 'update-plugin' === $_GET[ 'tgmpa-update' ] ) ) { |
|
| 703 | 703 | |
| 704 | 704 | $install_type = 'install'; |
| 705 | - if ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) { |
|
| 705 | + if ( isset( $_GET[ 'tgmpa-update' ] ) && 'update-plugin' === $_GET[ 'tgmpa-update' ] ) { |
|
| 706 | 706 | $install_type = 'update'; |
| 707 | 707 | } |
| 708 | 708 | |
| 709 | - check_admin_referer( 'tgmpa-' . $install_type, 'tgmpa-nonce' ); |
|
| 709 | + check_admin_referer( 'tgmpa-'.$install_type, 'tgmpa-nonce' ); |
|
| 710 | 710 | |
| 711 | 711 | // Pass necessary information via URL if WP_Filesystem is needed. |
| 712 | 712 | $url = wp_nonce_url( |
| 713 | 713 | add_query_arg( |
| 714 | 714 | array( |
| 715 | 715 | 'plugin' => urlencode( $slug ), |
| 716 | - 'tgmpa-' . $install_type => $install_type . '-plugin', |
|
| 716 | + 'tgmpa-'.$install_type => $install_type.'-plugin', |
|
| 717 | 717 | ), |
| 718 | 718 | $this->get_tgmpa_url() |
| 719 | 719 | ), |
| 720 | - 'tgmpa-' . $install_type, |
|
| 720 | + 'tgmpa-'.$install_type, |
|
| 721 | 721 | 'tgmpa-nonce' |
| 722 | 722 | ); |
| 723 | 723 | |
@@ -736,29 +736,29 @@ discard block |
||
| 736 | 736 | |
| 737 | 737 | // Prep variables for Plugin_Installer_Skin class. |
| 738 | 738 | $extra = array(); |
| 739 | - $extra['slug'] = $slug; // Needed for potentially renaming of directory name. |
|
| 739 | + $extra[ 'slug' ] = $slug; // Needed for potentially renaming of directory name. |
|
| 740 | 740 | $source = $this->get_download_url( $slug ); |
| 741 | - $api = ( 'repo' === $this->plugins[ $slug ]['source_type'] ) ? $this->get_plugins_api( $slug ) : null; |
|
| 741 | + $api = ( 'repo' === $this->plugins[ $slug ][ 'source_type' ] ) ? $this->get_plugins_api( $slug ) : null; |
|
| 742 | 742 | $api = ( false !== $api ) ? $api : null; |
| 743 | 743 | |
| 744 | 744 | $url = add_query_arg( |
| 745 | 745 | array( |
| 746 | - 'action' => $install_type . '-plugin', |
|
| 746 | + 'action' => $install_type.'-plugin', |
|
| 747 | 747 | 'plugin' => urlencode( $slug ), |
| 748 | 748 | ), |
| 749 | 749 | 'update.php' |
| 750 | 750 | ); |
| 751 | 751 | |
| 752 | 752 | if ( ! class_exists( 'Plugin_Upgrader', false ) ) { |
| 753 | - require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; |
|
| 753 | + require_once ABSPATH.'wp-admin/includes/class-wp-upgrader.php'; |
|
| 754 | 754 | } |
| 755 | 755 | |
| 756 | - $title = ( 'update' === $install_type ) ? $this->strings['updating'] : $this->strings['installing']; |
|
| 756 | + $title = ( 'update' === $install_type ) ? $this->strings[ 'updating' ] : $this->strings[ 'installing' ]; |
|
| 757 | 757 | $skin_args = array( |
| 758 | - 'type' => ( 'bundled' !== $this->plugins[ $slug ]['source_type'] ) ? 'web' : 'upload', |
|
| 759 | - 'title' => sprintf( $title, $this->plugins[ $slug ]['name'] ), |
|
| 758 | + 'type' => ( 'bundled' !== $this->plugins[ $slug ][ 'source_type' ] ) ? 'web' : 'upload', |
|
| 759 | + 'title' => sprintf( $title, $this->plugins[ $slug ][ 'name' ] ), |
|
| 760 | 760 | 'url' => esc_url_raw( $url ), |
| 761 | - 'nonce' => $install_type . '-plugin_' . $slug, |
|
| 761 | + 'nonce' => $install_type.'-plugin_'.$slug, |
|
| 762 | 762 | 'plugin' => '', |
| 763 | 763 | 'api' => $api, |
| 764 | 764 | 'extra' => $extra, |
@@ -766,7 +766,7 @@ discard block |
||
| 766 | 766 | unset( $title ); |
| 767 | 767 | |
| 768 | 768 | if ( 'update' === $install_type ) { |
| 769 | - $skin_args['plugin'] = $this->plugins[ $slug ]['file_path']; |
|
| 769 | + $skin_args[ 'plugin' ] = $this->plugins[ $slug ][ 'file_path' ]; |
|
| 770 | 770 | $skin = new Plugin_Upgrader_Skin( $skin_args ); |
| 771 | 771 | } else { |
| 772 | 772 | $skin = new Plugin_Installer_Skin( $skin_args ); |
@@ -781,10 +781,10 @@ discard block |
||
| 781 | 781 | if ( 'update' === $install_type ) { |
| 782 | 782 | // Inject our info into the update transient. |
| 783 | 783 | $to_inject = array( $slug => $this->plugins[ $slug ] ); |
| 784 | - $to_inject[ $slug ]['source'] = $source; |
|
| 784 | + $to_inject[ $slug ][ 'source' ] = $source; |
|
| 785 | 785 | $this->inject_update_info( $to_inject ); |
| 786 | 786 | |
| 787 | - $upgrader->upgrade( $this->plugins[ $slug ]['file_path'] ); |
|
| 787 | + $upgrader->upgrade( $this->plugins[ $slug ][ 'file_path' ] ); |
|
| 788 | 788 | } else { |
| 789 | 789 | $upgrader->install( $source ); |
| 790 | 790 | } |
@@ -807,18 +807,18 @@ discard block |
||
| 807 | 807 | |
| 808 | 808 | // Display message based on if all plugins are now active or not. |
| 809 | 809 | if ( $this->is_tgmpa_complete() ) { |
| 810 | - echo '<p>', sprintf( esc_html( $this->strings['complete'] ), '<a href="' . esc_url( self_admin_url() ) . '">' . esc_html__( 'Return to the Dashboard', 'tgmpa' ) . '</a>' ), '</p>'; |
|
| 810 | + echo '<p>', sprintf( esc_html( $this->strings[ 'complete' ] ), '<a href="'.esc_url( self_admin_url() ).'">'.esc_html__( 'Return to the Dashboard', 'tgmpa' ).'</a>' ), '</p>'; |
|
| 811 | 811 | echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>'; |
| 812 | 812 | } else { |
| 813 | - echo '<p><a href="', esc_url( $this->get_tgmpa_url() ), '" target="_parent">', esc_html( $this->strings['return'] ), '</a></p>'; |
|
| 813 | + echo '<p><a href="', esc_url( $this->get_tgmpa_url() ), '" target="_parent">', esc_html( $this->strings[ 'return' ] ), '</a></p>'; |
|
| 814 | 814 | } |
| 815 | 815 | |
| 816 | 816 | return true; |
| 817 | - } elseif ( isset( $this->plugins[ $slug ]['file_path'], $_GET['tgmpa-activate'] ) && 'activate-plugin' === $_GET['tgmpa-activate'] ) { |
|
| 817 | + } elseif ( isset( $this->plugins[ $slug ][ 'file_path' ], $_GET[ 'tgmpa-activate' ] ) && 'activate-plugin' === $_GET[ 'tgmpa-activate' ] ) { |
|
| 818 | 818 | // Activate action link was clicked. |
| 819 | 819 | check_admin_referer( 'tgmpa-activate', 'tgmpa-nonce' ); |
| 820 | 820 | |
| 821 | - if ( false === $this->activate_single_plugin( $this->plugins[ $slug ]['file_path'], $slug ) ) { |
|
| 821 | + if ( false === $this->activate_single_plugin( $this->plugins[ $slug ][ 'file_path' ], $slug ) ) { |
|
| 822 | 822 | return true; // Finish execution of the function early as we encountered an error. |
| 823 | 823 | } |
| 824 | 824 | } |
@@ -841,7 +841,7 @@ discard block |
||
| 841 | 841 | } |
| 842 | 842 | |
| 843 | 843 | foreach ( $plugins as $slug => $plugin ) { |
| 844 | - $file_path = $plugin['file_path']; |
|
| 844 | + $file_path = $plugin[ 'file_path' ]; |
|
| 845 | 845 | |
| 846 | 846 | if ( empty( $repo_updates->response[ $file_path ] ) ) { |
| 847 | 847 | $repo_updates->response[ $file_path ] = new stdClass; |
@@ -850,10 +850,10 @@ discard block |
||
| 850 | 850 | // We only really need to set package, but let's do all we can in case WP changes something. |
| 851 | 851 | $repo_updates->response[ $file_path ]->slug = $slug; |
| 852 | 852 | $repo_updates->response[ $file_path ]->plugin = $file_path; |
| 853 | - $repo_updates->response[ $file_path ]->new_version = $plugin['version']; |
|
| 854 | - $repo_updates->response[ $file_path ]->package = $plugin['source']; |
|
| 855 | - if ( empty( $repo_updates->response[ $file_path ]->url ) && ! empty( $plugin['external_url'] ) ) { |
|
| 856 | - $repo_updates->response[ $file_path ]->url = $plugin['external_url']; |
|
| 853 | + $repo_updates->response[ $file_path ]->new_version = $plugin[ 'version' ]; |
|
| 854 | + $repo_updates->response[ $file_path ]->package = $plugin[ 'source' ]; |
|
| 855 | + if ( empty( $repo_updates->response[ $file_path ]->url ) && ! empty( $plugin[ 'external_url' ] ) ) { |
|
| 856 | + $repo_updates->response[ $file_path ]->url = $plugin[ 'external_url' ]; |
|
| 857 | 857 | } |
| 858 | 858 | } |
| 859 | 859 | |
@@ -877,13 +877,13 @@ discard block |
||
| 877 | 877 | * @return string $source |
| 878 | 878 | */ |
| 879 | 879 | public function maybe_adjust_source_dir( $source, $remote_source, $upgrader ) { |
| 880 | - if ( ! $this->is_tgmpa_page() || ! is_object( $GLOBALS['wp_filesystem'] ) ) { |
|
| 880 | + if ( ! $this->is_tgmpa_page() || ! is_object( $GLOBALS[ 'wp_filesystem' ] ) ) { |
|
| 881 | 881 | return $source; |
| 882 | 882 | } |
| 883 | 883 | |
| 884 | 884 | // Check for single file plugins. |
| 885 | - $source_files = array_keys( $GLOBALS['wp_filesystem']->dirlist( $remote_source ) ); |
|
| 886 | - if ( 1 === count( $source_files ) && false === $GLOBALS['wp_filesystem']->is_dir( $source ) ) { |
|
| 885 | + $source_files = array_keys( $GLOBALS[ 'wp_filesystem' ]->dirlist( $remote_source ) ); |
|
| 886 | + if ( 1 === count( $source_files ) && false === $GLOBALS[ 'wp_filesystem' ]->is_dir( $source ) ) { |
|
| 887 | 887 | return $source; |
| 888 | 888 | } |
| 889 | 889 | |
@@ -891,12 +891,12 @@ discard block |
||
| 891 | 891 | $desired_slug = ''; |
| 892 | 892 | |
| 893 | 893 | // Figure out what the slug is supposed to be. |
| 894 | - if ( false === $upgrader->bulk && ! empty( $upgrader->skin->options['extra']['slug'] ) ) { |
|
| 895 | - $desired_slug = $upgrader->skin->options['extra']['slug']; |
|
| 894 | + if ( false === $upgrader->bulk && ! empty( $upgrader->skin->options[ 'extra' ][ 'slug' ] ) ) { |
|
| 895 | + $desired_slug = $upgrader->skin->options[ 'extra' ][ 'slug' ]; |
|
| 896 | 896 | } else { |
| 897 | 897 | // Bulk installer contains less info, so fall back on the info registered here. |
| 898 | 898 | foreach ( $this->plugins as $slug => $plugin ) { |
| 899 | - if ( ! empty( $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) && $plugin['name'] === $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) { |
|
| 899 | + if ( ! empty( $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) && $plugin[ 'name' ] === $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) { |
|
| 900 | 900 | $desired_slug = $slug; |
| 901 | 901 | break; |
| 902 | 902 | } |
@@ -909,15 +909,15 @@ discard block |
||
| 909 | 909 | |
| 910 | 910 | if ( ! empty( $subdir_name ) && $subdir_name !== $desired_slug ) { |
| 911 | 911 | $from = untrailingslashit( $source ); |
| 912 | - $to = trailingslashit( $remote_source ) . $desired_slug; |
|
| 912 | + $to = trailingslashit( $remote_source ).$desired_slug; |
|
| 913 | 913 | |
| 914 | - if ( true === $GLOBALS['wp_filesystem']->move( $from, $to ) ) { |
|
| 914 | + if ( true === $GLOBALS[ 'wp_filesystem' ]->move( $from, $to ) ) { |
|
| 915 | 915 | return trailingslashit( $to ); |
| 916 | 916 | } else { |
| 917 | - return new WP_Error( 'rename_failed', esc_html__( 'The remote plugin package does not contain a folder with the desired slug and renaming did not work.', 'tgmpa' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'tgmpa' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) ); |
|
| 917 | + return new WP_Error( 'rename_failed', esc_html__( 'The remote plugin package does not contain a folder with the desired slug and renaming did not work.', 'tgmpa' ).' '.esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'tgmpa' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) ); |
|
| 918 | 918 | } |
| 919 | 919 | } elseif ( empty( $subdir_name ) ) { |
| 920 | - return new WP_Error( 'packaged_wrong', esc_html__( 'The remote plugin package consists of more than one file, but the files are not packaged in a folder.', 'tgmpa' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'tgmpa' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) ); |
|
| 920 | + return new WP_Error( 'packaged_wrong', esc_html__( 'The remote plugin package consists of more than one file, but the files are not packaged in a folder.', 'tgmpa' ).' '.esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'tgmpa' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) ); |
|
| 921 | 921 | } |
| 922 | 922 | } |
| 923 | 923 | |
@@ -941,19 +941,19 @@ discard block |
||
| 941 | 941 | |
| 942 | 942 | if ( is_wp_error( $activate ) ) { |
| 943 | 943 | echo '<div id="message" class="error"><p>', wp_kses_post( $activate->get_error_message() ), '</p></div>', |
| 944 | - '<p><a href="', esc_url( $this->get_tgmpa_url() ), '" target="_parent">', esc_html( $this->strings['return'] ), '</a></p>'; |
|
| 944 | + '<p><a href="', esc_url( $this->get_tgmpa_url() ), '" target="_parent">', esc_html( $this->strings[ 'return' ] ), '</a></p>'; |
|
| 945 | 945 | |
| 946 | 946 | return false; // End it here if there is an error with activation. |
| 947 | 947 | } else { |
| 948 | 948 | if ( ! $automatic ) { |
| 949 | 949 | // Make sure message doesn't display again if bulk activation is performed |
| 950 | 950 | // immediately after a single activation. |
| 951 | - if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK. |
|
| 952 | - echo '<div id="message" class="updated"><p>', esc_html( $this->strings['activated_successfully'] ), ' <strong>', esc_html( $this->plugins[ $slug ]['name'] ), '.</strong></p></div>'; |
|
| 951 | + if ( ! isset( $_POST[ 'action' ] ) ) { // WPCS: CSRF OK. |
|
| 952 | + echo '<div id="message" class="updated"><p>', esc_html( $this->strings[ 'activated_successfully' ] ), ' <strong>', esc_html( $this->plugins[ $slug ][ 'name' ] ), '.</strong></p></div>'; |
|
| 953 | 953 | } |
| 954 | 954 | } else { |
| 955 | 955 | // Simpler message layout for use on the plugin install page. |
| 956 | - echo '<p>', esc_html( $this->strings['plugin_activated'] ), '</p>'; |
|
| 956 | + echo '<p>', esc_html( $this->strings[ 'plugin_activated' ] ), '</p>'; |
|
| 957 | 957 | } |
| 958 | 958 | } |
| 959 | 959 | } elseif ( $this->is_plugin_active( $slug ) ) { |
@@ -961,25 +961,25 @@ discard block |
||
| 961 | 961 | // on the plugin install page. |
| 962 | 962 | echo '<div id="message" class="error"><p>', |
| 963 | 963 | sprintf( |
| 964 | - esc_html( $this->strings['plugin_already_active'] ), |
|
| 965 | - '<strong>' . esc_html( $this->plugins[ $slug ]['name'] ) . '</strong>' |
|
| 964 | + esc_html( $this->strings[ 'plugin_already_active' ] ), |
|
| 965 | + '<strong>'.esc_html( $this->plugins[ $slug ][ 'name' ] ).'</strong>' |
|
| 966 | 966 | ), |
| 967 | 967 | '</p></div>'; |
| 968 | 968 | } elseif ( $this->does_plugin_require_update( $slug ) ) { |
| 969 | 969 | if ( ! $automatic ) { |
| 970 | 970 | // Make sure message doesn't display again if bulk activation is performed |
| 971 | 971 | // immediately after a single activation. |
| 972 | - if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK. |
|
| 972 | + if ( ! isset( $_POST[ 'action' ] ) ) { // WPCS: CSRF OK. |
|
| 973 | 973 | echo '<div id="message" class="error"><p>', |
| 974 | 974 | sprintf( |
| 975 | - esc_html( $this->strings['plugin_needs_higher_version'] ), |
|
| 976 | - '<strong>' . esc_html( $this->plugins[ $slug ]['name'] ) . '</strong>' |
|
| 975 | + esc_html( $this->strings[ 'plugin_needs_higher_version' ] ), |
|
| 976 | + '<strong>'.esc_html( $this->plugins[ $slug ][ 'name' ] ).'</strong>' |
|
| 977 | 977 | ), |
| 978 | 978 | '</p></div>'; |
| 979 | 979 | } |
| 980 | 980 | } else { |
| 981 | 981 | // Simpler message layout for use on the plugin install page. |
| 982 | - echo '<p>', sprintf( esc_html( $this->strings['plugin_needs_higher_version'] ), esc_html( $this->plugins[ $slug ]['name'] ) ), '</p>'; |
|
| 982 | + echo '<p>', sprintf( esc_html( $this->strings[ 'plugin_needs_higher_version' ] ), esc_html( $this->plugins[ $slug ][ 'name' ] ) ), '</p>'; |
|
| 983 | 983 | } |
| 984 | 984 | } |
| 985 | 985 | |
@@ -1003,7 +1003,7 @@ discard block |
||
| 1003 | 1003 | */ |
| 1004 | 1004 | public function notices() { |
| 1005 | 1005 | // Remove nag on the install page / Return early if the nag message has been dismissed or user < author. |
| 1006 | - if ( $this->is_tgmpa_page() || get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) || ! current_user_can( apply_filters( 'tgmpa_show_admin_notice_capability', 'publish_posts' ) ) ) { |
|
| 1006 | + if ( $this->is_tgmpa_page() || get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_'.$this->id, true ) || ! current_user_can( apply_filters( 'tgmpa_show_admin_notice_capability', 'publish_posts' ) ) ) { |
|
| 1007 | 1007 | return; |
| 1008 | 1008 | } |
| 1009 | 1009 | |
@@ -1025,13 +1025,13 @@ discard block |
||
| 1025 | 1025 | if ( current_user_can( 'install_plugins' ) ) { |
| 1026 | 1026 | $install_link_count++; |
| 1027 | 1027 | |
| 1028 | - if ( true === $plugin['required'] ) { |
|
| 1029 | - $message['notice_can_install_required'][] = $slug; |
|
| 1028 | + if ( true === $plugin[ 'required' ] ) { |
|
| 1029 | + $message[ 'notice_can_install_required' ][ ] = $slug; |
|
| 1030 | 1030 | } else { |
| 1031 | - $message['notice_can_install_recommended'][] = $slug; |
|
| 1031 | + $message[ 'notice_can_install_recommended' ][ ] = $slug; |
|
| 1032 | 1032 | } |
| 1033 | 1033 | } |
| 1034 | - if ( true === $plugin['required'] ) { |
|
| 1034 | + if ( true === $plugin[ 'required' ] ) { |
|
| 1035 | 1035 | $total_required_action_count++; |
| 1036 | 1036 | } |
| 1037 | 1037 | } else { |
@@ -1039,13 +1039,13 @@ discard block |
||
| 1039 | 1039 | if ( current_user_can( 'activate_plugins' ) ) { |
| 1040 | 1040 | $activate_link_count++; |
| 1041 | 1041 | |
| 1042 | - if ( true === $plugin['required'] ) { |
|
| 1043 | - $message['notice_can_activate_required'][] = $slug; |
|
| 1042 | + if ( true === $plugin[ 'required' ] ) { |
|
| 1043 | + $message[ 'notice_can_activate_required' ][ ] = $slug; |
|
| 1044 | 1044 | } else { |
| 1045 | - $message['notice_can_activate_recommended'][] = $slug; |
|
| 1045 | + $message[ 'notice_can_activate_recommended' ][ ] = $slug; |
|
| 1046 | 1046 | } |
| 1047 | 1047 | } |
| 1048 | - if ( true === $plugin['required'] ) { |
|
| 1048 | + if ( true === $plugin[ 'required' ] ) { |
|
| 1049 | 1049 | $total_required_action_count++; |
| 1050 | 1050 | } |
| 1051 | 1051 | } |
@@ -1056,12 +1056,12 @@ discard block |
||
| 1056 | 1056 | $update_link_count++; |
| 1057 | 1057 | |
| 1058 | 1058 | if ( $this->does_plugin_require_update( $slug ) ) { |
| 1059 | - $message['notice_ask_to_update'][] = $slug; |
|
| 1059 | + $message[ 'notice_ask_to_update' ][ ] = $slug; |
|
| 1060 | 1060 | } elseif ( false !== $this->does_plugin_have_update( $slug ) ) { |
| 1061 | - $message['notice_ask_to_update_maybe'][] = $slug; |
|
| 1061 | + $message[ 'notice_ask_to_update_maybe' ][ ] = $slug; |
|
| 1062 | 1062 | } |
| 1063 | 1063 | } |
| 1064 | - if ( true === $plugin['required'] ) { |
|
| 1064 | + if ( true === $plugin[ 'required' ] ) { |
|
| 1065 | 1065 | $total_required_action_count++; |
| 1066 | 1066 | } |
| 1067 | 1067 | } |
@@ -1076,10 +1076,10 @@ discard block |
||
| 1076 | 1076 | |
| 1077 | 1077 | // As add_settings_error() wraps the final message in a <p> and as the final message can't be |
| 1078 | 1078 | // filtered, using <p>'s in our html would render invalid html output. |
| 1079 | - $line_template = '<span style="display: block; margin: 0.5em 0.5em 0 0; clear: both;">%s</span>' . "\n"; |
|
| 1079 | + $line_template = '<span style="display: block; margin: 0.5em 0.5em 0 0; clear: both;">%s</span>'."\n"; |
|
| 1080 | 1080 | |
| 1081 | 1081 | if ( ! current_user_can( 'activate_plugins' ) && ! current_user_can( 'install_plugins' ) && ! current_user_can( 'update_plugins' ) ) { |
| 1082 | - $rendered = esc_html__( $this->strings['notice_cannot_install_activate'] ) . ' ' . esc_html__( $this->strings['contact_admin'] ); |
|
| 1082 | + $rendered = esc_html__( $this->strings[ 'notice_cannot_install_activate' ] ).' '.esc_html__( $this->strings[ 'contact_admin' ] ); |
|
| 1083 | 1083 | $rendered .= $this->create_user_action_links_for_notice( 0, 0, 0, $line_template ); |
| 1084 | 1084 | } else { |
| 1085 | 1085 | |
@@ -1094,14 +1094,14 @@ discard block |
||
| 1094 | 1094 | |
| 1095 | 1095 | // Get the external info link for a plugin if one is available. |
| 1096 | 1096 | foreach ( $plugin_group as $plugin_slug ) { |
| 1097 | - $linked_plugins[] = $this->get_info_link( $plugin_slug ); |
|
| 1097 | + $linked_plugins[ ] = $this->get_info_link( $plugin_slug ); |
|
| 1098 | 1098 | } |
| 1099 | 1099 | unset( $plugin_slug ); |
| 1100 | 1100 | |
| 1101 | 1101 | $count = count( $plugin_group ); |
| 1102 | 1102 | $linked_plugins = array_map( array( 'TGMPA_Utils', 'wrap_in_em' ), $linked_plugins ); |
| 1103 | 1103 | $last_plugin = array_pop( $linked_plugins ); // Pop off last name to prep for readability. |
| 1104 | - $imploded = empty( $linked_plugins ) ? $last_plugin : ( implode( ', ', $linked_plugins ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'tgmpa' ) . ' ' . $last_plugin ); |
|
| 1104 | + $imploded = empty( $linked_plugins ) ? $last_plugin : ( implode( ', ', $linked_plugins ).' '.esc_html_x( 'and', 'plugin A *and* plugin B', 'tgmpa' ).' '.$last_plugin ); |
|
| 1105 | 1105 | |
| 1106 | 1106 | $rendered .= sprintf( |
| 1107 | 1107 | $line_template, |
@@ -1123,7 +1123,7 @@ discard block |
||
| 1123 | 1123 | } |
| 1124 | 1124 | |
| 1125 | 1125 | // Admin options pages already output settings_errors, so this is to avoid duplication. |
| 1126 | - if ( 'options-general' !== $GLOBALS['current_screen']->parent_base ) { |
|
| 1126 | + if ( 'options-general' !== $GLOBALS[ 'current_screen' ]->parent_base ) { |
|
| 1127 | 1127 | $this->display_settings_errors(); |
| 1128 | 1128 | } |
| 1129 | 1129 | } |
@@ -1145,32 +1145,32 @@ discard block |
||
| 1145 | 1145 | 'install' => '', |
| 1146 | 1146 | 'update' => '', |
| 1147 | 1147 | 'activate' => '', |
| 1148 | - 'dismiss' => $this->dismissable ? '<a href="' . esc_url( wp_nonce_url( add_query_arg( 'tgmpa-dismiss', 'dismiss_admin_notices' ), 'tgmpa-dismiss-' . get_current_user_id() ) ) . '" class="dismiss-notice" target="_parent">' . esc_html( $this->strings['dismiss'] ) . '</a>' : '', |
|
| 1148 | + 'dismiss' => $this->dismissable ? '<a href="'.esc_url( wp_nonce_url( add_query_arg( 'tgmpa-dismiss', 'dismiss_admin_notices' ), 'tgmpa-dismiss-'.get_current_user_id() ) ).'" class="dismiss-notice" target="_parent">'.esc_html( $this->strings[ 'dismiss' ] ).'</a>' : '', |
|
| 1149 | 1149 | ); |
| 1150 | 1150 | |
| 1151 | 1151 | $link_template = '<a href="%2$s">%1$s</a>'; |
| 1152 | 1152 | |
| 1153 | 1153 | if ( current_user_can( 'install_plugins' ) ) { |
| 1154 | 1154 | if ( $install_count > 0 ) { |
| 1155 | - $action_links['install'] = sprintf( |
|
| 1155 | + $action_links[ 'install' ] = sprintf( |
|
| 1156 | 1156 | $link_template, |
| 1157 | - translate_nooped_plural( $this->strings['install_link'], $install_count, 'tgmpa' ), |
|
| 1157 | + translate_nooped_plural( $this->strings[ 'install_link' ], $install_count, 'tgmpa' ), |
|
| 1158 | 1158 | esc_url( $this->get_tgmpa_status_url( 'install' ) ) |
| 1159 | 1159 | ); |
| 1160 | 1160 | } |
| 1161 | 1161 | if ( $update_count > 0 ) { |
| 1162 | - $action_links['update'] = sprintf( |
|
| 1162 | + $action_links[ 'update' ] = sprintf( |
|
| 1163 | 1163 | $link_template, |
| 1164 | - translate_nooped_plural( $this->strings['update_link'], $update_count, 'tgmpa' ), |
|
| 1164 | + translate_nooped_plural( $this->strings[ 'update_link' ], $update_count, 'tgmpa' ), |
|
| 1165 | 1165 | esc_url( $this->get_tgmpa_status_url( 'update' ) ) |
| 1166 | 1166 | ); |
| 1167 | 1167 | } |
| 1168 | 1168 | } |
| 1169 | 1169 | |
| 1170 | 1170 | if ( current_user_can( 'activate_plugins' ) && $activate_count > 0 ) { |
| 1171 | - $action_links['activate'] = sprintf( |
|
| 1171 | + $action_links[ 'activate' ] = sprintf( |
|
| 1172 | 1172 | $link_template, |
| 1173 | - translate_nooped_plural( $this->strings['activate_link'], $activate_count, 'tgmpa' ), |
|
| 1173 | + translate_nooped_plural( $this->strings[ 'activate_link' ], $activate_count, 'tgmpa' ), |
|
| 1174 | 1174 | esc_url( $this->get_tgmpa_status_url( 'activate' ) ) |
| 1175 | 1175 | ); |
| 1176 | 1176 | } |
@@ -1198,8 +1198,8 @@ discard block |
||
| 1198 | 1198 | * @return string |
| 1199 | 1199 | */ |
| 1200 | 1200 | protected function get_admin_notice_class() { |
| 1201 | - if ( ! empty( $this->strings['nag_type'] ) ) { |
|
| 1202 | - return sanitize_html_class( strtolower( $this->strings['nag_type'] ) ); |
|
| 1201 | + if ( ! empty( $this->strings[ 'nag_type' ] ) ) { |
|
| 1202 | + return sanitize_html_class( strtolower( $this->strings[ 'nag_type' ] ) ); |
|
| 1203 | 1203 | } else { |
| 1204 | 1204 | if ( version_compare( $this->wp_version, '4.2', '>=' ) ) { |
| 1205 | 1205 | return 'notice-warning'; |
@@ -1222,7 +1222,7 @@ discard block |
||
| 1222 | 1222 | settings_errors( 'tgmpa' ); |
| 1223 | 1223 | |
| 1224 | 1224 | foreach ( (array) $wp_settings_errors as $key => $details ) { |
| 1225 | - if ( 'tgmpa' === $details['setting'] ) { |
|
| 1225 | + if ( 'tgmpa' === $details[ 'setting' ] ) { |
|
| 1226 | 1226 | unset( $wp_settings_errors[ $key ] ); |
| 1227 | 1227 | break; |
| 1228 | 1228 | } |
@@ -1237,8 +1237,8 @@ discard block |
||
| 1237 | 1237 | * @since 2.1.0 |
| 1238 | 1238 | */ |
| 1239 | 1239 | public function dismiss() { |
| 1240 | - if ( isset( $_GET['tgmpa-dismiss'] ) && check_admin_referer( 'tgmpa-dismis-' . get_current_user_id() ) ) { |
|
| 1241 | - update_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, 1 ); |
|
| 1240 | + if ( isset( $_GET[ 'tgmpa-dismiss' ] ) && check_admin_referer( 'tgmpa-dismis-'.get_current_user_id() ) ) { |
|
| 1241 | + update_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_'.$this->id, 1 ); |
|
| 1242 | 1242 | } |
| 1243 | 1243 | } |
| 1244 | 1244 | |
@@ -1254,54 +1254,54 @@ discard block |
||
| 1254 | 1254 | * @return null Return early if incorrect argument. |
| 1255 | 1255 | */ |
| 1256 | 1256 | public function register( $plugin ) { |
| 1257 | - if ( empty( $plugin['slug'] ) || empty( $plugin['name'] ) ) { |
|
| 1257 | + if ( empty( $plugin[ 'slug' ] ) || empty( $plugin[ 'name' ] ) ) { |
|
| 1258 | 1258 | return; |
| 1259 | 1259 | } |
| 1260 | 1260 | |
| 1261 | - if ( empty( $plugin['slug'] ) || ! is_string( $plugin['slug'] ) || isset( $this->plugins[ $plugin['slug'] ] ) ) { |
|
| 1261 | + if ( empty( $plugin[ 'slug' ] ) || ! is_string( $plugin[ 'slug' ] ) || isset( $this->plugins[ $plugin[ 'slug' ] ] ) ) { |
|
| 1262 | 1262 | return; |
| 1263 | 1263 | } |
| 1264 | 1264 | |
| 1265 | 1265 | $defaults = array( |
| 1266 | - 'name' => '', // String |
|
| 1267 | - 'slug' => '', // String |
|
| 1268 | - 'source' => 'repo', // String |
|
| 1269 | - 'required' => false, // Boolean |
|
| 1270 | - 'version' => '', // String |
|
| 1271 | - 'force_activation' => false, // Boolean |
|
| 1272 | - 'force_deactivation' => false, // Boolean |
|
| 1273 | - 'external_url' => '', // String |
|
| 1274 | - 'is_callable' => '', // String|Array. |
|
| 1266 | + 'name' => '', // String |
|
| 1267 | + 'slug' => '', // String |
|
| 1268 | + 'source' => 'repo', // String |
|
| 1269 | + 'required' => false, // Boolean |
|
| 1270 | + 'version' => '', // String |
|
| 1271 | + 'force_activation' => false, // Boolean |
|
| 1272 | + 'force_deactivation' => false, // Boolean |
|
| 1273 | + 'external_url' => '', // String |
|
| 1274 | + 'is_callable' => '', // String|Array. |
|
| 1275 | 1275 | ); |
| 1276 | 1276 | |
| 1277 | 1277 | // Prepare the received data. |
| 1278 | 1278 | $plugin = wp_parse_args( $plugin, $defaults ); |
| 1279 | 1279 | |
| 1280 | 1280 | // Standardize the received slug. |
| 1281 | - $plugin['slug'] = $this->sanitize_key( $plugin['slug'] ); |
|
| 1281 | + $plugin[ 'slug' ] = $this->sanitize_key( $plugin[ 'slug' ] ); |
|
| 1282 | 1282 | |
| 1283 | 1283 | // Forgive users for using string versions of booleans or floats for version number. |
| 1284 | - $plugin['version'] = (string) $plugin['version']; |
|
| 1285 | - $plugin['source'] = empty( $plugin['source'] ) ? 'repo' : $plugin['source']; |
|
| 1286 | - $plugin['required'] = TGMPA_Utils::validate_bool( $plugin['required'] ); |
|
| 1287 | - $plugin['force_activation'] = TGMPA_Utils::validate_bool( $plugin['force_activation'] ); |
|
| 1288 | - $plugin['force_deactivation'] = TGMPA_Utils::validate_bool( $plugin['force_deactivation'] ); |
|
| 1284 | + $plugin[ 'version' ] = (string) $plugin[ 'version' ]; |
|
| 1285 | + $plugin[ 'source' ] = empty( $plugin[ 'source' ] ) ? 'repo' : $plugin[ 'source' ]; |
|
| 1286 | + $plugin[ 'required' ] = TGMPA_Utils::validate_bool( $plugin[ 'required' ] ); |
|
| 1287 | + $plugin[ 'force_activation' ] = TGMPA_Utils::validate_bool( $plugin[ 'force_activation' ] ); |
|
| 1288 | + $plugin[ 'force_deactivation' ] = TGMPA_Utils::validate_bool( $plugin[ 'force_deactivation' ] ); |
|
| 1289 | 1289 | |
| 1290 | 1290 | // Enrich the received data. |
| 1291 | - $plugin['file_path'] = $this->_get_plugin_basename_from_slug( $plugin['slug'] ); |
|
| 1292 | - $plugin['source_type'] = $this->get_plugin_source_type( $plugin['source'] ); |
|
| 1291 | + $plugin[ 'file_path' ] = $this->_get_plugin_basename_from_slug( $plugin[ 'slug' ] ); |
|
| 1292 | + $plugin[ 'source_type' ] = $this->get_plugin_source_type( $plugin[ 'source' ] ); |
|
| 1293 | 1293 | |
| 1294 | 1294 | // Set the class properties. |
| 1295 | - $this->plugins[ $plugin['slug'] ] = $plugin; |
|
| 1296 | - $this->sort_order[ $plugin['slug'] ] = $plugin['name']; |
|
| 1295 | + $this->plugins[ $plugin[ 'slug' ] ] = $plugin; |
|
| 1296 | + $this->sort_order[ $plugin[ 'slug' ] ] = $plugin[ 'name' ]; |
|
| 1297 | 1297 | |
| 1298 | 1298 | // Should we add the force activation hook ? |
| 1299 | - if ( true === $plugin['force_activation'] ) { |
|
| 1299 | + if ( true === $plugin[ 'force_activation' ] ) { |
|
| 1300 | 1300 | $this->has_forced_activation = true; |
| 1301 | 1301 | } |
| 1302 | 1302 | |
| 1303 | 1303 | // Should we add the force deactivation hook ? |
| 1304 | - if ( true === $plugin['force_deactivation'] ) { |
|
| 1304 | + if ( true === $plugin[ 'force_deactivation' ] ) { |
|
| 1305 | 1305 | $this->has_forced_deactivation = true; |
| 1306 | 1306 | } |
| 1307 | 1307 | } |
@@ -1427,11 +1427,11 @@ discard block |
||
| 1427 | 1427 | */ |
| 1428 | 1428 | public function populate_file_path( $plugin_slug = '' ) { |
| 1429 | 1429 | if ( ! empty( $plugin_slug ) && is_string( $plugin_slug ) && isset( $this->plugins[ $plugin_slug ] ) ) { |
| 1430 | - $this->plugins[ $plugin_slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $plugin_slug ); |
|
| 1430 | + $this->plugins[ $plugin_slug ][ 'file_path' ] = $this->_get_plugin_basename_from_slug( $plugin_slug ); |
|
| 1431 | 1431 | } else { |
| 1432 | 1432 | // Add file_path key for all plugins. |
| 1433 | 1433 | foreach ( $this->plugins as $slug => $values ) { |
| 1434 | - $this->plugins[ $slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $slug ); |
|
| 1434 | + $this->plugins[ $slug ][ 'file_path' ] = $this->_get_plugin_basename_from_slug( $slug ); |
|
| 1435 | 1435 | } |
| 1436 | 1436 | } |
| 1437 | 1437 | } |
@@ -1449,7 +1449,7 @@ discard block |
||
| 1449 | 1449 | $keys = array_keys( $this->get_plugins() ); |
| 1450 | 1450 | |
| 1451 | 1451 | foreach ( $keys as $key ) { |
| 1452 | - if ( preg_match( '|^' . $slug . '/|', $key ) ) { |
|
| 1452 | + if ( preg_match( '|^'.$slug.'/|', $key ) ) { |
|
| 1453 | 1453 | return $key; |
| 1454 | 1454 | } |
| 1455 | 1455 | } |
@@ -1471,7 +1471,7 @@ discard block |
||
| 1471 | 1471 | */ |
| 1472 | 1472 | public function _get_plugin_data_from_name( $name, $data = 'slug' ) { |
| 1473 | 1473 | foreach ( $this->plugins as $values ) { |
| 1474 | - if ( $name === $values['name'] && isset( $values[ $data ] ) ) { |
|
| 1474 | + if ( $name === $values[ 'name' ] && isset( $values[ $data ] ) ) { |
|
| 1475 | 1475 | return $values[ $data ]; |
| 1476 | 1476 | } |
| 1477 | 1477 | } |
@@ -1490,13 +1490,13 @@ discard block |
||
| 1490 | 1490 | public function get_download_url( $slug ) { |
| 1491 | 1491 | $dl_source = ''; |
| 1492 | 1492 | |
| 1493 | - switch ( $this->plugins[ $slug ]['source_type'] ) { |
|
| 1493 | + switch ( $this->plugins[ $slug ][ 'source_type' ] ) { |
|
| 1494 | 1494 | case 'repo': |
| 1495 | 1495 | return $this->get_wp_repo_download_url( $slug ); |
| 1496 | 1496 | case 'external': |
| 1497 | - return $this->plugins[ $slug ]['source']; |
|
| 1497 | + return $this->plugins[ $slug ][ 'source' ]; |
|
| 1498 | 1498 | case 'bundled': |
| 1499 | - return $this->default_path . $this->plugins[ $slug ]['source']; |
|
| 1499 | + return $this->default_path.$this->plugins[ $slug ][ 'source' ]; |
|
| 1500 | 1500 | } |
| 1501 | 1501 | |
| 1502 | 1502 | return $dl_source; // Should never happen. |
@@ -1534,7 +1534,7 @@ discard block |
||
| 1534 | 1534 | |
| 1535 | 1535 | if ( ! isset( $api[ $slug ] ) ) { |
| 1536 | 1536 | if ( ! function_exists( 'plugins_api' ) ) { |
| 1537 | - require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; |
|
| 1537 | + require_once ABSPATH.'wp-admin/includes/plugin-install.php'; |
|
| 1538 | 1538 | } |
| 1539 | 1539 | |
| 1540 | 1540 | $response = plugins_api( 'plugin_information', array( 'slug' => $slug, 'fields' => array( 'sections' => false ) ) ); |
@@ -1542,7 +1542,7 @@ discard block |
||
| 1542 | 1542 | $api[ $slug ] = false; |
| 1543 | 1543 | |
| 1544 | 1544 | if ( is_wp_error( $response ) ) { |
| 1545 | - wp_die( esc_html( $this->strings['oops'] ) ); |
|
| 1545 | + wp_die( esc_html( $this->strings[ 'oops' ] ) ); |
|
| 1546 | 1546 | } else { |
| 1547 | 1547 | $api[ $slug ] = $response; |
| 1548 | 1548 | } |
@@ -1561,13 +1561,13 @@ discard block |
||
| 1561 | 1561 | * or the plugin name if not. |
| 1562 | 1562 | */ |
| 1563 | 1563 | public function get_info_link( $slug ) { |
| 1564 | - if ( ! empty( $this->plugins[ $slug ]['external_url'] ) && preg_match( self::IS_URL_REGEX, $this->plugins[ $slug ]['external_url'] ) ) { |
|
| 1564 | + if ( ! empty( $this->plugins[ $slug ][ 'external_url' ] ) && preg_match( self::IS_URL_REGEX, $this->plugins[ $slug ][ 'external_url' ] ) ) { |
|
| 1565 | 1565 | $link = sprintf( |
| 1566 | 1566 | '<a href="%1$s" target="_blank">%2$s</a>', |
| 1567 | - esc_url( $this->plugins[ $slug ]['external_url'] ), |
|
| 1568 | - esc_html( $this->plugins[ $slug ]['name'] ) |
|
| 1567 | + esc_url( $this->plugins[ $slug ][ 'external_url' ] ), |
|
| 1568 | + esc_html( $this->plugins[ $slug ][ 'name' ] ) |
|
| 1569 | 1569 | ); |
| 1570 | - } elseif ( 'repo' === $this->plugins[ $slug ]['source_type'] ) { |
|
| 1570 | + } elseif ( 'repo' === $this->plugins[ $slug ][ 'source_type' ] ) { |
|
| 1571 | 1571 | $url = add_query_arg( |
| 1572 | 1572 | array( |
| 1573 | 1573 | 'tab' => 'plugin-information', |
@@ -1582,10 +1582,10 @@ discard block |
||
| 1582 | 1582 | $link = sprintf( |
| 1583 | 1583 | '<a href="%1$s" class="thickbox">%2$s</a>', |
| 1584 | 1584 | esc_url( $url ), |
| 1585 | - esc_html( $this->plugins[ $slug ]['name'] ) |
|
| 1585 | + esc_html( $this->plugins[ $slug ][ 'name' ] ) |
|
| 1586 | 1586 | ); |
| 1587 | 1587 | } else { |
| 1588 | - $link = esc_html( $this->plugins[ $slug ]['name'] ); // No hyperlink. |
|
| 1588 | + $link = esc_html( $this->plugins[ $slug ][ 'name' ] ); // No hyperlink. |
|
| 1589 | 1589 | } |
| 1590 | 1590 | |
| 1591 | 1591 | return $link; |
@@ -1599,7 +1599,7 @@ discard block |
||
| 1599 | 1599 | * @return boolean True when on the TGMPA page, false otherwise. |
| 1600 | 1600 | */ |
| 1601 | 1601 | protected function is_tgmpa_page() { |
| 1602 | - return isset( $_GET['page'] ) && $this->menu === $_GET['page']; |
|
| 1602 | + return isset( $_GET[ 'page' ] ) && $this->menu === $_GET[ 'page' ]; |
|
| 1603 | 1603 | } |
| 1604 | 1604 | |
| 1605 | 1605 | /** |
@@ -1681,7 +1681,7 @@ discard block |
||
| 1681 | 1681 | public function is_plugin_installed( $slug ) { |
| 1682 | 1682 | $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached). |
| 1683 | 1683 | |
| 1684 | - return ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ] ) ); |
|
| 1684 | + return ( ! empty( $installed_plugins[ $this->plugins[ $slug ][ 'file_path' ] ] ) ); |
|
| 1685 | 1685 | } |
| 1686 | 1686 | |
| 1687 | 1687 | /** |
@@ -1693,7 +1693,7 @@ discard block |
||
| 1693 | 1693 | * @return bool True if active, false otherwise. |
| 1694 | 1694 | */ |
| 1695 | 1695 | public function is_plugin_active( $slug ) { |
| 1696 | - return ( ( ! empty( $this->plugins[ $slug ]['is_callable'] ) && is_callable( $this->plugins[ $slug ]['is_callable'] ) ) || is_plugin_active( $this->plugins[ $slug ]['file_path'] ) ); |
|
| 1696 | + return ( ( ! empty( $this->plugins[ $slug ][ 'is_callable' ] ) && is_callable( $this->plugins[ $slug ][ 'is_callable' ] ) ) || is_plugin_active( $this->plugins[ $slug ][ 'file_path' ] ) ); |
|
| 1697 | 1697 | } |
| 1698 | 1698 | |
| 1699 | 1699 | /** |
@@ -1707,7 +1707,7 @@ discard block |
||
| 1707 | 1707 | */ |
| 1708 | 1708 | public function can_plugin_update( $slug ) { |
| 1709 | 1709 | // We currently can't get reliable info on non-WP-repo plugins - issue #380. |
| 1710 | - if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { |
|
| 1710 | + if ( 'repo' !== $this->plugins[ $slug ][ 'source_type' ] ) { |
|
| 1711 | 1711 | return true; |
| 1712 | 1712 | } |
| 1713 | 1713 | |
@@ -1763,8 +1763,8 @@ discard block |
||
| 1763 | 1763 | public function get_installed_version( $slug ) { |
| 1764 | 1764 | $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached). |
| 1765 | 1765 | |
| 1766 | - if ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'] ) ) { |
|
| 1767 | - return $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version']; |
|
| 1766 | + if ( ! empty( $installed_plugins[ $this->plugins[ $slug ][ 'file_path' ] ][ 'Version' ] ) ) { |
|
| 1767 | + return $installed_plugins[ $this->plugins[ $slug ][ 'file_path' ] ][ 'Version' ]; |
|
| 1768 | 1768 | } |
| 1769 | 1769 | |
| 1770 | 1770 | return ''; |
@@ -1780,7 +1780,7 @@ discard block |
||
| 1780 | 1780 | */ |
| 1781 | 1781 | public function does_plugin_require_update( $slug ) { |
| 1782 | 1782 | $installed_version = $this->get_installed_version( $slug ); |
| 1783 | - $minimum_version = $this->plugins[ $slug ]['version']; |
|
| 1783 | + $minimum_version = $this->plugins[ $slug ][ 'version' ]; |
|
| 1784 | 1784 | |
| 1785 | 1785 | return version_compare( $minimum_version, $installed_version, '>' ); |
| 1786 | 1786 | } |
@@ -1795,9 +1795,9 @@ discard block |
||
| 1795 | 1795 | */ |
| 1796 | 1796 | public function does_plugin_have_update( $slug ) { |
| 1797 | 1797 | // Presume bundled and external plugins will point to a package which meets the minimum required version. |
| 1798 | - if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { |
|
| 1798 | + if ( 'repo' !== $this->plugins[ $slug ][ 'source_type' ] ) { |
|
| 1799 | 1799 | if ( $this->does_plugin_require_update( $slug ) ) { |
| 1800 | - return $this->plugins[ $slug ]['version']; |
|
| 1800 | + return $this->plugins[ $slug ][ 'version' ]; |
|
| 1801 | 1801 | } |
| 1802 | 1802 | |
| 1803 | 1803 | return false; |
@@ -1805,8 +1805,8 @@ discard block |
||
| 1805 | 1805 | |
| 1806 | 1806 | $repo_updates = get_site_transient( 'update_plugins' ); |
| 1807 | 1807 | |
| 1808 | - if ( isset( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version ) ) { |
|
| 1809 | - return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version; |
|
| 1808 | + if ( isset( $repo_updates->response[ $this->plugins[ $slug ][ 'file_path' ] ]->new_version ) ) { |
|
| 1809 | + return $repo_updates->response[ $this->plugins[ $slug ][ 'file_path' ] ]->new_version; |
|
| 1810 | 1810 | } |
| 1811 | 1811 | |
| 1812 | 1812 | return false; |
@@ -1822,14 +1822,14 @@ discard block |
||
| 1822 | 1822 | */ |
| 1823 | 1823 | public function get_upgrade_notice( $slug ) { |
| 1824 | 1824 | // We currently can't get reliable info on non-WP-repo plugins - issue #380. |
| 1825 | - if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { |
|
| 1825 | + if ( 'repo' !== $this->plugins[ $slug ][ 'source_type' ] ) { |
|
| 1826 | 1826 | return ''; |
| 1827 | 1827 | } |
| 1828 | 1828 | |
| 1829 | 1829 | $repo_updates = get_site_transient( 'update_plugins' ); |
| 1830 | 1830 | |
| 1831 | - if ( ! empty( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice ) ) { |
|
| 1832 | - return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice; |
|
| 1831 | + if ( ! empty( $repo_updates->response[ $this->plugins[ $slug ][ 'file_path' ] ]->upgrade_notice ) ) { |
|
| 1832 | + return $repo_updates->response[ $this->plugins[ $slug ][ 'file_path' ] ]->upgrade_notice; |
|
| 1833 | 1833 | } |
| 1834 | 1834 | |
| 1835 | 1835 | return ''; |
@@ -1845,7 +1845,7 @@ discard block |
||
| 1845 | 1845 | */ |
| 1846 | 1846 | public function get_plugins( $plugin_folder = '' ) { |
| 1847 | 1847 | if ( ! function_exists( 'get_plugins' ) ) { |
| 1848 | - require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
| 1848 | + require_once ABSPATH.'wp-admin/includes/plugin.php'; |
|
| 1849 | 1849 | } |
| 1850 | 1850 | |
| 1851 | 1851 | return get_plugins( $plugin_folder ); |
@@ -1860,7 +1860,7 @@ discard block |
||
| 1860 | 1860 | * @since 2.1.1 |
| 1861 | 1861 | */ |
| 1862 | 1862 | public function update_dismiss() { |
| 1863 | - delete_metadata( 'user', null, 'tgmpa_dismissed_notice_' . $this->id, null, true ); |
|
| 1863 | + delete_metadata( 'user', null, 'tgmpa_dismissed_notice_'.$this->id, null, true ); |
|
| 1864 | 1864 | } |
| 1865 | 1865 | |
| 1866 | 1866 | /** |
@@ -1879,13 +1879,13 @@ discard block |
||
| 1879 | 1879 | */ |
| 1880 | 1880 | public function force_activation() { |
| 1881 | 1881 | foreach ( $this->plugins as $slug => $plugin ) { |
| 1882 | - if ( true === $plugin['force_activation'] ) { |
|
| 1882 | + if ( true === $plugin[ 'force_activation' ] ) { |
|
| 1883 | 1883 | if ( ! $this->is_plugin_installed( $slug ) ) { |
| 1884 | 1884 | // Oops, plugin isn't there so iterate to next condition. |
| 1885 | 1885 | continue; |
| 1886 | 1886 | } elseif ( $this->can_plugin_activate( $slug ) ) { |
| 1887 | 1887 | // There we go, activate the plugin. |
| 1888 | - activate_plugin( $plugin['file_path'] ); |
|
| 1888 | + activate_plugin( $plugin[ 'file_path' ] ); |
|
| 1889 | 1889 | } |
| 1890 | 1890 | } |
| 1891 | 1891 | } |
@@ -1906,8 +1906,8 @@ discard block |
||
| 1906 | 1906 | public function force_deactivation() { |
| 1907 | 1907 | foreach ( $this->plugins as $slug => $plugin ) { |
| 1908 | 1908 | // Only proceed forward if the parameter is set to true and plugin is active. |
| 1909 | - if ( true === $plugin['force_deactivation'] && $this->is_plugin_active( $slug ) ) { |
|
| 1910 | - deactivate_plugins( $plugin['file_path'] ); |
|
| 1909 | + if ( true === $plugin[ 'force_deactivation' ] && $this->is_plugin_active( $slug ) ) { |
|
| 1910 | + deactivate_plugins( $plugin[ 'file_path' ] ); |
|
| 1911 | 1911 | } |
| 1912 | 1912 | } |
| 1913 | 1913 | } |
@@ -1942,7 +1942,7 @@ discard block |
||
| 1942 | 1942 | * Ensure only one instance of the class is ever invoked. |
| 1943 | 1943 | */ |
| 1944 | 1944 | function load_tgm_plugin_activation() { |
| 1945 | - $GLOBALS['tgmpa'] = TGM_Plugin_Activation::get_instance(); |
|
| 1945 | + $GLOBALS[ 'tgmpa' ] = TGM_Plugin_Activation::get_instance(); |
|
| 1946 | 1946 | } |
| 1947 | 1947 | } |
| 1948 | 1948 | |
@@ -1964,7 +1964,7 @@ discard block |
||
| 1964 | 1964 | * @param array $config Optional. An array of configuration values. |
| 1965 | 1965 | */ |
| 1966 | 1966 | function tgmpa( $plugins, $config = array() ) { |
| 1967 | - $instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); |
|
| 1967 | + $instance = call_user_func( array( get_class( $GLOBALS[ 'tgmpa' ] ), 'get_instance' ) ); |
|
| 1968 | 1968 | |
| 1969 | 1969 | foreach ( $plugins as $plugin ) { |
| 1970 | 1970 | call_user_func( array( $instance, 'register' ), $plugin ); |
@@ -1972,17 +1972,17 @@ discard block |
||
| 1972 | 1972 | |
| 1973 | 1973 | if ( ! empty( $config ) && is_array( $config ) ) { |
| 1974 | 1974 | // Send out notices for deprecated arguments passed. |
| 1975 | - if ( isset( $config['notices'] ) ) { |
|
| 1975 | + if ( isset( $config[ 'notices' ] ) ) { |
|
| 1976 | 1976 | _deprecated_argument( __FUNCTION__, '2.2.0', 'The `notices` config parameter was renamed to `has_notices` in TGMPA 2.2.0. Please adjust your configuration.' ); |
| 1977 | - if ( ! isset( $config['has_notices'] ) ) { |
|
| 1978 | - $config['has_notices'] = $config['notices']; |
|
| 1977 | + if ( ! isset( $config[ 'has_notices' ] ) ) { |
|
| 1978 | + $config[ 'has_notices' ] = $config[ 'notices' ]; |
|
| 1979 | 1979 | } |
| 1980 | 1980 | } |
| 1981 | 1981 | |
| 1982 | - if ( isset( $config['parent_menu_slug'] ) ) { |
|
| 1982 | + if ( isset( $config[ 'parent_menu_slug' ] ) ) { |
|
| 1983 | 1983 | _deprecated_argument( __FUNCTION__, '2.4.0', 'The `parent_menu_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' ); |
| 1984 | 1984 | } |
| 1985 | - if ( isset( $config['parent_url_slug'] ) ) { |
|
| 1985 | + if ( isset( $config[ 'parent_url_slug' ] ) ) { |
|
| 1986 | 1986 | _deprecated_argument( __FUNCTION__, '2.4.0', 'The `parent_url_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' ); |
| 1987 | 1987 | } |
| 1988 | 1988 | |
@@ -1998,7 +1998,7 @@ discard block |
||
| 1998 | 1998 | * @since 2.2.0 |
| 1999 | 1999 | */ |
| 2000 | 2000 | if ( ! class_exists( 'WP_List_Table' ) ) { |
| 2001 | - require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; |
|
| 2001 | + require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php'; |
|
| 2002 | 2002 | } |
| 2003 | 2003 | |
| 2004 | 2004 | if ( ! class_exists( 'TGMPA_List_Table' ) ) { |
@@ -2059,7 +2059,7 @@ discard block |
||
| 2059 | 2059 | * @since 2.2.0 |
| 2060 | 2060 | */ |
| 2061 | 2061 | public function __construct() { |
| 2062 | - $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); |
|
| 2062 | + $this->tgmpa = call_user_func( array( get_class( $GLOBALS[ 'tgmpa' ] ), 'get_instance' ) ); |
|
| 2063 | 2063 | |
| 2064 | 2064 | parent::__construct( |
| 2065 | 2065 | array( |
@@ -2069,8 +2069,8 @@ discard block |
||
| 2069 | 2069 | ) |
| 2070 | 2070 | ); |
| 2071 | 2071 | |
| 2072 | - if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], array( 'install', 'update', 'activate' ), true ) ) { |
|
| 2073 | - $this->view_context = sanitize_key( $_REQUEST['plugin_status'] ); |
|
| 2072 | + if ( isset( $_REQUEST[ 'plugin_status' ] ) && in_array( $_REQUEST[ 'plugin_status' ], array( 'install', 'update', 'activate' ), true ) ) { |
|
| 2073 | + $this->view_context = sanitize_key( $_REQUEST[ 'plugin_status' ] ); |
|
| 2074 | 2074 | } |
| 2075 | 2075 | |
| 2076 | 2076 | add_filter( 'tgmpa_table_data_items', array( $this, 'sort_table_items' ) ); |
@@ -2117,20 +2117,20 @@ discard block |
||
| 2117 | 2117 | } |
| 2118 | 2118 | |
| 2119 | 2119 | foreach ( $plugins[ $this->view_context ] as $slug => $plugin ) { |
| 2120 | - $table_data[ $i ]['sanitized_plugin'] = $plugin['name']; |
|
| 2121 | - $table_data[ $i ]['slug'] = $slug; |
|
| 2122 | - $table_data[ $i ]['plugin'] = '<strong>' . $this->tgmpa->get_info_link( $slug ) . '</strong>'; |
|
| 2123 | - $table_data[ $i ]['source'] = $this->get_plugin_source_type_text( $plugin['source_type'] ); |
|
| 2124 | - $table_data[ $i ]['type'] = $this->get_plugin_advise_type_text( $plugin['required'] ); |
|
| 2125 | - $table_data[ $i ]['status'] = $this->get_plugin_status_text( $slug ); |
|
| 2126 | - $table_data[ $i ]['installed_version'] = $this->tgmpa->get_installed_version( $slug ); |
|
| 2127 | - $table_data[ $i ]['minimum_version'] = $plugin['version']; |
|
| 2128 | - $table_data[ $i ]['available_version'] = $this->tgmpa->does_plugin_have_update( $slug ); |
|
| 2120 | + $table_data[ $i ][ 'sanitized_plugin' ] = $plugin[ 'name' ]; |
|
| 2121 | + $table_data[ $i ][ 'slug' ] = $slug; |
|
| 2122 | + $table_data[ $i ][ 'plugin' ] = '<strong>'.$this->tgmpa->get_info_link( $slug ).'</strong>'; |
|
| 2123 | + $table_data[ $i ][ 'source' ] = $this->get_plugin_source_type_text( $plugin[ 'source_type' ] ); |
|
| 2124 | + $table_data[ $i ][ 'type' ] = $this->get_plugin_advise_type_text( $plugin[ 'required' ] ); |
|
| 2125 | + $table_data[ $i ][ 'status' ] = $this->get_plugin_status_text( $slug ); |
|
| 2126 | + $table_data[ $i ][ 'installed_version' ] = $this->tgmpa->get_installed_version( $slug ); |
|
| 2127 | + $table_data[ $i ][ 'minimum_version' ] = $plugin[ 'version' ]; |
|
| 2128 | + $table_data[ $i ][ 'available_version' ] = $this->tgmpa->does_plugin_have_update( $slug ); |
|
| 2129 | 2129 | |
| 2130 | 2130 | // Prep the upgrade notice info. |
| 2131 | 2131 | $upgrade_notice = $this->tgmpa->get_upgrade_notice( $slug ); |
| 2132 | 2132 | if ( ! empty( $upgrade_notice ) ) { |
| 2133 | - $table_data[ $i ]['upgrade_notice'] = $upgrade_notice; |
|
| 2133 | + $table_data[ $i ][ 'upgrade_notice' ] = $upgrade_notice; |
|
| 2134 | 2134 | |
| 2135 | 2135 | add_action( "tgmpa_after_plugin_row_$slug", array( $this, 'wp_plugin_update_row' ), 10, 2 ); |
| 2136 | 2136 | } |
@@ -2161,17 +2161,17 @@ discard block |
||
| 2161 | 2161 | // No need to display plugins if they are installed, up-to-date and active. |
| 2162 | 2162 | continue; |
| 2163 | 2163 | } else { |
| 2164 | - $plugins['all'][ $slug ] = $plugin; |
|
| 2164 | + $plugins[ 'all' ][ $slug ] = $plugin; |
|
| 2165 | 2165 | |
| 2166 | 2166 | if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) { |
| 2167 | - $plugins['install'][ $slug ] = $plugin; |
|
| 2167 | + $plugins[ 'install' ][ $slug ] = $plugin; |
|
| 2168 | 2168 | } else { |
| 2169 | 2169 | if ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) { |
| 2170 | - $plugins['update'][ $slug ] = $plugin; |
|
| 2170 | + $plugins[ 'update' ][ $slug ] = $plugin; |
|
| 2171 | 2171 | } |
| 2172 | 2172 | |
| 2173 | 2173 | if ( $this->tgmpa->can_plugin_activate( $slug ) ) { |
| 2174 | - $plugins['activate'][ $slug ] = $plugin; |
|
| 2174 | + $plugins[ 'activate' ][ $slug ] = $plugin; |
|
| 2175 | 2175 | } |
| 2176 | 2176 | } |
| 2177 | 2177 | } |
@@ -2290,8 +2290,8 @@ discard block |
||
| 2290 | 2290 | $name = array(); |
| 2291 | 2291 | |
| 2292 | 2292 | foreach ( $items as $i => $plugin ) { |
| 2293 | - $type[ $i ] = $plugin['type']; // Required / recommended. |
|
| 2294 | - $name[ $i ] = $plugin['sanitized_plugin']; |
|
| 2293 | + $type[ $i ] = $plugin[ 'type' ]; // Required / recommended. |
|
| 2294 | + $name[ $i ] = $plugin[ 'sanitized_plugin' ]; |
|
| 2295 | 2295 | } |
| 2296 | 2296 | |
| 2297 | 2297 | array_multisort( $type, SORT_DESC, $name, SORT_ASC, $items ); |
@@ -2373,9 +2373,9 @@ discard block |
||
| 2373 | 2373 | public function column_cb( $item ) { |
| 2374 | 2374 | return sprintf( |
| 2375 | 2375 | '<input type="checkbox" name="%1$s[]" value="%2$s" id="%3$s" />', |
| 2376 | - esc_attr( $this->_args['singular'] ), |
|
| 2377 | - esc_attr( $item['slug'] ), |
|
| 2378 | - esc_attr( $item['sanitized_plugin'] ) |
|
| 2376 | + esc_attr( $this->_args[ 'singular' ] ), |
|
| 2377 | + esc_attr( $item[ 'slug' ] ), |
|
| 2378 | + esc_attr( $item[ 'sanitized_plugin' ] ) |
|
| 2379 | 2379 | ); |
| 2380 | 2380 | } |
| 2381 | 2381 | |
@@ -2390,7 +2390,7 @@ discard block |
||
| 2390 | 2390 | public function column_plugin( $item ) { |
| 2391 | 2391 | return sprintf( |
| 2392 | 2392 | '%1$s %2$s', |
| 2393 | - $item['plugin'], |
|
| 2393 | + $item[ 'plugin' ], |
|
| 2394 | 2394 | $this->row_actions( $this->get_row_actions( $item ), true ) |
| 2395 | 2395 | ); |
| 2396 | 2396 | } |
@@ -2406,38 +2406,38 @@ discard block |
||
| 2406 | 2406 | public function column_version( $item ) { |
| 2407 | 2407 | $output = array(); |
| 2408 | 2408 | |
| 2409 | - if ( $this->tgmpa->is_plugin_installed( $item['slug'] ) ) { |
|
| 2410 | - $installed = ! empty( $item['installed_version'] ) ? $item['installed_version'] : _x( 'unknown', 'as in: "version nr unknown"', 'tgmpa' ); |
|
| 2409 | + if ( $this->tgmpa->is_plugin_installed( $item[ 'slug' ] ) ) { |
|
| 2410 | + $installed = ! empty( $item[ 'installed_version' ] ) ? $item[ 'installed_version' ] : _x( 'unknown', 'as in: "version nr unknown"', 'tgmpa' ); |
|
| 2411 | 2411 | |
| 2412 | 2412 | $color = ''; |
| 2413 | - if ( ! empty( $item['minimum_version'] ) && $this->tgmpa->does_plugin_require_update( $item['slug'] ) ) { |
|
| 2413 | + if ( ! empty( $item[ 'minimum_version' ] ) && $this->tgmpa->does_plugin_require_update( $item[ 'slug' ] ) ) { |
|
| 2414 | 2414 | $color = ' color: #ff0000; font-weight: bold;'; |
| 2415 | 2415 | } |
| 2416 | 2416 | |
| 2417 | - $output[] = sprintf( |
|
| 2418 | - '<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>' . __( 'Installed version:', 'tgmpa' ) . '</p>', |
|
| 2417 | + $output[ ] = sprintf( |
|
| 2418 | + '<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>'.__( 'Installed version:', 'tgmpa' ).'</p>', |
|
| 2419 | 2419 | $color, |
| 2420 | 2420 | $installed |
| 2421 | 2421 | ); |
| 2422 | 2422 | } |
| 2423 | 2423 | |
| 2424 | - if ( ! empty( $item['minimum_version'] ) ) { |
|
| 2425 | - $output[] = sprintf( |
|
| 2426 | - '<p><span style="min-width: 32px; text-align: right; float: right;">%1$s</span>' . __( 'Minimum required version:', 'tgmpa' ) . '</p>', |
|
| 2427 | - $item['minimum_version'] |
|
| 2424 | + if ( ! empty( $item[ 'minimum_version' ] ) ) { |
|
| 2425 | + $output[ ] = sprintf( |
|
| 2426 | + '<p><span style="min-width: 32px; text-align: right; float: right;">%1$s</span>'.__( 'Minimum required version:', 'tgmpa' ).'</p>', |
|
| 2427 | + $item[ 'minimum_version' ] |
|
| 2428 | 2428 | ); |
| 2429 | 2429 | } |
| 2430 | 2430 | |
| 2431 | - if ( ! empty( $item['available_version'] ) ) { |
|
| 2431 | + if ( ! empty( $item[ 'available_version' ] ) ) { |
|
| 2432 | 2432 | $color = ''; |
| 2433 | - if ( ! empty( $item['minimum_version'] ) && version_compare( $item['available_version'], $item['minimum_version'], '>=' ) ) { |
|
| 2433 | + if ( ! empty( $item[ 'minimum_version' ] ) && version_compare( $item[ 'available_version' ], $item[ 'minimum_version' ], '>=' ) ) { |
|
| 2434 | 2434 | $color = ' color: #71C671; font-weight: bold;'; |
| 2435 | 2435 | } |
| 2436 | 2436 | |
| 2437 | - $output[] = sprintf( |
|
| 2438 | - '<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>' . __( 'Available version:', 'tgmpa' ) . '</p>', |
|
| 2437 | + $output[ ] = sprintf( |
|
| 2438 | + '<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>'.__( 'Available version:', 'tgmpa' ).'</p>', |
|
| 2439 | 2439 | $color, |
| 2440 | - $item['available_version'] |
|
| 2440 | + $item[ 'available_version' ] |
|
| 2441 | 2441 | ); |
| 2442 | 2442 | } |
| 2443 | 2443 | |
@@ -2478,8 +2478,8 @@ discard block |
||
| 2478 | 2478 | ); |
| 2479 | 2479 | |
| 2480 | 2480 | if ( 'all' === $this->view_context || 'update' === $this->view_context ) { |
| 2481 | - $columns['version'] = __( 'Version', 'tgmpa' ); |
|
| 2482 | - $columns['status'] = __( 'Status', 'tgmpa' ); |
|
| 2481 | + $columns[ 'version' ] = __( 'Version', 'tgmpa' ); |
|
| 2482 | + $columns[ 'status' ] = __( 'Status', 'tgmpa' ); |
|
| 2483 | 2483 | } |
| 2484 | 2484 | |
| 2485 | 2485 | return apply_filters( 'tgmpa_table_columns', $columns ); |
@@ -2526,17 +2526,17 @@ discard block |
||
| 2526 | 2526 | $action_links = array(); |
| 2527 | 2527 | |
| 2528 | 2528 | // Display the 'Install' action link if the plugin is not yet available. |
| 2529 | - if ( ! $this->tgmpa->is_plugin_installed( $item['slug'] ) ) { |
|
| 2530 | - $actions['install'] = _x( 'Install %2$s', '%2$s = plugin name in screen reader markup', 'tgmpa' ); |
|
| 2529 | + if ( ! $this->tgmpa->is_plugin_installed( $item[ 'slug' ] ) ) { |
|
| 2530 | + $actions[ 'install' ] = _x( 'Install %2$s', '%2$s = plugin name in screen reader markup', 'tgmpa' ); |
|
| 2531 | 2531 | } else { |
| 2532 | 2532 | // Display the 'Update' action link if an update is available and WP complies with plugin minimum. |
| 2533 | - if ( false !== $this->tgmpa->does_plugin_have_update( $item['slug'] ) && $this->tgmpa->can_plugin_update( $item['slug'] ) ) { |
|
| 2534 | - $actions['update'] = _x( 'Update %2$s', '%2$s = plugin name in screen reader markup', 'tgmpa' ); |
|
| 2533 | + if ( false !== $this->tgmpa->does_plugin_have_update( $item[ 'slug' ] ) && $this->tgmpa->can_plugin_update( $item[ 'slug' ] ) ) { |
|
| 2534 | + $actions[ 'update' ] = _x( 'Update %2$s', '%2$s = plugin name in screen reader markup', 'tgmpa' ); |
|
| 2535 | 2535 | } |
| 2536 | 2536 | |
| 2537 | 2537 | // Display the 'Activate' action link, but only if the plugin meets the minimum version. |
| 2538 | - if ( $this->tgmpa->can_plugin_activate( $item['slug'] ) ) { |
|
| 2539 | - $actions['activate'] = _x( 'Activate %2$s', '%2$s = plugin name in screen reader markup', 'tgmpa' ); |
|
| 2538 | + if ( $this->tgmpa->can_plugin_activate( $item[ 'slug' ] ) ) { |
|
| 2539 | + $actions[ 'activate' ] = _x( 'Activate %2$s', '%2$s = plugin name in screen reader markup', 'tgmpa' ); |
|
| 2540 | 2540 | } |
| 2541 | 2541 | } |
| 2542 | 2542 | |
@@ -2545,24 +2545,24 @@ discard block |
||
| 2545 | 2545 | $nonce_url = wp_nonce_url( |
| 2546 | 2546 | add_query_arg( |
| 2547 | 2547 | array( |
| 2548 | - 'plugin' => urlencode( $item['slug'] ), |
|
| 2549 | - 'tgmpa-' . $action => $action . '-plugin', |
|
| 2548 | + 'plugin' => urlencode( $item[ 'slug' ] ), |
|
| 2549 | + 'tgmpa-'.$action => $action.'-plugin', |
|
| 2550 | 2550 | ), |
| 2551 | 2551 | $this->tgmpa->get_tgmpa_url() |
| 2552 | 2552 | ), |
| 2553 | - 'tgmpa-' . $action, |
|
| 2553 | + 'tgmpa-'.$action, |
|
| 2554 | 2554 | 'tgmpa-nonce' |
| 2555 | 2555 | ); |
| 2556 | 2556 | |
| 2557 | 2557 | $action_links[ $action ] = sprintf( |
| 2558 | - '<a href="%1$s">' . esc_html( $text ) . '</a>', |
|
| 2558 | + '<a href="%1$s">'.esc_html( $text ).'</a>', |
|
| 2559 | 2559 | esc_url( $nonce_url ), |
| 2560 | - '<span class="screen-reader-text">' . esc_html( $item['sanitized_plugin'] ) . '</span>' |
|
| 2560 | + '<span class="screen-reader-text">'.esc_html( $item[ 'sanitized_plugin' ] ).'</span>' |
|
| 2561 | 2561 | ); |
| 2562 | 2562 | } |
| 2563 | 2563 | |
| 2564 | 2564 | $prefix = ( defined( 'WP_NETWORK_ADMIN' ) && WP_NETWORK_ADMIN ) ? 'network_admin_' : ''; |
| 2565 | - return apply_filters( "tgmpa_{$prefix}plugin_action_links", array_filter( $action_links ), $item['slug'], $item, $this->view_context ); |
|
| 2565 | + return apply_filters( "tgmpa_{$prefix}plugin_action_links", array_filter( $action_links ), $item[ 'slug' ], $item, $this->view_context ); |
|
| 2566 | 2566 | } |
| 2567 | 2567 | |
| 2568 | 2568 | /** |
@@ -2583,7 +2583,7 @@ discard block |
||
| 2583 | 2583 | * |
| 2584 | 2584 | * @since 2.5.0 |
| 2585 | 2585 | */ |
| 2586 | - do_action( "tgmpa_after_plugin_row_{$item['slug']}", $item['slug'], $item, $this->view_context ); |
|
| 2586 | + do_action( "tgmpa_after_plugin_row_{$item[ 'slug' ]}", $item[ 'slug' ], $item, $this->view_context ); |
|
| 2587 | 2587 | } |
| 2588 | 2588 | |
| 2589 | 2589 | /** |
@@ -2598,7 +2598,7 @@ discard block |
||
| 2598 | 2598 | * @return null Return early if upgrade notice is empty. |
| 2599 | 2599 | */ |
| 2600 | 2600 | public function wp_plugin_update_row( $slug, $item ) { |
| 2601 | - if ( empty( $item['upgrade_notice'] ) ) { |
|
| 2601 | + if ( empty( $item[ 'upgrade_notice' ] ) ) { |
|
| 2602 | 2602 | return; |
| 2603 | 2603 | } |
| 2604 | 2604 | |
@@ -2607,7 +2607,7 @@ discard block |
||
| 2607 | 2607 | <td colspan="', absint( $this->get_column_count() ), '" class="plugin-update colspanchange"> |
| 2608 | 2608 | <div class="update-message">', |
| 2609 | 2609 | esc_html__( 'Upgrade message from the plugin author:', 'tgmpa' ), |
| 2610 | - ' <strong>', wp_kses_data( $item['upgrade_notice'] ), '</strong> |
|
| 2610 | + ' <strong>', wp_kses_data( $item[ 'upgrade_notice' ] ), '</strong> |
|
| 2611 | 2611 | </div> |
| 2612 | 2612 | </td> |
| 2613 | 2613 | </tr>'; |
@@ -2639,16 +2639,16 @@ discard block |
||
| 2639 | 2639 | |
| 2640 | 2640 | if ( 'update' !== $this->view_context && 'activate' !== $this->view_context ) { |
| 2641 | 2641 | if ( current_user_can( 'install_plugins' ) ) { |
| 2642 | - $actions['tgmpa-bulk-install'] = __( 'Install', 'tgmpa' ); |
|
| 2642 | + $actions[ 'tgmpa-bulk-install' ] = __( 'Install', 'tgmpa' ); |
|
| 2643 | 2643 | } |
| 2644 | 2644 | } |
| 2645 | 2645 | |
| 2646 | 2646 | if ( 'install' !== $this->view_context ) { |
| 2647 | 2647 | if ( current_user_can( 'update_plugins' ) ) { |
| 2648 | - $actions['tgmpa-bulk-update'] = __( 'Update', 'tgmpa' ); |
|
| 2648 | + $actions[ 'tgmpa-bulk-update' ] = __( 'Update', 'tgmpa' ); |
|
| 2649 | 2649 | } |
| 2650 | 2650 | if ( current_user_can( 'activate_plugins' ) ) { |
| 2651 | - $actions['tgmpa-bulk-activate'] = __( 'Activate', 'tgmpa' ); |
|
| 2651 | + $actions[ 'tgmpa-bulk-activate' ] = __( 'Activate', 'tgmpa' ); |
|
| 2652 | 2652 | } |
| 2653 | 2653 | } |
| 2654 | 2654 | |
@@ -2667,7 +2667,7 @@ discard block |
||
| 2667 | 2667 | // Bulk installation process. |
| 2668 | 2668 | if ( 'tgmpa-bulk-install' === $this->current_action() || 'tgmpa-bulk-update' === $this->current_action() ) { |
| 2669 | 2669 | |
| 2670 | - check_admin_referer( 'bulk-' . $this->_args['plural'] ); |
|
| 2670 | + check_admin_referer( 'bulk-'.$this->_args[ 'plural' ] ); |
|
| 2671 | 2671 | |
| 2672 | 2672 | $install_type = 'install'; |
| 2673 | 2673 | if ( 'tgmpa-bulk-update' === $this->current_action() ) { |
@@ -2677,7 +2677,7 @@ discard block |
||
| 2677 | 2677 | $plugins_to_install = array(); |
| 2678 | 2678 | |
| 2679 | 2679 | // Did user actually select any plugins to install/update ? |
| 2680 | - if ( empty( $_POST['plugin'] ) ) { |
|
| 2680 | + if ( empty( $_POST[ 'plugin' ] ) ) { |
|
| 2681 | 2681 | if ( 'install' === $install_type ) { |
| 2682 | 2682 | $message = __( 'No plugins were selected to be installed. No action taken.', 'tgmpa' ); |
| 2683 | 2683 | } else { |
@@ -2689,11 +2689,11 @@ discard block |
||
| 2689 | 2689 | return false; |
| 2690 | 2690 | } |
| 2691 | 2691 | |
| 2692 | - if ( is_array( $_POST['plugin'] ) ) { |
|
| 2693 | - $plugins_to_install = (array) $_POST['plugin']; |
|
| 2694 | - } elseif ( is_string( $_POST['plugin'] ) ) { |
|
| 2692 | + if ( is_array( $_POST[ 'plugin' ] ) ) { |
|
| 2693 | + $plugins_to_install = (array) $_POST[ 'plugin' ]; |
|
| 2694 | + } elseif ( is_string( $_POST[ 'plugin' ] ) ) { |
|
| 2695 | 2695 | // Received via Filesystem page - un-flatten array (WP bug #19643). |
| 2696 | - $plugins_to_install = explode( ',', $_POST['plugin'] ); |
|
| 2696 | + $plugins_to_install = explode( ',', $_POST[ 'plugin' ] ); |
|
| 2697 | 2697 | } |
| 2698 | 2698 | |
| 2699 | 2699 | // Sanitize the received input. |
@@ -2735,11 +2735,11 @@ discard block |
||
| 2735 | 2735 | // Pass all necessary information if WP_Filesystem is needed. |
| 2736 | 2736 | $url = wp_nonce_url( |
| 2737 | 2737 | $this->tgmpa->get_tgmpa_url(), |
| 2738 | - 'bulk-' . $this->_args['plural'] |
|
| 2738 | + 'bulk-'.$this->_args[ 'plural' ] |
|
| 2739 | 2739 | ); |
| 2740 | 2740 | |
| 2741 | 2741 | // Give validated data back to $_POST which is the only place the filesystem looks for extra fields. |
| 2742 | - $_POST['plugin'] = implode( ',', $plugins_to_install ); // Work around for WP bug #19643. |
|
| 2742 | + $_POST[ 'plugin' ] = implode( ',', $plugins_to_install ); // Work around for WP bug #19643. |
|
| 2743 | 2743 | |
| 2744 | 2744 | $method = ''; // Leave blank so WP_Filesystem can populate it as necessary. |
| 2745 | 2745 | $fields = array_keys( $_POST ); // Extra fields to pass to WP_Filesystem. |
@@ -2766,22 +2766,22 @@ discard block |
||
| 2766 | 2766 | |
| 2767 | 2767 | // Prepare the data for validated plugins for the install/upgrade. |
| 2768 | 2768 | foreach ( $plugins_to_install as $slug ) { |
| 2769 | - $name = $this->tgmpa->plugins[ $slug ]['name']; |
|
| 2769 | + $name = $this->tgmpa->plugins[ $slug ][ 'name' ]; |
|
| 2770 | 2770 | $source = $this->tgmpa->get_download_url( $slug ); |
| 2771 | 2771 | |
| 2772 | 2772 | if ( ! empty( $name ) && ! empty( $source ) ) { |
| 2773 | - $names[] = $name; |
|
| 2773 | + $names[ ] = $name; |
|
| 2774 | 2774 | |
| 2775 | 2775 | switch ( $install_type ) { |
| 2776 | 2776 | |
| 2777 | 2777 | case 'install': |
| 2778 | - $sources[] = $source; |
|
| 2778 | + $sources[ ] = $source; |
|
| 2779 | 2779 | break; |
| 2780 | 2780 | |
| 2781 | 2781 | case 'update': |
| 2782 | - $file_paths[] = $this->tgmpa->plugins[ $slug ]['file_path']; |
|
| 2782 | + $file_paths[ ] = $this->tgmpa->plugins[ $slug ][ 'file_path' ]; |
|
| 2783 | 2783 | $to_inject[ $slug ] = $this->tgmpa->plugins[ $slug ]; |
| 2784 | - $to_inject[ $slug ]['source'] = $source; |
|
| 2784 | + $to_inject[ $slug ][ 'source' ] = $source; |
|
| 2785 | 2785 | break; |
| 2786 | 2786 | } |
| 2787 | 2787 | } |
@@ -2793,7 +2793,7 @@ discard block |
||
| 2793 | 2793 | new TGMPA_Bulk_Installer_Skin( |
| 2794 | 2794 | array( |
| 2795 | 2795 | 'url' => esc_url_raw( $this->tgmpa->get_tgmpa_url() ), |
| 2796 | - 'nonce' => 'bulk-' . $this->_args['plural'], |
|
| 2796 | + 'nonce' => 'bulk-'.$this->_args[ 'plural' ], |
|
| 2797 | 2797 | 'names' => $names, |
| 2798 | 2798 | 'install_type' => $install_type, |
| 2799 | 2799 | ) |
@@ -2826,10 +2826,10 @@ discard block |
||
| 2826 | 2826 | |
| 2827 | 2827 | // Bulk activation process. |
| 2828 | 2828 | if ( 'tgmpa-bulk-activate' === $this->current_action() ) { |
| 2829 | - check_admin_referer( 'bulk-' . $this->_args['plural'] ); |
|
| 2829 | + check_admin_referer( 'bulk-'.$this->_args[ 'plural' ] ); |
|
| 2830 | 2830 | |
| 2831 | 2831 | // Did user actually select any plugins to activate ? |
| 2832 | - if ( empty( $_POST['plugin'] ) ) { |
|
| 2832 | + if ( empty( $_POST[ 'plugin' ] ) ) { |
|
| 2833 | 2833 | echo '<div id="message" class="error"><p>', esc_html__( 'No plugins were selected to be activated. No action taken.', 'tgmpa' ), '</p></div>'; |
| 2834 | 2834 | |
| 2835 | 2835 | return false; |
@@ -2837,8 +2837,8 @@ discard block |
||
| 2837 | 2837 | |
| 2838 | 2838 | // Grab plugin data from $_POST. |
| 2839 | 2839 | $plugins = array(); |
| 2840 | - if ( isset( $_POST['plugin'] ) ) { |
|
| 2841 | - $plugins = array_map( 'urldecode', (array) $_POST['plugin'] ); |
|
| 2840 | + if ( isset( $_POST[ 'plugin' ] ) ) { |
|
| 2841 | + $plugins = array_map( 'urldecode', (array) $_POST[ 'plugin' ] ); |
|
| 2842 | 2842 | $plugins = array_map( array( $this->tgmpa, 'sanitize_key' ), $plugins ); |
| 2843 | 2843 | } |
| 2844 | 2844 | |
@@ -2848,8 +2848,8 @@ discard block |
||
| 2848 | 2848 | // Grab the file paths for the selected & inactive plugins from the registration array. |
| 2849 | 2849 | foreach ( $plugins as $slug ) { |
| 2850 | 2850 | if ( $this->tgmpa->can_plugin_activate( $slug ) ) { |
| 2851 | - $plugins_to_activate[] = $this->tgmpa->plugins[ $slug ]['file_path']; |
|
| 2852 | - $plugin_names[] = $this->tgmpa->plugins[ $slug ]['name']; |
|
| 2851 | + $plugins_to_activate[ ] = $this->tgmpa->plugins[ $slug ][ 'file_path' ]; |
|
| 2852 | + $plugin_names[ ] = $this->tgmpa->plugins[ $slug ][ 'name' ]; |
|
| 2853 | 2853 | } |
| 2854 | 2854 | } |
| 2855 | 2855 | unset( $slug ); |
@@ -2870,7 +2870,7 @@ discard block |
||
| 2870 | 2870 | $count = count( $plugin_names ); // Count so we can use _n function. |
| 2871 | 2871 | $plugin_names = array_map( array( 'TGMPA_Utils', 'wrap_in_strong' ), $plugin_names ); |
| 2872 | 2872 | $last_plugin = array_pop( $plugin_names ); // Pop off last name to prep for readability. |
| 2873 | - $imploded = empty( $plugin_names ) ? $last_plugin : ( implode( ', ', $plugin_names ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'tgmpa' ) . ' ' . $last_plugin ); |
|
| 2873 | + $imploded = empty( $plugin_names ) ? $last_plugin : ( implode( ', ', $plugin_names ).' '.esc_html_x( 'and', 'plugin A *and* plugin B', 'tgmpa' ).' '.$last_plugin ); |
|
| 2874 | 2874 | |
| 2875 | 2875 | printf( // WPCS: xss ok. |
| 2876 | 2876 | '<div id="message" class="updated"><p>%1$s %2$s.</p></div>', |
@@ -2973,16 +2973,16 @@ discard block |
||
| 2973 | 2973 | */ |
| 2974 | 2974 | function tgmpa_load_bulk_installer() { |
| 2975 | 2975 | // Silently fail if 2.5+ is loaded *after* an older version. |
| 2976 | - if ( ! isset( $GLOBALS['tgmpa'] ) ) { |
|
| 2976 | + if ( ! isset( $GLOBALS[ 'tgmpa' ] ) ) { |
|
| 2977 | 2977 | return; |
| 2978 | 2978 | } |
| 2979 | 2979 | |
| 2980 | 2980 | // Get TGMPA class instance. |
| 2981 | - $tgmpa_instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); |
|
| 2981 | + $tgmpa_instance = call_user_func( array( get_class( $GLOBALS[ 'tgmpa' ] ), 'get_instance' ) ); |
|
| 2982 | 2982 | |
| 2983 | - if ( isset( $_GET['page'] ) && $tgmpa_instance->menu === $_GET['page'] ) { |
|
| 2983 | + if ( isset( $_GET[ 'page' ] ) && $tgmpa_instance->menu === $_GET[ 'page' ] ) { |
|
| 2984 | 2984 | if ( ! class_exists( 'Plugin_Upgrader', false ) ) { |
| 2985 | - require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; |
|
| 2985 | + require_once ABSPATH.'wp-admin/includes/class-wp-upgrader.php'; |
|
| 2986 | 2986 | } |
| 2987 | 2987 | |
| 2988 | 2988 | if ( ! class_exists( 'TGMPA_Bulk_Installer' ) ) { |
@@ -3049,11 +3049,11 @@ discard block |
||
| 3049 | 3049 | */ |
| 3050 | 3050 | public function __construct( $skin = null ) { |
| 3051 | 3051 | // Get TGMPA class instance. |
| 3052 | - $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); |
|
| 3052 | + $this->tgmpa = call_user_func( array( get_class( $GLOBALS[ 'tgmpa' ] ), 'get_instance' ) ); |
|
| 3053 | 3053 | |
| 3054 | 3054 | parent::__construct( $skin ); |
| 3055 | 3055 | |
| 3056 | - if ( isset( $this->skin->options['install_type'] ) && 'update' === $this->skin->options['install_type'] ) { |
|
| 3056 | + if ( isset( $this->skin->options[ 'install_type' ] ) && 'update' === $this->skin->options[ 'install_type' ] ) { |
|
| 3057 | 3057 | $this->clear_destination = true; |
| 3058 | 3058 | } |
| 3059 | 3059 | |
@@ -3070,8 +3070,8 @@ discard block |
||
| 3070 | 3070 | * @since 2.2.0 |
| 3071 | 3071 | */ |
| 3072 | 3072 | public function activate_strings() { |
| 3073 | - $this->strings['activation_failed'] = __( 'Plugin activation failed.', 'tgmpa' ); |
|
| 3074 | - $this->strings['activation_success'] = __( 'Plugin activated successfully.', 'tgmpa' ); |
|
| 3073 | + $this->strings[ 'activation_failed' ] = __( 'Plugin activation failed.', 'tgmpa' ); |
|
| 3074 | + $this->strings[ 'activation_success' ] = __( 'Plugin activated successfully.', 'tgmpa' ); |
|
| 3075 | 3075 | } |
| 3076 | 3076 | |
| 3077 | 3077 | /** |
@@ -3089,7 +3089,7 @@ discard block |
||
| 3089 | 3089 | |
| 3090 | 3090 | // Reset the strings in case we changed one during automatic activation. |
| 3091 | 3091 | if ( $this->tgmpa->is_automatic ) { |
| 3092 | - if ( 'update' === $this->skin->options['install_type'] ) { |
|
| 3092 | + if ( 'update' === $this->skin->options[ 'install_type' ] ) { |
|
| 3093 | 3093 | $this->upgrade_strings(); |
| 3094 | 3094 | } else { |
| 3095 | 3095 | $this->install_strings(); |
@@ -3247,7 +3247,7 @@ discard block |
||
| 3247 | 3247 | remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 ); |
| 3248 | 3248 | |
| 3249 | 3249 | // Force refresh of plugin update information. |
| 3250 | - wp_clean_plugins_cache( $parsed_args['clear_update_cache'] ); |
|
| 3250 | + wp_clean_plugins_cache( $parsed_args[ 'clear_update_cache' ] ); |
|
| 3251 | 3251 | |
| 3252 | 3252 | return $results; |
| 3253 | 3253 | } |
@@ -3298,13 +3298,13 @@ discard block |
||
| 3298 | 3298 | $activate = activate_plugin( $plugin_info ); |
| 3299 | 3299 | |
| 3300 | 3300 | // Adjust the success string based on the activation result. |
| 3301 | - $this->strings['process_success'] = $this->strings['process_success'] . "<br />\n"; |
|
| 3301 | + $this->strings[ 'process_success' ] = $this->strings[ 'process_success' ]."<br />\n"; |
|
| 3302 | 3302 | |
| 3303 | 3303 | if ( is_wp_error( $activate ) ) { |
| 3304 | 3304 | $this->skin->error( $activate ); |
| 3305 | - $this->strings['process_success'] .= $this->strings['activation_failed']; |
|
| 3305 | + $this->strings[ 'process_success' ] .= $this->strings[ 'activation_failed' ]; |
|
| 3306 | 3306 | } else { |
| 3307 | - $this->strings['process_success'] .= $this->strings['activation_success']; |
|
| 3307 | + $this->strings[ 'process_success' ] .= $this->strings[ 'activation_success' ]; |
|
| 3308 | 3308 | } |
| 3309 | 3309 | } |
| 3310 | 3310 | } |
@@ -3380,7 +3380,7 @@ discard block |
||
| 3380 | 3380 | */ |
| 3381 | 3381 | public function __construct( $args = array() ) { |
| 3382 | 3382 | // Get TGMPA class instance. |
| 3383 | - $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); |
|
| 3383 | + $this->tgmpa = call_user_func( array( get_class( $GLOBALS[ 'tgmpa' ] ), 'get_instance' ) ); |
|
| 3384 | 3384 | |
| 3385 | 3385 | // Parse default and new args. |
| 3386 | 3386 | $defaults = array( |
@@ -3389,10 +3389,10 @@ discard block |
||
| 3389 | 3389 | 'names' => array(), |
| 3390 | 3390 | 'install_type' => 'install', |
| 3391 | 3391 | ); |
| 3392 | - $args = wp_parse_args( $args, $defaults ); |
|
| 3392 | + $args = wp_parse_args( $args, $defaults ); |
|
| 3393 | 3393 | |
| 3394 | 3394 | // Set plugin names to $this->plugin_names property. |
| 3395 | - $this->plugin_names = $args['names']; |
|
| 3395 | + $this->plugin_names = $args[ 'names' ]; |
|
| 3396 | 3396 | |
| 3397 | 3397 | // Extract the new args. |
| 3398 | 3398 | parent::__construct( $args ); |
@@ -3407,25 +3407,25 @@ discard block |
||
| 3407 | 3407 | * @since 2.2.0 |
| 3408 | 3408 | */ |
| 3409 | 3409 | public function add_strings() { |
| 3410 | - if ( 'update' === $this->options['install_type'] ) { |
|
| 3410 | + if ( 'update' === $this->options[ 'install_type' ] ) { |
|
| 3411 | 3411 | parent::add_strings(); |
| 3412 | - $this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)', 'tgmpa' ); |
|
| 3412 | + $this->upgrader->strings[ 'skin_before_update_header' ] = __( 'Updating Plugin %1$s (%2$d/%3$d)', 'tgmpa' ); |
|
| 3413 | 3413 | } else { |
| 3414 | - $this->upgrader->strings['skin_update_failed_error'] = __( 'An error occurred while installing %1$s: <strong>%2$s</strong>.', 'tgmpa' ); |
|
| 3415 | - $this->upgrader->strings['skin_update_failed'] = __( 'The installation of %1$s failed.', 'tgmpa' ); |
|
| 3414 | + $this->upgrader->strings[ 'skin_update_failed_error' ] = __( 'An error occurred while installing %1$s: <strong>%2$s</strong>.', 'tgmpa' ); |
|
| 3415 | + $this->upgrader->strings[ 'skin_update_failed' ] = __( 'The installation of %1$s failed.', 'tgmpa' ); |
|
| 3416 | 3416 | |
| 3417 | 3417 | if ( $this->tgmpa->is_automatic ) { |
| 3418 | 3418 | // Automatic activation strings. |
| 3419 | - $this->upgrader->strings['skin_upgrade_start'] = __( 'The installation and activation process is starting. This process may take a while on some hosts, so please be patient.', 'tgmpa' ); |
|
| 3420 | - $this->upgrader->strings['skin_update_successful'] = __( '%1$s installed and activated successfully.', 'tgmpa' ) . ' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>' . esc_html__( 'Show Details', 'tgmpa' ) . '</span><span class="hidden">' . esc_html__( 'Hide Details', 'tgmpa' ) . '</span>.</a>'; |
|
| 3421 | - $this->upgrader->strings['skin_upgrade_end'] = __( 'All installations and activations have been completed.', 'tgmpa' ); |
|
| 3422 | - $this->upgrader->strings['skin_before_update_header'] = __( 'Installing and Activating Plugin %1$s (%2$d/%3$d)', 'tgmpa' ); |
|
| 3419 | + $this->upgrader->strings[ 'skin_upgrade_start' ] = __( 'The installation and activation process is starting. This process may take a while on some hosts, so please be patient.', 'tgmpa' ); |
|
| 3420 | + $this->upgrader->strings[ 'skin_update_successful' ] = __( '%1$s installed and activated successfully.', 'tgmpa' ).' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>'.esc_html__( 'Show Details', 'tgmpa' ).'</span><span class="hidden">'.esc_html__( 'Hide Details', 'tgmpa' ).'</span>.</a>'; |
|
| 3421 | + $this->upgrader->strings[ 'skin_upgrade_end' ] = __( 'All installations and activations have been completed.', 'tgmpa' ); |
|
| 3422 | + $this->upgrader->strings[ 'skin_before_update_header' ] = __( 'Installing and Activating Plugin %1$s (%2$d/%3$d)', 'tgmpa' ); |
|
| 3423 | 3423 | } else { |
| 3424 | 3424 | // Default installation strings. |
| 3425 | - $this->upgrader->strings['skin_upgrade_start'] = __( 'The installation process is starting. This process may take a while on some hosts, so please be patient.', 'tgmpa' ); |
|
| 3426 | - $this->upgrader->strings['skin_update_successful'] = esc_html__( '%1$s installed successfully.', 'tgmpa' ) . ' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>' . esc_html__( 'Show Details', 'tgmpa' ) . '</span><span class="hidden">' . esc_html__( 'Hide Details', 'tgmpa' ) . '</span>.</a>'; |
|
| 3427 | - $this->upgrader->strings['skin_upgrade_end'] = __( 'All installations have been completed.', 'tgmpa' ); |
|
| 3428 | - $this->upgrader->strings['skin_before_update_header'] = __( 'Installing Plugin %1$s (%2$d/%3$d)', 'tgmpa' ); |
|
| 3425 | + $this->upgrader->strings[ 'skin_upgrade_start' ] = __( 'The installation process is starting. This process may take a while on some hosts, so please be patient.', 'tgmpa' ); |
|
| 3426 | + $this->upgrader->strings[ 'skin_update_successful' ] = esc_html__( '%1$s installed successfully.', 'tgmpa' ).' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>'.esc_html__( 'Show Details', 'tgmpa' ).'</span><span class="hidden">'.esc_html__( 'Hide Details', 'tgmpa' ).'</span>.</a>'; |
|
| 3427 | + $this->upgrader->strings[ 'skin_upgrade_end' ] = __( 'All installations have been completed.', 'tgmpa' ); |
|
| 3428 | + $this->upgrader->strings[ 'skin_before_update_header' ] = __( 'Installing Plugin %1$s (%2$d/%3$d)', 'tgmpa' ); |
|
| 3429 | 3429 | } |
| 3430 | 3430 | } |
| 3431 | 3431 | } |
@@ -3483,12 +3483,12 @@ discard block |
||
| 3483 | 3483 | if ( $this->tgmpa->is_tgmpa_complete() ) { |
| 3484 | 3484 | // All plugins are active, so we display the complete string and hide the menu to protect users. |
| 3485 | 3485 | echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>'; |
| 3486 | - $update_actions['dashboard'] = sprintf( |
|
| 3487 | - esc_html( $this->tgmpa->strings['complete'] ), |
|
| 3488 | - '<a href="' . esc_url( self_admin_url() ) . '">' . esc_html__( 'Return to the Dashboard', 'tgmpa' ) . '</a>' |
|
| 3486 | + $update_actions[ 'dashboard' ] = sprintf( |
|
| 3487 | + esc_html( $this->tgmpa->strings[ 'complete' ] ), |
|
| 3488 | + '<a href="'.esc_url( self_admin_url() ).'">'.esc_html__( 'Return to the Dashboard', 'tgmpa' ).'</a>' |
|
| 3489 | 3489 | ); |
| 3490 | 3490 | } else { |
| 3491 | - $update_actions['tgmpa_page'] = '<a href="' . esc_url( $this->tgmpa->get_tgmpa_url() ) . '" target="_parent">' . esc_html( $this->tgmpa->strings['return'] ) . '</a>'; |
|
| 3491 | + $update_actions[ 'tgmpa_page' ] = '<a href="'.esc_url( $this->tgmpa->get_tgmpa_url() ).'" target="_parent">'.esc_html( $this->tgmpa->strings[ 'return' ] ).'</a>'; |
|
| 3492 | 3492 | } |
| 3493 | 3493 | |
| 3494 | 3494 | /** |
@@ -3578,7 +3578,7 @@ discard block |
||
| 3578 | 3578 | * @return string |
| 3579 | 3579 | */ |
| 3580 | 3580 | public static function wrap_in_em( $string ) { |
| 3581 | - return '<em>' . wp_kses_post( $string ) . '</em>'; |
|
| 3581 | + return '<em>'.wp_kses_post( $string ).'</em>'; |
|
| 3582 | 3582 | } |
| 3583 | 3583 | |
| 3584 | 3584 | /** |
@@ -3592,7 +3592,7 @@ discard block |
||
| 3592 | 3592 | * @return string |
| 3593 | 3593 | */ |
| 3594 | 3594 | public static function wrap_in_strong( $string ) { |
| 3595 | - return '<strong>' . wp_kses_post( $string ) . '</strong>'; |
|
| 3595 | + return '<strong>'.wp_kses_post( $string ).'</strong>'; |
|
| 3596 | 3596 | } |
| 3597 | 3597 | |
| 3598 | 3598 | /** |
@@ -3629,7 +3629,7 @@ discard block |
||
| 3629 | 3629 | */ |
| 3630 | 3630 | protected static function emulate_filter_bool( $value ) { |
| 3631 | 3631 | // @codingStandardsIgnoreStart |
| 3632 | - static $true = array( |
|
| 3632 | + static $true = array( |
|
| 3633 | 3633 | '1', |
| 3634 | 3634 | 'true', 'True', 'TRUE', |
| 3635 | 3635 | 'y', 'Y', |
@@ -1,21 +1,21 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * This file represents an example of the code that themes would use to register |
|
| 4 | - * the required plugins. |
|
| 5 | - * |
|
| 6 | - * It is expected that theme authors would copy and paste this code into their |
|
| 7 | - * functions.php file, and amend to suit. |
|
| 8 | - * |
|
| 9 | - * @see http://tgmpluginactivation.com/configuration/ for detailed documentation. |
|
| 10 | - * |
|
| 11 | - * @package TGM-Plugin-Activation |
|
| 12 | - * @subpackage Example |
|
| 13 | - * @version 2.5.2 |
|
| 14 | - * @author Thomas Griffin, Gary Jones, Juliette Reinders Folmer |
|
| 15 | - * @copyright Copyright (c) 2011, Thomas Griffin |
|
| 16 | - * @license http://opensource.org/licenses/gpl-2.0.php GPL v2 or later |
|
| 17 | - * @link https://github.com/TGMPA/TGM-Plugin-Activation |
|
| 18 | - */ |
|
| 3 | + * This file represents an example of the code that themes would use to register |
|
| 4 | + * the required plugins. |
|
| 5 | + * |
|
| 6 | + * It is expected that theme authors would copy and paste this code into their |
|
| 7 | + * functions.php file, and amend to suit. |
|
| 8 | + * |
|
| 9 | + * @see http://tgmpluginactivation.com/configuration/ for detailed documentation. |
|
| 10 | + * |
|
| 11 | + * @package TGM-Plugin-Activation |
|
| 12 | + * @subpackage Example |
|
| 13 | + * @version 2.5.2 |
|
| 14 | + * @author Thomas Griffin, Gary Jones, Juliette Reinders Folmer |
|
| 15 | + * @copyright Copyright (c) 2011, Thomas Griffin |
|
| 16 | + * @license http://opensource.org/licenses/gpl-2.0.php GPL v2 or later |
|
| 17 | + * @link https://github.com/TGMPA/TGM-Plugin-Activation |
|
| 18 | + */ |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * Include the TGM_Plugin_Activation class. |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | /** |
| 21 | 21 | * Include the TGM_Plugin_Activation class. |
| 22 | 22 | */ |
| 23 | -require_once dirname( __FILE__ ) . '/class-tgm-plugin-activation.php'; |
|
| 23 | +require_once dirname( __FILE__ ).'/class-tgm-plugin-activation.php'; |
|
| 24 | 24 | |
| 25 | 25 | add_action( 'tgmpa_register', 'my_theme_register_required_plugins' ); |
| 26 | 26 | /** |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | array( |
| 49 | 49 | 'name' => 'TGM Example Plugin', // The plugin name. |
| 50 | 50 | 'slug' => 'tgm-example-plugin', // The plugin slug (typically the folder name). |
| 51 | - 'source' => get_stylesheet_directory() . '/lib/plugins/tgm-example-plugin.zip', // The plugin source. |
|
| 51 | + 'source' => get_stylesheet_directory().'/lib/plugins/tgm-example-plugin.zip', // The plugin source. |
|
| 52 | 52 | 'required' => true, // If false, the plugin is only 'recommended' instead of required. |
| 53 | 53 | 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher. If the plugin version is higher than the plugin version installed, the user will be notified to update the plugin. |
| 54 | 54 | 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch. |
@@ -106,16 +106,16 @@ discard block |
||
| 106 | 106 | * Only uncomment the strings in the config array if you want to customize the strings. |
| 107 | 107 | */ |
| 108 | 108 | $config = array( |
| 109 | - 'id' => 'tgmpa', // Unique ID for hashing notices for multiple instances of TGMPA. |
|
| 110 | - 'default_path' => '', // Default absolute path to bundled plugins. |
|
| 109 | + 'id' => 'tgmpa', // Unique ID for hashing notices for multiple instances of TGMPA. |
|
| 110 | + 'default_path' => '', // Default absolute path to bundled plugins. |
|
| 111 | 111 | 'menu' => 'tgmpa-install-plugins', // Menu slug. |
| 112 | - 'parent_slug' => 'themes.php', // Parent menu slug. |
|
| 113 | - 'capability' => 'edit_theme_options', // Capability needed to view plugin install page, should be a capability associated with the parent menu used. |
|
| 114 | - 'has_notices' => true, // Show admin notices or not. |
|
| 115 | - 'dismissable' => true, // If false, a user cannot dismiss the nag message. |
|
| 116 | - 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. |
|
| 117 | - 'is_automatic' => false, // Automatically activate plugins after installation or not. |
|
| 118 | - 'message' => '', // Message to output right before the plugins table. |
|
| 112 | + 'parent_slug' => 'themes.php', // Parent menu slug. |
|
| 113 | + 'capability' => 'edit_theme_options', // Capability needed to view plugin install page, should be a capability associated with the parent menu used. |
|
| 114 | + 'has_notices' => true, // Show admin notices or not. |
|
| 115 | + 'dismissable' => true, // If false, a user cannot dismiss the nag message. |
|
| 116 | + 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. |
|
| 117 | + 'is_automatic' => false, // Automatically activate plugins after installation or not. |
|
| 118 | + 'message' => '', // Message to output right before the plugins table. |
|
| 119 | 119 | |
| 120 | 120 | /* |
| 121 | 121 | 'strings' => array( |