Title: wp_plugin_update_row
Published: April 25, 2014
Last modified: August 20, 2026

---

# wp_plugin_update_row( string $file, array $plugin_data ): void|false

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/wp_plugin_update_row/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/wp_plugin_update_row/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/wp_plugin_update_row/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/wp_plugin_update_row/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/wp_plugin_update_row/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_plugin_update_row/?output_format=md#changelog)

Displays update information for a plugin.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/wp_plugin_update_row/?output_format=md#parameters)󠁿

 `$file`stringrequired

Plugin basename.

`$plugin_data`arrayrequired

Plugin information.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/wp_plugin_update_row/?output_format=md#return)󠁿

 void|false Void on success, false if the plugin update is not available.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_plugin_update_row/?output_format=md#source)󠁿

    ```php
    function wp_plugin_update_row( $file, $plugin_data ) {
    	$current = get_site_transient( 'update_plugins' );

    	if ( ! isset( $current->response[ $file ] ) ) {
    		return false;
    	}

    	$response = $current->response[ $file ];

    	$plugins_allowedtags = array(
    		'a'       => array(
    			'href'  => array(),
    			'title' => array(),
    		),
    		'abbr'    => array( 'title' => array() ),
    		'acronym' => array( 'title' => array() ),
    		'code'    => array(),
    		'em'      => array(),
    		'strong'  => array(),
    	);

    	$plugin_name = wp_kses( $plugin_data['Name'], $plugins_allowedtags );
    	$plugin_slug = $response->slug ?? $response->id;

    	if ( isset( $response->slug ) ) {
    		$details_url = self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug . '&section=changelog' );
    	} elseif ( isset( $response->url ) ) {
    		$details_url = $response->url;
    	} else {
    		$details_url = $plugin_data['PluginURI'];
    	}

    	$details_url = add_query_arg(
    		array(
    			'TB_iframe' => 'true',
    			'width'     => 600,
    			'height'    => 800,
    		),
    		$details_url
    	);

    	/** @var WP_Plugins_List_Table $wp_list_table */
    	$wp_list_table = _get_list_table(
    		'WP_Plugins_List_Table',
    		array(
    			'screen' => get_current_screen(),
    		)
    	);

    	if ( is_network_admin() || ! is_multisite() ) {
    		if ( is_network_admin() ) {
    			$active_class = is_plugin_active_for_network( $file ) ? ' active' : '';
    		} else {
    			$active_class = is_plugin_active( $file ) ? ' active' : '';
    		}

    		$requires_php   = $response->requires_php ?? null;
    		$compatible_php = is_php_version_compatible( $requires_php );
    		$notice_type    = $compatible_php ? 'notice-warning' : 'notice-error';

    		printf(
    			'<tr class="plugin-update-tr%s" id="%s" data-slug="%s" data-plugin="%s">' .
    			'<td colspan="%s" class="plugin-update colspanchange">' .
    			'<div class="update-message notice inline %s notice-alt"><p>',
    			$active_class,
    			esc_attr( $plugin_slug . '-update' ),
    			esc_attr( $plugin_slug ),
    			esc_attr( $file ),
    			esc_attr( $wp_list_table->get_column_count() ),
    			$notice_type
    		);

    		if ( ! current_user_can( 'update_plugins' ) ) {
    			printf(
    				/* translators: 1: Plugin name, 2: Details URL, 3: Additional link attributes, 4: Version number. */
    				__( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>.' ),
    				$plugin_name,
    				esc_url( $details_url ),
    				sprintf(
    					'class="thickbox open-plugin-details-modal" aria-label="%s"',
    					/* translators: 1: Plugin name, 2: Version number. */
    					esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) )
    				),
    				esc_attr( $response->new_version )
    			);
    		} elseif ( empty( $response->package ) ) {
    			printf(
    				/* translators: 1: Plugin name, 2: Details URL, 3: Additional link attributes, 4: Version number. */
    				__( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>. <em>Automatic update is unavailable for this plugin.</em>' ),
    				$plugin_name,
    				esc_url( $details_url ),
    				sprintf(
    					'class="thickbox open-plugin-details-modal" aria-label="%s"',
    					/* translators: 1: Plugin name, 2: Version number. */
    					esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) )
    				),
    				esc_attr( $response->new_version )
    			);
    		} else {
    			if ( $compatible_php ) {
    				printf(
    					/* translators: 1: Plugin name, 2: Details URL, 3: Additional link attributes, 4: Version number, 5: Update URL, 6: Additional link attributes. */
    					__( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a> or <a href="%5$s" %6$s>update now</a>.' ),
    					$plugin_name,
    					esc_url( $details_url ),
    					sprintf(
    						'class="thickbox open-plugin-details-modal" aria-label="%s"',
    						/* translators: 1: Plugin name, 2: Version number. */
    						esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) )
    					),
    					esc_attr( $response->new_version ),
    					wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file, 'upgrade-plugin_' . $file ),
    					sprintf(
    						'class="update-link" aria-label="%s"',
    						/* translators: %s: Plugin name. */
    						esc_attr( sprintf( _x( 'Update %s now', 'plugin' ), $plugin_name ) )
    					)
    				);
    			} else {
    				printf(
    					/* translators: 1: Plugin name, 2: Details URL, 3: Additional link attributes, 4: Version number 5: URL to Update PHP page. */
    					__( 'There is a new version of %1$s available, but it does not work with your version of PHP. <a href="%2$s" %3$s>View version %4$s details</a> or <a href="%5$s">learn more about updating PHP</a>.' ),
    					$plugin_name,
    					esc_url( $details_url ),
    					sprintf(
    						'class="thickbox open-plugin-details-modal" aria-label="%s"',
    						/* translators: 1: Plugin name, 2: Version number. */
    						esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) )
    					),
    					esc_attr( $response->new_version ),
    					esc_url( wp_get_update_php_url() )
    				);
    				wp_update_php_annotation( '<br><em>', '</em>' );
    			}
    		}

    		/**
    		 * Fires at the end of the update message container in each
    		 * row of the plugins list table.
    		 *
    		 * The dynamic portion of the hook name, `$file`, refers to the path
    		 * of the plugin's primary file relative to the plugins directory.
    		 *
    		 * @since 2.8.0
    		 *
    		 * @param array  $plugin_data An array of plugin metadata. See get_plugin_data()
    		 *                            and the 'plugin_row_meta' filter for the list
    		 *                            of possible values.
    		 * @param object $response {
    		 *     An object of metadata about the available plugin update.
    		 *
    		 *     @type string   $id           Plugin ID, e.g. `w.org/plugins/[plugin-name]`.
    		 *     @type string   $slug         Plugin slug.
    		 *     @type string   $plugin       Plugin basename.
    		 *     @type string   $new_version  New plugin version.
    		 *     @type string   $url          Plugin URL.
    		 *     @type string   $package      Plugin update package URL.
    		 *     @type string[] $icons        An array of plugin icon URLs.
    		 *     @type string[] $banners      An array of plugin banner URLs.
    		 *     @type string[] $banners_rtl  An array of plugin RTL banner URLs.
    		 *     @type string   $requires     The version of WordPress which the plugin requires.
    		 *     @type string   $tested       The version of WordPress the plugin is tested against.
    		 *     @type string   $requires_php The version of PHP which the plugin requires.
    		 * }
    		 */
    		do_action( "in_plugin_update_message-{$file}", $plugin_data, $response ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores

    		echo '</p></div></td></tr>';
    	}
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/update.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-admin/includes/update.php#L449)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/update.php#L449-L618)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/wp_plugin_update_row/?output_format=md#hooks)󠁿

 [do_action( “in_plugin_update_message-{$file}”, array $plugin_data, object $response )](https://developer.wordpress.org/reference/hooks/in_plugin_update_message-file/)

Fires at the end of the update message container in each row of the plugins list
table.

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_plugin_update_row/?output_format=md#related)󠁿

| Uses | Description | 
| [is_php_version_compatible()](https://developer.wordpress.org/reference/functions/is_php_version_compatible/)`wp-includes/functions.php` |

Checks compatibility with the current PHP version.

  | 
| [wp_get_update_php_url()](https://developer.wordpress.org/reference/functions/wp_get_update_php_url/)`wp-includes/functions.php` |

Gets the URL to learn more about updating the PHP version the site is running on.

  | 
| [wp_update_php_annotation()](https://developer.wordpress.org/reference/functions/wp_update_php_annotation/)`wp-includes/functions.php` |

Prints the default annotation for the web host altering the “Update PHP” page URL.

  | 
| [get_current_screen()](https://developer.wordpress.org/reference/functions/get_current_screen/)`wp-admin/includes/screen.php` |

Get the current screen object

  | 
| [WP_List_Table::get_column_count()](https://developer.wordpress.org/reference/classes/wp_list_table/get_column_count/)`wp-admin/includes/class-wp-list-table.php` |

Returns the number of visible columns.

  | 
| [is_plugin_active_for_network()](https://developer.wordpress.org/reference/functions/is_plugin_active_for_network/)`wp-admin/includes/plugin.php` |

Determines whether the plugin is active for the entire network.

  | 
| [is_plugin_active()](https://developer.wordpress.org/reference/functions/is_plugin_active/)`wp-admin/includes/plugin.php` |

Determines whether a plugin is active.

  | 
| [_get_list_table()](https://developer.wordpress.org/reference/functions/_get_list_table/)`wp-admin/includes/list-table.php` |

Fetches an instance of a [WP_List_Table](https://developer.wordpress.org/reference/classes/wp_list_table/) class.

  | 
| [wp_kses()](https://developer.wordpress.org/reference/functions/wp_kses/)`wp-includes/kses.php` |

Filters text content and strips out disallowed HTML.

  | 
| [is_network_admin()](https://developer.wordpress.org/reference/functions/is_network_admin/)`wp-includes/load.php` |

Determines whether the current request is for the network administrative interface.

  | 
| [self_admin_url()](https://developer.wordpress.org/reference/functions/self_admin_url/)`wp-includes/link-template.php` |

Retrieves the URL to the admin area for either the current site or the network depending on context.

  | 
| [current_user_can()](https://developer.wordpress.org/reference/functions/current_user_can/)`wp-includes/capabilities.php` |

Returns whether the current user has the specified capability.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [_x()](https://developer.wordpress.org/reference/functions/_x/)`wp-includes/l10n.php` |

Retrieves translated string with gettext context.

  | 
| [esc_attr()](https://developer.wordpress.org/reference/functions/esc_attr/)`wp-includes/formatting.php` |

Escaping for HTML attributes.

  | 
| [esc_url()](https://developer.wordpress.org/reference/functions/esc_url/)`wp-includes/formatting.php` |

Checks and cleans a URL.

  | 
| [is_multisite()](https://developer.wordpress.org/reference/functions/is_multisite/)`wp-includes/load.php` |

Determines whether Multisite is enabled.

  | 
| [wp_nonce_url()](https://developer.wordpress.org/reference/functions/wp_nonce_url/)`wp-includes/functions.php` |

Retrieves URL with nonce added to URL query.

  | 
| [add_query_arg()](https://developer.wordpress.org/reference/functions/add_query_arg/)`wp-includes/functions.php` |

Retrieves a modified URL query string.

  | 
| [do_action()](https://developer.wordpress.org/reference/functions/do_action/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to an action hook.

  | 
| [get_site_transient()](https://developer.wordpress.org/reference/functions/get_site_transient/)`wp-includes/option.php` |

Retrieves the value of a site transient.

  |

[Show 16 more](https://developer.wordpress.org/reference/functions/wp_plugin_update_row/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/wp_plugin_update_row/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_plugin_update_row/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_plugin_update_row%2F)
before being able to contribute a note or feedback.