Wordpress_Module

WordPress management An interface to wp-cli
extends Module\Support\Webapps
Methods Summary
public
# install( string $hostname , string $path = '', array $opts = array ( ) )
Install WordPress
protected
# execCommand( $path = NULL, $cmd , array $args = array ( ) )
protected
# generateNewConfiguration( $domain , $docroot , $dbcredentials , array $ftpcredentials = array ( ) )
public
# get_version( string $hostname , string $path = '' )
Get installed version
public
# valid( string $hostname , string $path = '' )
Location is a valid WP install
public
# fortify( string $hostname , string $path = '', string $mode = 'max' )
Restrict write-access by the app

Overrides

protected
# shareOwnershipSystemCheck( string $docroot )
Share ownership of a WordPress install allowing WP write-access in min fortification
protected
# assertOwnershipSystemCheck( string $docroot )
Change ownership over to WordPress admin
public
# plugin_status( string $hostname , string $path = '', string $plugin = NULL )
Enumerate plugin states
protected
# assetListWrapper( string $approot , string $type , array $fields )
protected
# pluginVersions( string $plugin )
protected
# pluginInfo( string $plugin )
Get information about a plugin
public
# install_plugin( string $hostname , string $path = '', string $plugin , string $version = '' )
Install and activate plugin
public
# uninstall_plugin( string $hostname , string $path , string $plugin , bool $force = false )
Uninstall a plugin
public
# disable_plugin( string $hostname , string $path , string $plugin )
Disable plugin
public
# enable_plugin( string $hostname , string $path , string $plugin )
Enable plugin
public
# disable_theme( string $hostname , string $path , string $plugin )
Disable theme
public
# enable_theme( string $hostname , string $path , string $plugin )
Enable theme
public
# uninstall_theme( string $hostname , string $path = '', string $theme , bool $force = false )
Remove a Wordpress theme

Overrides

public
# disable_all_plugins( string $hostname , string $path = '' )
Recovery mode to disable all plugins
public
# uninstall( string $hostname , string $path = '', string $delete = 'all' )
Uninstall WP from a location

Overrides

public
# db_config( string $hostname , string $path = '' )
Get database configuration for a blog
public
# change_admin( string $hostname , string $path = '', array $fields )
Change WP admin credentials $fields is a hash whose indices match wp_update_user common fields include: user_pass, user_login, and user_nicename

link

public
# get_admin( string $hostname , string $path = '' )
Get the primary admin for a WP instance
public
# update_all( string $hostname , string $path = '', string $version = NULL )
Update core, plugins, and themes atomically
public
# update_themes( string $hostname , string $path = '', array $themes = array ( ) )
Update WordPress themes
protected
# getSkiplist( string $docroot , string $type )
Get update protection list
public
# update_plugins( string $hostname , string $path = '', array $plugins = array ( ) )
Update WordPress plugins
public
# update( string $hostname , string $path = '', string $version = NULL )
Update WordPress to latest version
public
# is_current( string $version = NULL, string $branchcomp = NULL )
Check if version is latest or get latest version

Overrides

public
# theme_status( string $hostname , string $path = '', string $theme = NULL )
Get theme status Sample response: [ hestia => [ version => 1.1.50 next => 1.1.51 current => false max => 1.1.66 ] ]

Overrides

protected
# themeVersions( string $theme )
Get theme versions
protected
# themeInfo( string $theme )
Get theme information
public
# install_theme( string $hostname , string $path = '', string $theme , string $version = NULL )
public
# has_fortification( string $mode = NULL )
Web application supports fortification

Overrides

public
# _housekeeping( )
Install wp-cli if necessary
public
# get_versions( )
Get all available WordPress versions
public
# next_version( string $version , string $maximalbranch = '99999999.99999999.99999999' )
public
# reconfigure( string $field , string $attribute , array $new , array $old = NULL )
Reconfigure a WordPress instance
public
# get_configuration( $field )
protected
# _mapFiles( array $files , string $docroot )
protected
# _getLastestVersion( )
Get latest WP release
protected
# _getVersions( )
Get all current major versions
public
# asset_summary( string $hostname , string $path = '' )
Get basic summary of assets
public
# skip_asset( string $hostname , string $path = '', string $name , string $type )
Skip updating an asset
public
# unskip_asset( string $hostname , string $path = '', string $name , string $type )
Permit updates of an asset
Methods inherited from Module\Support\Webapps
__construct(), getAppName(), blacklisted(), knownApps(), fortify(), getAppRoot(), valid(), getInternalName(), getDocrootUser(), _mapFiles(), buildFileMapList(), getACLFiles(), setOptions(), getOptions(), failed(), getVersionLock(), has_fortification(), unfortify(), uninstall(), getDocumentRoot(), normalizeDocumentRoot(), map(), getModule(), remapPublic(), movePrimaryDocumentRoot(), unsquash(), next_version(), is_current(), _cron(), configureSsl(), theme_status(), install_theme(), uninstall_theme(), getApnscpFunctionInterceptorFromDocroot(), hasMemoryAllowance(), hasStorageAllowance(), checkEmail(), prepareSquash(), checkVersion(), checkDocroot(), kill(), _suggestDB(), _suggestUser(), suggestPassword(), setupDatabase(), getLatestVersion(), fixRewriteBase(), removeInvalidDirectives(), download(), setInfo(), _getWebappExtraStorageDirectory()
Methods inherited from Module\Skeleton\Standard
__construct(), setUserParameters(), autoloadModule(), __wakeup(), _invoke(), __debugInfo(), getExportedFunctions(), _reset(), _resetModule(), cleanUserParameters(), query()
Constants Summary
public string APP_NAME
# 'WordPress'
public string ASSET_SKIPLIST
# '.wp-update-skip'
public string WP_CLI
# '/usr/share/pear/wp-cli.phar'
public string WP_CLI_URL
# 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar'
public string VERSION_CHECK_URL
# 'https://api.wordpress.org/core/version-check/1.7/'
public string PLUGIN_VERSION_CHECK_URL
# 'https://api.wordpress.org/plugins/info/1.0/%plugin%.json'
public string THEME_VERSION_CHECK_URL
# 'https://api.wordpress.org/themes/info/1.2/?action=theme_information&request[slug]=%theme%&request[fields][versions]=1'
public string DEFAULT_VERSION_LOCK
# 'none'
public array NON_UPDATEABLE_TYPES
# array ( 0 => 'dropin', 1 => 'must-use', )
Constants inherited from Module\Support\Webapps
APPLICATION_PREF_KEY , APP_NAME , DEFAULT_VERSION_LOCK , BANNED_DIRECTIVES
Constants inherited from Module\Skeleton\Standard
DEPENDENCY_MAP
Properties Summary
protected $_aclList

# array ( 'min' => array ( 0 => 'wp-content', 1 => '.htaccess', 2 => 'wp-config.php', ), 'max' => array ( 0 => 'wp-content/uploads', 1 => 'wp-content/cache', 2 => 'wp-content/wflogs', 3 => 'wp-content/updraft', ), )
protected array $controlFiles

# array ( 0 => '/wp-admin/includes/file.php', )
Properties inherited from Module\Support\Webapps
$exportedFunctions
Properties inherited from Module\Skeleton\Standard
$exportedFunctions, $username, $password, $domain, $user_id, $group_id, $permission_level, $session_id, $site, $site_id