Completed
Push — develop ( 5e31dd...6c1373 )
by Gary
01:59
created
class-tgm-plugin-activation.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1327,13 +1327,13 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Spacing   +275 added lines, -275 removed lines patch added patch discarded remove patch
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
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 ) );
@@ -455,10 +455,10 @@  discard block
 block discarded – undo
455 455
 			if ( false !== strpos( __FILE__, WP_PLUGIN_DIR ) || false !== strpos( __FILE__, WPMU_PLUGIN_DIR ) ) {
456 456
 				// Plugin, we'll need to adjust the file name.
457 457
 				add_action( 'load_textdomain_mofile', array( $this, 'correct_plugin_mofile' ), 10, 2 );
458
-				load_theme_textdomain( 'tgmpa', dirname( __FILE__ ) . '/languages' );
458
+				load_theme_textdomain( 'tgmpa', dirname( __FILE__ ).'/languages' );
459 459
 				remove_action( 'load_textdomain_mofile', array( $this, 'correct_plugin_mofile' ), 10 );
460 460
 			} else {
461
-				load_theme_textdomain( 'tgmpa', dirname( __FILE__ ) . '/languages' );
461
+				load_theme_textdomain( 'tgmpa', dirname( __FILE__ ).'/languages' );
462 462
 			}
463 463
 		}
464 464
 
@@ -531,15 +531,15 @@  discard block
 block discarded – undo
531 531
 		public function add_plugin_action_link_filters() {
532 532
 			foreach ( $this->plugins as $slug => $plugin ) {
533 533
 				if ( false === $this->can_plugin_activate( $slug ) ) {
534
-					add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_activate' ), 20 );
534
+					add_filter( 'plugin_action_links_'.$plugin[ 'file_path' ], array( $this, 'filter_plugin_action_links_activate' ), 20 );
535 535
 				}
536 536
 
537
-				if ( true === $plugin['force_activation'] ) {
538
-					add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_deactivate' ), 20 );
537
+				if ( true === $plugin[ 'force_activation' ] ) {
538
+					add_filter( 'plugin_action_links_'.$plugin[ 'file_path' ], array( $this, 'filter_plugin_action_links_deactivate' ), 20 );
539 539
 				}
540 540
 
541 541
 				if ( false !== $this->does_plugin_require_update( $slug ) ) {
542
-					add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_update' ), 20 );
542
+					add_filter( 'plugin_action_links_'.$plugin[ 'file_path' ], array( $this, 'filter_plugin_action_links_update' ), 20 );
543 543
 				}
544 544
 			}
545 545
 		}
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 		 * @return array
555 555
 		 */
556 556
 		public function filter_plugin_action_links_activate( $actions ) {
557
-			unset( $actions['activate'] );
557
+			unset( $actions[ 'activate' ] );
558 558
 
559 559
 			return $actions;
560 560
 		}
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
 		 * @return array
569 569
 		 */
570 570
 		public function filter_plugin_action_links_deactivate( $actions ) {
571
-			unset( $actions['deactivate'] );
571
+			unset( $actions[ 'deactivate' ] );
572 572
 
573 573
 			return $actions;
574 574
 		}
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
 		 * @return array
584 584
 		 */
585 585
 		public function filter_plugin_action_links_update( $actions ) {
586
-			$actions['update'] = sprintf(
586
+			$actions[ 'update' ] = sprintf(
587 587
 				'<a href="%1$s" title="%2$s" class="edit">%3$s</a>',
588 588
 				esc_url( $this->get_tgmpa_status_url( 'update' ) ),
589 589
 				esc_attr__( 'This plugin needs to be updated to be compatible with your theme.', 'tgmpa' ),
@@ -621,9 +621,9 @@  discard block
 block discarded – undo
621 621
 				return;
622 622
 			}
623 623
 
624
-			if ( isset( $_REQUEST['tab'] ) && 'plugin-information' === $_REQUEST['tab'] ) {
624
+			if ( isset( $_REQUEST[ 'tab' ] ) && 'plugin-information' === $_REQUEST[ 'tab' ] ) {
625 625
 				// Needed for install_plugin_information().
626
-				require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
626
+				require_once ABSPATH.'wp-admin/includes/plugin-install.php';
627 627
 
628 628
 				wp_enqueue_style( 'plugin-install' );
629 629
 
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
 		 * @since 2.1.0
652 652
 		 */
653 653
 		public function thickbox() {
654
-			if ( ! get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) ) {
654
+			if ( ! get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_'.$this->id, true ) ) {
655 655
 				add_thickbox();
656 656
 			}
657 657
 		}
@@ -680,11 +680,11 @@  discard block
 block discarded – undo
680 680
 			$args = apply_filters(
681 681
 				'tgmpa_admin_menu_args',
682 682
 				array(
683
-					'parent_slug' => $this->parent_slug,                     // Parent Menu slug.
684
-					'page_title'  => $this->strings['page_title'],           // Page title.
685
-					'menu_title'  => $this->strings['menu_title'],           // Menu title.
686
-					'capability'  => $this->capability,                      // Capability.
687
-					'menu_slug'   => $this->menu,                            // Menu slug.
683
+					'parent_slug' => $this->parent_slug, // Parent Menu slug.
684
+					'page_title'  => $this->strings[ 'page_title' ], // Page title.
685
+					'menu_title'  => $this->strings[ 'menu_title' ], // Menu title.
686
+					'capability'  => $this->capability, // Capability.
687
+					'menu_slug'   => $this->menu, // Menu slug.
688 688
 					'function'    => array( $this, 'install_plugins_page' ), // Callback.
689 689
 				)
690 690
 			);
@@ -708,9 +708,9 @@  discard block
 block discarded – undo
708 708
 			}
709 709
 
710 710
 			if ( 'themes.php' === $this->parent_slug ) {
711
-				$this->page_hook = call_user_func( 'add_theme_page', $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] );
711
+				$this->page_hook = call_user_func( 'add_theme_page', $args[ 'page_title' ], $args[ 'menu_title' ], $args[ 'capability' ], $args[ 'menu_slug' ], $args[ 'function' ] );
712 712
 			} else {
713
-				$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'] );
713
+				$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' ] );
714 714
 			}
715 715
 		}
716 716
 
@@ -779,37 +779,37 @@  discard block
 block discarded – undo
779 779
 		 * @return boolean True on success, false on failure.
780 780
 		 */
781 781
 		protected function do_plugin_install() {
782
-			if ( empty( $_GET['plugin'] ) ) {
782
+			if ( empty( $_GET[ 'plugin' ] ) ) {
783 783
 				return false;
784 784
 			}
785 785
 
786 786
 			// All plugin information will be stored in an array for processing.
787
-			$slug = $this->sanitize_key( urldecode( $_GET['plugin'] ) );
787
+			$slug = $this->sanitize_key( urldecode( $_GET[ 'plugin' ] ) );
788 788
 
789 789
 			if ( ! isset( $this->plugins[ $slug ] ) ) {
790 790
 				return false;
791 791
 			}
792 792
 
793 793
 			// Was an install or upgrade action link clicked?
794
-			if ( ( isset( $_GET['tgmpa-install'] ) && 'install-plugin' === $_GET['tgmpa-install'] ) || ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) ) {
794
+			if ( ( isset( $_GET[ 'tgmpa-install' ] ) && 'install-plugin' === $_GET[ 'tgmpa-install' ] ) || ( isset( $_GET[ 'tgmpa-update' ] ) && 'update-plugin' === $_GET[ 'tgmpa-update' ] ) ) {
795 795
 
796 796
 				$install_type = 'install';
797
-				if ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) {
797
+				if ( isset( $_GET[ 'tgmpa-update' ] ) && 'update-plugin' === $_GET[ 'tgmpa-update' ] ) {
798 798
 					$install_type = 'update';
799 799
 				}
800 800
 
801
-				check_admin_referer( 'tgmpa-' . $install_type, 'tgmpa-nonce' );
801
+				check_admin_referer( 'tgmpa-'.$install_type, 'tgmpa-nonce' );
802 802
 
803 803
 				// Pass necessary information via URL if WP_Filesystem is needed.
804 804
 				$url = wp_nonce_url(
805 805
 					add_query_arg(
806 806
 						array(
807 807
 							'plugin'                 => urlencode( $slug ),
808
-							'tgmpa-' . $install_type => $install_type . '-plugin',
808
+							'tgmpa-'.$install_type => $install_type.'-plugin',
809 809
 						),
810 810
 						$this->get_tgmpa_url()
811 811
 					),
812
-					'tgmpa-' . $install_type,
812
+					'tgmpa-'.$install_type,
813 813
 					'tgmpa-nonce'
814 814
 				);
815 815
 
@@ -828,29 +828,29 @@  discard block
 block discarded – undo
828 828
 
829 829
 				// Prep variables for Plugin_Installer_Skin class.
830 830
 				$extra         = array();
831
-				$extra['slug'] = $slug; // Needed for potentially renaming of directory name.
831
+				$extra[ 'slug' ] = $slug; // Needed for potentially renaming of directory name.
832 832
 				$source        = $this->get_download_url( $slug );
833
-				$api           = ( 'repo' === $this->plugins[ $slug ]['source_type'] ) ? $this->get_plugins_api( $slug ) : null;
833
+				$api           = ( 'repo' === $this->plugins[ $slug ][ 'source_type' ] ) ? $this->get_plugins_api( $slug ) : null;
834 834
 				$api           = ( false !== $api ) ? $api : null;
835 835
 
836 836
 				$url = add_query_arg(
837 837
 					array(
838
-						'action' => $install_type . '-plugin',
838
+						'action' => $install_type.'-plugin',
839 839
 						'plugin' => urlencode( $slug ),
840 840
 					),
841 841
 					'update.php'
842 842
 				);
843 843
 
844 844
 				if ( ! class_exists( 'Plugin_Upgrader', false ) ) {
845
-					require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
845
+					require_once ABSPATH.'wp-admin/includes/class-wp-upgrader.php';
846 846
 				}
847 847
 
848
-				$title     = ( 'update' === $install_type ) ? $this->strings['updating'] : $this->strings['installing'];
848
+				$title     = ( 'update' === $install_type ) ? $this->strings[ 'updating' ] : $this->strings[ 'installing' ];
849 849
 				$skin_args = array(
850
-					'type'   => ( 'bundled' !== $this->plugins[ $slug ]['source_type'] ) ? 'web' : 'upload',
851
-					'title'  => sprintf( $title, $this->plugins[ $slug ]['name'] ),
850
+					'type'   => ( 'bundled' !== $this->plugins[ $slug ][ 'source_type' ] ) ? 'web' : 'upload',
851
+					'title'  => sprintf( $title, $this->plugins[ $slug ][ 'name' ] ),
852 852
 					'url'    => esc_url_raw( $url ),
853
-					'nonce'  => $install_type . '-plugin_' . $slug,
853
+					'nonce'  => $install_type.'-plugin_'.$slug,
854 854
 					'plugin' => '',
855 855
 					'api'    => $api,
856 856
 					'extra'  => $extra,
@@ -858,7 +858,7 @@  discard block
 block discarded – undo
858 858
 				unset( $title );
859 859
 
860 860
 				if ( 'update' === $install_type ) {
861
-					$skin_args['plugin'] = $this->plugins[ $slug ]['file_path'];
861
+					$skin_args[ 'plugin' ] = $this->plugins[ $slug ][ 'file_path' ];
862 862
 					$skin                = new Plugin_Upgrader_Skin( $skin_args );
863 863
 				} else {
864 864
 					$skin = new Plugin_Installer_Skin( $skin_args );
@@ -873,10 +873,10 @@  discard block
 block discarded – undo
873 873
 				if ( 'update' === $install_type ) {
874 874
 					// Inject our info into the update transient.
875 875
 					$to_inject                    = array( $slug => $this->plugins[ $slug ] );
876
-					$to_inject[ $slug ]['source'] = $source;
876
+					$to_inject[ $slug ][ 'source' ] = $source;
877 877
 					$this->inject_update_info( $to_inject );
878 878
 
879
-					$upgrader->upgrade( $this->plugins[ $slug ]['file_path'] );
879
+					$upgrader->upgrade( $this->plugins[ $slug ][ 'file_path' ] );
880 880
 				} else {
881 881
 					$upgrader->install( $source );
882 882
 				}
@@ -899,18 +899,18 @@  discard block
 block discarded – undo
899 899
 
900 900
 				// Display message based on if all plugins are now active or not.
901 901
 				if ( $this->is_tgmpa_complete() ) {
902
-					echo '<p>', sprintf( esc_html( $this->strings['complete'] ), '<a href="' . esc_url( self_admin_url() ) . '">' . esc_html__( 'Return to the Dashboard', 'tgmpa' ) . '</a>' ), '</p>';
902
+					echo '<p>', sprintf( esc_html( $this->strings[ 'complete' ] ), '<a href="'.esc_url( self_admin_url() ).'">'.esc_html__( 'Return to the Dashboard', 'tgmpa' ).'</a>' ), '</p>';
903 903
 					echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>';
904 904
 				} else {
905
-					echo '<p><a href="', esc_url( $this->get_tgmpa_url() ), '" target="_parent">', esc_html( $this->strings['return'] ), '</a></p>';
905
+					echo '<p><a href="', esc_url( $this->get_tgmpa_url() ), '" target="_parent">', esc_html( $this->strings[ 'return' ] ), '</a></p>';
906 906
 				}
907 907
 
908 908
 				return true;
909
-			} elseif ( isset( $this->plugins[ $slug ]['file_path'], $_GET['tgmpa-activate'] ) && 'activate-plugin' === $_GET['tgmpa-activate'] ) {
909
+			} elseif ( isset( $this->plugins[ $slug ][ 'file_path' ], $_GET[ 'tgmpa-activate' ] ) && 'activate-plugin' === $_GET[ 'tgmpa-activate' ] ) {
910 910
 				// Activate action link was clicked.
911 911
 				check_admin_referer( 'tgmpa-activate', 'tgmpa-nonce' );
912 912
 
913
-				if ( false === $this->activate_single_plugin( $this->plugins[ $slug ]['file_path'], $slug ) ) {
913
+				if ( false === $this->activate_single_plugin( $this->plugins[ $slug ][ 'file_path' ], $slug ) ) {
914 914
 					return true; // Finish execution of the function early as we encountered an error.
915 915
 				}
916 916
 			}
@@ -933,7 +933,7 @@  discard block
 block discarded – undo
933 933
 			}
934 934
 
935 935
 			foreach ( $plugins as $slug => $plugin ) {
936
-				$file_path = $plugin['file_path'];
936
+				$file_path = $plugin[ 'file_path' ];
937 937
 
938 938
 				if ( empty( $repo_updates->response[ $file_path ] ) ) {
939 939
 					$repo_updates->response[ $file_path ] = new stdClass;
@@ -942,10 +942,10 @@  discard block
 block discarded – undo
942 942
 				// We only really need to set package, but let's do all we can in case WP changes something.
943 943
 				$repo_updates->response[ $file_path ]->slug        = $slug;
944 944
 				$repo_updates->response[ $file_path ]->plugin      = $file_path;
945
-				$repo_updates->response[ $file_path ]->new_version = $plugin['version'];
946
-				$repo_updates->response[ $file_path ]->package     = $plugin['source'];
947
-				if ( empty( $repo_updates->response[ $file_path ]->url ) && ! empty( $plugin['external_url'] ) ) {
948
-					$repo_updates->response[ $file_path ]->url = $plugin['external_url'];
945
+				$repo_updates->response[ $file_path ]->new_version = $plugin[ 'version' ];
946
+				$repo_updates->response[ $file_path ]->package     = $plugin[ 'source' ];
947
+				if ( empty( $repo_updates->response[ $file_path ]->url ) && ! empty( $plugin[ 'external_url' ] ) ) {
948
+					$repo_updates->response[ $file_path ]->url = $plugin[ 'external_url' ];
949 949
 				}
950 950
 			}
951 951
 
@@ -969,13 +969,13 @@  discard block
 block discarded – undo
969 969
 		 * @return string $source
970 970
 		 */
971 971
 		public function maybe_adjust_source_dir( $source, $remote_source, $upgrader ) {
972
-			if ( ! $this->is_tgmpa_page() || ! is_object( $GLOBALS['wp_filesystem'] ) ) {
972
+			if ( ! $this->is_tgmpa_page() || ! is_object( $GLOBALS[ 'wp_filesystem' ] ) ) {
973 973
 				return $source;
974 974
 			}
975 975
 
976 976
 			// Check for single file plugins.
977
-			$source_files = array_keys( $GLOBALS['wp_filesystem']->dirlist( $remote_source ) );
978
-			if ( 1 === count( $source_files ) && false === $GLOBALS['wp_filesystem']->is_dir( $source ) ) {
977
+			$source_files = array_keys( $GLOBALS[ 'wp_filesystem' ]->dirlist( $remote_source ) );
978
+			if ( 1 === count( $source_files ) && false === $GLOBALS[ 'wp_filesystem' ]->is_dir( $source ) ) {
979 979
 				return $source;
980 980
 			}
981 981
 
@@ -983,12 +983,12 @@  discard block
 block discarded – undo
983 983
 			$desired_slug = '';
984 984
 
985 985
 			// Figure out what the slug is supposed to be.
986
-			if ( false === $upgrader->bulk && ! empty( $upgrader->skin->options['extra']['slug'] ) ) {
987
-				$desired_slug = $upgrader->skin->options['extra']['slug'];
986
+			if ( false === $upgrader->bulk && ! empty( $upgrader->skin->options[ 'extra' ][ 'slug' ] ) ) {
987
+				$desired_slug = $upgrader->skin->options[ 'extra' ][ 'slug' ];
988 988
 			} else {
989 989
 				// Bulk installer contains less info, so fall back on the info registered here.
990 990
 				foreach ( $this->plugins as $slug => $plugin ) {
991
-					if ( ! empty( $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) && $plugin['name'] === $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) {
991
+					if ( ! empty( $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) && $plugin[ 'name' ] === $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) {
992 992
 						$desired_slug = $slug;
993 993
 						break;
994 994
 					}
@@ -1001,15 +1001,15 @@  discard block
 block discarded – undo
1001 1001
 
1002 1002
 				if ( ! empty( $subdir_name ) && $subdir_name !== $desired_slug ) {
1003 1003
 					$from = untrailingslashit( $source );
1004
-					$to   = trailingslashit( $remote_source ) . $desired_slug;
1004
+					$to   = trailingslashit( $remote_source ).$desired_slug;
1005 1005
 
1006
-					if ( true === $GLOBALS['wp_filesystem']->move( $from, $to ) ) {
1006
+					if ( true === $GLOBALS[ 'wp_filesystem' ]->move( $from, $to ) ) {
1007 1007
 						return trailingslashit( $to );
1008 1008
 					} else {
1009
-						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 ) );
1009
+						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 ) );
1010 1010
 					}
1011 1011
 				} elseif ( empty( $subdir_name ) ) {
1012
-					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 ) );
1012
+					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 ) );
1013 1013
 				}
1014 1014
 			}
1015 1015
 
@@ -1033,19 +1033,19 @@  discard block
 block discarded – undo
1033 1033
 
1034 1034
 				if ( is_wp_error( $activate ) ) {
1035 1035
 					echo '<div id="message" class="error"><p>', wp_kses_post( $activate->get_error_message() ), '</p></div>',
1036
-						'<p><a href="', esc_url( $this->get_tgmpa_url() ), '" target="_parent">', esc_html( $this->strings['return'] ), '</a></p>';
1036
+						'<p><a href="', esc_url( $this->get_tgmpa_url() ), '" target="_parent">', esc_html( $this->strings[ 'return' ] ), '</a></p>';
1037 1037
 
1038 1038
 					return false; // End it here if there is an error with activation.
1039 1039
 				} else {
1040 1040
 					if ( ! $automatic ) {
1041 1041
 						// Make sure message doesn't display again if bulk activation is performed
1042 1042
 						// immediately after a single activation.
1043
-						if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK.
1044
-							echo '<div id="message" class="updated"><p>', esc_html( $this->strings['activated_successfully'] ), ' <strong>', esc_html( $this->plugins[ $slug ]['name'] ), '.</strong></p></div>';
1043
+						if ( ! isset( $_POST[ 'action' ] ) ) { // WPCS: CSRF OK.
1044
+							echo '<div id="message" class="updated"><p>', esc_html( $this->strings[ 'activated_successfully' ] ), ' <strong>', esc_html( $this->plugins[ $slug ][ 'name' ] ), '.</strong></p></div>';
1045 1045
 						}
1046 1046
 					} else {
1047 1047
 						// Simpler message layout for use on the plugin install page.
1048
-						echo '<p>', esc_html( $this->strings['plugin_activated'] ), '</p>';
1048
+						echo '<p>', esc_html( $this->strings[ 'plugin_activated' ] ), '</p>';
1049 1049
 					}
1050 1050
 				}
1051 1051
 			} elseif ( $this->is_plugin_active( $slug ) ) {
@@ -1053,25 +1053,25 @@  discard block
 block discarded – undo
1053 1053
 				// on the plugin install page.
1054 1054
 				echo '<div id="message" class="error"><p>',
1055 1055
 					sprintf(
1056
-						esc_html( $this->strings['plugin_already_active'] ),
1057
-						'<strong>' . esc_html( $this->plugins[ $slug ]['name'] ) . '</strong>'
1056
+						esc_html( $this->strings[ 'plugin_already_active' ] ),
1057
+						'<strong>'.esc_html( $this->plugins[ $slug ][ 'name' ] ).'</strong>'
1058 1058
 					),
1059 1059
 					'</p></div>';
1060 1060
 			} elseif ( $this->does_plugin_require_update( $slug ) ) {
1061 1061
 				if ( ! $automatic ) {
1062 1062
 					// Make sure message doesn't display again if bulk activation is performed
1063 1063
 					// immediately after a single activation.
1064
-					if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK.
1064
+					if ( ! isset( $_POST[ 'action' ] ) ) { // WPCS: CSRF OK.
1065 1065
 						echo '<div id="message" class="error"><p>',
1066 1066
 							sprintf(
1067
-								esc_html( $this->strings['plugin_needs_higher_version'] ),
1068
-								'<strong>' . esc_html( $this->plugins[ $slug ]['name'] ) . '</strong>'
1067
+								esc_html( $this->strings[ 'plugin_needs_higher_version' ] ),
1068
+								'<strong>'.esc_html( $this->plugins[ $slug ][ 'name' ] ).'</strong>'
1069 1069
 							),
1070 1070
 							'</p></div>';
1071 1071
 					}
1072 1072
 				} else {
1073 1073
 					// Simpler message layout for use on the plugin install page.
1074
-					echo '<p>', sprintf( esc_html( $this->strings['plugin_needs_higher_version'] ), esc_html( $this->plugins[ $slug ]['name'] ) ), '</p>';
1074
+					echo '<p>', sprintf( esc_html( $this->strings[ 'plugin_needs_higher_version' ] ), esc_html( $this->plugins[ $slug ][ 'name' ] ) ), '</p>';
1075 1075
 				}
1076 1076
 			}
1077 1077
 
@@ -1095,7 +1095,7 @@  discard block
 block discarded – undo
1095 1095
 		 */
1096 1096
 		public function notices() {
1097 1097
 			// Remove nag on the install page / Return early if the nag message has been dismissed or user < author.
1098
-			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' ) ) ) {
1098
+			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' ) ) ) {
1099 1099
 				return;
1100 1100
 			}
1101 1101
 
@@ -1117,13 +1117,13 @@  discard block
 block discarded – undo
1117 1117
 					if ( current_user_can( 'install_plugins' ) ) {
1118 1118
 						$install_link_count++;
1119 1119
 
1120
-						if ( true === $plugin['required'] ) {
1121
-							$message['notice_can_install_required'][] = $slug;
1120
+						if ( true === $plugin[ 'required' ] ) {
1121
+							$message[ 'notice_can_install_required' ][ ] = $slug;
1122 1122
 						} else {
1123
-							$message['notice_can_install_recommended'][] = $slug;
1123
+							$message[ 'notice_can_install_recommended' ][ ] = $slug;
1124 1124
 						}
1125 1125
 					}
1126
-					if ( true === $plugin['required'] ) {
1126
+					if ( true === $plugin[ 'required' ] ) {
1127 1127
 						$total_required_action_count++;
1128 1128
 					}
1129 1129
 				} else {
@@ -1131,13 +1131,13 @@  discard block
 block discarded – undo
1131 1131
 						if ( current_user_can( 'activate_plugins' ) ) {
1132 1132
 							$activate_link_count++;
1133 1133
 
1134
-							if ( true === $plugin['required'] ) {
1135
-								$message['notice_can_activate_required'][] = $slug;
1134
+							if ( true === $plugin[ 'required' ] ) {
1135
+								$message[ 'notice_can_activate_required' ][ ] = $slug;
1136 1136
 							} else {
1137
-								$message['notice_can_activate_recommended'][] = $slug;
1137
+								$message[ 'notice_can_activate_recommended' ][ ] = $slug;
1138 1138
 							}
1139 1139
 						}
1140
-						if ( true === $plugin['required'] ) {
1140
+						if ( true === $plugin[ 'required' ] ) {
1141 1141
 							$total_required_action_count++;
1142 1142
 						}
1143 1143
 					}
@@ -1148,12 +1148,12 @@  discard block
 block discarded – undo
1148 1148
 							$update_link_count++;
1149 1149
 
1150 1150
 							if ( $this->does_plugin_require_update( $slug ) ) {
1151
-								$message['notice_ask_to_update'][] = $slug;
1151
+								$message[ 'notice_ask_to_update' ][ ] = $slug;
1152 1152
 							} elseif ( false !== $this->does_plugin_have_update( $slug ) ) {
1153
-								$message['notice_ask_to_update_maybe'][] = $slug;
1153
+								$message[ 'notice_ask_to_update_maybe' ][ ] = $slug;
1154 1154
 							}
1155 1155
 						}
1156
-						if ( true === $plugin['required'] ) {
1156
+						if ( true === $plugin[ 'required' ] ) {
1157 1157
 							$total_required_action_count++;
1158 1158
 						}
1159 1159
 					}
@@ -1168,10 +1168,10 @@  discard block
 block discarded – undo
1168 1168
 
1169 1169
 				// As add_settings_error() wraps the final message in a <p> and as the final message can't be
1170 1170
 				// filtered, using <p>'s in our html would render invalid html output.
1171
-				$line_template = '<span style="display: block; margin: 0.5em 0.5em 0 0; clear: both;">%s</span>' . "\n";
1171
+				$line_template = '<span style="display: block; margin: 0.5em 0.5em 0 0; clear: both;">%s</span>'."\n";
1172 1172
 
1173 1173
 				if ( ! current_user_can( 'activate_plugins' ) && ! current_user_can( 'install_plugins' ) && ! current_user_can( 'update_plugins' ) ) {
1174
-					$rendered = esc_html__( $this->strings['notice_cannot_install_activate'] ) . ' ' . esc_html__( $this->strings['contact_admin'] );
1174
+					$rendered = esc_html__( $this->strings[ 'notice_cannot_install_activate' ] ).' '.esc_html__( $this->strings[ 'contact_admin' ] );
1175 1175
 					$rendered .= $this->create_user_action_links_for_notice( 0, 0, 0, $line_template );
1176 1176
 				} else {
1177 1177
 
@@ -1186,14 +1186,14 @@  discard block
 block discarded – undo
1186 1186
 
1187 1187
 						// Get the external info link for a plugin if one is available.
1188 1188
 						foreach ( $plugin_group as $plugin_slug ) {
1189
-							$linked_plugins[] = $this->get_info_link( $plugin_slug );
1189
+							$linked_plugins[ ] = $this->get_info_link( $plugin_slug );
1190 1190
 						}
1191 1191
 						unset( $plugin_slug );
1192 1192
 
1193 1193
 						$count          = count( $plugin_group );
1194 1194
 						$linked_plugins = array_map( array( 'TGMPA_Utils', 'wrap_in_em' ), $linked_plugins );
1195 1195
 						$last_plugin    = array_pop( $linked_plugins ); // Pop off last name to prep for readability.
1196
-						$imploded       = empty( $linked_plugins ) ? $last_plugin : ( implode( ', ', $linked_plugins ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'tgmpa' ) . ' ' . $last_plugin );
1196
+						$imploded       = empty( $linked_plugins ) ? $last_plugin : ( implode( ', ', $linked_plugins ).' '.esc_html_x( 'and', 'plugin A *and* plugin B', 'tgmpa' ).' '.$last_plugin );
1197 1197
 
1198 1198
 						$rendered .= sprintf(
1199 1199
 							$line_template,
@@ -1215,7 +1215,7 @@  discard block
 block discarded – undo
1215 1215
 			}
1216 1216
 
1217 1217
 			// Admin options pages already output settings_errors, so this is to avoid duplication.
1218
-			if ( 'options-general' !== $GLOBALS['current_screen']->parent_base ) {
1218
+			if ( 'options-general' !== $GLOBALS[ 'current_screen' ]->parent_base ) {
1219 1219
 				$this->display_settings_errors();
1220 1220
 			}
1221 1221
 		}
@@ -1237,32 +1237,32 @@  discard block
 block discarded – undo
1237 1237
 				'install'  => '',
1238 1238
 				'update'   => '',
1239 1239
 				'activate' => '',
1240
-				'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>' : '',
1240
+				'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>' : '',
1241 1241
 			);
1242 1242
 
1243 1243
 			$link_template = '<a href="%2$s">%1$s</a>';
1244 1244
 
1245 1245
 			if ( current_user_can( 'install_plugins' ) ) {
1246 1246
 				if ( $install_count > 0 ) {
1247
-					$action_links['install'] = sprintf(
1247
+					$action_links[ 'install' ] = sprintf(
1248 1248
 						$link_template,
1249
-						translate_nooped_plural( $this->strings['install_link'], $install_count, 'tgmpa' ),
1249
+						translate_nooped_plural( $this->strings[ 'install_link' ], $install_count, 'tgmpa' ),
1250 1250
 						esc_url( $this->get_tgmpa_status_url( 'install' ) )
1251 1251
 					);
1252 1252
 				}
1253 1253
 				if ( $update_count > 0 ) {
1254
-					$action_links['update'] = sprintf(
1254
+					$action_links[ 'update' ] = sprintf(
1255 1255
 						$link_template,
1256
-						translate_nooped_plural( $this->strings['update_link'], $update_count, 'tgmpa' ),
1256
+						translate_nooped_plural( $this->strings[ 'update_link' ], $update_count, 'tgmpa' ),
1257 1257
 						esc_url( $this->get_tgmpa_status_url( 'update' ) )
1258 1258
 					);
1259 1259
 				}
1260 1260
 			}
1261 1261
 
1262 1262
 			if ( current_user_can( 'activate_plugins' ) && $activate_count > 0 ) {
1263
-				$action_links['activate'] = sprintf(
1263
+				$action_links[ 'activate' ] = sprintf(
1264 1264
 					$link_template,
1265
-					translate_nooped_plural( $this->strings['activate_link'], $activate_count, 'tgmpa' ),
1265
+					translate_nooped_plural( $this->strings[ 'activate_link' ], $activate_count, 'tgmpa' ),
1266 1266
 					esc_url( $this->get_tgmpa_status_url( 'activate' ) )
1267 1267
 				);
1268 1268
 			}
@@ -1290,8 +1290,8 @@  discard block
 block discarded – undo
1290 1290
 		 * @return string
1291 1291
 		 */
1292 1292
 		protected function get_admin_notice_class() {
1293
-			if ( ! empty( $this->strings['nag_type'] ) ) {
1294
-				return sanitize_html_class( strtolower( $this->strings['nag_type'] ) );
1293
+			if ( ! empty( $this->strings[ 'nag_type' ] ) ) {
1294
+				return sanitize_html_class( strtolower( $this->strings[ 'nag_type' ] ) );
1295 1295
 			} else {
1296 1296
 				if ( version_compare( $this->wp_version, '4.2', '>=' ) ) {
1297 1297
 					return 'notice-warning';
@@ -1314,7 +1314,7 @@  discard block
 block discarded – undo
1314 1314
 			settings_errors( 'tgmpa' );
1315 1315
 
1316 1316
 			foreach ( (array) $wp_settings_errors as $key => $details ) {
1317
-				if ( 'tgmpa' === $details['setting'] ) {
1317
+				if ( 'tgmpa' === $details[ 'setting' ] ) {
1318 1318
 					unset( $wp_settings_errors[ $key ] );
1319 1319
 					break;
1320 1320
 				}
@@ -1329,8 +1329,8 @@  discard block
 block discarded – undo
1329 1329
 		 * @since 2.1.0
1330 1330
 		 */
1331 1331
 		public function dismiss() {
1332
-			if ( isset( $_GET['tgmpa-dismiss'] ) && check_admin_referer( 'tgmpa-dismis-' . get_current_user_id() ) ) {
1333
-				update_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, 1 );
1332
+			if ( isset( $_GET[ 'tgmpa-dismiss' ] ) && check_admin_referer( 'tgmpa-dismis-'.get_current_user_id() ) ) {
1333
+				update_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_'.$this->id, 1 );
1334 1334
 			}
1335 1335
 		}
1336 1336
 
@@ -1346,54 +1346,54 @@  discard block
 block discarded – undo
1346 1346
 		 * @return null Return early if incorrect argument.
1347 1347
 		 */
1348 1348
 		public function register( $plugin ) {
1349
-			if ( empty( $plugin['slug'] ) || empty( $plugin['name'] ) ) {
1349
+			if ( empty( $plugin[ 'slug' ] ) || empty( $plugin[ 'name' ] ) ) {
1350 1350
 				return;
1351 1351
 			}
1352 1352
 
1353
-			if ( empty( $plugin['slug'] ) || ! is_string( $plugin['slug'] ) || isset( $this->plugins[ $plugin['slug'] ] ) ) {
1353
+			if ( empty( $plugin[ 'slug' ] ) || ! is_string( $plugin[ 'slug' ] ) || isset( $this->plugins[ $plugin[ 'slug' ] ] ) ) {
1354 1354
 				return;
1355 1355
 			}
1356 1356
 
1357 1357
 			$defaults = array(
1358
-				'name'               => '',      // String
1359
-				'slug'               => '',      // String
1360
-				'source'             => 'repo',  // String
1361
-				'required'           => false,   // Boolean
1362
-				'version'            => '',      // String
1363
-				'force_activation'   => false,   // Boolean
1364
-				'force_deactivation' => false,   // Boolean
1365
-				'external_url'       => '',      // String
1366
-				'is_callable'        => '',      // String|Array.
1358
+				'name'               => '', // String
1359
+				'slug'               => '', // String
1360
+				'source'             => 'repo', // String
1361
+				'required'           => false, // Boolean
1362
+				'version'            => '', // String
1363
+				'force_activation'   => false, // Boolean
1364
+				'force_deactivation' => false, // Boolean
1365
+				'external_url'       => '', // String
1366
+				'is_callable'        => '', // String|Array.
1367 1367
 			);
1368 1368
 
1369 1369
 			// Prepare the received data.
1370 1370
 			$plugin = wp_parse_args( $plugin, $defaults );
1371 1371
 
1372 1372
 			// Standardize the received slug.
1373
-			$plugin['slug'] = $this->sanitize_key( $plugin['slug'] );
1373
+			$plugin[ 'slug' ] = $this->sanitize_key( $plugin[ 'slug' ] );
1374 1374
 
1375 1375
 			// Forgive users for using string versions of booleans or floats for version number.
1376
-			$plugin['version']            = (string) $plugin['version'];
1377
-			$plugin['source']             = empty( $plugin['source'] ) ? 'repo' : $plugin['source'];
1378
-			$plugin['required']           = TGMPA_Utils::validate_bool( $plugin['required'] );
1379
-			$plugin['force_activation']   = TGMPA_Utils::validate_bool( $plugin['force_activation'] );
1380
-			$plugin['force_deactivation'] = TGMPA_Utils::validate_bool( $plugin['force_deactivation'] );
1376
+			$plugin[ 'version' ]            = (string) $plugin[ 'version' ];
1377
+			$plugin[ 'source' ]             = empty( $plugin[ 'source' ] ) ? 'repo' : $plugin[ 'source' ];
1378
+			$plugin[ 'required' ]           = TGMPA_Utils::validate_bool( $plugin[ 'required' ] );
1379
+			$plugin[ 'force_activation' ]   = TGMPA_Utils::validate_bool( $plugin[ 'force_activation' ] );
1380
+			$plugin[ 'force_deactivation' ] = TGMPA_Utils::validate_bool( $plugin[ 'force_deactivation' ] );
1381 1381
 
1382 1382
 			// Enrich the received data.
1383
-			$plugin['file_path']   = $this->_get_plugin_basename_from_slug( $plugin['slug'] );
1384
-			$plugin['source_type'] = $this->get_plugin_source_type( $plugin['source'] );
1383
+			$plugin[ 'file_path' ]   = $this->_get_plugin_basename_from_slug( $plugin[ 'slug' ] );
1384
+			$plugin[ 'source_type' ] = $this->get_plugin_source_type( $plugin[ 'source' ] );
1385 1385
 
1386 1386
 			// Set the class properties.
1387
-			$this->plugins[ $plugin['slug'] ]    = $plugin;
1388
-			$this->sort_order[ $plugin['slug'] ] = $plugin['name'];
1387
+			$this->plugins[ $plugin[ 'slug' ] ]    = $plugin;
1388
+			$this->sort_order[ $plugin[ 'slug' ] ] = $plugin[ 'name' ];
1389 1389
 
1390 1390
 			// Should we add the force activation hook ?
1391
-			if ( true === $plugin['force_activation'] ) {
1391
+			if ( true === $plugin[ 'force_activation' ] ) {
1392 1392
 				$this->has_forced_activation = true;
1393 1393
 			}
1394 1394
 
1395 1395
 			// Should we add the force deactivation hook ?
1396
-			if ( true === $plugin['force_deactivation'] ) {
1396
+			if ( true === $plugin[ 'force_deactivation' ] ) {
1397 1397
 				$this->has_forced_deactivation = true;
1398 1398
 			}
1399 1399
 		}
@@ -1519,11 +1519,11 @@  discard block
 block discarded – undo
1519 1519
 		 */
1520 1520
 		public function populate_file_path( $plugin_slug = '' ) {
1521 1521
 			if ( ! empty( $plugin_slug ) && is_string( $plugin_slug ) && isset( $this->plugins[ $plugin_slug ] ) ) {
1522
-				$this->plugins[ $plugin_slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $plugin_slug );
1522
+				$this->plugins[ $plugin_slug ][ 'file_path' ] = $this->_get_plugin_basename_from_slug( $plugin_slug );
1523 1523
 			} else {
1524 1524
 				// Add file_path key for all plugins.
1525 1525
 				foreach ( $this->plugins as $slug => $values ) {
1526
-					$this->plugins[ $slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $slug );
1526
+					$this->plugins[ $slug ][ 'file_path' ] = $this->_get_plugin_basename_from_slug( $slug );
1527 1527
 				}
1528 1528
 			}
1529 1529
 		}
@@ -1541,7 +1541,7 @@  discard block
 block discarded – undo
1541 1541
 			$keys = array_keys( $this->get_plugins() );
1542 1542
 
1543 1543
 			foreach ( $keys as $key ) {
1544
-				if ( preg_match( '|^' . $slug . '/|', $key ) ) {
1544
+				if ( preg_match( '|^'.$slug.'/|', $key ) ) {
1545 1545
 					return $key;
1546 1546
 				}
1547 1547
 			}
@@ -1563,7 +1563,7 @@  discard block
 block discarded – undo
1563 1563
 		 */
1564 1564
 		public function _get_plugin_data_from_name( $name, $data = 'slug' ) {
1565 1565
 			foreach ( $this->plugins as $values ) {
1566
-				if ( $name === $values['name'] && isset( $values[ $data ] ) ) {
1566
+				if ( $name === $values[ 'name' ] && isset( $values[ $data ] ) ) {
1567 1567
 					return $values[ $data ];
1568 1568
 				}
1569 1569
 			}
@@ -1582,13 +1582,13 @@  discard block
 block discarded – undo
1582 1582
 		public function get_download_url( $slug ) {
1583 1583
 			$dl_source = '';
1584 1584
 
1585
-			switch ( $this->plugins[ $slug ]['source_type'] ) {
1585
+			switch ( $this->plugins[ $slug ][ 'source_type' ] ) {
1586 1586
 				case 'repo':
1587 1587
 					return $this->get_wp_repo_download_url( $slug );
1588 1588
 				case 'external':
1589
-					return $this->plugins[ $slug ]['source'];
1589
+					return $this->plugins[ $slug ][ 'source' ];
1590 1590
 				case 'bundled':
1591
-					return $this->default_path . $this->plugins[ $slug ]['source'];
1591
+					return $this->default_path.$this->plugins[ $slug ][ 'source' ];
1592 1592
 			}
1593 1593
 
1594 1594
 			return $dl_source; // Should never happen.
@@ -1626,7 +1626,7 @@  discard block
 block discarded – undo
1626 1626
 
1627 1627
 			if ( ! isset( $api[ $slug ] ) ) {
1628 1628
 				if ( ! function_exists( 'plugins_api' ) ) {
1629
-					require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
1629
+					require_once ABSPATH.'wp-admin/includes/plugin-install.php';
1630 1630
 				}
1631 1631
 
1632 1632
 				$response = plugins_api( 'plugin_information', array( 'slug' => $slug, 'fields' => array( 'sections' => false ) ) );
@@ -1634,7 +1634,7 @@  discard block
 block discarded – undo
1634 1634
 				$api[ $slug ] = false;
1635 1635
 
1636 1636
 				if ( is_wp_error( $response ) ) {
1637
-					wp_die( esc_html( $this->strings['oops'] ) );
1637
+					wp_die( esc_html( $this->strings[ 'oops' ] ) );
1638 1638
 				} else {
1639 1639
 					$api[ $slug ] = $response;
1640 1640
 				}
@@ -1653,13 +1653,13 @@  discard block
 block discarded – undo
1653 1653
 		 *                or the plugin name if not.
1654 1654
 		 */
1655 1655
 		public function get_info_link( $slug ) {
1656
-			if ( ! empty( $this->plugins[ $slug ]['external_url'] ) && preg_match( self::IS_URL_REGEX, $this->plugins[ $slug ]['external_url'] ) ) {
1656
+			if ( ! empty( $this->plugins[ $slug ][ 'external_url' ] ) && preg_match( self::IS_URL_REGEX, $this->plugins[ $slug ][ 'external_url' ] ) ) {
1657 1657
 				$link = sprintf(
1658 1658
 					'<a href="%1$s" target="_blank">%2$s</a>',
1659
-					esc_url( $this->plugins[ $slug ]['external_url'] ),
1660
-					esc_html( $this->plugins[ $slug ]['name'] )
1659
+					esc_url( $this->plugins[ $slug ][ 'external_url' ] ),
1660
+					esc_html( $this->plugins[ $slug ][ 'name' ] )
1661 1661
 				);
1662
-			} elseif ( 'repo' === $this->plugins[ $slug ]['source_type'] ) {
1662
+			} elseif ( 'repo' === $this->plugins[ $slug ][ 'source_type' ] ) {
1663 1663
 				$url = add_query_arg(
1664 1664
 					array(
1665 1665
 						'tab'       => 'plugin-information',
@@ -1674,10 +1674,10 @@  discard block
 block discarded – undo
1674 1674
 				$link = sprintf(
1675 1675
 					'<a href="%1$s" class="thickbox">%2$s</a>',
1676 1676
 					esc_url( $url ),
1677
-					esc_html( $this->plugins[ $slug ]['name'] )
1677
+					esc_html( $this->plugins[ $slug ][ 'name' ] )
1678 1678
 				);
1679 1679
 			} else {
1680
-				$link = esc_html( $this->plugins[ $slug ]['name'] ); // No hyperlink.
1680
+				$link = esc_html( $this->plugins[ $slug ][ 'name' ] ); // No hyperlink.
1681 1681
 			}
1682 1682
 
1683 1683
 			return $link;
@@ -1691,7 +1691,7 @@  discard block
 block discarded – undo
1691 1691
 		 * @return boolean True when on the TGMPA page, false otherwise.
1692 1692
 		 */
1693 1693
 		protected function is_tgmpa_page() {
1694
-			return isset( $_GET['page'] ) && $this->menu === $_GET['page'];
1694
+			return isset( $_GET[ 'page' ] ) && $this->menu === $_GET[ 'page' ];
1695 1695
 		}
1696 1696
 
1697 1697
 		/**
@@ -1773,7 +1773,7 @@  discard block
 block discarded – undo
1773 1773
 		public function is_plugin_installed( $slug ) {
1774 1774
 			$installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached).
1775 1775
 
1776
-			return ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ] ) );
1776
+			return ( ! empty( $installed_plugins[ $this->plugins[ $slug ][ 'file_path' ] ] ) );
1777 1777
 		}
1778 1778
 
1779 1779
 		/**
@@ -1785,7 +1785,7 @@  discard block
 block discarded – undo
1785 1785
 		 * @return bool True if active, false otherwise.
1786 1786
 		 */
1787 1787
 		public function is_plugin_active( $slug ) {
1788
-			return ( ( ! empty( $this->plugins[ $slug ]['is_callable'] ) && is_callable( $this->plugins[ $slug ]['is_callable'] ) ) || is_plugin_active( $this->plugins[ $slug ]['file_path'] ) );
1788
+			return ( ( ! empty( $this->plugins[ $slug ][ 'is_callable' ] ) && is_callable( $this->plugins[ $slug ][ 'is_callable' ] ) ) || is_plugin_active( $this->plugins[ $slug ][ 'file_path' ] ) );
1789 1789
 		}
1790 1790
 
1791 1791
 		/**
@@ -1799,7 +1799,7 @@  discard block
 block discarded – undo
1799 1799
 		 */
1800 1800
 		public function can_plugin_update( $slug ) {
1801 1801
 			// We currently can't get reliable info on non-WP-repo plugins - issue #380.
1802
-			if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) {
1802
+			if ( 'repo' !== $this->plugins[ $slug ][ 'source_type' ] ) {
1803 1803
 				return true;
1804 1804
 			}
1805 1805
 
@@ -1855,8 +1855,8 @@  discard block
 block discarded – undo
1855 1855
 		public function get_installed_version( $slug ) {
1856 1856
 			$installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached).
1857 1857
 
1858
-			if ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'] ) ) {
1859
-				return $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'];
1858
+			if ( ! empty( $installed_plugins[ $this->plugins[ $slug ][ 'file_path' ] ][ 'Version' ] ) ) {
1859
+				return $installed_plugins[ $this->plugins[ $slug ][ 'file_path' ] ][ 'Version' ];
1860 1860
 			}
1861 1861
 
1862 1862
 			return '';
@@ -1872,7 +1872,7 @@  discard block
 block discarded – undo
1872 1872
 		 */
1873 1873
 		public function does_plugin_require_update( $slug ) {
1874 1874
 			$installed_version = $this->get_installed_version( $slug );
1875
-			$minimum_version   = $this->plugins[ $slug ]['version'];
1875
+			$minimum_version   = $this->plugins[ $slug ][ 'version' ];
1876 1876
 
1877 1877
 			return version_compare( $minimum_version, $installed_version, '>' );
1878 1878
 		}
@@ -1887,9 +1887,9 @@  discard block
 block discarded – undo
1887 1887
 		 */
1888 1888
 		public function does_plugin_have_update( $slug ) {
1889 1889
 			// Presume bundled and external plugins will point to a package which meets the minimum required version.
1890
-			if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) {
1890
+			if ( 'repo' !== $this->plugins[ $slug ][ 'source_type' ] ) {
1891 1891
 				if ( $this->does_plugin_require_update( $slug ) ) {
1892
-					return $this->plugins[ $slug ]['version'];
1892
+					return $this->plugins[ $slug ][ 'version' ];
1893 1893
 				}
1894 1894
 
1895