wp/wp-admin/includes/class-wp-plugins-list-table.php
changeset 19 3d72ae0968f4
parent 18 be944660c56a
child 21 48c4eec2b7e6
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
   737 
   737 
   738 		// Do not restrict by default.
   738 		// Do not restrict by default.
   739 		$restrict_network_active = false;
   739 		$restrict_network_active = false;
   740 		$restrict_network_only   = false;
   740 		$restrict_network_only   = false;
   741 
   741 
       
   742 		$requires_php = isset( $plugin_data['RequiresPHP'] ) ? $plugin_data['RequiresPHP'] : null;
       
   743 		$requires_wp  = isset( $plugin_data['RequiresWP'] ) ? $plugin_data['RequiresWP'] : null;
       
   744 
       
   745 		$compatible_php = is_php_version_compatible( $requires_php );
       
   746 		$compatible_wp  = is_wp_version_compatible( $requires_wp );
       
   747 
   742 		if ( 'mustuse' === $context ) {
   748 		if ( 'mustuse' === $context ) {
   743 			$is_active = true;
   749 			$is_active = true;
   744 		} elseif ( 'dropins' === $context ) {
   750 		} elseif ( 'dropins' === $context ) {
   745 			$dropins     = _get_dropins();
   751 			$dropins     = _get_dropins();
   746 			$plugin_name = $plugin_file;
   752 			$plugin_name = $plugin_file;
   790 							__( 'Network Deactivate' )
   796 							__( 'Network Deactivate' )
   791 						);
   797 						);
   792 					}
   798 					}
   793 				} else {
   799 				} else {
   794 					if ( current_user_can( 'manage_network_plugins' ) ) {
   800 					if ( current_user_can( 'manage_network_plugins' ) ) {
   795 						$actions['activate'] = sprintf(
   801 						if ( $compatible_php && $compatible_wp ) {
   796 							'<a href="%s" id="activate-%s" class="edit" aria-label="%s">%s</a>',
   802 							$actions['activate'] = sprintf(
   797 							wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . urlencode( $plugin_file ) . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'activate-plugin_' . $plugin_file ),
   803 								'<a href="%s" id="activate-%s" class="edit" aria-label="%s">%s</a>',
   798 							esc_attr( $plugin_id_attr ),
   804 								wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . urlencode( $plugin_file ) . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'activate-plugin_' . $plugin_file ),
   799 							/* translators: %s: Plugin name. */
   805 								esc_attr( $plugin_id_attr ),
   800 							esc_attr( sprintf( _x( 'Network Activate %s', 'plugin' ), $plugin_data['Name'] ) ),
   806 								/* translators: %s: Plugin name. */
   801 							__( 'Network Activate' )
   807 								esc_attr( sprintf( _x( 'Network Activate %s', 'plugin' ), $plugin_data['Name'] ) ),
   802 						);
   808 								__( 'Network Activate' )
       
   809 							);
       
   810 						} else {
       
   811 							$actions['activate'] = sprintf(
       
   812 								'<span>%s</span>',
       
   813 								_x( 'Cannot Activate', 'plugin' )
       
   814 							);
       
   815 						}
   803 					}
   816 					}
   804 
   817 
   805 					if ( current_user_can( 'delete_plugins' ) && ! is_plugin_active( $plugin_file ) ) {
   818 					if ( current_user_can( 'delete_plugins' ) && ! is_plugin_active( $plugin_file ) ) {
   806 						$actions['delete'] = sprintf(
   819 						$actions['delete'] = sprintf(
   807 							'<a href="%s" id="delete-%s" class="delete" aria-label="%s">%s</a>',
   820 							'<a href="%s" id="delete-%s" class="delete" aria-label="%s">%s</a>',
   844 							__( 'Resume' )
   857 							__( 'Resume' )
   845 						);
   858 						);
   846 					}
   859 					}
   847 				} else {
   860 				} else {
   848 					if ( current_user_can( 'activate_plugin', $plugin_file ) ) {
   861 					if ( current_user_can( 'activate_plugin', $plugin_file ) ) {
   849 						$actions['activate'] = sprintf(
   862 						if ( $compatible_php && $compatible_wp ) {
   850 							'<a href="%s" id="activate-%s" class="edit" aria-label="%s">%s</a>',
   863 							$actions['activate'] = sprintf(
   851 							wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . urlencode( $plugin_file ) . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'activate-plugin_' . $plugin_file ),
   864 								'<a href="%s" id="activate-%s" class="edit" aria-label="%s">%s</a>',
   852 							esc_attr( $plugin_id_attr ),
   865 								wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . urlencode( $plugin_file ) . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'activate-plugin_' . $plugin_file ),
   853 							/* translators: %s: Plugin name. */
   866 								esc_attr( $plugin_id_attr ),
   854 							esc_attr( sprintf( _x( 'Activate %s', 'plugin' ), $plugin_data['Name'] ) ),
   867 								/* translators: %s: Plugin name. */
   855 							__( 'Activate' )
   868 								esc_attr( sprintf( _x( 'Activate %s', 'plugin' ), $plugin_data['Name'] ) ),
   856 						);
   869 								__( 'Activate' )
       
   870 							);
       
   871 						} else {
       
   872 							$actions['activate'] = sprintf(
       
   873 								'<span>%s</span>',
       
   874 								_x( 'Cannot Activate', 'plugin' )
       
   875 							);
       
   876 						}
   857 					}
   877 					}
   858 
   878 
   859 					if ( ! is_multisite() && current_user_can( 'delete_plugins' ) ) {
   879 					if ( ! is_multisite() && current_user_can( 'delete_plugins' ) ) {
   860 						$actions['delete'] = sprintf(
   880 						$actions['delete'] = sprintf(
   861 							'<a href="%s" id="delete-%s" class="delete" aria-label="%s">%s</a>',
   881 							'<a href="%s" id="delete-%s" class="delete" aria-label="%s">%s</a>',
   877 			/**
   897 			/**
   878 			 * Filters the action links displayed for each plugin in the Network Admin Plugins list table.
   898 			 * Filters the action links displayed for each plugin in the Network Admin Plugins list table.
   879 			 *
   899 			 *
   880 			 * @since 3.1.0
   900 			 * @since 3.1.0
   881 			 *
   901 			 *
   882 			 * @param string[] $actions     An array of plugin action links. By default this can include 'activate',
   902 			 * @param string[] $actions     An array of plugin action links. By default this can include
   883 			 *                              'deactivate', and 'delete'.
   903 			 *                              'activate', 'deactivate', and 'delete'.
   884 			 * @param string   $plugin_file Path to the plugin file relative to the plugins directory.
   904 			 * @param string   $plugin_file Path to the plugin file relative to the plugins directory.
   885 			 * @param array    $plugin_data An array of plugin data. See `get_plugin_data()`.
   905 			 * @param array    $plugin_data An array of plugin data. See `get_plugin_data()`
   886 			 * @param string   $context     The plugin context. By default this can include 'all', 'active', 'inactive',
   906 			 *                              and the {@see 'plugin_row_meta'} filter for the list
   887 			 *                              'recently_activated', 'upgrade', 'mustuse', 'dropins', and 'search'.
   907 			 *                              of possible values.
       
   908 			 * @param string   $context     The plugin context. By default this can include 'all',
       
   909 			 *                              'active', 'inactive', 'recently_activated', 'upgrade',
       
   910 			 *                              'mustuse', 'dropins', and 'search'.
   888 			 */
   911 			 */
   889 			$actions = apply_filters( 'network_admin_plugin_action_links', $actions, $plugin_file, $plugin_data, $context );
   912 			$actions = apply_filters( 'network_admin_plugin_action_links', $actions, $plugin_file, $plugin_data, $context );
   890 
   913 
   891 			/**
   914 			/**
   892 			 * Filters the list of action links displayed for a specific plugin in the Network Admin Plugins list table.
   915 			 * Filters the list of action links displayed for a specific plugin in the Network Admin Plugins list table.
   894 			 * The dynamic portion of the hook name, `$plugin_file`, refers to the path
   917 			 * The dynamic portion of the hook name, `$plugin_file`, refers to the path
   895 			 * to the plugin file, relative to the plugins directory.
   918 			 * to the plugin file, relative to the plugins directory.
   896 			 *
   919 			 *
   897 			 * @since 3.1.0
   920 			 * @since 3.1.0
   898 			 *
   921 			 *
   899 			 * @param string[] $actions     An array of plugin action links. By default this can include 'activate',
   922 			 * @param string[] $actions     An array of plugin action links. By default this can include
   900 			 *                              'deactivate', and 'delete'.
   923 			 *                              'activate', 'deactivate', and 'delete'.
   901 			 * @param string   $plugin_file Path to the plugin file relative to the plugins directory.
   924 			 * @param string   $plugin_file Path to the plugin file relative to the plugins directory.
   902 			 * @param array    $plugin_data An array of plugin data. See `get_plugin_data()`.
   925 			 * @param array    $plugin_data An array of plugin data. See `get_plugin_data()`
   903 			 * @param string   $context     The plugin context. By default this can include 'all', 'active', 'inactive',
   926 			 *                              and the {@see 'plugin_row_meta'} filter for the list
   904 			 *                              'recently_activated', 'upgrade', 'mustuse', 'dropins', and 'search'.
   927 			 *                              of possible values.
       
   928 			 * @param string   $context     The plugin context. By default this can include 'all',
       
   929 			 *                              'active', 'inactive', 'recently_activated', 'upgrade',
       
   930 			 *                              'mustuse', 'dropins', and 'search'.
   905 			 */
   931 			 */
   906 			$actions = apply_filters( "network_admin_plugin_action_links_{$plugin_file}", $actions, $plugin_file, $plugin_data, $context );
   932 			$actions = apply_filters( "network_admin_plugin_action_links_{$plugin_file}", $actions, $plugin_file, $plugin_data, $context );
   907 
   933 
   908 		} else {
   934 		} else {
   909 
   935 
   912 			 *
   938 			 *
   913 			 * @since 2.5.0
   939 			 * @since 2.5.0
   914 			 * @since 2.6.0 The `$context` parameter was added.
   940 			 * @since 2.6.0 The `$context` parameter was added.
   915 			 * @since 4.9.0 The 'Edit' link was removed from the list of action links.
   941 			 * @since 4.9.0 The 'Edit' link was removed from the list of action links.
   916 			 *
   942 			 *
   917 			 * @param string[] $actions     An array of plugin action links. By default this can include 'activate',
   943 			 * @param string[] $actions     An array of plugin action links. By default this can include
   918 			 *                              'deactivate', and 'delete'. With Multisite active this can also include
   944 			 *                              'activate', 'deactivate', and 'delete'. With Multisite active
   919 			 *                              'network_active' and 'network_only' items.
   945 			 *                              this can also include 'network_active' and 'network_only' items.
   920 			 * @param string   $plugin_file Path to the plugin file relative to the plugins directory.
   946 			 * @param string   $plugin_file Path to the plugin file relative to the plugins directory.
   921 			 * @param array    $plugin_data An array of plugin data. See `get_plugin_data()`.
   947 			 * @param array    $plugin_data An array of plugin data. See `get_plugin_data()`
   922 			 * @param string   $context     The plugin context. By default this can include 'all', 'active', 'inactive',
   948 			 *                              and the {@see 'plugin_row_meta'} filter for the list
   923 			 *                              'recently_activated', 'upgrade', 'mustuse', 'dropins', and 'search'.
   949 			 *                              of possible values.
       
   950 			 * @param string   $context     The plugin context. By default this can include 'all',
       
   951 			 *                              'active', 'inactive', 'recently_activated', 'upgrade',
       
   952 			 *                              'mustuse', 'dropins', and 'search'.
   924 			 */
   953 			 */
   925 			$actions = apply_filters( 'plugin_action_links', $actions, $plugin_file, $plugin_data, $context );
   954 			$actions = apply_filters( 'plugin_action_links', $actions, $plugin_file, $plugin_data, $context );
   926 
   955 
   927 			/**
   956 			/**
   928 			 * Filters the list of action links displayed for a specific plugin in the Plugins list table.
   957 			 * Filters the list of action links displayed for a specific plugin in the Plugins list table.
   931 			 * to the plugin file, relative to the plugins directory.
   960 			 * to the plugin file, relative to the plugins directory.
   932 			 *
   961 			 *
   933 			 * @since 2.7.0
   962 			 * @since 2.7.0
   934 			 * @since 4.9.0 The 'Edit' link was removed from the list of action links.
   963 			 * @since 4.9.0 The 'Edit' link was removed from the list of action links.
   935 			 *
   964 			 *
   936 			 * @param string[] $actions     An array of plugin action links. By default this can include 'activate',
   965 			 * @param string[] $actions     An array of plugin action links. By default this can include
   937 			 *                              'deactivate', and 'delete'. With Multisite active this can also include
   966 			 *                              'activate', 'deactivate', and 'delete'. With Multisite active
   938 			 *                              'network_active' and 'network_only' items.
   967 			 *                              this can also include 'network_active' and 'network_only' items.
   939 			 * @param string   $plugin_file Path to the plugin file relative to the plugins directory.
   968 			 * @param string   $plugin_file Path to the plugin file relative to the plugins directory.
   940 			 * @param array    $plugin_data An array of plugin data. See `get_plugin_data()`.
   969 			 * @param array    $plugin_data An array of plugin data. See `get_plugin_data()`
   941 			 * @param string   $context     The plugin context. By default this can include 'all', 'active', 'inactive',
   970 			 *                              and the {@see 'plugin_row_meta'} filter for the list
   942 			 *                              'recently_activated', 'upgrade', 'mustuse', 'dropins', and 'search'.
   971 			 *                              of possible values.
       
   972 			 * @param string   $context     The plugin context. By default this can include 'all',
       
   973 			 *                              'active', 'inactive', 'recently_activated', 'upgrade',
       
   974 			 *                              'mustuse', 'dropins', and 'search'.
   943 			 */
   975 			 */
   944 			$actions = apply_filters( "plugin_action_links_{$plugin_file}", $actions, $plugin_file, $plugin_data, $context );
   976 			$actions = apply_filters( "plugin_action_links_{$plugin_file}", $actions, $plugin_file, $plugin_data, $context );
   945 
   977 
   946 		}
   978 		}
   947 
   979 
   948 		$requires_php   = isset( $plugin_data['requires_php'] ) ? $plugin_data['requires_php'] : null;
   980 		$class       = $is_active ? 'active' : 'inactive';
   949 		$compatible_php = is_php_version_compatible( $requires_php );
   981 		$checkbox_id = 'checkbox_' . md5( $plugin_file );
   950 		$class          = $is_active ? 'active' : 'inactive';
       
   951 		$checkbox_id    = 'checkbox_' . md5( $plugin_file );
       
   952 
   982 
   953 		if ( $restrict_network_active || $restrict_network_only || in_array( $status, array( 'mustuse', 'dropins' ), true ) || ! $compatible_php ) {
   983 		if ( $restrict_network_active || $restrict_network_only || in_array( $status, array( 'mustuse', 'dropins' ), true ) || ! $compatible_php ) {
   954 			$checkbox = '';
   984 			$checkbox = '';
   955 		} else {
   985 		} else {
   956 			$checkbox = sprintf(
   986 			$checkbox = sprintf(
   966 		if ( 'dropins' !== $context ) {
   996 		if ( 'dropins' !== $context ) {
   967 			$description = '<p>' . ( $plugin_data['Description'] ? $plugin_data['Description'] : '&nbsp;' ) . '</p>';
   997 			$description = '<p>' . ( $plugin_data['Description'] ? $plugin_data['Description'] : '&nbsp;' ) . '</p>';
   968 			$plugin_name = $plugin_data['Name'];
   998 			$plugin_name = $plugin_data['Name'];
   969 		}
   999 		}
   970 
  1000 
   971 		if ( ! empty( $totals['upgrade'] ) && ! empty( $plugin_data['update'] ) ) {
  1001 		if ( ! empty( $totals['upgrade'] ) && ! empty( $plugin_data['update'] )
       
  1002 			|| ! $compatible_php || ! $compatible_wp
       
  1003 		) {
   972 			$class .= ' update';
  1004 			$class .= ' update';
   973 		}
  1005 		}
   974 
  1006 
   975 		$paused = ! $screen->in_admin( 'network' ) && is_plugin_paused( $plugin_file );
  1007 		$paused = ! $screen->in_admin( 'network' ) && is_plugin_paused( $plugin_file );
   976 
  1008 
  1044 							esc_attr( sprintf( __( 'More information about %s' ), $plugin_name ) ),
  1076 							esc_attr( sprintf( __( 'More information about %s' ), $plugin_name ) ),
  1045 							esc_attr( $plugin_name ),
  1077 							esc_attr( $plugin_name ),
  1046 							__( 'View details' )
  1078 							__( 'View details' )
  1047 						);
  1079 						);
  1048 					} elseif ( ! empty( $plugin_data['PluginURI'] ) ) {
  1080 					} elseif ( ! empty( $plugin_data['PluginURI'] ) ) {
       
  1081 						/* translators: %s: Plugin name. */
       
  1082 						$aria_label = sprintf( __( 'Visit plugin site for %s' ), $plugin_name );
       
  1083 
  1049 						$plugin_meta[] = sprintf(
  1084 						$plugin_meta[] = sprintf(
  1050 							'<a href="%s">%s</a>',
  1085 							'<a href="%s" aria-label="%s">%s</a>',
  1051 							esc_url( $plugin_data['PluginURI'] ),
  1086 							esc_url( $plugin_data['PluginURI'] ),
       
  1087 							esc_attr( $aria_label ),
  1052 							__( 'Visit plugin site' )
  1088 							__( 'Visit plugin site' )
  1053 						);
  1089 						);
  1054 					}
  1090 					}
  1055 
  1091 
  1056 					/**
  1092 					/**
  1059 					 * @since 2.8.0
  1095 					 * @since 2.8.0
  1060 					 *
  1096 					 *
  1061 					 * @param string[] $plugin_meta An array of the plugin's metadata, including
  1097 					 * @param string[] $plugin_meta An array of the plugin's metadata, including
  1062 					 *                              the version, author, author URI, and plugin URI.
  1098 					 *                              the version, author, author URI, and plugin URI.
  1063 					 * @param string   $plugin_file Path to the plugin file relative to the plugins directory.
  1099 					 * @param string   $plugin_file Path to the plugin file relative to the plugins directory.
  1064 					 * @param array    $plugin_data An array of plugin data.
  1100 					 * @param array    $plugin_data {
       
  1101 					 *     An array of plugin data.
       
  1102 					 *
       
  1103 					 *     @type string   $id               Plugin ID, e.g. `w.org/plugins/[plugin-name]`.
       
  1104 					 *     @type string   $slug             Plugin slug.
       
  1105 					 *     @type string   $plugin           Plugin basename.
       
  1106 					 *     @type string   $new_version      New plugin version.
       
  1107 					 *     @type string   $url              Plugin URL.
       
  1108 					 *     @type string   $package          Plugin update package URL.
       
  1109 					 *     @type string[] $icons            An array of plugin icon URLs.
       
  1110 					 *     @type string[] $banners          An array of plugin banner URLs.
       
  1111 					 *     @type string[] $banners_rtl      An array of plugin RTL banner URLs.
       
  1112 					 *     @type string   $requires         The version of WordPress which the plugin requires.
       
  1113 					 *     @type string   $tested           The version of WordPress the plugin is tested against.
       
  1114 					 *     @type string   $requires_php     The version of PHP which the plugin requires.
       
  1115 					 *     @type string   $upgrade_notice   The upgrade notice for the new plugin version.
       
  1116 					 *     @type bool     $update-supported Whether the plugin supports updates.
       
  1117 					 *     @type string   $Name             The human-readable name of the plugin.
       
  1118 					 *     @type string   $PluginURI        Plugin URI.
       
  1119 					 *     @type string   $Version          Plugin version.
       
  1120 					 *     @type string   $Description      Plugin description.
       
  1121 					 *     @type string   $Author           Plugin author.
       
  1122 					 *     @type string   $AuthorURI        Plugin author URI.
       
  1123 					 *     @type string   $TextDomain       Plugin textdomain.
       
  1124 					 *     @type string   $DomainPath       Relative path to the plugin's .mo file(s).
       
  1125 					 *     @type bool     $Network          Whether the plugin can only be activated network-wide.
       
  1126 					 *     @type string   $RequiresWP       The version of WordPress which the plugin requires.
       
  1127 					 *     @type string   $RequiresPHP      The version of PHP which the plugin requires.
       
  1128 					 *     @type string   $UpdateURI        ID of the plugin for update purposes, should be a URI.
       
  1129 					 *     @type string   $Title            The human-readable title of the plugin.
       
  1130 					 *     @type string   $AuthorName       Plugin author's name.
       
  1131 					 *     @type bool     $update           Whether there's an available update. Default null.
       
  1132 					 * }
  1065 					 * @param string   $status      Status filter currently applied to the plugin list. Possible
  1133 					 * @param string   $status      Status filter currently applied to the plugin list. Possible
  1066 					 *                              values are: 'all', 'active', 'inactive', 'recently_activated',
  1134 					 *                              values are: 'all', 'active', 'inactive', 'recently_activated',
  1067 					 *                              'upgrade', 'mustuse', 'dropins', 'search', 'paused',
  1135 					 *                              'upgrade', 'mustuse', 'dropins', 'search', 'paused',
  1068 					 *                              'auto-update-enabled', 'auto-update-disabled'.
  1136 					 *                              'auto-update-enabled', 'auto-update-disabled'.
  1069 					 */
  1137 					 */
  1155 					/**
  1223 					/**
  1156 					 * Filters the HTML of the auto-updates setting for each plugin in the Plugins list table.
  1224 					 * Filters the HTML of the auto-updates setting for each plugin in the Plugins list table.
  1157 					 *
  1225 					 *
  1158 					 * @since 5.5.0
  1226 					 * @since 5.5.0
  1159 					 *
  1227 					 *
  1160 					 * @param string $html        The HTML of the plugin's auto-update column content, including
  1228 					 * @param string $html        The HTML of the plugin's auto-update column content,
  1161 					 *                            toggle auto-update action links and time to next update.
  1229 					 *                            including toggle auto-update action links and
       
  1230 					 *                            time to next update.
  1162 					 * @param string $plugin_file Path to the plugin file relative to the plugins directory.
  1231 					 * @param string $plugin_file Path to the plugin file relative to the plugins directory.
  1163 					 * @param array  $plugin_data An array of plugin data.
  1232 					 * @param array  $plugin_data An array of plugin data. See `get_plugin_data()`
       
  1233 					 *                            and the {@see 'plugin_row_meta'} filter for the list
       
  1234 					 *                            of possible values.
  1164 					 */
  1235 					 */
  1165 					echo apply_filters( 'plugin_auto_update_setting_html', $html, $plugin_file, $plugin_data );
  1236 					echo apply_filters( 'plugin_auto_update_setting_html', $html, $plugin_file, $plugin_data );
  1166 
  1237 
  1167 					echo '<div class="notice notice-error notice-alt inline hidden"><p></p></div>';
  1238 					echo '<div class="notice notice-error notice-alt inline hidden"><p></p></div>';
  1168 					echo '</td>';
  1239 					echo '</td>';
  1178 					 *
  1249 					 *
  1179 					 * @since 3.1.0
  1250 					 * @since 3.1.0
  1180 					 *
  1251 					 *
  1181 					 * @param string $column_name Name of the column.
  1252 					 * @param string $column_name Name of the column.
  1182 					 * @param string $plugin_file Path to the plugin file relative to the plugins directory.
  1253 					 * @param string $plugin_file Path to the plugin file relative to the plugins directory.
  1183 					 * @param array  $plugin_data An array of plugin data.
  1254 					 * @param array  $plugin_data An array of plugin data. See `get_plugin_data()`
       
  1255 					 *                            and the {@see 'plugin_row_meta'} filter for the list
       
  1256 					 *                            of possible values.
  1184 					 */
  1257 					 */
  1185 					do_action( 'manage_plugins_custom_column', $column_name, $plugin_file, $plugin_data );
  1258 					do_action( 'manage_plugins_custom_column', $column_name, $plugin_file, $plugin_data );
  1186 
  1259 
  1187 					echo '</td>';
  1260 					echo '</td>';
  1188 			}
  1261 			}
  1189 		}
  1262 		}
  1190 
  1263 
  1191 		echo '</tr>';
  1264 		echo '</tr>';
       
  1265 
       
  1266 		if ( ! $compatible_php || ! $compatible_wp ) {
       
  1267 			printf(
       
  1268 				'<tr class="plugin-update-tr">' .
       
  1269 				'<td colspan="%s" class="plugin-update colspanchange">' .
       
  1270 				'<div class="update-message notice inline notice-error notice-alt"><p>',
       
  1271 				esc_attr( $this->get_column_count() )
       
  1272 			);
       
  1273 
       
  1274 			if ( ! $compatible_php && ! $compatible_wp ) {
       
  1275 				_e( 'This plugin does not work with your versions of WordPress and PHP.' );
       
  1276 				if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
       
  1277 					printf(
       
  1278 						/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
       
  1279 						' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
       
  1280 						self_admin_url( 'update-core.php' ),
       
  1281 						esc_url( wp_get_update_php_url() )
       
  1282 					);
       
  1283 					wp_update_php_annotation( '</p><p><em>', '</em>' );
       
  1284 				} elseif ( current_user_can( 'update_core' ) ) {
       
  1285 					printf(
       
  1286 						/* translators: %s: URL to WordPress Updates screen. */
       
  1287 						' ' . __( '<a href="%s">Please update WordPress</a>.' ),
       
  1288 						self_admin_url( 'update-core.php' )
       
  1289 					);
       
  1290 				} elseif ( current_user_can( 'update_php' ) ) {
       
  1291 					printf(
       
  1292 						/* translators: %s: URL to Update PHP page. */
       
  1293 						' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
       
  1294 						esc_url( wp_get_update_php_url() )
       
  1295 					);
       
  1296 					wp_update_php_annotation( '</p><p><em>', '</em>' );
       
  1297 				}
       
  1298 			} elseif ( ! $compatible_wp ) {
       
  1299 				_e( 'This plugin does not work with your version of WordPress.' );
       
  1300 				if ( current_user_can( 'update_core' ) ) {
       
  1301 					printf(
       
  1302 						/* translators: %s: URL to WordPress Updates screen. */
       
  1303 						' ' . __( '<a href="%s">Please update WordPress</a>.' ),
       
  1304 						self_admin_url( 'update-core.php' )
       
  1305 					);
       
  1306 				}
       
  1307 			} elseif ( ! $compatible_php ) {
       
  1308 				_e( 'This plugin does not work with your version of PHP.' );
       
  1309 				if ( current_user_can( 'update_php' ) ) {
       
  1310 					printf(
       
  1311 						/* translators: %s: URL to Update PHP page. */
       
  1312 						' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
       
  1313 						esc_url( wp_get_update_php_url() )
       
  1314 					);
       
  1315 					wp_update_php_annotation( '</p><p><em>', '</em>' );
       
  1316 				}
       
  1317 			}
       
  1318 
       
  1319 			echo '</p></div></td></tr>';
       
  1320 		}
  1192 
  1321 
  1193 		/**
  1322 		/**
  1194 		 * Fires after each row in the Plugins list table.
  1323 		 * Fires after each row in the Plugins list table.
  1195 		 *
  1324 		 *
  1196 		 * @since 2.3.0
  1325 		 * @since 2.3.0
  1197 		 * @since 5.5.0 Added 'auto-update-enabled' and 'auto-update-disabled' to possible values for `$status`.
  1326 		 * @since 5.5.0 Added 'auto-update-enabled' and 'auto-update-disabled'
       
  1327 		 *              to possible values for `$status`.
  1198 		 *
  1328 		 *
  1199 		 * @param string $plugin_file Path to the plugin file relative to the plugins directory.
  1329 		 * @param string $plugin_file Path to the plugin file relative to the plugins directory.
  1200 		 * @param array  $plugin_data An array of plugin data.
  1330 		 * @param array  $plugin_data An array of plugin data. See `get_plugin_data()`
  1201 		 * @param string $status      Status filter currently applied to the plugin list. Possible
  1331 		 *                            and the {@see 'plugin_row_meta'} filter for the list
  1202 		 *                            values are: 'all', 'active', 'inactive', 'recently_activated',
  1332 		 *                            of possible values.
  1203 		 *                            'upgrade', 'mustuse', 'dropins', 'search', 'paused',
  1333 		 * @param string $status      Status filter currently applied to the plugin list.
  1204 		 *                            'auto-update-enabled', 'auto-update-disabled'.
  1334 		 *                            Possible values are: 'all', 'active', 'inactive',
       
  1335 		 *                            'recently_activated', 'upgrade', 'mustuse', 'dropins',
       
  1336 		 *                            'search', 'paused', 'auto-update-enabled', 'auto-update-disabled'.
  1205 		 */
  1337 		 */
  1206 		do_action( 'after_plugin_row', $plugin_file, $plugin_data, $status );
  1338 		do_action( 'after_plugin_row', $plugin_file, $plugin_data, $status );
  1207 
  1339 
  1208 		/**
  1340 		/**
  1209 		 * Fires after each specific row in the Plugins list table.
  1341 		 * Fires after each specific row in the Plugins list table.
  1210 		 *
  1342 		 *
  1211 		 * The dynamic portion of the hook name, `$plugin_file`, refers to the path
  1343 		 * The dynamic portion of the hook name, `$plugin_file`, refers to the path
  1212 		 * to the plugin file, relative to the plugins directory.
  1344 		 * to the plugin file, relative to the plugins directory.
  1213 		 *
  1345 		 *
  1214 		 * @since 2.7.0
  1346 		 * @since 2.7.0
  1215 		 * @since 5.5.0 Added 'auto-update-enabled' and 'auto-update-disabled' to possible values for `$status`.
  1347 		 * @since 5.5.0 Added 'auto-update-enabled' and 'auto-update-disabled'
       
  1348 		 *              to possible values for `$status`.
  1216 		 *
  1349 		 *
  1217 		 * @param string $plugin_file Path to the plugin file relative to the plugins directory.
  1350 		 * @param string $plugin_file Path to the plugin file relative to the plugins directory.
  1218 		 * @param array  $plugin_data An array of plugin data.
  1351 		 * @param array  $plugin_data An array of plugin data. See `get_plugin_data()`
  1219 		 * @param string $status      Status filter currently applied to the plugin list. Possible
  1352 		 *                            and the {@see 'plugin_row_meta'} filter for the list
  1220 		 *                            values are: 'all', 'active', 'inactive', 'recently_activated',
  1353 		 *                            of possible values.
  1221 		 *                            'upgrade', 'mustuse', 'dropins', 'search', 'paused',
  1354 		 * @param string $status      Status filter currently applied to the plugin list.
  1222 		 *                            'auto-update-enabled', 'auto-update-disabled'.
  1355 		 *                            Possible values are: 'all', 'active', 'inactive',
       
  1356 		 *                            'recently_activated', 'upgrade', 'mustuse', 'dropins',
       
  1357 		 *                            'search', 'paused', 'auto-update-enabled', 'auto-update-disabled'.
  1223 		 */
  1358 		 */
  1224 		do_action( "after_plugin_row_{$plugin_file}", $plugin_file, $plugin_data, $status );
  1359 		do_action( "after_plugin_row_{$plugin_file}", $plugin_file, $plugin_data, $status );
  1225 	}
  1360 	}
  1226 
  1361 
  1227 	/**
  1362 	/**