\TGMPA_Bulk_Installer

Installer class to handle bulk plugin installations.

Extends WP_Upgrader and customizes to suit the installation of multiple plugins.

Summary

Methods
Properties
Constants
__construct()
activate_strings()
run()
bulk_upgrade()
auto_activate()
$result
$bulk
No constants found
No protected methods found
$tgmpa
$clear_destination
N/A
No private methods found
No private properties found
N/A

Properties

$result

$result : string

Holds result of bulk plugin installation.

Type

string

$bulk

$bulk : boolean

Flag to check if bulk installation is occurring or not.

Type

boolean

$tgmpa

$tgmpa : object

TGMPA instance

Type

object

$clear_destination

$clear_destination : bool

Whether or not the destination directory needs to be cleared ( = on update).

Type

bool

Methods

__construct()

__construct(\Bulk_Upgrader_Skin|null $skin)

References parent constructor and sets defaults for class.

Parameters

\Bulk_Upgrader_Skin|null $skin

Installer skin.

activate_strings()

activate_strings()

Sets the correct activation strings for the installer skin to use.

run()

run(array $options) : null|array

Performs the actual installation of each plugin.

Parameters

array $options

The installation config options.

Returns

null|array —

Return early if error, array of installation data on success.

bulk_upgrade()

bulk_upgrade(array $plugins, array $args) : string|bool

Handle a bulk upgrade request.

Parameters

array $plugins

The local WP file_path's of the plugins which should be upgraded.

array $args

Arbitrary passed extra arguments.

Returns

string|bool —

Install confirmation messages on success, false on failure.

auto_activate()

auto_activate(bool $bool) : bool

Abuse a filter to auto-activate plugins after installation.

Hooked into the 'upgrader_post_install' filter hook.

Parameters

bool $bool

The value we need to give back (true).

Returns

bool