$table_prefix
$table_prefix : string
Table prefix.
Class MainWP_DB
instance() : \MainWP\Dashboard\MainWP_DB
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.