feedback example

/** * Filters the list of action links available following a single theme update. * * @since 2.8.0 * * @param string[] $update_actions Array of theme action links. * @param string $theme Theme directory name. */
        $update_actions = apply_filters( 'update_theme_complete_actions', $update_actions$this->theme );

        if ( ! empty( $update_actions ) ) {
            $this->feedback( implode( ' | ', (array) $update_actions ) );
        }
    }
}
$results = array();

        $this->update_count   = count( $plugins );
        $this->update_current = 0;
        foreach ( $plugins as $plugin ) {
            $this->update_current++;
            $this->skin->plugin_info = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin, false, true );

            if ( ! isset( $current->response[ $plugin ] ) ) {
                $this->skin->set_result( 'up_to_date' );
                $this->skin->before();
                $this->skin->feedback( 'up_to_date' );
                $this->skin->after();
                $results[ $plugin ] = true;
                continue;
            }

            // Get the URL to the zip file.             $r = $current->response[ $plugin ];

            $this->skin->plugin_active = is_plugin_active( $plugin );

            $result = $this->run(
                
/** * Filters the list of action links available following bulk plugin updates. * * @since 3.0.0 * * @param string[] $update_actions Array of plugin action links. * @param array $plugin_info Array of information for the last-updated plugin. */
        $update_actions = apply_filters( 'update_bulk_plugins_complete_actions', $update_actions$this->plugin_info );

        if ( ! empty( $update_actions ) ) {
            $this->feedback( implode( ' | ', (array) $update_actions ) );
        }
    }
}
/** * Filters the list of action links available following bulk theme updates. * * @since 3.0.0 * * @param string[] $update_actions Array of theme action links. * @param WP_Theme $theme_info Theme object for the last-updated theme. */
        $update_actions = apply_filters( 'update_bulk_theme_complete_actions', $update_actions$this->theme_info );

        if ( ! empty( $update_actions ) ) {
            $this->feedback( implode( ' | ', (array) $update_actions ) );
        }
    }
}
ob_start();
    }

    /** * Retrieves the buffered content, deletes the buffer, and processes the output. * * @since 3.7.0 */
    public function footer() {
        $output = ob_get_clean();
        if ( ! empty( $output ) ) {
            $this->feedback( $output );
        }
    }
}
$messages[] = $emessage;
                }
            }
            $this->error = implode( ', ', $messages );
        }
        echo '<script type="text/javascript">jQuery(\'.waiting-' . esc_js( $this->upgrader->update_current ) . '\').hide();</script>';
    }

    /** */
    public function bulk_header() {
        $this->feedback( 'skin_upgrade_start' );
    }

    /** */
    public function bulk_footer() {
        $this->feedback( 'skin_upgrade_end' );
    }

    /** * @param string $title */
    
return $reply;
        }

        if ( ! preg_match( '!^(http|https|ftp)://!i', $package ) && file_exists( $package ) ) { // Local file or remote?             return $package; // Must be a local file.         }

        if ( empty( $package ) ) {
            return new WP_Error( 'no_package', $this->strings['no_package'] );
        }

        $this->skin->feedback( 'downloading_package', $package );

        $download_file = download_url( $package, 300, $check_signatures );

        if ( is_wp_error( $download_file ) && ! $download_file->get_error_data( 'softfail-filename' ) ) {
            return new WP_Error( 'download_failed', $this->strings['download_failed']$download_file->get_error_message() );
        }

        return $download_file;
    }

    /** * Unpacks a compressed package file. * * @since 2.8.0 * * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. * * @param string $package Full path to the package file. * @param bool $delete_package Optional. Whether to delete the package file after attempting * to unpack it. Default true. * @return string|WP_Error The path to the unpacked contents, or a WP_Error on failure. */

        $install_actions = apply_filters( 'install_plugin_complete_actions', $install_actions$this->api, $plugin_file );

        if ( ! empty( $install_actions ) ) {
            $this->feedback( implode( ' ', (array) $install_actions ) );
        }
    }

    /** * Checks if the plugin can be overwritten and outputs the HTML for overwriting a plugin on upload. * * @since 5.5.0 * * @return bool Whether the plugin can be overwritten and HTML was outputted. */
    private function do_overwrite() {
        
/** * Filters the list of action links available following a single plugin update. * * @since 2.7.0 * * @param string[] $update_actions Array of plugin action links. * @param string $plugin Path to the plugin file relative to the plugins directory. */
        $update_actions = apply_filters( 'update_plugin_complete_actions', $update_actions$this->plugin );

        if ( ! empty( $update_actions ) ) {
            $this->feedback( implode( ' | ', (array) $update_actions ) );
        }
    }
}
/** * @since 2.8.0 * * @param string|WP_Error $errors Errors. */
    public function error( $errors ) {
        if ( ! $this->done_header ) {
            $this->header();
        }
        if ( is_string( $errors ) ) {
            $this->feedback( $errors );
        } elseif ( is_wp_error( $errors ) && $errors->has_errors() ) {
            foreach ( $errors->get_error_messages() as $message ) {
                if ( $errors->get_error_data() && is_string( $errors->get_error_data() ) ) {
                    $this->feedback( $message . ' ' . esc_html( strip_tags( $errors->get_error_data() ) ) );
                } else {
                    $this->feedback( $message );
                }
            }
        }
    }

    

        $install_actions = apply_filters( 'install_theme_complete_actions', $install_actions$this->api, $stylesheet$theme_info );
        if ( ! empty( $install_actions ) ) {
            $this->feedback( implode( ' | ', (array) $install_actions ) );
        }
    }

    /** * Checks if the theme can be overwritten and outputs the HTML for overwriting a theme on upload. * * @since 5.5.0 * * @return bool Whether the theme can be overwritten and HTML was outputted. */
    private function do_overwrite() {
        
/** * Filters the list of action links available following a translations update. * * @since 3.7.0 * * @param string[] $update_actions Array of translations update links. */
        $update_actions = apply_filters( 'update_translations_complete_actions', $update_actions );

        if ( $update_actions && $this->display_footer_actions ) {
            $this->feedback( implode( ' | ', $update_actions ) );
        }
    }
}
$this->init();
        $this->upgrade_strings();

        if ( ! $language_updates ) {
            $language_updates = wp_get_translation_updates();
        }

        if ( empty( $language_updates ) ) {
            $this->skin->header();
            $this->skin->set_result( true );
            $this->skin->feedback( 'up_to_date' );
            $this->skin->bulk_footer();
            $this->skin->footer();
            return true;
        }

        if ( 'upgrader_process_complete' === current_filter() ) {
            $this->skin->feedback( 'starting_upgrade' );
        }

        // Remove any existing upgrade filters from the plugin/theme upgraders #WP29425 & #WP29230.         remove_all_filters( 'upgrader_pre_install' );
        

        do_action( 'pre_auto_update', $type$item$context );

        $upgrader_item = $item;
        switch ( $type ) {
            case 'core':
                /* translators: %s: WordPress version. */
                $skin->feedback( __( 'Updating to WordPress %s' )$item->version );
                /* translators: %s: WordPress version. */
                $item_name = sprintf( __( 'WordPress %s' )$item->version );
                break;
            case 'theme':
                $upgrader_item = $item->theme;
                $theme         = wp_get_theme( $upgrader_item );
                $item_name     = $theme->Get( 'Name' );
                // Add the current version so that it can be reported in the notification email.                 $item->current_version = $theme->get( 'Version' );
                if ( empty( $item->current_version ) ) {
                    $item->current_version = false;
                }

    public function feedback( $feedback, ...$args ) {
        if ( is_wp_error( $feedback ) ) {
            foreach ( $feedback->get_error_codes() as $error_code ) {
                $this->errors->add( $error_code$feedback->get_error_message( $error_code )$feedback->get_error_data( $error_code ) );
            }
        }

        parent::feedback( $feedback, ...$args );
    }
}
Home | Imprint | This part of the site doesn't use cookies.