MainWP Child Documentation

MainWP_Child_Install
in package

Class MainWP_Child_Install

Handles Plugins and Themes Activate, Deactivate and Delete process.

Table of Contents

Properties

$instance  : mixed
Public static variable to hold the single instance of MainWP_Child_Install.

Methods

__construct()  : mixed
MainWP_Child_Install constructor
get_class_name()  : string
Get class name.
get_instance()  : MainWP_Child_Install|mixed|null
Create a public static instance of MainWP_Child_Install.
install_plugin_theme()  : mixed
Method install_plugin_theme()
no_ssl_filter_function()  : array<string|int, mixed>
Method no_ssl_filter_function()
plugin_action()  : mixed
Method plugin_action()
theme_action()  : mixed
Method theme_action()
after_installed()  : mixed
Method after_installed()
delete_plugins()  : mixed
Method delete_plugins()
require_files()  : mixed
Method require_files()
try_second_install()  : object
Method try_second_install()

Properties

$instance

Public static variable to hold the single instance of MainWP_Child_Install.

protected static mixed $instance = null

Default null

Methods

get_class_name()

Get class name.

public static get_class_name() : string
Return values
string

CLASS Class name.

install_plugin_theme()

Method install_plugin_theme()

public install_plugin_theme() : mixed

Plugin & Theme Installation functions.

Tags
uses
MainWP_Child_Install::require_files()

Include necessary files.

uses
MainWP_Child_Install::after_installed()

After plugin or theme has been installed.

uses
MainWP_Child_Install::no_ssl_filter_function()

Hook to set ssl verify value.

uses
MainWP_Child_Install::try_second_install()

Alternative installation method.

uses
MainWP_Helper::check_wp_filesystem()
uses

\MainWP\Child\MainWP_Helper::instance()->error()

uses
MainWP_Helper::get_class_name()
uses
MainWP_Helper::write()
used-by
MainWP_Child_Callable::install_plugin_theme()

no_ssl_filter_function()

Method no_ssl_filter_function()

public static no_ssl_filter_function(array<string|int, mixed> $r) : array<string|int, mixed>

Hook to set ssl verify value.

Parameters
$r : array<string|int, mixed>

Request's array values.

Tags
used-by

install_plugin_theme() Plugin & Theme Installation functions.

used-by
MainWP_Child_Install::install_plugin_theme()

Hook to set ssl verify value.

Return values
array<string|int, mixed>

$r Request's array values.

plugin_action()

Method plugin_action()

public plugin_action() : mixed

Plugin Activate, Deactivate & Delete actions.

Tags
uses
get_plugin_data()

Parses the plugin contents to retrieve plugin’s metadata.

uses
activate_plugin()

Attempts activation of plugin in a “sandbox” and redirects on success.

uses
deactivate_plugin()

Deactivate a single plugin or multiple plugins.

uses
MainWP_Child_Install::delete_plugins()

Delete a plugin from the Child Site.

uses
MainWP_Child_Stats::get_site_stats()
uses
MainWP_Helper::write()
see
https://developer.wordpress.org/reference/functions/get_plugin_data/
see
https://developer.wordpress.org/reference/functions/activate_plugin/
see
https://developer.wordpress.org/reference/functions/deactivate_plugin/
used-by
MainWP_Child_Callable::plugin_action()

theme_action()

Method theme_action()

public theme_action() : mixed

Theme Activate, Deactivate & Delete actions.

Tags
uses
wp_get_theme()

Gets a WP_Theme object for a theme.

uses
switch_theme()

Switches the theme.

uses
MainWP_Child_Stats::get_site_stats()
uses
MainWP_Helper::check_wp_filesystem()
uses
MainWP_Helper::write()
see
https://developer.wordpress.org/reference/functions/wp_get_theme/
see
https://developer.wordpress.org/reference/functions/switch_theme/
used-by
MainWP_Child_Callable::theme_action()

after_installed()

Method after_installed()

private after_installed(array<string|int, mixed> $result, array<string|int, mixed> &$output) : mixed

After plugin or theme has been installed.

Parameters
$result : array<string|int, mixed>

Results array from static::install_plugin_theme().

$output : array<string|int, mixed>

Results output array.

Tags
uses
wp_cache_set()

Saves the data to the cache.

uses
activate_plugin()

Attempts activation of plugin in a “sandbox” and redirects on success.

uses
get_plugin_data()

Parses the plugin contents to retrieve plugin’s metadata.

see
https://developer.wordpress.org/reference/functions/wp_cache_set/
see
https://developer.wordpress.org/reference/functions/activate_plugin/
see
https://developer.wordpress.org/reference/functions/get_plugin_data/
used-by

install_plugin_theme() Plugin & Theme Installation functions.

used-by
MainWP_Child_Install::install_plugin_theme()

After plugin or theme has been installed.

delete_plugins()

Method delete_plugins()

private delete_plugins(array<string|int, mixed> $plugins[, array<string|int, mixed> &$output = array() ]) : mixed

Delete a plugin from the Child Site.

Parameters
$plugins : array<string|int, mixed>

An array of plugins to delete.

$output : array<string|int, mixed> = array()

An array output data.

Tags
uses
get_plugin_data()

Parses the plugin contents to retrieve plugin’s metadata.

uses
deactivate_plugin()

Deactivate a single plugin or multiple plugins.

uses
is_plugin_active()

Determines whether a plugin is active.

uses
MainWP_Helper::check_wp_filesystem()
see
https://developer.wordpress.org/reference/functions/get_plugin_data/
see
https://developer.wordpress.org/reference/functions/deactivate_plugin/
see
https://developer.wordpress.org/reference/functions/is_plugin_active/
used-by

\MainWP\Child\MainWP_Child_Install::plugin_action() Plugin Activate, Deactivate & Delete actions.

used-by
MainWP_Child_Install::plugin_action()

Delete a plugin from the Child Site.

try_second_install()

Method try_second_install()

private try_second_install(string $url, object $installer) : object

Alternative installation method.

Parameters
$url : string

Package URL.

$installer : object

Instance of \WP_Upgrader.

Tags
uses
is_wp_error()

Check whether variable is a WordPress Error.

uses

\MainWP\Child\MainWP_Helper::instance()->error()

see
https://developer.wordpress.org/reference/functions/is_wp_error/
used-by

install_plugin_theme() Plugin & Theme Installation functions.

used-by
MainWP_Child_Install::install_plugin_theme()

Alternative installation method.

Return values
object

$result Return error messages or TRUE.


        
On this page

Search results