Completed
Push — develop ( f64257...88e8b1 )
by Gary
05:50 queued 03:14
created
class-tgm-plugin-activation.php 1 patch
Spacing   +278 added lines, -278 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 ) );
@@ -459,10 +459,10 @@  discard block
 block discarded – undo
459 459
 			if ( false !== strpos( __FILE__, WP_PLUGIN_DIR ) || false !== strpos( __FILE__, WPMU_PLUGIN_DIR ) ) {
460 460
 				// Plugin, we'll need to adjust the file name.
461 461
 				add_action( 'load_textdomain_mofile', array( $this, 'correct_plugin_mofile' ), 10, 2 );
462
-				load_theme_textdomain( 'tgmpa', dirname( __FILE__ ) . '/languages' );
462
+				load_theme_textdomain( 'tgmpa', dirname( __FILE__ ).'/languages' );
463 463
 				remove_action( 'load_textdomain_mofile', array( $this, 'correct_plugin_mofile' ), 10 );
464 464
 			} else {
465
-				load_theme_textdomain( 'tgmpa', dirname( __FILE__ ) . '/languages' );
465
+				load_theme_textdomain( 'tgmpa', dirname( __FILE__ ).'/languages' );
466 466
 			}
467 467
 		}
468 468
 
@@ -535,15 +535,15 @@  discard block
 block discarded – undo
535 535
 		public function add_plugin_action_link_filters() {
536 536
 			foreach ( $this->plugins as $slug => $plugin ) {
537 537
 				if ( false === $this->can_plugin_activate( $slug ) ) {
538
-					add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_activate' ), 20 );
538
+					add_filter( 'plugin_action_links_'.$plugin[ 'file_path' ], array( $this, 'filter_plugin_action_links_activate' ), 20 );
539 539
 				}
540 540
 
541
-				if ( true === $plugin['force_activation'] ) {
542
-					add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_deactivate' ), 20 );
541
+				if ( true === $plugin[ 'force_activation' ] ) {
542
+					add_filter( 'plugin_action_links_'.$plugin[ 'file_path' ], array( $this, 'filter_plugin_action_links_deactivate' ), 20 );
543 543
 				}
544 544
 
545 545
 				if ( false !== $this->does_plugin_require_update( $slug ) ) {
546
-					add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_update' ), 20 );
546
+					add_filter( 'plugin_action_links_'.$plugin[ 'file_path' ], array( $this, 'filter_plugin_action_links_update' ), 20 );
547 547
 				}
548 548
 			}
549 549
 		}
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
 		 * @return array
559 559
 		 */
560 560
 		public function filter_plugin_action_links_activate( $actions ) {
561
-			unset( $actions['activate'] );
561
+			unset( $actions[ 'activate' ] );
562 562
 
563 563
 			return $actions;
564 564
 		}
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
 		 * @return array
573 573
 		 */
574 574
 		public function filter_plugin_action_links_deactivate( $actions ) {
575
-			unset( $actions['deactivate'] );
575
+			unset( $actions[ 'deactivate' ] );
576 576
 
577 577
 			return $actions;
578 578
 		}
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 		 * @return array
588 588
 		 */
589 589
 		public function filter_plugin_action_links_update( $actions ) {
590
-			$actions['update'] = sprintf(
590
+			$actions[ 'update' ] = sprintf(
591 591
 				'<a href="%1$s" title="%2$s" class="edit">%3$s</a>',
592 592
 				esc_url( $this->get_tgmpa_status_url( 'update' ) ),
593 593
 				esc_attr__( 'This plugin needs to be updated to be compatible with your theme.', 'tgmpa' ),
@@ -625,9 +625,9 @@  discard block
 block discarded – undo
625 625
 				return;
626 626
 			}
627 627
 
628
-			if ( isset( $_REQUEST['tab'] ) && 'plugin-information' === $_REQUEST['tab'] ) {
628
+			if ( isset( $_REQUEST[ 'tab' ] ) && 'plugin-information' === $_REQUEST[ 'tab' ] ) {
629 629
 				// Needed for install_plugin_information().
630
-				require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
630
+				require_once ABSPATH.'wp-admin/includes/plugin-install.php';
631 631
 
632 632
 				wp_enqueue_style( 'plugin-install' );
633 633
 
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
 		 * @since 2.1.0
656 656
 		 */
657 657
 		public function thickbox() {
658
-			if ( ! get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) ) {
658
+			if ( ! get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_'.$this->id, true ) ) {
659 659
 				add_thickbox();
660 660
 			}
661 661
 		}
@@ -684,11 +684,11 @@  discard block
 block discarded – undo
684 684
 			$args = apply_filters(
685 685
 				'tgmpa_admin_menu_args',
686 686
 				array(
687
-					'parent_slug' => $this->parent_slug,                     // Parent Menu slug.
688
-					'page_title'  => $this->strings['page_title'],           // Page title.
689
-					'menu_title'  => $this->strings['menu_title'],           // Menu title.
690
-					'capability'  => $this->capability,                      // Capability.
691
-					'menu_slug'   => $this->menu,                            // Menu slug.
687
+					'parent_slug' => $this->parent_slug, // Parent Menu slug.
688
+					'page_title'  => $this->strings[ 'page_title' ], // Page title.
689
+					'menu_title'  => $this->strings[ 'menu_title' ], // Menu title.
690
+					'capability'  => $this->capability, // Capability.
691
+					'menu_slug'   => $this->menu, // Menu slug.
692 692
 					'function'    => array( $this, 'install_plugins_page' ), // Callback.
693 693
 				)
694 694
 			);
@@ -712,9 +712,9 @@  discard block
 block discarded – undo
712 712
 			}
713 713
 
714 714
 			if ( 'themes.php' === $this->parent_slug ) {
715
-				$this->page_hook = call_user_func( 'add_theme_page', $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] );
715
+				$this->page_hook = call_user_func( 'add_theme_page', $args[ 'page_title' ], $args[ 'menu_title' ], $args[ 'capability' ], $args[ 'menu_slug' ], $args[ 'function' ] );
716 716
 			} else {
717
-				$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'] );
717
+				$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' ] );
718 718
 			}
719 719
 		}
720 720
 
@@ -783,37 +783,37 @@  discard block
 block discarded – undo
783 783
 		 * @return boolean True on success, false on failure.
784 784
 		 */
785 785
 		protected function do_plugin_install() {
786
-			if ( empty( $_GET['plugin'] ) ) {
786
+			if ( empty( $_GET[ 'plugin' ] ) ) {
787 787
 				return false;
788 788
 			}
789 789
 
790 790
 			// All plugin information will be stored in an array for processing.
791
-			$slug = $this->sanitize_key( urldecode( $_GET['plugin'] ) );
791
+			$slug = $this->sanitize_key( urldecode( $_GET[ 'plugin' ] ) );
792 792
 
793 793
 			if ( ! isset( $this->plugins[ $slug ] ) ) {
794 794
 				return false;
795 795
 			}
796 796
 
797 797
 			// Was an install or upgrade action link clicked?
798
-			if ( ( isset( $_GET['tgmpa-install'] ) && 'install-plugin' === $_GET['tgmpa-install'] ) || ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) ) {
798
+			if ( ( isset( $_GET[ 'tgmpa-install' ] ) && 'install-plugin' === $_GET[ 'tgmpa-install' ] ) || ( isset( $_GET[ 'tgmpa-update' ] ) && 'update-plugin' === $_GET[ 'tgmpa-update' ] ) ) {
799 799
 
800 800
 				$install_type = 'install';
801
-				if ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) {
801
+				if ( isset( $_GET[ 'tgmpa-update' ] ) && 'update-plugin' === $_GET[ 'tgmpa-update' ] ) {
802 802
 					$install_type = 'update';
803 803
 				}
804 804
 
805
-				check_admin_referer( 'tgmpa-' . $install_type, 'tgmpa-nonce' );
805
+				check_admin_referer( 'tgmpa-'.$install_type, 'tgmpa-nonce' );
806 806
 
807 807
 				// Pass necessary information via URL if WP_Filesystem is needed.
808 808
 				$url = wp_nonce_url(
809 809
 					add_query_arg(
810 810
 						array(
811 811
 							'plugin'                 => urlencode( $slug ),
812
-							'tgmpa-' . $install_type => $install_type . '-plugin',
812
+							'tgmpa-'.$install_type => $install_type.'-plugin',
813 813
 						),
814 814
 						$this->get_tgmpa_url()
815 815
 					),
816
-					'tgmpa-' . $install_type,
816
+					'tgmpa-'.$install_type,
817 817
 					'tgmpa-nonce'
818 818
 				);
819 819
 
@@ -832,29 +832,29 @@  discard block
 block discarded – undo
832 832
 
833 833
 				// Prep variables for Plugin_Installer_Skin class.
834 834
 				$extra         = array();
835
-				$extra['slug'] = $slug; // Needed for potentially renaming of directory name.
835
+				$extra[ 'slug' ] = $slug; // Needed for potentially renaming of directory name.
836 836
 				$source        = $this->get_download_url( $slug );
837
-				$api           = ( 'repo' === $this->plugins[ $slug ]['source_type'] ) ? $this->get_plugins_api( $slug ) : null;
837
+				$api           = ( 'repo' === $this->plugins[ $slug ][ 'source_type' ] ) ? $this->get_plugins_api( $slug ) : null;
838 838
 				$api           = ( false !== $api ) ? $api : null;
839 839
 
840 840
 				$url = add_query_arg(
841 841
 					array(
842
-						'action' => $install_type . '-plugin',
842
+						'action' => $install_type.'-plugin',
843 843
 						'plugin' => urlencode( $slug ),
844 844
 					),
845 845
 					'update.php'
846 846
 				);
847 847
 
848 848
 				if ( ! class_exists( 'Plugin_Upgrader', false ) ) {
849
-					require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
849
+					require_once ABSPATH.'wp-admin/includes/class-wp-upgrader.php';
850 850
 				}
851 851
 
852
-				$title     = ( 'update' === $install_type ) ? $this->strings['updating'] : $this->strings['installing'];
852
+				$title     = ( 'update' === $install_type ) ? $this->strings[ 'updating' ] : $this->strings[ 'installing' ];
853 853
 				$skin_args = array(
854
-					'type'   => ( 'bundled' !== $this->plugins[ $slug ]['source_type'] ) ? 'web' : 'upload',
855
-					'title'  => sprintf( $title, $this->plugins[ $slug ]['name'] ),
854
+					'type'   => ( 'bundled' !== $this->plugins[ $slug ][ 'source_type' ] ) ? 'web' : 'upload',
855
+					'title'  => sprintf( $title, $this->plugins[ $slug ][ 'name' ] ),
856 856
 					'url'    => esc_url_raw( $url ),
857
-					'nonce'  => $install_type . '-plugin_' . $slug,
857
+					'nonce'  => $install_type.'-plugin_'.$slug,
858 858
 					'plugin' => '',
859 859
 					'api'    => $api,
860 860
 					'extra'  => $extra,
@@ -862,7 +862,7 @@  discard block
 block discarded – undo
862 862
 				unset( $title );
863 863
 
864 864
 				if ( 'update' === $install_type ) {
865
-					$skin_args['plugin'] = $this->plugins[ $slug ]['file_path'];
865
+					$skin_args[ 'plugin' ] = $this->plugins[ $slug ][ 'file_path' ];
866 866
 					$skin                = new Plugin_Upgrader_Skin( $skin_args );
867 867
 				} else {
868 868
 					$skin = new Plugin_Installer_Skin( $skin_args );
@@ -877,10 +877,10 @@  discard block
 block discarded – undo
877 877
 				if ( 'update' === $install_type ) {
878 878
 					// Inject our info into the update transient.
879 879
 					$to_inject                    = array( $slug => $this->plugins[ $slug ] );
880
-					$to_inject[ $slug ]['source'] = $source;
880
+					$to_inject[ $slug ][ 'source' ] = $source;
881 881
 					$this->inject_update_info( $to_inject );
882 882
 
883
-					$upgrader->upgrade( $this->plugins[ $slug ]['file_path'] );
883
+					$upgrader->upgrade( $this->plugins[ $slug ][ 'file_path' ] );
884 884
 				} else {
885 885
 					$upgrader->install( $source );
886 886
 				}
@@ -903,18 +903,18 @@  discard block
 block discarded – undo
903 903
 
904 904
 				// Display message based on if all plugins are now active or not.
905 905
 				if ( $this->is_tgmpa_complete() ) {
906
-					echo '<p>', sprintf( esc_html( $this->strings['complete'] ), '<a href="' . esc_url( self_admin_url() ) . '">' . esc_html__( 'Return to the Dashboard', 'tgmpa' ) . '</a>' ), '</p>';
906
+					echo '<p>', sprintf( esc_html( $this->strings[ 'complete' ] ), '<a href="'.esc_url( self_admin_url() ).'">'.esc_html__( 'Return to the Dashboard', 'tgmpa' ).'</a>' ), '</p>';
907 907
 					echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>';
908 908
 				} else {
909
-					echo '<p><a href="', esc_url( $this->get_tgmpa_url() ), '" target="_parent">', esc_html( $this->strings['return'] ), '</a></p>';
909
+					echo '<p><a href="', esc_url( $this->get_tgmpa_url() ), '" target="_parent">', esc_html( $this->strings[ 'return' ] ), '</a></p>';
910 910
 				}
911 911
 
912 912
 				return true;
913
-			} elseif ( isset( $this->plugins[ $slug ]['file_path'], $_GET['tgmpa-activate'] ) && 'activate-plugin' === $_GET['tgmpa-activate'] ) {
913
+			} elseif ( isset( $this->plugins[ $slug ][ 'file_path' ], $_GET[ 'tgmpa-activate' ] ) && 'activate-plugin' === $_GET[ 'tgmpa-activate' ] ) {
914 914
 				// Activate action link was clicked.
915 915
 				check_admin_referer( 'tgmpa-activate', 'tgmpa-nonce' );
916 916
 
917
-				if ( false === $this->activate_single_plugin( $this->plugins[ $slug ]['file_path'], $slug ) ) {
917
+				if ( false === $this->activate_single_plugin( $this->plugins[ $slug ][ 'file_path' ], $slug ) ) {
918 918
 					return true; // Finish execution of the function early as we encountered an error.
919 919
 				}
920 920
 			}
@@ -937,7 +937,7 @@  discard block
 block discarded – undo
937 937
 			}
938 938
 
939 939
 			foreach ( $plugins as $slug => $plugin ) {
940
-				$file_path = $plugin['file_path'];
940
+				$file_path = $plugin[ 'file_path' ];
941 941
 
942 942
 				if ( empty( $repo_updates->response[ $file_path ] ) ) {
943 943
 					$repo_updates->response[ $file_path ] = new stdClass;
@@ -946,10 +946,10 @@  discard block
 block discarded – undo
946 946
 				// We only really need to set package, but let's do all we can in case WP changes something.
947 947
 				$repo_updates->response[ $file_path ]->slug        = $slug;
948 948
 				$repo_updates->response[ $file_path ]->plugin      = $file_path;
949
-				$repo_updates->response[ $file_path ]->new_version = $plugin['version'];
950
-				$repo_updates->response[ $file_path ]->package     = $plugin['source'];
951
-				if ( empty( $repo_updates->response[ $file_path ]->url ) && ! empty( $plugin['external_url'] ) ) {
952
-					$repo_updates->response[ $file_path ]->url = $plugin['external_url'];
949
+				$repo_updates->response[ $file_path ]->new_version = $plugin[ 'version' ];
950
+				$repo_updates->response[ $file_path ]->package     = $plugin[ 'source' ];
951
+				if ( empty( $repo_updates->response[ $file_path ]->url ) && ! empty( $plugin[ 'external_url' ] ) ) {
952
+					$repo_updates->response[ $file_path ]->url = $plugin[ 'external_url' ];
953 953
 				}
954 954
 			}
955 955
 
@@ -973,13 +973,13 @@  discard block
 block discarded – undo
973 973
 		 * @return string $source
974 974
 		 */
975 975
 		public function maybe_adjust_source_dir( $source, $remote_source, $upgrader ) {
976
-			if ( ! $this->is_tgmpa_page() || ! is_object( $GLOBALS['wp_filesystem'] ) ) {
976
+			if ( ! $this->is_tgmpa_page() || ! is_object( $GLOBALS[ 'wp_filesystem' ] ) ) {
977 977
 				return $source;
978 978
 			}
979 979
 
980 980
 			// Check for single file plugins.
981
-			$source_files = array_keys( $GLOBALS['wp_filesystem']->dirlist( $remote_source ) );
982
-			if ( 1 === count( $source_files ) && false === $GLOBALS['wp_filesystem']->is_dir( $source ) ) {
981
+			$source_files = array_keys( $GLOBALS[ 'wp_filesystem' ]->dirlist( $remote_source ) );
982
+			if ( 1 === count( $source_files ) && false === $GLOBALS[ 'wp_filesystem' ]->is_dir( $source ) ) {
983 983
 				return $source;
984 984
 			}
985 985
 
@@ -987,12 +987,12 @@  discard block
 block discarded – undo
987 987
 			$desired_slug = '';
988 988
 
989 989
 			// Figure out what the slug is supposed to be.
990
-			if ( false === $upgrader->bulk && ! empty( $upgrader->skin->options['extra']['slug'] ) ) {
991
-				$desired_slug = $upgrader->skin->options['extra']['slug'];
990
+			if ( false === $upgrader->bulk && ! empty( $upgrader->skin->options[ 'extra' ][ 'slug' ] ) ) {
991
+				$desired_slug = $upgrader->skin->options[ 'extra' ][ 'slug' ];
992 992
 			} else {
993 993
 				// Bulk installer contains less info, so fall back on the info registered here.
994 994
 				foreach ( $this->plugins as $slug => $plugin ) {
995
-					if ( ! empty( $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) && $plugin['name'] === $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) {
995
+					if ( ! empty( $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) && $plugin[ 'name' ] === $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) {
996 996
 						$desired_slug = $slug;
997 997
 						break;
998 998
 					}
@@ -1005,15 +1005,15 @@  discard block
 block discarded – undo
1005 1005
 
1006 1006
 				if ( ! empty( $subdir_name ) && $subdir_name !== $desired_slug ) {
1007 1007
 					$from = untrailingslashit( $source );
1008
-					$to   = trailingslashit( $remote_source ) . $desired_slug;
1008
+					$to   = trailingslashit( $remote_source ).$desired_slug;
1009 1009
 
1010
-					if ( true === $GLOBALS['wp_filesystem']->move( $from, $to ) ) {
1010
+					if ( true === $GLOBALS[ 'wp_filesystem' ]->move( $from, $to ) ) {
1011 1011
 						return trailingslashit( $to );
1012 1012
 					} else {
1013
-						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 ) );
1013
+						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 ) );
1014 1014
 					}
1015 1015
 				} elseif ( empty( $subdir_name ) ) {
1016
-					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 ) );
1016
+					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 ) );
1017 1017
 				}
1018 1018
 			}
1019 1019
 
@@ -1037,19 +1037,19 @@  discard block
 block discarded – undo
1037 1037
 
1038 1038
 				if ( is_wp_error( $activate ) ) {
1039 1039
 					echo '<div id="message" class="error"><p>', wp_kses_post( $activate->get_error_message() ), '</p></div>',
1040
-						'<p><a href="', esc_url( $this->get_tgmpa_url() ), '" target="_parent">', esc_html( $this->strings['return'] ), '</a></p>';
1040
+						'<p><a href="', esc_url( $this->get_tgmpa_url() ), '" target="_parent">', esc_html( $this->strings[ 'return' ] ), '</a></p>';
1041 1041
 
1042 1042
 					return false; // End it here if there is an error with activation.
1043 1043
 				} else {
1044 1044
 					if ( ! $automatic ) {
1045 1045
 						// Make sure message doesn't display again if bulk activation is performed
1046 1046
 						// immediately after a single activation.
1047
-						if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK.
1048
-							echo '<div id="message" class="updated"><p>', esc_html( $this->strings['activated_successfully'] ), ' <strong>', esc_html( $this->plugins[ $slug ]['name'] ), '.</strong></p></div>';
1047
+						if ( ! isset( $_POST[ 'action' ] ) ) { // WPCS: CSRF OK.
1048
+							echo '<div id="message" class="updated"><p>', esc_html( $this->strings[ 'activated_successfully' ] ), ' <strong>', esc_html( $this->plugins[ $slug ][ 'name' ] ), '.</strong></p></div>';
1049 1049
 						}
1050 1050
 					} else {
1051 1051
 						// Simpler message layout for use on the plugin install page.
1052
-						echo '<p>', esc_html( $this->strings['plugin_activated'] ), '</p>';
1052
+						echo '<p>', esc_html( $this->strings[ 'plugin_activated' ] ), '</p>';
1053 1053
 					}
1054 1054
 				}
1055 1055
 			} elseif ( $this->is_plugin_active( $slug ) ) {
@@ -1057,25 +1057,25 @@  discard block
 block discarded – undo
1057 1057
 				// on the plugin install page.
1058 1058
 				echo '<div id="message" class="error"><p>',
1059 1059
 					sprintf(
1060
-						esc_html( $this->strings['plugin_already_active'] ),
1061
-						'<strong>' . esc_html( $this->plugins[ $slug ]['name'] ) . '</strong>'
1060
+						esc_html( $this->strings[ 'plugin_already_active' ] ),
1061
+						'<strong>'.esc_html( $this->plugins[ $slug ][ 'name' ] ).'</strong>'
1062 1062
 					),
1063 1063
 					'</p></div>';
1064 1064
 			} elseif ( $this->does_plugin_require_update( $slug ) ) {
1065 1065
 				if ( ! $automatic ) {
1066 1066
 					// Make sure message doesn't display again if bulk activation is performed
1067 1067
 					// immediately after a single activation.
1068
-					if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK.
1068
+					if ( ! isset( $_POST[ 'action' ] ) ) { // WPCS: CSRF OK.
1069 1069
 						echo '<div id="message" class="error"><p>',
1070 1070
 							sprintf(
1071
-								esc_html( $this->strings['plugin_needs_higher_version'] ),
1072
-								'<strong>' . esc_html( $this->plugins[ $slug ]['name'] ) . '</strong>'
1071
+								esc_html( $this->strings[ 'plugin_needs_higher_version' ] ),
1072
+								'<strong>'.esc_html( $this->plugins[ $slug ][ 'name' ] ).'</strong>'
1073 1073
 							),
1074 1074
 							'</p></div>';
1075 1075
 					}
1076 1076
 				} else {
1077 1077
 					// Simpler message layout for use on the plugin install page.
1078
-					echo '<p>', sprintf( esc_html( $this->strings['plugin_needs_higher_version'] ), esc_html( $this->plugins[ $slug ]['name'] ) ), '</p>';
1078
+					echo '<p>', sprintf( esc_html( $this->strings[ 'plugin_needs_higher_version' ] ), esc_html( $this->plugins[ $slug ][ 'name' ] ) ), '</p>';
1079 1079
 				}
1080 1080
 			}
1081 1081
 
@@ -1099,7 +1099,7 @@  discard block
 block discarded – undo
1099 1099
 		 */
1100 1100
 		public function notices() {
1101 1101
 			// Remove nag on the install page / Return early if the nag message has been dismissed or user < author.
1102
-			if ( ( $this->is_tgmpa_page() || $this->is_core_update_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' ) ) ) {
1102
+			if ( ( $this->is_tgmpa_page() || $this->is_core_update_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' ) ) ) {
1103 1103
 				return;
1104 1104
 			}
1105 1105
 
@@ -1121,13 +1121,13 @@  discard block
 block discarded – undo
1121 1121
 					if ( current_user_can( 'install_plugins' ) ) {
1122 1122
 						$install_link_count++;
1123 1123
 
1124
-						if ( true === $plugin['required'] ) {
1125
-							$message['notice_can_install_required'][] = $slug;
1124
+						if ( true === $plugin[ 'required' ] ) {
1125
+							$message[ 'notice_can_install_required' ][ ] = $slug;
1126 1126
 						} else {
1127
-							$message['notice_can_install_recommended'][] = $slug;
1127
+							$message[ 'notice_can_install_recommended' ][ ] = $slug;
1128 1128
 						}
1129 1129
 					}
1130
-					if ( true === $plugin['required'] ) {
1130
+					if ( true === $plugin[ 'required' ] ) {
1131 1131
 						$total_required_action_count++;
1132 1132
 					}
1133 1133
 				} else {
@@ -1135,13 +1135,13 @@  discard block
 block discarded – undo
1135 1135
 						if ( current_user_can( 'activate_plugins' ) ) {
1136 1136
 							$activate_link_count++;
1137 1137
 
1138
-							if ( true === $plugin['required'] ) {
1139
-								$message['notice_can_activate_required'][] = $slug;
1138
+							if ( true === $plugin[ 'required' ] ) {
1139
+								$message[ 'notice_can_activate_required' ][ ] = $slug;
1140 1140
 							} else {
1141
-								$message['notice_can_activate_recommended'][] = $slug;
1141
+								$message[ 'notice_can_activate_recommended' ][ ] = $slug;
1142 1142
 							}
1143 1143
 						}
1144
-						if ( true === $plugin['required'] ) {
1144
+						if ( true === $plugin[ 'required' ] ) {
1145 1145
 							$total_required_action_count++;
1146 1146
 						}
1147 1147
 					}
@@ -1152,12 +1152,12 @@  discard block
 block discarded – undo
1152 1152
 							$update_link_count++;
1153 1153
 
1154 1154
 							if ( $this->does_plugin_require_update( $slug ) ) {
1155
-								$message['notice_ask_to_update'][] = $slug;
1155
+								$message[ 'notice_ask_to_update' ][ ] = $slug;
1156 1156
 							} elseif ( false !== $this->does_plugin_have_update( $slug ) ) {
1157
-								$message['notice_ask_to_update_maybe'][] = $slug;
1157
+								$message[ 'notice_ask_to_update_maybe' ][ ] = $slug;
1158 1158
 							}
1159 1159
 						}
1160
-						if ( true === $plugin['required'] ) {
1160
+						if ( true === $plugin[ 'required' ] ) {
1161 1161
 							$total_required_action_count++;
1162 1162
 						}
1163 1163
 					}
@@ -1172,10 +1172,10 @@  discard block
 block discarded – undo
1172 1172
 
1173 1173
 				// As add_settings_error() wraps the final message in a <p> and as the final message can't be
1174 1174
 				// filtered, using <p>'s in our html would render invalid html output.
1175
-				$line_template = '<span style="display: block; margin: 0.5em 0.5em 0 0; clear: both;">%s</span>' . "\n";
1175
+				$line_template = '<span style="display: block; margin: 0.5em 0.5em 0 0; clear: both;">%s</span>'."\n";
1176 1176
 
1177 1177
 				if ( ! current_user_can( 'activate_plugins' ) && ! current_user_can( 'install_plugins' ) && ! current_user_can( 'update_plugins' ) ) {
1178
-					$rendered = esc_html__( $this->strings['notice_cannot_install_activate'] ) . ' ' . esc_html__( $this->strings['contact_admin'] );
1178
+					$rendered = esc_html__( $this->strings[ 'notice_cannot_install_activate' ] ).' '.esc_html__( $this->strings[ 'contact_admin' ] );
1179 1179
 					$rendered .= $this->create_user_action_links_for_notice( 0, 0, 0, $line_template );
1180 1180
 				} else {
1181 1181
 
@@ -1190,14 +1190,14 @@  discard block
 block discarded – undo
1190 1190
 
1191 1191
 						// Get the external info link for a plugin if one is available.
1192 1192
 						foreach ( $plugin_group as $plugin_slug ) {
1193
-							$linked_plugins[] = $this->get_info_link( $plugin_slug );
1193
+							$linked_plugins[ ] = $this->get_info_link( $plugin_slug );
1194 1194
 						}
1195 1195
 						unset( $plugin_slug );
1196 1196
 
1197 1197
 						$count          = count( $plugin_group );
1198 1198
 						$linked_plugins = array_map( array( 'TGMPA_Utils', 'wrap_in_em' ), $linked_plugins );
1199 1199
 						$last_plugin    = array_pop( $linked_plugins ); // Pop off last name to prep for readability.
1200
-						$imploded       = empty( $linked_plugins ) ? $last_plugin : ( implode( ', ', $linked_plugins ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'tgmpa' ) . ' ' . $last_plugin );
1200
+						$imploded       = empty( $linked_plugins ) ? $last_plugin : ( implode( ', ', $linked_plugins ).' '.esc_html_x( 'and', 'plugin A *and* plugin B', 'tgmpa' ).' '.$last_plugin );
1201 1201
 
1202 1202
 						$rendered .= sprintf(
1203 1203
 							$line_template,
@@ -1219,7 +1219,7 @@  discard block
 block discarded – undo
1219 1219
 			}
1220 1220
 
1221 1221
 			// Admin options pages already output settings_errors, so this is to avoid duplication.
1222
-			if ( 'options-general' !== $GLOBALS['current_screen']->parent_base ) {
1222
+			if ( 'options-general' !== $GLOBALS[ 'current_screen' ]->parent_base ) {
1223 1223
 				$this->display_settings_errors();
1224 1224
 			}
1225 1225
 		}
@@ -1241,32 +1241,32 @@  discard block
 block discarded – undo
1241 1241
 				'install'  => '',
1242 1242
 				'update'   => '',
1243 1243
 				'activate' => '',
1244
-				'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>' : '',
1244
+				'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>' : '',
1245 1245
 			);
1246 1246
 
1247 1247
 			$link_template = '<a href="%2$s">%1$s</a>';
1248 1248
 
1249 1249
 			if ( current_user_can( 'install_plugins' ) ) {
1250 1250
 				if ( $install_count > 0 ) {
1251
-					$action_links['install'] = sprintf(
1251
+					$action_links[ 'install' ] = sprintf(
1252 1252
 						$link_template,
1253
-						translate_nooped_plural( $this->strings['install_link'], $install_count, 'tgmpa' ),
1253
+						translate_nooped_plural( $this->strings[ 'install_link' ], $install_count, 'tgmpa' ),
1254 1254
 						esc_url( $this->get_tgmpa_status_url( 'install' ) )
1255 1255
 					);
1256 1256
 				}
1257 1257
 				if ( $update_count > 0 ) {
1258
-					$action_links['update'] = sprintf(
1258
+					$action_links[ 'update' ] = sprintf(
1259 1259
 						$link_template,
1260
-						translate_nooped_plural( $this->strings['update_link'], $update_count, 'tgmpa' ),
1260
+						translate_nooped_plural( $this->strings[ 'update_link' ], $update_count, 'tgmpa' ),
1261 1261
 						esc_url( $this->get_tgmpa_status_url( 'update' ) )
1262 1262
 					);
1263 1263
 				}
1264 1264
 			}
1265 1265
 
1266 1266
 			if ( current_user_can( 'activate_plugins' ) && $activate_count > 0 ) {
1267
-				$action_links['activate'] = sprintf(
1267
+				$action_links[ 'activate' ] = sprintf(
1268 1268
 					$link_template,
1269
-					translate_nooped_plural( $this->strings['activate_link'], $activate_count, 'tgmpa' ),
1269
+					translate_nooped_plural( $this->strings[ 'activate_link' ], $activate_count, 'tgmpa' ),
1270 1270
 					esc_url( $this->get_tgmpa_status_url( 'activate' ) )
1271 1271
 				);
1272 1272
 			}
@@ -1294,8 +1294,8 @@  discard block
 block discarded – undo
1294 1294
 		 * @return string
1295 1295
 		 */
1296 1296
 		protected function get_admin_notice_class() {
1297
-			if ( ! empty( $this->strings['nag_type'] ) ) {
1298
-				return sanitize_html_class( strtolower( $this->strings['nag_type'] ) );
1297
+			if ( ! empty( $this->strings[ 'nag_type' ] ) ) {
1298
+				return sanitize_html_class( strtolower( $this->strings[ 'nag_type' ] ) );
1299 1299
 			} else {
1300 1300
 				if ( version_compare( $this->wp_version, '4.2', '>=' ) ) {
1301 1301
 					return 'notice-warning';
@@ -1318,7 +1318,7 @@  discard block
 block discarded – undo
1318 1318
 			settings_errors( 'tgmpa' );
1319 1319
 
1320 1320
 			foreach ( (array) $wp_settings_errors as $key => $details ) {
1321
-				if ( 'tgmpa' === $details['setting'] ) {
1321
+				if ( 'tgmpa' === $details[ 'setting' ] ) {
1322 1322
 					unset( $wp_settings_errors[ $key ] );
1323 1323
 					break;
1324 1324
 				}
@@ -1334,8 +1334,8 @@  discard block
 block discarded – undo
1334 1334
 		 * @since 2.1.0
1335 1335
 		 */
1336 1336
 		public function dismiss() {
1337
-			if ( isset( $_GET['tgmpa-dismiss'] ) && check_admin_referer( 'tgmpa-dismiss-' . get_current_user_id() ) ) {
1338
-				update_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, 1 );
1337
+			if ( isset( $_GET[ 'tgmpa-dismiss' ] ) && check_admin_referer( 'tgmpa-dismiss-'.get_current_user_id() ) ) {
1338
+				update_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_'.$this->id, 1 );
1339 1339
 			}
1340 1340
 		}
1341 1341
 
@@ -1351,54 +1351,54 @@  discard block
 block discarded – undo
1351 1351
 		 * @return null Return early if incorrect argument.
1352 1352
 		 */
1353 1353
 		public function register( $plugin ) {
1354
-			if ( empty( $plugin['slug'] ) || empty( $plugin['name'] ) ) {
1354
+			if ( empty( $plugin[ 'slug' ] ) || empty( $plugin[ 'name' ] ) ) {
1355 1355
 				return;
1356 1356
 			}
1357 1357
 
1358
-			if ( empty( $plugin['slug'] ) || ! is_string( $plugin['slug'] ) || isset( $this->plugins[ $plugin['slug'] ] ) ) {
1358
+			if ( empty( $plugin[ 'slug' ] ) || ! is_string( $plugin[ 'slug' ] ) || isset( $this->plugins[ $plugin[ 'slug' ] ] ) ) {
1359 1359
 				return;
1360 1360
 			}
1361 1361
 
1362 1362
 			$defaults = array(
1363
-				'name'               => '',      // String
1364
-				'slug'               => '',      // String
1365
-				'source'             => 'repo',  // String
1366
-				'required'           => false,   // Boolean
1367
-				'version'            => '',      // String
1368
-				'force_activation'   => false,   // Boolean
1369
-				'force_deactivation' => false,   // Boolean
1370
-				'external_url'       => '',      // String
1371
-				'is_callable'        => '',      // String|Array.
1363
+				'name'               => '', // String
1364
+				'slug'               => '', // String
1365
+				'source'             => 'repo', // String
1366
+				'required'           => false, // Boolean
1367
+				'version'            => '', // String
1368
+				'force_activation'   => false, // Boolean
1369
+				'force_deactivation' => false, // Boolean
1370
+				'external_url'       => '', // String
1371
+				'is_callable'        => '', // String|Array.
1372 1372
 			);
1373 1373
 
1374 1374
 			// Prepare the received data.
1375 1375
 			$plugin = wp_parse_args( $plugin, $defaults );
1376 1376
 
1377 1377
 			// Standardize the received slug.
1378
-			$plugin['slug'] = $this->sanitize_key( $plugin['slug'] );
1378
+			$plugin[ 'slug' ] = $this->sanitize_key( $plugin[ 'slug' ] );
1379 1379
 
1380 1380
 			// Forgive users for using string versions of booleans or floats for version number.
1381
-			$plugin['version']            = (string) $plugin['version'];
1382
-			$plugin['source']             = empty( $plugin['source'] ) ? 'repo' : $plugin['source'];
1383
-			$plugin['required']           = TGMPA_Utils::validate_bool( $plugin['required'] );
1384
-			$plugin['force_activation']   = TGMPA_Utils::validate_bool( $plugin['force_activation'] );
1385
-			$plugin['force_deactivation'] = TGMPA_Utils::validate_bool( $plugin['force_deactivation'] );
1381
+			$plugin[ 'version' ]            = (string) $plugin[ 'version' ];
1382
+			$plugin[ 'source' ]             = empty( $plugin[ 'source' ] ) ? 'repo' : $plugin[ 'source' ];
1383
+			$plugin[ 'required' ]           = TGMPA_Utils::validate_bool( $plugin[ 'required' ] );
1384
+			$plugin[ 'force_activation' ]   = TGMPA_Utils::validate_bool( $plugin[ 'force_activation' ] );
1385
+			$plugin[ 'force_deactivation' ] = TGMPA_Utils::validate_bool( $plugin[ 'force_deactivation' ] );
1386 1386
 
1387 1387
 			// Enrich the received data.
1388
-			$plugin['file_path']   = $this->_get_plugin_basename_from_slug( $plugin['slug'] );
1389
-			$plugin['source_type'] = $this->get_plugin_source_type( $plugin['source'] );
1388
+			$plugin[ 'file_path' ]   = $this->_get_plugin_basename_from_slug( $plugin[ 'slug' ] );
1389
+			$plugin[ 'source_type' ] = $this->get_plugin_source_type( $plugin[ 'source' ] );
1390 1390
 
1391 1391
 			// Set the class properties.
1392
-			$this->plugins[ $plugin['slug'] ]    = $plugin;
1393
-			$this->sort_order[ $plugin['slug'] ] = $plugin['name'];
1392
+			$this->plugins[ $plugin[ 'slug' ] ]    = $plugin;
1393
+			$this->sort_order[ $plugin[ 'slug' ] ] = $plugin[ 'name' ];
1394 1394
 
1395 1395
 			// Should we add the force activation hook ?
1396
-			if ( true === $plugin['force_activation'] ) {
1396
+			if ( true === $plugin[ 'force_activation' ] ) {
1397 1397
 				$this->has_forced_activation = true;
1398 1398
 			}
1399 1399
 
1400 1400
 			// Should we add the force deactivation hook ?
1401
-			if ( true === $plugin['force_deactivation'] ) {
1401
+			if ( true === $plugin[ 'force_deactivation' ] ) {
1402 1402
 				$this->has_forced_deactivation = true;
1403 1403
 			}
1404 1404
 		}
@@ -1524,11 +1524,11 @@  discard block
 block discarded – undo
1524 1524
 		 */
1525 1525
 		public function populate_file_path( $plugin_slug = '' ) {
1526 1526
 			if ( ! empty( $plugin_slug ) && is_string( $plugin_slug ) && isset( $this->plugins[ $plugin_slug ] ) ) {
1527
-				$this->plugins[ $plugin_slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $plugin_slug );
1527
+				$this->plugins[ $plugin_slug ][ 'file_path' ] = $this->_get_plugin_basename_from_slug( $plugin_slug );
1528 1528
 			} else {
1529 1529
 				// Add file_path key for all plugins.
1530 1530
 				foreach ( $this->plugins as $slug => $values ) {
1531
-					$this->plugins[ $slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $slug );
1531
+					$this->plugins[ $slug ][ 'file_path' ] = $this->_get_plugin_basename_from_slug( $slug );
1532 1532
 				}
1533 1533
 			}
1534 1534
 		}
@@ -1546,7 +1546,7 @@  discard block
 block discarded – undo
1546 1546
 			$keys = array_keys( $this->get_plugins() );
1547 1547
 
1548 1548
 			foreach ( $keys as $key ) {
1549
-				if ( preg_match( '|^' . $slug . '/|', $key ) ) {
1549
+				if ( preg_match( '|^'.$slug.'/|', $key ) ) {
1550 1550
 					return $key;
1551 1551
 				}
1552 1552
 			}
@@ -1568,7 +1568,7 @@  discard block
 block discarded – undo
1568 1568
 		 */
1569 1569
 		public function _get_plugin_data_from_name( $name, $data = 'slug' ) {
1570 1570
 			foreach ( $this->plugins as $values ) {
1571
-				if ( $name === $values['name'] && isset( $values[ $data ] ) ) {
1571
+				if ( $name === $values[ 'name' ] && isset( $values[ $data ] ) ) {
1572 1572
 					return $values[ $data ];
1573 1573
 				}
1574 1574
 			}
@@ -1587,13 +1587,13 @@  discard block
 block discarded – undo
1587 1587
 		public function get_download_url( $slug ) {
1588 1588
 			$dl_source = '';
1589 1589
 
1590
-			switch ( $this->plugins[ $slug ]['source_type'] ) {
1590
+			switch ( $this->plugins[ $slug ][ 'source_type' ] ) {
1591 1591
 				case 'repo':
1592 1592
 					return $this->get_wp_repo_download_url( $slug );
1593 1593
 				case 'external':
1594
-					return $this->plugins[ $slug ]['source'];
1594
+					return $this->plugins[ $slug ][ 'source' ];
1595 1595
 				case 'bundled':
1596
-					return $this->default_path . $this->plugins[ $slug ]['source'];
1596
+					return $this->default_path.$this->plugins[ $slug ][ 'source' ];
1597 1597
 			}
1598 1598
 
1599 1599
 			return $dl_source; // Should never happen.
@@ -1631,7 +1631,7 @@  discard block
 block discarded – undo
1631 1631
 
1632 1632
 			if ( ! isset( $api[ $slug ] ) ) {
1633 1633
 				if ( ! function_exists( 'plugins_api' ) ) {
1634
-					require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
1634
+					require_once ABSPATH.'wp-admin/includes/plugin-install.php';
1635 1635
 				}
1636 1636
 
1637 1637
 				$response = plugins_api( 'plugin_information', array( 'slug' => $slug, 'fields' => array( 'sections' => false ) ) );
@@ -1639,7 +1639,7 @@  discard block
 block discarded – undo
1639 1639
 				$api[ $slug ] = false;
1640 1640
 
1641 1641
 				if ( is_wp_error( $response ) ) {
1642
-					wp_die( esc_html( $this->strings['oops'] ) );
1642
+					wp_die( esc_html( $this->strings[ 'oops' ] ) );
1643 1643
 				} else {
1644 1644
 					$api[ $slug ] = $response;
1645 1645
 				}
@@ -1658,13 +1658,13 @@  discard block
 block discarded – undo
1658 1658
 		 *                or the plugin name if not.
1659 1659
 		 */
1660 1660
 		public function get_info_link( $slug ) {
1661
-			if ( ! empty( $this->plugins[ $slug ]['external_url'] ) && preg_match( self::IS_URL_REGEX, $this->plugins[ $slug ]['external_url'] ) ) {
1661
+			if ( ! empty( $this->plugins[ $slug ][ 'external_url' ] ) && preg_match( self::IS_URL_REGEX, $this->plugins[ $slug ][ 'external_url' ] ) ) {
1662 1662
 				$link = sprintf(
1663 1663
 					'<a href="%1$s" target="_blank">%2$s</a>',
1664
-					esc_url( $this->plugins[ $slug ]['external_url'] ),
1665
-					esc_html( $this->plugins[ $slug ]['name'] )
1664
+					esc_url( $this->plugins[ $slug ][ 'external_url' ] ),
1665
+					esc_html( $this->plugins[ $slug ][ 'name' ] )
1666 1666
 				);
1667
-			} elseif ( 'repo' === $this->plugins[ $slug ]['source_type'] ) {
1667
+			} elseif ( 'repo' === $this->plugins[ $slug ][ 'source_type' ] ) {
1668 1668
 				$url = add_query_arg(
1669 1669
 					array(
1670 1670
 						'tab'       => 'plugin-information',
@@ -1679,10 +1679,10 @@  discard block
 block discarded – undo
1679 1679
 				$link = sprintf(
1680 1680
 					'<a href="%1$s" class="thickbox">%2$s</a>',
1681 1681
 					esc_url( $url ),
1682
-					esc_html( $this->plugins[ $slug ]['name'] )
1682
+					esc_html( $this->plugins[ $slug ][ 'name' ] )
1683 1683
 				);
1684 1684
 			} else {
1685
-				$link = esc_html( $this->plugins[ $slug ]['name'] ); // No hyperlink.
1685
+				$link = esc_html( $this->plugins[ $slug ][ 'name' ] ); // No hyperlink.
1686 1686
 			}
1687 1687
 
1688 1688
 			return $link;
@@ -1696,7 +1696,7 @@  discard block
 block discarded – undo
1696 1696
 		 * @return boolean True when on the TGMPA page, false otherwise.
1697 1697
 		 */
1698 1698
 		protected function is_tgmpa_page() {
1699
-			return isset( $_GET['page'] ) && $this->menu === $_GET['page'];
1699
+			return isset( $_GET[ 'page' ] ) && $this->menu === $_GET[ 'page' ];
1700 1700
 		}
1701 1701
 
1702 1702
 		/**
@@ -1717,10 +1717,10 @@  discard block
 block discarded – undo
1717 1717
 			if ( 'update-core' === $screen->base ) {
1718 1718
 				// Core update screen.
1719 1719
 				return true;
1720
-			} elseif ( 'plugins' === $screen->base && ! empty( $_POST['action'] ) ) { // WPCS: CSRF ok.
1720
+			} elseif ( 'plugins' === $screen->base && ! empty( $_POST[ 'action' ] ) ) { // WPCS: CSRF ok.
1721 1721
 				// Plugins bulk update screen.
1722 1722
 				return true;
1723
-			} elseif ( 'update' === $screen->base && ! empty( $_POST['action'] ) ) { // WPCS: CSRF ok.
1723
+			} elseif ( 'update' === $screen->base && ! empty( $_POST[ 'action' ] ) ) { // WPCS: CSRF ok.
1724 1724
 				// Individual updates (ajax call).
1725 1725
 				return true;
1726 1726
 			}
@@ -1807,7 +1807,7 @@  discard block
 block discarded – undo
1807 1807
 		public function is_plugin_installed( $slug ) {
1808 1808
 			$installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached).
1809 1809
 
1810
-			return ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ] ) );
1810
+			return ( ! empty( $installed_plugins[ $this->plugins[ $slug ][ 'file_path' ] ] ) );
1811 1811
 		}
1812 1812
 
1813 1813
 		/**
@@ -1819,7 +1819,7 @@  discard block
 block discarded – undo
1819 1819
 		 * @return bool True if active, false otherwise.
1820 1820
 		 */
1821 1821
 		public function is_plugin_active( $slug ) {
1822
-			return ( ( ! empty( $this->plugins[ $slug ]['is_callable'] ) && is_callable( $this->plugins[ $slug ]['is_callable'] ) ) || is_plugin_active( $this->plugins[ $slug ]['file_path'] ) );
1822
+			return ( ( ! empty( $this->plugins[ $slug ][ 'is_callable' ] ) && is_callable( $this->plugins[ $slug ][ 'is_callable' ] ) ) || is_plugin_active( $this->plugins[ $slug ][ 'file_path' ] ) );
1823 1823
 		}
1824 1824
 
1825 1825
 		/**
@@ -1833,7 +1833,7 @@  discard block
 block discarded – undo
1833 1833
 		 */
1834 1834
 		public function can_plugin_update( $slug ) {
1835 1835
 			// We currently can't get reliable info on non-WP-repo plugins - issue #380.
1836
-			if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) {
1836
+			if ( 'repo' !== $this->plugins[ $slug ][ 'source_type' ] ) {
1837 1837
 				return true;
1838 1838
 			}
1839 1839
 
@@ -1889,8 +1889,8 @@  discard block
 block discarded – undo
1889 1889
 		public function get_installed_version( $slug ) {
1890 1890
 			$installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached).
1891 1891
 
1892
-			if ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'] ) ) {
1893
-				return $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'];
1892
+			if ( ! empty( $installed_plugins[ $this->plugins[ $slug ][ 'file_path' ] ][ 'Version' ] ) ) {
1893
+				return $installed_plugins[ $this->plugins[ $slug ][ 'file_path' ] ][ 'Version' ];
1894 1894
 			}
1895 1895
 
1896 1896
 			return '';
@@ -1906,7 +1906,7 @@  discard block
 block discarded – undo
1906 1906
 		 */
1907 1907
 		public function does_plugin_require_update( $slug ) {
1908 1908
 			$installed_version = $this->get_installed_version( $slug );
1909
-			$minimum_version   = $this->plugins[ $slug ]['version'];
1909
+			$minimum_version   = $this->plugins[ $slug ][ 'version' ];
1910 1910
 
1911 1911
 			return version_compare( $minimum_version, $installed_version, '>' );
1912 1912
 		}
@@ -1921,9 +1921,9 @@  discard block
 block discarded – undo
1921 1921
 		 */
1922 1922
 		public function does_plugin_have_update( $slug ) {
1923 1923
 			// Presume bundled and external plugins will point to a package which meets the minimum required version.
1924
-			if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) {
1924
+			if ( 'repo' !== $this->plugins[ $slug ][ 'source_type' ] ) {
1925 1925
 				if ( $this->does_plugin_require_update( $slug ) ) {
1926
-					return $this->plugins[ $slug ]['version'];
1926
+					return $this->plugins[ $slug ][ 'version' ];
1927 1927
 				}
1928 1928
 
1929 1929
 				return false;
@@ -1931,8 +1931,8 @@  discard block
 block discarded – undo
1931 1931
 
1932 1932
 			$repo_updates = get_site_transient( 'update_plugins' );
1933 1933
 
1934
-			if ( isset( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version ) ) {
1935
-				return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version;
1934
+			if ( isset( $repo_updates->response[ $this->plugins[ $slug ][ 'file_path' ] ]->new_version ) ) {