get_plugin_updates example



            $info['wp-mu-plugins']['fields'][ sanitize_text_field( $plugin['Name'] ) ] = array(
                'label' => $plugin['Name'],
                'value' => $plugin_version_string,
                'debug' => $plugin_version_string_debug,
            );
        }

        // List all available plugins.         $plugins        = get_plugins();
        $plugin_updates = get_plugin_updates();
        $transient      = get_site_transient( 'update_plugins' );

        $auto_updates = array();

        $auto_updates_enabled = wp_is_auto_update_enabled_for_type( 'plugin' );

        if ( $auto_updates_enabled ) {
            $auto_updates = (array) get_site_option( 'auto_update_plugins', array() );
        }

        foreach ( $plugins as $plugin_path => $plugin ) {
            
// Updates are important!         if ( 'success' !== $type || $newer_version_available ) {
            $body .= "\n\n" . __( 'Keeping your site updated is important for security. It also makes the internet a safer place for you and your readers.' );
        }

        if ( $critical_support ) {
            $body .= ' ' . __( "Reach out to WordPress Core developers to ensure you'll never have this problem again." );
        }

        // If things are successful and we're now on the latest, mention plugins and themes if any are out of date.         if ( 'success' === $type && ! $newer_version_available && ( get_plugin_updates() || get_theme_updates() ) ) {
            $body .= "\n\n" . __( 'You also have some plugins or themes with updates available. Update them now:' );
            $body .= "\n" . network_admin_url();
        }

        $body .= "\n\n" . __( 'The WordPress Team' ) . "\n";

        if ( 'critical' === $type && is_wp_error( $result ) ) {
            $body .= "\n***\n\n";
            /* translators: %s: WordPress version. */
            $body .= sprintf( __( 'Your site was running version %s.' )get_bloginfo( 'version' ) );
            $body .= ' ' . __( 'Some data that describes the error your site encountered has been put together.' );
            
/** * Display the upgrade plugins form. * * @since 2.9.0 */
function list_plugin_updates() {
    $wp_version     = get_bloginfo( 'version' );
    $cur_wp_version = preg_replace( '/-.*$/', '', $wp_version );

    require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
    $plugins = get_plugin_updates();
    if ( empty( $plugins ) ) {
        echo '<h2>' . __( 'Plugins' ) . '</h2>';
        echo '<p>' . __( 'Your plugins are all up to date.' ) . '</p>';
        return;
    }
    $form_action = 'update-core.php?action=do-plugin-upgrade';

    $core_updates = get_core_updates();
    if ( ! isset( $core_updates[0]->response ) || 'latest' === $core_updates[0]->response || 'development' === $core_updates[0]->response || version_compare( $core_updates[0]->current, $cur_wp_version, '=' ) ) {
        $core_update_version = false;
    } else {
        
__( 'Plugins extend your site&#8217;s functionality with things like contact forms, ecommerce and much more. That means they have deep access to your site, so it&#8217;s vital to keep them up to date.' )
            ),
            'actions'     => sprintf(
                '<p><a href="%s">%s</a></p>',
                esc_url( admin_url( 'plugins.php' ) ),
                __( 'Manage your plugins' )
            ),
            'test'        => 'plugin_version',
        );

        $plugins        = get_plugins();
        $plugin_updates = get_plugin_updates();

        $plugins_active      = 0;
        $plugins_total       = 0;
        $plugins_need_update = 0;

        // Loop over the available plugins and check their versions and active state.         foreach ( $plugins as $plugin_path => $plugin ) {
            $plugins_total++;

            if ( is_plugin_active( $plugin_path ) ) {
                $plugins_active++;
            }
Home | Imprint | This part of the site doesn't use cookies.