$table_prefix
$table_prefix : string
Table prefix.
Class MainWP_DB_Backup
instance() : \MainWP\Dashboard\MainWP_DB
Method instance()
Create public static instance.
get_website_option(array $website, mixed $option, mixed $default_value = null) : string|null
Get Child site wp_options database table.
array | $website | Child Site array. |
mixed | $option | Child Site wp_options table name. |
mixed | $default_value | default value. |
Database query result (as string), or null on failure.
get_websites_by_user_id(integer $userid, boolean $selectgroups = false, null $search_site = null, string $orderBy = 'wp.url') : array|object|null
Get child sites by user ID.
integer | $userid | User ID. |
boolean | $selectgroups | Selected groups. |
null | $search_site | Site search field value. |
string | $orderBy | Order list by. Default: URL. |
Database query results or null on failer.
get_sql_websites_by_user_id(integer $userid, boolean $selectgroups = false, null $search_site = null, string $orderBy = 'wp.url', boolean $offset = false, boolean $rowcount = false) : object|null
Get child sites by user id via SQL.
integer | $userid | Given user ID. |
boolean | $selectgroups | Selected groups. Default: false. |
null | $search_site | Site search field value. Default: null. |
string | $orderBy | Order list by. Default: URL. |
boolean | $offset | Query offset. Default: false. |
boolean | $rowcount | Row count. Default: falese. |
Return database query or null on failure.
get_sql_websites_for_current_user(boolean $selectgroups = false, null $search_site = null, string $orderBy = 'wp.url', boolean $offset = false, boolean $rowcount = false, null $extraWhere = null, boolean $for_manager = false, mixed $extra_view = array('favi_icon'), string $is_staging = 'no', array $params = array()) : object|null
Get SQL to get child sites for current user.
boolean | $selectgroups | Selected groups. Default: false. |
null | $search_site | Site search field value. Default: null. |
string | $orderBy | Order list by. Default: URL. |
boolean | $offset | Query offset. Default: false. |
boolean | $rowcount | Row count. Default: false. |
null | $extraWhere | Extra WHERE. Default: null. |
boolean | $for_manager | For role manager. Default: false. |
mixed | $extra_view | Extra view. Default favi_icon. |
string | $is_staging | yes|no Is child site a staging site. |
array | $params | other params. |
Database query results or null on failure.
get_sql_where_allow_access_sites(string $site_table_alias = '', string $is_staging = 'no') : boolean|null
Get child sites where allowed access via SQL.
string | $site_table_alias | Child site table alias. |
string | $is_staging | yes|no Is child site a staging site. |
$_where Database query results or null on failure.
get_sql_where_allow_groups(string $group_table_alias = '', string $with_staging = 'no') : boolean|null
Get groupd where allowed access via SQL.
string | $group_table_alias | Child site table alias. |
string | $with_staging | yes|no Is child site a staging site. |
$_where Database query results or null on failer.
get_website_by_id(integer $id, array $selectGroups = false, array $extra_view = array()) : object|null
Get child site by id.
integer | $id | Child site ID. |
array | $selectGroups | Select groups. |
array | $extra_view | Get extra option fields. |
Database query results or null on failure.
get_sql_website_by_id(integer $id, boolean $selectGroups = false, mixed $extra_view = array()) : object|null
Get child site by id via SQL.
integer | $id | Child site ID. |
boolean | $selectGroups | Selected groups. |
mixed | $extra_view | Extra view value. |
Database query result or null on failure.
get_sql_websites_by_group_id(integer $id, boolean $selectgroups = false, string $orderBy = 'wp.url', boolean $offset = false, boolean $rowcount = false, null $where = null, null $search_site = null) : object|null
Get child sites by group id via SQL.
integer | $id | Group ID. |
boolean | $selectgroups | Selected groups. Default: false. |
string | $orderBy | Order list by. Default: URL. |
boolean | $offset | Query offset. Default: false. |
boolean | $rowcount | Row count. Default: falese. |
null | $where | SQL WHERE value. |
null | $search_site | Site search field value. Default: null. |
Return database query or null on failure.
add_website(integer $userid, string $name, string $url, string $admin, string $pubkey, string $privkey, array $groupids, array $groupnames, integer $verifyCertificate = 1, string $uniqueId = '', string $http_user = null, string $http_pass = null, integer $sslVersion, integer $wpe, integer $isStaging) : integer|false
Add website to the MainWP Dashboard.
integer | $userid | Current user ID. |
string | $name | Child site name. |
string | $url | Child site URL. |
string | $admin | Child site administrator username. |
string | $pubkey | OpenSSL public key. |
string | $privkey | OpenSSL private key. |
array | $groupids | Group IDs. |
array | $groupnames | Group names. |
integer | $verifyCertificate | Whether or not to verify SSL Certificate. |
string | $uniqueId | Unique security ID. |
string | $http_user | HTTP Basic Authentication username. |
string | $http_pass | HTTP Basic Authentication password. |
integer | $sslVersion | SSL Version. |
integer | $wpe | Is it WP Engine hosted site. |
integer | $isStaging | Whether or not child site is staging site. |
Child site ID or false on failure.
update_website(integer $websiteid, string $url, integer $userid, string $name, string $siteadmin, array $groupids, array $groupnames, string $pluginDir, mixed $maximumFileDescriptorsOverride, mixed $maximumFileDescriptorsAuto, mixed $maximumFileDescriptors, integer $verifyCertificate = 1, mixed $archiveFormat = 'global', string $uniqueId = '', string $http_user = null, string $http_pass = null, integer $sslVersion, integer $disableChecking = 1, integer $checkInterval = 1440, boolean $disableHealthChecking = 1, integer $healthThreshold = 80, integer $wpe) : boolean
Update child site.
integer | $websiteid | Website ID. |
string | $url | Child site URL. |
integer | $userid | Current user ID. |
string | $name | Child site name. |
string | $siteadmin | Child site administrator username. |
array | $groupids | Group IDs. |
array | $groupnames | Group Names. |
string | $pluginDir | Plugin directory. |
mixed | $maximumFileDescriptorsOverride | Overwrite the Maximum File Descriptors option. |
mixed | $maximumFileDescriptorsAuto | Auto set the Maximum File Descriptors option. |
mixed | $maximumFileDescriptors | Set the Maximum File Descriptors option. |
integer | $verifyCertificate | Whether or not to verify SSL Certificate. |
mixed | $archiveFormat | Backup archive formate. |
string | $uniqueId | Unique security ID. |
string | $http_user | HTTP Basic Authentication username. |
string | $http_pass | HTTP Basic Authentication password. |
integer | $sslVersion | SSL Version. |
integer | $disableChecking | Wether or not disable sites status checking. |
integer | $checkInterval | Status checking interval. |
boolean | $disableHealthChecking | Disable Site health threshold. |
integer | $healthThreshold | Site health threshold. |
integer | $wpe | Is it WP Engine hosted site. |
ture on success or false on failure.
get_websites_count_where_dts_automatic_sync_smaller_then_start(integer $lasttime_start) : integer
Get child site count where date & time Session sync is smaller then start.
integer | $lasttime_start | Last time start automatic. |
Returned child site count.
get_websites_check_updates(integer $limit, integer $lasttime_start) : object|null
Get child sites check updates.
integer | $limit | Query limit. |
integer | $lasttime_start | Lasttime start automatic update. |
Database query result or null on failure.
update_website_stats(mixed $websiteid, mixed $statsUpdated) : \MainWP\Dashboard\(int|\MainWP\Dashboard\boolean)
Update child site statistics.
Update whether or not a child site has been updated.
mixed | $websiteid | Child site ID. |
mixed | $statsUpdated | Child site Update status. |
Number of rows effected in update or false on failure.
get_websites_to_notice_health_threshold(integer $globalThreshold, integer $count = 10)
Method get_websites_to_notice_health_threshold()
Get websites to notice site health.
integer | $globalThreshold | Global site health threshold. |
integer | $count | Limit count. |
get_sites(integer $websiteid = null, boolean $for_manager = false, array $others = array()) : array
Get Sites.
integer | $websiteid | The id of the child site you wish to retrieve. |
boolean | $for_manager | Check Team Control. |
array | $others | Array of others. |
$output Array of content to output.
update_backup_task_progress(mixed $task_id, mixed $wp_id, mixed $values) : mixed
Method update_backup_task_progress()
Update backup tasuk progress.
mixed | $task_id | Task ID. |
mixed | $wp_id | Child Site ID. |
mixed | $values | Values to update. |
get_backup_task_progres().
add_backup_task_progress(mixed $task_id, mixed $wp_id, mixed $information) : \MainWP\Dashboard\(array|\MainWP\Dashboard\null)
Method add_backup_task_progress()
Add backup task progress.
mixed | $task_id | Task ID. |
mixed | $wp_id | Child Site ID. |
mixed | $information | Task info to add. |
$this->get_backup_task_progress() or null on failure
get_backup_task_progress(mixed $task_id, mixed $wp_id) : \MainWP\Dashboard\(array|\MainWP\Dashboard\null)
Method get_backup_task_progress()
Get backup task progress.
mixed | $task_id | Task ID. |
mixed | $wp_id | Child Site ID. |
Backup Progress or null on failer.
get_backup_task_by_id(mixed $id) : \MainWP\Dashboard\(object|\MainWP\Dashboard\null)
Method get_backup_task_by_id()
Get backup task by id.
mixed | $id | Task ID. |
Database query result for Backup Task or null on failure
get_backup_tasks(null $userid = null, string $orderBy = null) : \MainWP\Dashboard\(object|\MainWP\Dashboard\null)
Method get_backup_tasks()
Get backup tasks for current user.
null | $userid | Current user ID. |
string | $orderBy | Task order. |
Database query result for backup tasks for current user or null on failer.
add_backup_task(mixed $userid, mixed $name, mixed $schedule, mixed $type, mixed $exclude, mixed $sites, mixed $groups, mixed $subfolder, mixed $filename, mixed $template, mixed $excludebackup, mixed $excludecache, mixed $excludenonwp, mixed $excludezip, mixed $archiveFormat, mixed $maximumFileDescriptorsOverride, mixed $maximumFileDescriptorsAuto, mixed $maximumFileDescriptors, mixed $loadFilesBeforeZip) : integer|false
Method add_backup_task()
Add backup task.
mixed | $userid | Current user ID. |
mixed | $name | Name of backup. |
mixed | $schedule | Backup schedual. |
mixed | $type | Type of backup, full|db. |
mixed | $exclude | Files or directories to exclude. |
mixed | $sites | Child Sites to backup. |
mixed | $groups | Groups to backup. |
mixed | $subfolder | Folder the backups are going into. |
mixed | $filename | Filename of the backups. |
mixed | $template | Backup template. |
mixed | $excludebackup | Backup files to exclude. |
mixed | $excludecache | Cache files to exclude. |
mixed | $excludenonwp | Non-wp files to exclude. |
mixed | $excludezip | Archives to exclude. |
mixed | $archiveFormat | Format to store backups in. |
mixed | $maximumFileDescriptorsOverride | Overide maximum file descriptors. |
mixed | $maximumFileDescriptorsAuto | Auto maximum file discriptors. |
mixed | $maximumFileDescriptors | Maximum file descriptors. |
mixed | $loadFilesBeforeZip | Load files before Zip. |
The number of rows added, or false on error.
update_backup_task(mixed $id, mixed $userid, mixed $name, mixed $schedule, mixed $type, mixed $exclude, mixed $sites, mixed $groups, mixed $subfolder, mixed $filename, mixed $excludebackup, mixed $excludecache, mixed $excludenonwp, mixed $excludezip, mixed $archiveFormat, mixed $maximumFileDescriptorsOverride, mixed $maximumFileDescriptorsAuto, mixed $maximumFileDescriptors, mixed $loadFilesBeforeZip) : integer|false
Method update_backup_task()
Update backup task.
mixed | $id | task id. |
mixed | $userid | Current user ID. |
mixed | $name | Name of backup. |
mixed | $schedule | Backup schedual. |
mixed | $type | Type of backup, full|db. |
mixed | $exclude | Files or directories to exclude. |
mixed | $sites | Child Sites to backup. |
mixed | $groups | Groups to backup. |
mixed | $subfolder | Folder the backups are going into. |
mixed | $filename | Filename of the backups. |
mixed | $excludebackup | Backup files to exclude. |
mixed | $excludecache | Cache files to exclude. |
mixed | $excludenonwp | Non-wp files to exclude. |
mixed | $excludezip | Archives to exclude. |
mixed | $archiveFormat | Format to store backups in. |
mixed | $maximumFileDescriptorsOverride | Overide maximum file descriptors. |
mixed | $maximumFileDescriptorsAuto | Auto maximum file discriptors. |
mixed | $maximumFileDescriptors | Maximum file descriptors. |
mixed | $loadFilesBeforeZip | Load files before Zip. |
The number of rows updated, or false on error.
update_backup_task_with_values(mixed $id, mixed $values) : \MainWP\Dashboard\(int|\MainWP\Dashboard\false)
Method update_backup_task_with_values()
Update backup task with values.
mixed | $id | Task ID. |
mixed | $values | values to update. |
The number of rows updated, or false on error.