merge with branch01 + php fixes

This commit is contained in:
ruben- 2016-10-24 20:33:37 +02:00
parent d1a95266ef
commit 91af385a04
16 changed files with 687 additions and 185 deletions

View file

@ -19,9 +19,12 @@ class MainWP_Child_Server_Information {
}

if ( $_POST['what'] == 'warning' ) {
$dismissWarnings['warnings'] = self::getWarnings();
}

if (isset($_POST['warnings']))
$warnings = intval($_POST['warnings']);
else
$warnings = self::getWarnings();
$dismissWarnings['warnings'] = $warnings;
}
MainWP_Helper::update_option( 'mainwp_child_dismiss_warnings', $dismissWarnings );
}
}
@ -62,7 +65,8 @@ class MainWP_Child_Server_Information {

var data = {
action: 'mainwp-child_dismiss_warnings',
what: pAction
what: pAction,
warnings: <?php echo intval($warnings); ?>
};

jQuery.ajax( {
@ -120,7 +124,7 @@ class MainWP_Child_Server_Information {
$warning = '';

if ( $warnings > 0 ) {
$warning .= '<tr><td colspan="2">This site may not connect to your dashboard or may have other issues. Check your <a href="admin.php?page=MainWP_Child_Server_Information">MainWP Server Information page</a> to review and <a href="http://docs.mainwp.com/child-site-issues/">check here for more information on possible fixes</a></td><td style="text-align: right;"><a href="#" id="mainwp-child-connect-warning-dismiss">Dismiss</a></td></tr>';
$warning .= '<tr><td colspan="2">This site may not connect to your dashboard or may have other issues. Check your <a href="admin.php?page=MainWP_Child_Server_Information">MainWP server information page</a> to review and <a href="http://docs.mainwp.com/child-site-issues/">check here for more information on possible fixes</a></td><td style="text-align: right;"><a href="#" id="mainwp-child-connect-warning-dismiss">Dismiss</a></td></tr>';
}
echo $warning;
?>
@ -462,7 +466,7 @@ class MainWP_Child_Server_Information {
</a></span>

<p class="submit">
<a class="button-primary mwp-child-get-system-report-btn" href="#"><?php _e( 'Get System Report', 'mainwp' ); ?></a>
<a class="button-primary mwp-child-get-system-report-btn" href="#"><?php _e( 'Get system report', 'mainwp' ); ?></a>
</p>

<div id="mwp-server-information"><textarea readonly="readonly" wrap="off"></textarea></div>
@ -546,9 +550,9 @@ class MainWP_Child_Server_Information {
<th scope="col" class="manage-column column-posts mwp-not-generate-row"
style="width: 1px;"></th>
<th scope="col" class="manage-column column-posts" style="">
<span><?php esc_html_e( 'Server Configuration', 'mainwp-child' ); ?></span></th>
<span><?php esc_html_e( 'Server configuration', 'mainwp-child' ); ?></span></th>
<th scope="col" class="manage-column column-posts"
style=""><?php esc_html_e( 'Required Value', 'mainwp' ); ?></th>
style=""><?php esc_html_e( 'Required value', 'mainwp' ); ?></th>
<th scope="col" class="manage-column column-posts" style=""><?php esc_html_e( 'Value', 'mainwp' ); ?></th>
<th scope="col" class="manage-column column-posts" style=""><?php esc_html_e( 'Status', 'mainwp' ); ?></th>
</tr>
@ -571,7 +575,7 @@ class MainWP_Child_Server_Information {
?>
<tr>
<td></td>
<td><?php _e( 'Currently Connected to Dashboard URL', 'mainwp-child' ); ?></td>
<td><?php _e( 'Currently connected to dashboard URL', 'mainwp-child' ); ?></td>
<td><?php echo esc_html( $server ); ?></td>
<td></td>
<td></td>
@ -647,7 +651,7 @@ class MainWP_Child_Server_Information {
<tr>
<td></td>
<td><?php esc_html_e( 'Server Name', 'mainwp' ); ?></td>
<td colspan="3"><?php self::getSeverName(); ?></td>
<td colspan="3"><?php self::getServerName(); ?></td>
</tr>
<tr>
<td></td>
@ -686,7 +690,7 @@ class MainWP_Child_Server_Information {
</tr>
<tr>
<td></td>
<td><?php _e( 'Sever self connect', 'mainwp' ); ?></td>
<td><?php _e( 'Server self connect', 'mainwp' ); ?></td>
<td colspan="3"><?php self::serverSelfConnect(); ?></td>
</tr>
<tr>
@ -701,7 +705,7 @@ class MainWP_Child_Server_Information {
</tr>
<tr>
<td></td>
<td><?php esc_html_e( 'Getaway Interface', 'mainwp' ); ?></td>
<td><?php esc_html_e( 'Gateway Interface', 'mainwp' ); ?></td>
<td colspan="3"><?php self::getServerGetawayInterface(); ?></td>
</tr>
<tr>
@ -1241,7 +1245,7 @@ class MainWP_Child_Server_Information {
echo esc_html( $_SERVER['SERVER_ADDR'] );
}

protected static function getSeverName() {
protected static function getServerName() {
echo esc_html( $_SERVER['SERVER_NAME'] );
}

@ -1569,7 +1573,7 @@ class MainWP_Child_Server_Information {
public static function renderhtaccess() {
?>
<div class="postbox" id="mainwp-code-display">
<h3 class="hndle" style="padding: 8px 12px; font-size: 14px;"><span>.htaccess</span></h3>
<h3 class="hndle" style="padding: 8px 12px; font-size: 14px;"><span><?php _e( '.htaccess', 'mainwp-child' ); ?></span></h3>

<div style="padding: 1em;">
<?php
@ -1579,4 +1583,69 @@ class MainWP_Child_Server_Information {
</div>
<?php
}
public static function renderConnectionDetails() {
global $current_user;
$details = array(
'siteurl' => array(
'title' => __('Site URL', 'mainwp'),
'value' => get_bloginfo( 'url' ),
'desc' => get_bloginfo( 'url' )
),
'adminuser' => array(
'title' => __('Administrator name', 'mainwp'),
'value' => $current_user->user_login,
'desc' => __('This is your Administrator username, however, you can use any existing Administrator username.', 'mainwp')
),
'friendly_name' => array(
'title' => __('Friendly site name', 'mainwp'),
'value' => get_bloginfo( 'name' ),
'desc' => __('For the friendly site name, you can use any name, this is just a suggestion.', 'mainwp')
),
'uniqueid' => array(
'title' => __('Child unique security id', 'mainwp'),
'value' => !empty(get_option('mainwp_child_uniqueId')) ? get_option('mainwp_child_uniqueId') : __('Leave the field blank', 'mainwp-child'),
'desc' => __('Child unique security id is not required, however, since you have enabled it, you need to add it to your MainWP dashboad.', 'mainwp')
),
'verify_ssl' => array(
'title' => __('Verify certificate', 'mainwp'),
'value' => __('Yes', 'mainwp-child'),
'desc' => __('If there is an issue with SSL certificate on this site, try to set this option to No.', 'mainwp')
),
'ssl_version' => array(
'title' => __('SSL version', 'mainwp'),
'value' => __('Auto Detect', 'mainwp-child'),
'desc' => __('Auto Detect', 'mainwp-child'),
),

);
?>
<div class="postbox" id="connection_detail">
<h3 class="mainwp_box_title"><span><?php _e( 'Connection details', 'mainwp-child' ); ?></span></h3>
<div class="inside">
<div class="mainwp-postbox-actions-top mainwp-padding-5">
<?php
_e('If you are trying to connect this child site to your Mainwp Dashboard, you can use following details to do that. Please note that these are only suggested values.', 'mainwp');
?>
</div>
<table id="mainwp-table" class="wp-list-table widefat" cellspacing="0" style="border: 0">
<tbody>
<?php
foreach ($details as $row) {
?>
<tr>
<th style="width: 20%"><strong><?php echo $row['title']; ?></strong></th>
<td style="width: 20%"><strong><?php echo $row['value']; ?></strong></td>
<td><?php echo $row['desc']; ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
<?php
}
}