TGMPA / TGM-Plugin-Activation

TGM Plugin Activation is a PHP library that allows you to easily require or recommend plugins for your WordPress themes (and plugins). It allows your users to install, update and even automatically activate plugins in singular or bulk fashion using native WordPress classes, functions and interfaces. You can reference bundled plugins, plugins from the WordPress Plugin Repository or even plugins hosted elsewhere on the internet.
http://tgmpluginactivation.com/
GNU General Public License v2.0
1.76k stars 431 forks source link

When install more than two plugin using TGM it will occurs an error(warning) #697

Closed dharmeshtops closed 7 years ago

dharmeshtops commented 7 years ago

Warning: sprintf(): Too few arguments in /opt/lampp/htdocs/wpcodex/wp-admin/includes/class-bulk-upgrader-skin.php on line 154

My code is below.

require_once dirname( __FILE__ ) . '/class-tgm-plugin-activation.php';
add_action( 'tgmpa_register', 'sa_register_required_plugins' );
function sa_register_required_plugins() {
    error_reporting(E_WARNING);
    $plugins = array(
        array(
            'name' => 'Visual Composer',
            'slug' => 'js_composer_theme',
            'source' => THEME_FRAMEWORK. '/plugins/js_composer.zip',
            'required' => true,
            'version' => '5.0.1',
        ),
        array(
            'name'        => 'WordPress SEO by Yoast',
            'slug'        => 'wordpress-seo',
            'is_callable' => 'wpseo_init',
            'required' => true,
        ),
        array(
            'name' => 'respacio',
            'slug' => 'respacio',
            'source' => THEME_FRAMEWORK. '/plugins/respacio.zip',
            'required' => true,
            'version' => '1.0',
        )
    );

    $config = array(
        'id'           => 'tgmpa',
        'default_path' => '',
        'menu'         => 'tgmpa-install-plugins',
        'parent_slug'  => 'themes.php',
        'capability'   => 'edit_theme_options',
        'has_notices'  => true,
        'dismissable'  => false,
        'dismiss_msg'  => '',
        'is_automatic' => false,
        'message'      => '',
        'strings'      => array(
            'page_title'                      => __( 'Install Required Plugins', 'sa_framework' ),
            'menu_title'                      => __( 'Install Plugins', 'sa_framework' ),
            'installing'                      => __( 'Installing Plugin: %s', 'sa_framework' ), // %s = plugin name.
            'oops'                            => __( 'Something went wrong with the plugin API.', 'sa_framework' ),
            'notice_can_install_required'     => _n_noop(
                'This theme requires the following plugin: %1$s.',
                'This theme requires the following plugins: %1$s.',
                'sa_framework'
            ), // %1$s = plugin name(s).
            'notice_can_install_recommended'  => _n_noop(
                'This theme recommends the following plugin: %1$s.',
                'This theme recommends the following plugins: %1$s.',
                'sa_framework'
            ), // %1$s = plugin name(s).
            'notice_cannot_install'           => _n_noop(
                'Sorry, but you do not have the correct permissions to install the %1$s plugin.',
                'Sorry, but you do not have the correct permissions to install the %1$s plugins.',
                'sa_framework'
            ), // %1$s = plugin name(s).
            'notice_ask_to_update'            => _n_noop(
                'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.',
                'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.',
                'sa_framework'
            ), // %1$s = plugin name(s).
            'notice_ask_to_update_maybe'      => _n_noop(
                'There is an update available for: %1$s.',
                'There are updates available for the following plugins: %1$s.',
                'sa_framework'
            ), // %1$s = plugin name(s).
            'notice_cannot_update'            => _n_noop(
                'Sorry, but you do not have the correct permissions to update the %1$s plugin.',
                'Sorry, but you do not have the correct permissions to update the %1$s plugins.',
                'sa_framework'
            ), // %1$s = plugin name(s).
            'notice_can_activate_required'    => _n_noop(
                'The following required plugin is currently inactive: %1$s.',
                'The following required plugins are currently inactive: %1$s.',
                'sa_framework'
            ), // %1$s = plugin name(s).
            'notice_can_activate_recommended' => _n_noop(
                'The following recommended plugin is currently inactive: %1$s.',
                'The following recommended plugins are currently inactive: %1$s.',
                'sa_framework'
            ), // %1$s = plugin name(s).
            'notice_cannot_activate'          => _n_noop(
                'Sorry, but you do not have the correct permissions to activate the %1$s plugin.',
                'Sorry, but you do not have the correct permissions to activate the %1$s plugins.',
                'sa_framework'
            ), // %1$s = plugin name(s).
            'install_link'                    => _n_noop(
                'Begin installing plugin',
                'Begin installing plugins',
                'sa_framework'
            ),
            'update_link'                     => _n_noop(
                'Begin updating plugin',
                'Begin updating plugins',
                'sa_framework'
            ),
            'activate_link'                   => _n_noop(
                'Begin activating plugin',
                'Begin activating plugins',
                'sa_framework'
            ),
            'return'                          => __( 'Return to Required Plugins Installer', 'sa_framework' ),
            'plugin_activated'                => __( 'Plugin activated successfully.', 'sa_framework' ),
            'activated_successfully'          => __( 'The following plugin was activated successfully:', 'sa_framework' ),
            'plugin_already_active'           => __( 'No action taken. Plugin %1$s was already active.', 'sa_framework' ),  // %1$s = plugin name(s).
            'plugin_needs_higher_version'     => __( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'sa_framework' ),  // %1$s = plugin name(s).
            'complete'                        => __( 'All plugins installed and activated successfully. %1$s', 'sa_framework' ), // %s = dashboard link.
            'contact_admin'                   => __( 'Please contact the administrator of this site for help.', 'tgmpa' ),
            'nag_type'                        => 'updated', // Determines admin notice type - can only be 'updated', 'update-nag' or 'error'.
        )
    );
    tgmpa( $plugins, $config );
}
jrfnl commented 7 years ago

Closing as duplicate of #669 which was fixed by PR #670. The fix will be in the next release of TGMPA.