Пример #1
0
    protected static function usersSearchHandlerRenderer($users, $website)
    {
        $return = 0;
        foreach ($users as $user) {
            ob_start();
            ?>
        <tr id="user-1" class="alternate">
            <th scope="row" class="check-column"><input type="checkbox" name="user[]" value="1"></th>
            <td class="username column-username">
                <input class="userId" type="hidden" name="id" value="<?php 
            echo $user['id'];
            ?>
"/>
                <input class="userName" type="hidden" name="name" value="<?php 
            echo $user['login'];
            ?>
"/>
                <input class="websiteId" type="hidden" name="id"
                       value="<?php 
            echo $website->id;
            ?>
"/>

                <?php 
            if (isset($user['avatar'])) {
                echo $user['avatar'];
            }
            ?>
                <strong><abbr title="<?php 
            echo $user['login'];
            ?>
"><?php 
            echo $user['login'];
            ?>
</abbr></strong>

                <div class="row-actions">
                    <span class="edit"><a
                            href="admin.php?page=SiteOpen&websiteid=<?php 
            echo $website->id;
            ?>
&location=<?php 
            echo base64_encode('user-edit.php?user_id=' . $user['id']);
            ?>
"
                            title="Edit this user"><?php 
            _e('Edit', 'mainwp');
            ?>
</a>
                    </span>
                    <?php 
            if ($user['id'] != 1 && $user['login'] != $website->adminname) {
                ?>
                    <span class="trash">
                        | <a class="user_submitdelete" title="Delete this user" href="#"><?php 
                _e('Delete', 'mainwp');
                ?>
</a>
                    </span>
                    <?php 
            } else {
                if ($user['id'] == 1 || $user['login'] == $website->adminname) {
                    ?>
                    <span class="trash">
                        | <span title="This user is used for our secure link, it can not be deleted." style="color: gray"><?php 
                    _e('Delete', 'mainwp');
                    ?>
&nbsp;&nbsp;<?php 
                    MainWPUtility::renderToolTip(__('This user is used for our secure link, it can not be deleted.', 'mainwp'), 'http://docs.mainwp.com/deleting-secure-link-admin', 'images/info.png', 'float: none !important;');
                    ?>
</span>
                    </span>
                    <?php 
                }
            }
            ?>
                </div>
                <div class="row-actions-working"><i class="fa fa-spinner fa-pulse"></i> <?php 
            _e('Please wait', 'mainwp');
            ?>
                </div>
            </td>
            <td class="name column-name"><?php 
            echo $user['display_name'];
            ?>
</td>
            <td class="email column-email"><a
                    href="mailto:<?php 
            echo $user['email'];
            ?>
"><?php 
            echo $user['email'];
            ?>
</a></td>
            <td class="role column-role"><?php 
            echo self::getRole($user['role']);
            ?>
</td>
            <td class="posts column-posts" style="text-align: left; padding-left: 1.7em ;"><a href="<?php 
            echo admin_url('admin.php?page=PostBulkManage&siteid=' . $website->id . '&userid=' . $user['id']);
            ?>
"><?php 
            echo $user['post_count'];
            ?>
</a></td>
            <td class="website column-website"><a
                    href="<?php 
            echo $website->url;
            ?>
"><?php 
            echo $website->url;
            ?>
</a>
                    <div class="row-actions">
                        <span class="edit"><a href="admin.php?page=managesites&dashboard=<?php 
            echo $website->id;
            ?>
"><?php 
            _e('Dashboard', 'mainwp');
            ?>
</a> | <a href="admin.php?page=SiteOpen&websiteid=<?php 
            echo $website->id;
            ?>
"><?php 
            _e('WP Admin', 'mainwp');
            ?>
</a></span>
                    </div>
            </td>
        </tr>
        <?php 
            $newOutput = ob_get_clean();
            echo $newOutput;
            MainWPCache::addBody('Users', $newOutput);
            $return++;
        }
        return $return;
    }
Пример #2
0
    public static function renderSettings()
    {
        $username = get_option("mainwp_api_username");
        $password = MainWPUtility::decrypt(get_option('mainwp_api_password'), 'MainWPAPI');
        ?>
        <div class="postbox mainwp_postbox" id="mainwp-account-information" section="setting-1">
        <div class="handlediv"><br /></div> 
        <h3 class="mainwp_box_title"><span><i class="fa fa-cog"></i> <?php 
        _e('MainWP Account Information', 'mainwp');
        ?>
</span></h3>
        <div class="inside">
        <div id="mainwp_api_errors" class="mainwp_error error" style="display: none"></div>
        <div id="mainwp_api_message" class="mainwp_updated updated" style="display: none"></div>
        <div class="mainwp_info-box-red" style="margin-top: 5px;"><?php 
        _e('<strong>IMPORTANT</strong>: This section is being retired and is replaced by the new Extension API and <a href="http://docs.mainwp.com/backups-scheduled-events-occurring/" target="_blank">Uptime Robot Cron wp-cron</a> trigger directions. You no longer need to add any information to this section it is here for a limited time to allow previous users time to update their Extensions to the new API system and setup their Uptime Robot accounts.', 'mainwp');
        ?>
</div>
        <table class="form-table">
            <tbody>
            <tr>
                <th scope="row"><label for="mainwp_api_username"><?php 
        _e('Username', 'mainwp');
        ?>
</label></th>
                <td>
                    <input type="text" name="mainwp_api_username" class="mainwp-field mainwp-username" id="mainwp_api_username" size="35"
                           value="<?php 
        echo $username;
        ?>
"/>
                </td>
            </tr>
            <tr>
                <th scope="row"><label for="mainwp_api_password"><?php 
        _e('Password', 'mainwp');
        ?>
</label></th>
                <td>
                    <input type="password" name="mainwp_api_password" class="mainwp-field mainwp-password" id="mainwp_api_password" size="35"
                           value="<?php 
        echo $password;
        ?>
"/>
                </td>
            </tr>
            <span class="submit">
            <tr>
            <th scope="row" colspan="2"><input type="button" name="submit" id="mainwp-api-submit" class="button-primary" value="<?php 
        _e('Save Login', 'mainwp');
        ?>
" /></th>
            </tr>
            </span>
             <tr>
                <th scope="row"><?php 
        _e('Use MainWP Cron Trigger', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip(__('Enables the cron jobs triggered from the MainWP Member area. A MainWP login is required for this option.', 'mainwp'));
        ?>
</th>
                <td>
                    <div class="mainwp-checkbox">
                    <input type="checkbox" name="mainwp_options_cron_jobs"
                           id="mainwp_options_cron_jobs" <?php 
        echo get_option('mainwp_cron_jobs') == 1 ? 'checked="true"' : '';
        ?>
/>
                    <label for="mainwp_options_cron_jobs"></label>
                    </div><em style="display: inline;"><?php 
        _e('Requires MainWP Login', 'mainwp');
        ?>
</em>
                </td>
            </tr>
            </tbody>
            </table>
        </p>
    </div>
    </div>
        <?php 
    }
    protected static function renderRow($pConfig, $pCompare, $pVersion, $pGetter, $pExtraText = '', $pExtraCompare = null, $pExtraVersion = null, $toolTip = null, $whatType = null)
    {
        $currentVersion = call_user_func(array(MainWPServerInformation::getClassName(), $pGetter));
        ?>
    <tr>
        <td class="mwp-not-generate-row"><?php 
        if ($toolTip != null) {
            ?>
 <a href="http://docs.mainwp.com/child-site-issues/" target="_blank"><?php 
            MainWPUtility::renderToolTip($toolTip);
            ?>
</a><?php 
        }
        ?>
</td>
        <td><?php 
        echo $pConfig;
        ?>
</td>
        <td><?php 
        echo $pCompare;
        ?>
  <?php 
        echo ($pVersion === true ? 'true' : (is_array($pVersion) && isset($pVersion['version']) ? $pVersion['version'] : $pVersion)) . ' ' . $pExtraText;
        ?>
</td>
        <td><?php 
        echo $currentVersion === true ? 'true' : $currentVersion;
        ?>
</td>
        <?php 
        if ($whatType == 'filesize') {
            ?>
        
        <td><?php 
            echo self::filesize_compare($currentVersion, $pVersion, $pCompare) ? '<span class="mainwp-pass"><i class="fa fa-check-circle"></i> Pass</span>' : '<span class="mainwp-warning"><i class="fa fa-exclamation-circle"></i> Warning</span>';
            ?>
</td>
        <?php 
        } else {
            if ($whatType == 'curlssl') {
                ?>
        <td><?php 
                echo self::curlssl_compare($pVersion, $pCompare) ? '<span class="mainwp-pass"><i class="fa fa-check-circle"></i> Pass</span>' : '<span class="mainwp-warning"><i class="fa fa-exclamation-circle"></i> Warning</span>';
                ?>
</td>
        <?php 
            } else {
                ?>
        <td><?php 
                echo version_compare($currentVersion, $pVersion, $pCompare) || $pExtraCompare != null && version_compare($currentVersion, $pExtraVersion, $pExtraCompare) ? '<span class="mainwp-pass"><i class="fa fa-check-circle"></i> Pass</span>' : '<span class="mainwp-warning"><i class="fa fa-exclamation-circle"></i> Warning</span>';
                ?>
</td>
        <?php 
            }
        }
        ?>
    </tr>
    <?php 
    }
Пример #4
0
    public static function renderAllSites(&$website, $updated, $groups, $statusses, $pluginDir)
    {
        if (!mainwp_current_user_can("dashboard", "edit_sites")) {
            mainwp_do_not_have_permissions("edit sites");
            return;
        }
        $remote_destinations = apply_filters('mainwp_backups_remote_get_destinations', null, array('website' => $website->id));
        $hasRemoteDestinations = $remote_destinations == null ? $remote_destinations : count($remote_destinations);
        ?>
        <div class="error below-h2" style="display: none;" id="ajax-error-zone"></div>
        <div id="ajax-information-zone" class="updated" style="display: none;"></div>
        <?php 
        if ($updated) {
            ?>
            <div id="mainwp_managesites_edit_message" class="updated"><p><?php 
            _e('Website updated.', 'mainwp');
            ?>
</p></div>
            <?php 
        }
        ?>
        <form method="POST" action="" id="mainwp-edit-single-site-form" enctype="multipart/form-data">
            <div class="postbox">
            <h3 class="mainwp_box_title"><i class="fa fa-cog"></i> <?php 
        _e('General Options', 'mainwp');
        ?>
</h3>
            <div class="inside">
            <table class="form-table">
                <tbody>
                <tr>
                    <th scope="row"><?php 
        _e('Site Name', 'mainwp');
        ?>
</th>
                    <td><input type="text" name="mainwp_managesites_edit_sitename"
                               value="<?php 
        echo stripslashes($website->name);
        ?>
" class="regular-text mainwp-field mainwp-site"/></td>
                </tr>
                <tr>
                    <th scope="row"><?php 
        _e('Site URL', 'mainwp');
        ?>
</th>
                    <td><input type="text" id="mainwp_managesites_edit_siteurl" disabled="disabled"
                               value="<?php 
        echo $website->url;
        ?>
" class="regular-text mainwp-field mainwp-url" /> <span
                            class="mainwp-form_hint-display"><?php 
        _e('Site URL cannot be changed.', 'mainwp');
        ?>
</span></td>
                </tr>
                <tr>
                    <th scope="row"><?php 
        _e('Administrator Username', 'mainwp');
        ?>
</th>
                    <td><input type="text" name="mainwp_managesites_edit_siteadmin"
                               id="mainwp_managesites_edit_siteadmin"
                               value="<?php 
        echo $website->adminname;
        ?>
"
                               class="regular-text  mainwp-field mainwp-username"/></td>
                </tr>
                <tr>
                    <th scope="row"><?php 
        _e('Groups', 'mainwp');
        ?>
</th>
                    <td>
                        <input type="text" name="mainwp_managesites_edit_addgroups"
                               id="mainwp_managesites_edit_addgroups" value=""
                               class="regular-text  mainwp-field mainwp-groups"/> <span
                            class="mainwp-form_hint"><?php 
        _e('Separate groups by commas (e.g. Group 1, Group 2).', 'mainwp');
        ?>
</span>

                        <div id="selected_groups" style="display: block; width: 25em">
                            <?php 
        if (count($groups) == 0) {
            echo 'No groups added yet.';
        }
        $groupsSite = MainWPDB::Instance()->getGroupsByWebsiteId($website->id);
        foreach ($groups as $group) {
            echo '<div class="mainwp_selected_groups_item"><input type="checkbox" name="selected_groups[]" value="' . $group->id . '" ' . (isset($groupsSite[$group->id]) && $groupsSite[$group->id] ? 'checked' : '') . ' />&nbsp' . $group->name . '</div>';
        }
        ?>
                        </div>
                        <span class="description"><?php 
        _e('Or assign existing groups.', 'mainwp');
        ?>
</span>
                    </td>
                </tr>
                <tr>
                    <th scope="row"><?php 
        _e('Offline Checks', 'mainwp');
        ?>
</th>
                    <td>
                        <input type="radio" name="offline_checks" id="check_disabled" value="disabled"
                            <?php 
        echo !in_array($website->offline_checks, $statusses) ? 'checked="true"' : '';
        ?>
 /> <?php 
        _e('Disabled', 'mainwp');
        ?>
 &nbsp;&nbsp;&nbsp;
                        <input type="radio" name="offline_checks" id="check_hourly"
                               value="hourly" <?php 
        echo $website->offline_checks == 'hourly' ? 'checked="true"' : '';
        ?>
/> <?php 
        _e('Hourly', 'mainwp');
        ?>
 &nbsp;&nbsp;&nbsp;
                        <input type="radio" name="offline_checks" id="check_2xday"
                               value="2xday" <?php 
        echo $website->offline_checks == '2xday' ? 'checked="true"' : '';
        ?>
/> <?php 
        _e('2x Day', 'mainwp');
        ?>
 &nbsp;&nbsp;&nbsp;
                        <input type="radio" name="offline_checks" id="check_daily"
                               value="daily" <?php 
        echo $website->offline_checks == 'daily' ? 'checked="true"' : '';
        ?>
/> <?php 
        _e('Daily', 'mainwp');
        ?>
 &nbsp;&nbsp;&nbsp;
                        <input type="radio" name="offline_checks" id="check_weekly" value="weekly"
                            <?php 
        echo $website->offline_checks == 'weekly' ? 'checked="true"' : '';
        ?>
/>
                        Weekly  &nbsp;
                    <span class="mainwp-form_hint-display"><?php 
        _e('Notifications are sent to:', 'mainwp');
        ?>
 <?php 
        echo MainWPUtility::getNotificationEmail();
        ?>
                        (<?php 
        _e('this address can be changed', 'mainwp');
        ?>
 <a
                                href="<?php 
        echo get_admin_url();
        ?>
admin.php?page=Settings"><?php 
        _e('here', 'mainwp');
        ?>
</a>)</span>
                    </td>
                </tr>
                <tr>
                    <th scope="row"><?php 
        _e('Client Plugin Folder Option', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip('Default, files/folders on the child site are viewable.<br />Hidden, when attempting to view files a 404 file will be returned, however a footprint does still exist.<br /><strong>Hiding the Child Plugin does require the plugin to make changes to your .htaccess file that in rare instances or server configurations could cause problems.</strong>');
        ?>
</th>
                    <td>
                        <div class="mainwp-radio" style="float: left;">
                          <input type="radio" value="" name="mainwp_options_footprint_plugin_folder" id="mainwp_options_footprint_plugin_folder_global" <?php 
        echo $pluginDir == '' ? 'checked="true"' : '';
        ?>
"/>
                          <label for="mainwp_options_footprint_plugin_folder_global"></label>
                        </div>Global Setting (<a href="<?php 
        echo admin_url('admin.php?page=Settings#network-footprint');
        ?>
">Change Here</a>)<br/>
                        <div class="mainwp-radio" style="float: left;">
                          <input type="radio" value="default" name="mainwp_options_footprint_plugin_folder" id="mainwp_options_footprint_plugin_folder_default" <?php 
        echo $pluginDir == 'default' ? 'checked="true"' : '';
        ?>
"/>
                          <label for="mainwp_options_footprint_plugin_folder_default"></label>
                        </div>Default<br/>
                        <div class="mainwp-radio" style="float: left;">
                          <input type="radio" value="hidden" name="mainwp_options_footprint_plugin_folder" id="mainwp_options_footprint_plugin_folder_hidden" <?php 
        echo $pluginDir == 'hidden' ? 'checked="true"' : '';
        ?>
/>
                          <label for="mainwp_options_footprint_plugin_folder_hidden"></label>
                        </div>Hidden (<strong>Note: </strong><i>If the heatmap is turned on, the heatmap javascript will still be visible.</i>) <br/>
                    </td>
                </tr>               
                <tr>
                    <th scope="row"><?php 
        _e('Require Backup Before Upgrade', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip(__('Backup only works when enabled in the global settings as well.', 'mainwp'), admin_url('admin.php?page=Settings'));
        ?>
</th>
                    <td>
                         <select id="mainwp_backup_before_upgrade" name="mainwp_backup_before_upgrade">
                             <option <?php 
        echo $website->backup_before_upgrade == 1 ? "selected" : "";
        ?>
 value="1"><?php 
        _e('Yes', 'mainwp');
        ?>
</option>
                             <option <?php 
        echo $website->backup_before_upgrade == 0 ? "selected" : "";
        ?>
 value="0"><?php 
        _e('No', 'mainwp');
        ?>
</option>
                             <option <?php 
        echo $website->backup_before_upgrade == 2 ? "selected" : "";
        ?>
 value="2"><?php 
        _e('Use Global Setting', 'mainwp');
        ?>
</option>
                         </select> <i>(<?php 
        _e('Default', 'mainwp');
        ?>
: <?php 
        _e('Use Global Setting', 'mainwp');
        ?>
)</i>
                         
                    </td>
                </tr>
                 <tr>
                    <th scope="row"><?php 
        _e('Auto Update Core', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip('Auto update only works when enabled in the global settings as well.', admin_url('admin.php?page=Settings'));
        ?>
</th>
                    <td>
                        <div class="mainwp-checkbox">
                        <input type="checkbox" name="mainwp_automaticDailyUpdate"
                               id="mainwp_automaticDailyUpdate" <?php 
        echo $website->automatic_update == 1 ? 'checked="true"' : '';
        ?>
 />
                        <label for="mainwp_automaticDailyUpdate"></label>
                        </div>
                    </td>
                </tr>
                <?php 
        if (mainwp_current_user_can("dashboard", "ignore_unignore_updates")) {
            ?>
                <tr>
                    <th scope="row"><?php 
            _e('Ignore Core Updates', 'mainwp');
            ?>
 <?php 
            MainWPUtility::renderToolTip('Set to YES if you want to Ignore Core Updates.');
            ?>
</th>
                    <td>
                        <div class="mainwp-checkbox">
                        <input type="checkbox" name="mainwp_is_ignoreCoreUpdates"
                               id="mainwp_is_ignoreCoreUpdates" <?php 
            echo $website->is_ignoreCoreUpdates == 1 ? 'checked="true"' : '';
            ?>
 />
                        <label for="mainwp_is_ignoreCoreUpdates"></label>
                        </div>
                    </td>
                </tr>  
                <tr>
                    <th scope="row"><?php 
            _e('Ignore All Plugin Updates', 'mainwp');
            ?>
 <?php 
            MainWPUtility::renderToolTip('Set to YES if you want to Ignore All Plugin Updates.');
            ?>
</th>
                    <td>
                        <div class="mainwp-checkbox">
                        <input type="checkbox" name="mainwp_is_ignorePluginUpdates"
                               id="mainwp_is_ignorePluginUpdates" <?php 
            echo $website->is_ignorePluginUpdates == 1 ? 'checked="true"' : '';
            ?>
 />
                        <label for="mainwp_is_ignorePluginUpdates"></label>
                        </div>
                    </td>
                </tr>  
                <tr>
                    <th scope="row"><?php 
            _e('Ignore All Theme Updates', 'mainwp');
            ?>
 <?php 
            MainWPUtility::renderToolTip('Set to YES if you want to Ignore All Theme Updates.');
            ?>
</th>
                    <td>
                        <div class="mainwp-checkbox">
                        <input type="checkbox" name="mainwp_is_ignoreThemeUpdates"
                               id="mainwp_is_ignoreThemeUpdates" <?php 
            echo $website->is_ignoreThemeUpdates == 1 ? 'checked="true"' : '';
            ?>
 />
                        <label for="mainwp_is_ignoreThemeUpdates"></label>
                        </div>
                    </td>
                </tr>
                <?php 
        }
        ?>
                <?php 
        do_action('mainwp_extension_sites_edit_tablerow', $website);
        ?>
                </tbody>
            </table>
            </div>
            </div>
            <div class="clear"></div>
            <div class="postbox">
            <h3 class="mainwp_box_title"><span><i class="fa fa-cog"></i> <?php 
        _e('Advanced Options', 'mainwp');
        ?>
</span></h3>
            <div class="inside">
            <table class="form-table" style="width: 100%">
                <?php 
        $disabled_unique = empty($website->uniqueId) ? true : false;
        ?>
 
                <tr class="form-field form-required">
                    <th scope="row"><?php 
        _e('Child Unique Security
                      ID: ', 'mainwp');
        MainWPUtility::renderToolTip('The Unique Security ID adds additional protection between the Child plugin and your Main Dashboard. The Unique Security ID will need to match when being added to the Main Dashboard. This is additional security and should not be needed in most situations.');
        ?>
</th>
                    <td><input type="text" id="mainwp_managesites_edit_uniqueId" style="width: 350px;" <?php 
        echo $disabled_unique ? 'disabled="disabled"' : '';
        ?>
                             name="mainwp_managesites_edit_uniqueId" value="<?php 
        echo $website->uniqueId;
        ?>
" class="mainwp-field mainwp-unique-id"/><span class="mainwp-form_hint">The Unique Security ID adds additional protection between the Child plugin and your Main Dashboard. The Unique Security ID will need to match when being added to the Main Dashboard. This is additional security and should not be needed in most situations.</span></td>
                </tr>                
                 <tr class="form-field form-required">
                    <th scope="row"><?php 
        _e('Verify Certificate', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip(__('Verify the childs SSL certificate. This should be disabled if you are using out of date or self signed certificates.', 'mainwp'));
        ?>
</th>
                    <td>
                        <select id="mainwp_managesites_edit_verifycertificate" name="mainwp_managesites_edit_verifycertificate">
                             <option <?php 
        echo $website->verify_certificate == 1 ? "selected" : "";
        ?>
 value="1"><?php 
        _e('Yes', 'mainwp');
        ?>
</option>
                             <option <?php 
        echo $website->verify_certificate == 0 ? "selected" : "";
        ?>
 value="0"><?php 
        _e('No', 'mainwp');
        ?>
</option>
                             <option <?php 
        echo $website->verify_certificate == 2 ? "selected" : "";
        ?>
 value="2"><?php 
        _e('Use Global Setting', 'mainwp');
        ?>
</option>
                         </select> <i>(Default: Yes)</i>
                    </td>
                </tr>

                <!-- fake fields are a workaround for chrome autofill getting the wrong fields -->
                <input style="display:none" type="text" name="fakeusernameremembered"/>
                <input style="display:none" type="password" name="fakepasswordremembered"/>

                <tr>
                    <td colspan="2"><div class="mainwp_info-box"><?php 
        _e('If your Child Site is protected with HTTP basic authentication, please set the username and password for authentication here.', 'mainwp');
        ?>
</div></td>
                </tr>

                <tr class="form-field form-required">
                     <th scope="row"><?php 
        _e('HTTP username: '******'mainwp');
        ?>
</th>
                     <td><input type="text" id="mainwp_managesites_edit_http_user" style="width: 350px;" name="mainwp_managesites_edit_http_user" value="<?php 
        echo empty($website->http_user) ? '' : $website->http_user;
        ?>
" class="mainwp-field mainwp-username"/></td>
                </tr>
                <tr class="form-field form-required">
                     <th scope="row"><?php 
        _e('HTTP password: '******'mainwp');
        ?>
</th>
                     <td><input type="password" id="mainwp_managesites_edit_http_pass" style="width: 350px;" name="mainwp_managesites_edit_http_pass" value="<?php 
        echo empty($website->http_pass) ? '' : $website->http_pass;
        ?>
" class="mainwp-field mainwp-password"/></td>
                </tr>
            </table>
            </div>
            </div>
            
            <div class="clear"></div>
            <div class="postbox">
            <h3 class="mainwp_box_title"><span><i class="fa fa-cog"></i> <?php 
        _e('Backup Settings', 'mainwp');
        ?>
</span></h3>
            <div class="inside">
            <table class="form-table" style="width: 100%">
                <?php 
        $globalArchiveFormat = get_option('mainwp_archiveFormat');
        if ($globalArchiveFormat == false) {
            $globalArchiveFormat = 'tar.gz';
        }
        if ($globalArchiveFormat == 'zip') {
            $globalArchiveFormatText = 'Zip';
        } else {
            if ($globalArchiveFormat == 'tar') {
                $globalArchiveFormatText = 'Tar';
            } else {
                if ($globalArchiveFormat == 'tar.gz') {
                    $globalArchiveFormatText = 'Tar GZip';
                } else {
                    if ($globalArchiveFormat == 'tar.bz2') {
                        $globalArchiveFormatText = 'Tar BZip2';
                    }
                }
            }
        }
        $backupSettings = MainWPDB::Instance()->getWebsiteBackupSettings($website->id);
        $archiveFormat = $backupSettings->archiveFormat;
        $useGlobal = $archiveFormat == 'global';
        ?>
                <tr>
                    <th scope="row"><?php 
        _e('Archive Format', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip(__('', 'mainwp'));
        ?>
</th>
                    <td>
                        <table class="mainwp-nomarkup">
                            <tr>
                                <td valign="top">
                                    <span class="mainwp-select-bg"><select name="mainwp_archiveFormat" id="mainwp_archiveFormat">
                                        <option value="global" <?php 
        if ($useGlobal) {
            ?>
selected<?php 
        }
        ?>
>Global setting (<?php 
        echo $globalArchiveFormatText;
        ?>
)</option>
                                        <option value="zip" <?php 
        if ($archiveFormat == 'zip') {
            ?>
selected<?php 
        }
        ?>
>Zip</option>
                                        <option value="tar" <?php 
        if ($archiveFormat == 'tar') {
            ?>
selected<?php 
        }
        ?>
>Tar</option>
                                        <option value="tar.gz" <?php 
        if ($archiveFormat == 'tar.gz') {
            ?>
selected<?php 
        }
        ?>
>Tar GZip</option>
                                        <option value="tar.bz2" <?php 
        if ($archiveFormat == 'tar.bz2') {
            ?>
selected<?php 
        }
        ?>
>Tar BZip2</option>
                                    </select><label></label></span>
                                </td>
                                <td>
                                    <i>
                                    <span id="info_global" class="archive_info" <?php 
        if (!$useGlobal) {
            ?>
style="display: none;"<?php 
        }
        ?>
><?php 
        if ($globalArchiveFormat == 'zip') {
            ?>
Uses PHP native Zip-library, when missing, the PCLZip library included in Wordpress will be used. (Good compression, fast with native zip-library)<?php 
        } elseif ($globalArchiveFormat == 'tar') {
            ?>
Uses PHP native Zip-library, when missing, the PCLZip library included in Wordpress will be used. (Good compression, fast with native zip-library)<?php 
        } elseif ($globalArchiveFormat == 'tar.gz') {
            ?>
Creates a GZipped tar-archive. (Good compression, fast, low memory usage)<?php 
        } elseif ($globalArchiveFormat == 'tar.bz2') {
            ?>
Creates a BZipped tar-archive. (Best compression, fast, low memory usage)<?php 
        }
        ?>
</span>
                                    <span id="info_zip" class="archive_info" <?php 
        if ($archiveFormat != 'zip') {
            ?>
style="display: none;"<?php 
        }
        ?>
>Uses PHP native Zip-library, when missing, the PCLZip library included in Wordpress will be used. (Good compression, fast with native zip-library)</span>
                                    <span id="info_tar" class="archive_info" <?php 
        if ($archiveFormat != 'tar') {
            ?>
style="display: none;"<?php 
        }
        ?>
>Creates an uncompressed tar-archive. (No compression, fast, low memory usage)</span>
                                    <span id="info_tar.gz" class="archive_info" <?php 
        if ($archiveFormat != 'tar.gz') {
            ?>
style="display: none;"<?php 
        }
        ?>
>Creates a GZipped tar-archive. (Good compression, fast, low memory usage)</span>
                                    <span id="info_tar.bz2" class="archive_info" <?php 
        if ($archiveFormat != 'tar.bz2') {
            ?>
style="display: none;"<?php 
        }
        ?>
>Creates a BZipped tar-archive. (Best compression, fast, low memory usage)</span>
                                    </i>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>

                <?php 
        $maximumFileDescriptorsOverride = $website->maximumFileDescriptorsOverride == 1;
        $maximumFileDescriptorsAuto = $website->maximumFileDescriptorsAuto == 1;
        $maximumFileDescriptors = $website->maximumFileDescriptors;
        ?>
                <tr class="archive_method archive_zip" <?php 
        if ($archiveFormat != 'zip') {
            ?>
style="display: none;"<?php 
        }
        ?>
>
                    <th scope="row"><?php 
        _e('Maximum File Descriptors on Child', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip('The maximum number of open file descriptors on the child hosting.', 'http://docs.mainwp.com/maximum-number-of-file-descriptors/');
        ?>
</th>
                    <td>
                        <div class="mainwp-radio" style="float: left;">
                          <input type="radio" value="" name="mainwp_options_maximumFileDescriptorsOverride" id="mainwp_options_maximumFileDescriptorsOverride_global" <?php 
        echo !$maximumFileDescriptorsOverride ? 'checked="true"' : '';
        ?>
"/>
                          <label for="mainwp_options_maximumFileDescriptorsOverride_global"></label>
                        </div>Global Setting (<a href="<?php 
        echo admin_url('admin.php?page=Settings');
        ?>
">Change Here</a>)<br/>
                        <div class="mainwp-radio" style="float: left;">
                          <input type="radio" value="override" name="mainwp_options_maximumFileDescriptorsOverride" id="mainwp_options_maximumFileDescriptorsOverride_override" <?php 
        echo $maximumFileDescriptorsOverride ? 'checked="true"' : '';
        ?>
"/>
                          <label for="mainwp_options_maximumFileDescriptorsOverride_override"></label>
                        </div>Override<br/><br />

                        <div style="float: left">Auto Detect:&nbsp;</div><div class="mainwp-checkbox"><input type="checkbox" id="mainwp_maximumFileDescriptorsAuto" name="mainwp_maximumFileDescriptorsAuto" <?php 
        echo $maximumFileDescriptorsAuto ? 'checked="checked"' : '';
        ?>
 /> <label for="mainwp_maximumFileDescriptorsAuto"></label></div><div style="float: left"><i>(<?php 
        _e('Enter a fallback value because not all hosts support this function.', 'mainwp');
        ?>
)</i></div><div style="clear:both"></div>
                        <input type="text" name="mainwp_options_maximumFileDescriptors" id="mainwp_options_maximumFileDescriptors"
                               value="<?php 
        echo $maximumFileDescriptors;
        ?>
"/><span class="mainwp-form_hint"><?php 
        _e('The maximum number of open file descriptors on the child hosting.  0 sets unlimited.', 'mainwp');
        ?>
</span>
                    </td>
                </tr>
                <tr class="archive_method archive_zip" <?php 
        if ($archiveFormat != 'zip') {
            ?>
style="display: none;"<?php 
        }
        ?>
>
                    <th scope="row"><?php 
        _e('Load Files in Memory Before Zipping', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip('This causes the files to be opened and closed immediately, using less simultaneous I/O operations on the disk. For huge sites with a lot of files we advise to disable this, memory usage will drop but we will use more file handlers when backing up.', 'http://docs.mainwp.com/load-files-memory/');
        ?>
</th>
                    <td>
                        <input type="radio" name="mainwp_options_loadFilesBeforeZip" id="mainwp_options_loadFilesBeforeZip_global" value="1" <?php 
        if ($website->loadFilesBeforeZip == false || $website->loadFilesBeforeZip == 1) {
            ?>
checked="true"<?php 
        }
        ?>
/> Global setting (<a href="<?php 
        echo admin_url('admin.php?page=Settings');
        ?>
">Change Here</a>)<br />
                        <input type="radio" name="mainwp_options_loadFilesBeforeZip" id="mainwp_options_loadFilesBeforeZip_yes" value="2" <?php 
        if ($website->loadFilesBeforeZip == 2) {
            ?>
checked="true"<?php 
        }
        ?>
/> Yes<br />
                        <input type="radio" name="mainwp_options_loadFilesBeforeZip" id="mainwp_options_loadFilesBeforeZip_no" value="0" <?php 
        if ($website->loadFilesBeforeZip == 0) {
            ?>
checked="true"<?php 
        }
        ?>
/> No<br />
                    </td>
                </tr>
                <?php 
        if ($hasRemoteDestinations !== null) {
            do_action('mainwp_backups_remote_settings', array('website' => $website->id, 'hide' => 'no'));
        }
        ?>
            </table>
            </div>
            </div>
            
            <?php 
        $plugin_upgrades = json_decode($website->plugin_upgrades, true);
        if (!is_array($plugin_upgrades)) {
            $plugin_upgrades = array();
        }
        $userExtension = MainWPDB::Instance()->getUserExtension();
        $globalIgnoredPluginConflicts = json_decode($userExtension->ignored_pluginConflicts, true);
        ?>
            <?php 
        do_action('mainwp-extension-sites-edit', $website);
        ?>
<p class="submit"><input type="submit" name="submit" id="submit" class="button-primary"
                                     value="<?php 
        _e('Update Site', 'mainwp');
        ?>
"/></p>
        </form>       
        <?php 
    }
Пример #5
0
    public static function renderSettings()
    {
        $userExtension = MainWPDB::Instance()->getUserExtension();
        $onlineNotifications = $userExtension == null || ($userExtension->offlineChecksOnlineNotification == null || $userExtension->offlineChecksOnlineNotification == '') ? '0' : $userExtension->offlineChecksOnlineNotification;
        ?>
    <div class="postbox" id="mainwp-offline-check-options-settings">
    <h3 class="mainwp_box_title"><span><i class="fa fa-cog"></i> <?php 
        _e('Offline Check Options', 'mainwp');
        ?>
</span></h3>
    <div class="inside">
    <table class="form-table">
        <tbody>
        <tr>
            <th scope="row"><?php 
        _e('Online Notifications', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip(__('Network will monitor your sites for downtime and uptime.  By default emails are only sent when your site is down.', 'mainwp'));
        ?>
</th>
            <td>
            	<div class="mainwp-checkbox">
                <input type="checkbox" name="mainwp_options_offlinecheck_onlinenotification"
                       id="mainwp_options_offlinecheck_onlinenotification" <?php 
        echo $onlineNotifications == 1 ? 'checked="true"' : '';
        ?>
 />
                <label for="mainwp_options_offlinecheck_onlinenotification"></label>
               </div><?php 
        _e('Enable notifications even when the website is online', 'mainwp');
        ?>
            </td>
        </tr>
        </tbody>
    </table>
    </div>
    </div>
    <?php 
    }
Пример #6
0
    public static function renderSites()
    {
        $globalView = true;
        $current_wpid = MainWPUtility::get_current_wpid();
        if ($current_wpid) {
            $sql = MainWPDB::Instance()->getSQLWebsiteById($current_wpid);
            $globalView = false;
        } else {
            $sql = MainWPDB::Instance()->getSQLWebsitesForCurrentUser();
        }
        $websites = MainWPDB::Instance()->query($sql);
        if (!$websites) {
            return;
        }
        $userExtension = MainWPDB::Instance()->getUserExtension();
        $total_themesIgnored = $total_pluginsIgnored = 0;
        $total_themesIgnoredAbandoned = $total_pluginsIgnoredAbandoned = 0;
        if ($globalView) {
            $decodedIgnoredPlugins = json_decode($userExtension->ignored_plugins, true);
            $decodedIgnoredThemes = json_decode($userExtension->ignored_themes, true);
            $total_pluginsIgnored = is_array($decodedIgnoredPlugins) ? count($decodedIgnoredPlugins) : 0;
            $total_themesIgnored = is_array($decodedIgnoredThemes) ? count($decodedIgnoredThemes) : 0;
            $decodedIgnoredPluginsAbandoned = json_decode($userExtension->dismissed_plugins, true);
            $decodedIgnoredThemesAbandoned = json_decode($userExtension->dismissed_themes, true);
            $total_pluginsIgnoredAbandoned = is_array($decodedIgnoredPluginsAbandoned) ? count($decodedIgnoredPluginsAbandoned) : 0;
            $total_themesIgnoredAbandoned = is_array($decodedIgnoredThemesAbandoned) ? count($decodedIgnoredThemesAbandoned) : 0;
        }
        $decodedDismissedPlugins = json_decode($userExtension->dismissed_plugins, true);
        $decodedDismissedThemes = json_decode($userExtension->dismissed_themes, true);
        $globalIgnoredPluginConflicts = json_decode($userExtension->ignored_pluginConflicts, true);
        if (!is_array($globalIgnoredPluginConflicts)) {
            $globalIgnoredPluginConflicts = array();
        }
        $globalIgnoredThemeConflicts = json_decode($userExtension->ignored_themeConflicts, true);
        if (!is_array($globalIgnoredThemeConflicts)) {
            $globalIgnoredThemeConflicts = array();
        }
        $total_wp_upgrades = 0;
        $total_plugin_upgrades = 0;
        $total_theme_upgrades = 0;
        $total_sync_errors = 0;
        $total_uptodate = 0;
        $total_offline = 0;
        $total_conflict = 0;
        $total_plugins_outdate = 0;
        $total_themes_outdate = 0;
        $allPlugins = array();
        $pluginsInfo = array();
        $allThemes = array();
        $themesInfo = array();
        $allPluginsOutdate = array();
        $pluginsOutdateInfo = array();
        $allThemesOutdate = array();
        $themesOutdateInfo = array();
        @MainWPDB::data_seek($websites, 0);
        $currentSite = null;
        $pluginsIgnored_perSites = $themesIgnored_perSites = array();
        $pluginsIgnoredAbandoned_perSites = $themesIgnoredAbandoned_perSites = array();
        while ($websites && ($website = @MainWPDB::fetch_object($websites))) {
            if (!$globalView) {
                $currentSite = $website;
            }
            $wp_upgrades = json_decode(MainWPDB::Instance()->getWebsiteOption($website, 'wp_upgrades'), true);
            if ($website->is_ignoreCoreUpdates) {
                $wp_upgrades = array();
            }
            if (is_array($wp_upgrades) && count($wp_upgrades) > 0) {
                $total_wp_upgrades++;
            }
            $plugin_upgrades = json_decode($website->plugin_upgrades, true);
            if ($website->is_ignorePluginUpdates) {
                $plugin_upgrades = array();
            }
            $theme_upgrades = json_decode($website->theme_upgrades, true);
            if ($website->is_ignoreThemeUpdates) {
                $theme_upgrades = array();
            }
            $decodedPremiumUpgrades = json_decode(MainWPDB::Instance()->getWebsiteOption($website, 'premium_upgrades'), true);
            if (is_array($decodedPremiumUpgrades)) {
                foreach ($decodedPremiumUpgrades as $crrSlug => $premiumUpgrade) {
                    $premiumUpgrade['premium'] = true;
                    if ($premiumUpgrade['type'] == 'plugin') {
                        if (!is_array($plugin_upgrades)) {
                            $plugin_upgrades = array();
                        }
                        if (!$website->is_ignorePluginUpdates) {
                            $plugin_upgrades[$crrSlug] = $premiumUpgrade;
                        }
                    } else {
                        if ($premiumUpgrade['type'] == 'theme') {
                            if (!is_array($theme_upgrades)) {
                                $theme_upgrades = array();
                            }
                            if (!$website->is_ignoreThemeUpdates) {
                                $theme_upgrades[$crrSlug] = $premiumUpgrade;
                            }
                        }
                    }
                }
            }
            if (is_array($plugin_upgrades)) {
                $ignored_plugins = json_decode($website->ignored_plugins, true);
                if (is_array($ignored_plugins)) {
                    $plugin_upgrades = array_diff_key($plugin_upgrades, $ignored_plugins);
                }
                $ignored_plugins = json_decode($userExtension->ignored_plugins, true);
                if (is_array($ignored_plugins)) {
                    $plugin_upgrades = array_diff_key($plugin_upgrades, $ignored_plugins);
                }
                $total_plugin_upgrades += count($plugin_upgrades);
            }
            if (is_array($theme_upgrades)) {
                $ignored_themes = json_decode($website->ignored_themes, true);
                if (is_array($ignored_themes)) {
                    $theme_upgrades = array_diff_key($theme_upgrades, $ignored_themes);
                }
                $ignored_themes = json_decode($userExtension->ignored_themes, true);
                if (is_array($ignored_themes)) {
                    $theme_upgrades = array_diff_key($theme_upgrades, $ignored_themes);
                }
                $total_theme_upgrades += count($theme_upgrades);
            }
            $ignored_plugins = json_decode($website->ignored_plugins, true);
            $ignored_themes = json_decode($website->ignored_themes, true);
            if (is_array($ignored_plugins)) {
                $ignored_plugins = array_filter($ignored_plugins);
                $pluginsIgnored_perSites = array_merge($pluginsIgnored_perSites, $ignored_plugins);
            }
            if (is_array($ignored_themes)) {
                $ignored_themes = array_filter($ignored_themes);
                $themesIgnored_perSites = array_merge($themesIgnored_perSites, $ignored_themes);
            }
            $ignoredAbandoned_plugins = json_decode(MainWPDB::Instance()->getWebsiteOption($website, 'plugins_outdate_dismissed'), true);
            if (is_array($ignoredAbandoned_plugins)) {
                $ignoredAbandoned_plugins = array_filter($ignoredAbandoned_plugins);
                $pluginsIgnoredAbandoned_perSites = array_merge($pluginsIgnoredAbandoned_perSites, $ignoredAbandoned_plugins);
            }
            $ignoredAbandoned_themes = json_decode(MainWPDB::Instance()->getWebsiteOption($website, 'themes_outdate_dismissed'), true);
            if (is_array($ignoredAbandoned_themes)) {
                $ignoredAbandoned_themes = array_filter($ignoredAbandoned_themes);
                $themesIgnoredAbandoned_perSites = array_merge($themesIgnoredAbandoned_perSites, $ignoredAbandoned_themes);
            }
            $plugins_outdate = json_decode(MainWPDB::Instance()->getWebsiteOption($website, 'plugins_outdate_info'), true);
            $themes_outdate = json_decode(MainWPDB::Instance()->getWebsiteOption($website, 'themes_outdate_info'), true);
            if (is_array($plugins_outdate)) {
                if (is_array($ignoredAbandoned_plugins)) {
                    $plugins_outdate = array_diff_key($plugins_outdate, $ignoredAbandoned_plugins);
                }
                if (is_array($decodedDismissedPlugins)) {
                    $plugins_outdate = array_diff_key($plugins_outdate, $decodedDismissedPlugins);
                }
                $total_plugins_outdate += count($plugins_outdate);
            }
            if (is_array($themes_outdate)) {
                if (is_array($themesIgnoredAbandoned_perSites)) {
                    $themes_outdate = array_diff_key($themes_outdate, $themesIgnoredAbandoned_perSites);
                }
                if (is_array($decodedDismissedThemes)) {
                    $themes_outdate = array_diff_key($themes_outdate, $decodedDismissedThemes);
                }
                $total_themes_outdate += count($themes_outdate);
            }
            if ($userExtension->site_view == 0) {
                //Keep track of all the plugins & themes
                if (is_array($plugin_upgrades)) {
                    foreach ($plugin_upgrades as $slug => $plugin_upgrade) {
                        if (!isset($allPlugins[$slug])) {
                            $allPlugins[$slug] = 1;
                        } else {
                            $allPlugins[$slug]++;
                        }
                        $pluginsInfo[$slug] = array('name' => $plugin_upgrade['Name'], 'slug' => $plugin_upgrade['update']['slug'], 'premium' => isset($plugin_upgrade['premium']) ? $plugin_upgrade['premium'] : 0);
                    }
                }
                ksort($allPlugins);
                if (is_array($theme_upgrades)) {
                    foreach ($theme_upgrades as $slug => $theme_upgrade) {
                        if (!isset($allThemes[$slug])) {
                            $allThemes[$slug] = 1;
                        } else {
                            $allThemes[$slug]++;
                        }
                        $themesInfo[$slug] = array('name' => $theme_upgrade['Name'], 'premium' => isset($theme_upgrade['premium']) ? $theme_upgrade['premium'] : 0);
                    }
                }
                ksort($allThemes);
                if (is_array($plugins_outdate)) {
                    foreach ($plugins_outdate as $slug => $plugin_outdate) {
                        if (!isset($allPluginsOutdate[$slug])) {
                            $allPluginsOutdate[$slug] = 1;
                        } else {
                            $allPluginsOutdate[$slug]++;
                        }
                        $pluginsOutdateInfo[$slug] = array('Name' => $plugin_outdate['Name'], 'last_updated' => isset($plugin_outdate['last_updated']) ? $plugin_outdate['last_updated'] : 0);
                    }
                }
                ksort($allPluginsOutdate);
                if (is_array($themes_outdate)) {
                    foreach ($themes_outdate as $slug => $theme_outdate) {
                        if (!isset($allThemesOutdate[$slug])) {
                            $allThemesOutdate[$slug] = 1;
                        } else {
                            $allThemesOutdate[$slug]++;
                        }
                        $themesOutdateInfo[$slug] = array('name' => $theme_outdate['Name'], 'slug' => dirname($slug), 'last_updated' => isset($theme_outdate['last_updated']) ? $theme_outdate['last_updated'] : 0);
                    }
                }
                ksort($allThemesOutdate);
            }
            if ($website->sync_errors != '') {
                $total_sync_errors++;
            }
            if ($website->uptodate == 1) {
                $total_uptodate++;
            }
            if ($website->offline_check_result == -1) {
                $total_offline++;
            }
            $pluginConflicts = json_decode($website->pluginConflicts, true);
            $themeConflicts = json_decode($website->themeConflicts, true);
            $ignoredPluginConflicts = json_decode($website->ignored_pluginConflicts, true);
            if (!is_array($ignoredPluginConflicts)) {
                $ignoredPluginConflicts = array();
            }
            $ignoredThemeConflicts = json_decode($website->ignored_themeConflicts, true);
            if (!is_array($ignoredThemeConflicts)) {
                $ignoredThemeConflicts = array();
            }
            $isConflict = false;
            if (count($pluginConflicts) > 0) {
                foreach ($pluginConflicts as $pluginConflict) {
                    if (!in_array($pluginConflict, $ignoredPluginConflicts) && !in_array($pluginConflict, $globalIgnoredPluginConflicts)) {
                        $isConflict = true;
                    }
                }
            }
            if (!$isConflict && count($themeConflicts) > 0) {
                foreach ($themeConflicts as $themeConflict) {
                    if (!in_array($themeConflict, $ignoredThemeConflicts) && !in_array($themeConflict, $globalIgnoredThemeConflicts)) {
                        $isConflict = true;
                    }
                }
            }
            if ($isConflict) {
                $total_conflict++;
            }
        }
        $errorsDismissed = get_user_option('mainwp_syncerrors_dismissed');
        ?>
    <div class="clear">
        <div id="mainwp-right-now-message" class="mainwp-right-now-error" <?php 
        if ($total_sync_errors <= 0 || $globalView && $errorsDismissed) {
            echo ' style="display: none;"';
        }
        ?>
>
            <p>
                <?php 
        if ($globalView) {
            ?>
                        <span id="mainwp-right-now-message-content"><?php 
            echo $total_sync_errors;
            ?>
 <?php 
            echo _n('Site Timed Out / Errored', 'Sites Timed Out / Errored', $total_sync_errors, 'mainwp');
            ?>
 (There was an error syncing some of your sites. <a href="http://docs.mainwp.com/sync-error/">Please check this help doc for possible solutions.</a>)</span><span style="float: right;"><a href="#" id="mainwp-right-now-message-dismiss"><i class="fa fa-times-circle"></i> <?php 
            _e('Dismiss', 'mainwp');
            ?>
</a></span>
                <?php 
        } else {
            ?>
                    <span id="mainwp-right-now-message-content"><a href="<?php 
            echo admin_url('admin.php?page=managesites&dashboard=' . $currentSite->id);
            ?>
"><?php 
            echo stripslashes($currentSite->name);
            ?>
</a> <?php 
            _e('Timed Out / Errored', 'mainwp');
            ?>
 (There was an error syncing some of your sites. <a href="http://docs.mainwp.com/sync-error/">Please check this help doc for possible solutions.</a>)</span>
                <?php 
        }
        ?>
            </p>
        </div>
    </div>
    <?php 
        $total_pluginsIgnored += count($pluginsIgnored_perSites);
        $total_themesIgnored += count($themesIgnored_perSites);
        $total_pluginsIgnoredAbandoned += count($pluginsIgnoredAbandoned_perSites);
        $total_themesIgnoredAbandoned += count($themesIgnoredAbandoned_perSites);
        //WP Upgrades part:
        $total_upgrades = $total_wp_upgrades + $total_plugin_upgrades + $total_theme_upgrades;
        ?>
    
    <div class="clear">
        <div class="mainwp-row-top">
            <span class="mainwp-left-col"><span class="mainwp-rightnow-number"><?php 
        echo $total_upgrades;
        ?>
</span> <?php 
        _e('Upgrade', 'mainwp');
        if ($total_upgrades != 1) {
            echo "s";
        }
        ?>
 <?php 
        _e('available', 'mainwp');
        ?>
</span>
            <span class="mainwp-mid-col">&nbsp;</span>
            <?php 
        if (mainwp_current_user_can("dashboard", "update_wordpress") && mainwp_current_user_can("dashboard", "update_plugins") && mainwp_current_user_can("dashboard", "update_themes")) {
            ?>
            <span class="mainwp-right-col"><?php 
            if ($total_upgrades == 0) {
                ?>
<a class="button" disabled="disabled"><?php 
                _e('Upgrade Everything', 'mainwp');
                ?>
</a><?php 
            } else {
                ?>
<a href="#" onClick="return rightnow_global_upgrade_all();" class="mainwp-upgrade-button button"><?php 
                _e('Upgrade Everything', 'mainwp');
                ?>
</a><?php 
            }
            ?>
</span>
            <?php 
        }
        ?>
        </div>
    </div>
    <div class="clear">        
        <div class="mainwp-row">
            <span class="mainwp-left-col"><span class="mainwp-rightnow-number"><?php 
        echo $total_wp_upgrades;
        ?>
</span> <?php 
        _e('WordPress upgrade', 'mainwp');
        if ($total_wp_upgrades != 1) {
            echo "s";
        }
        ?>
 <?php 
        _e('available', 'mainwp');
        ?>
</span>
            <span class="mainwp-mid-col">&nbsp;</span>
            <span class="mainwp-right-col">
                <a href="#" id="mainwp_upgrades_show" onClick="return rightnow_show('upgrades');"><i class="fa fa-eye-slash"></i> <?php 
        _e('Show', 'mainwp');
        ?>
</a>
                <?php 
        if (mainwp_current_user_can("dashboard", "update_wordpress")) {
            if ($total_wp_upgrades > 0) {
                ?>
                    &nbsp; <a href="#" onClick="return rightnow_wordpress_global_upgrade_all();" class="button-primary"><?php 
                echo _n('Upgrade', 'Upgrade All', $total_wp_upgrades, 'mainwp');
                ?>
</a>
                        <?php 
            } else {
                ?>
                    &nbsp; <a class="button" disabled="disabled"><?php 
                _e('No Upgrades', 'mainwp');
                ?>
</a> <?php 
            }
            ?>
 
                <?php 
        }
        ?>
            </span>
        </div>
        <div id="wp_upgrades" style="display: none">
            <?php 
        @MainWPDB::data_seek($websites, 0);
        while ($websites && ($website = @MainWPDB::fetch_object($websites))) {
            if ($website->is_ignoreCoreUpdates) {
                continue;
            }
            $wp_upgrades = json_decode(MainWPDB::Instance()->getWebsiteOption($website, 'wp_upgrades'), true);
            if (count($wp_upgrades) == 0 && $website->sync_errors == '') {
                continue;
            }
            ?>
                <div class="mainwp-row mainwp_wordpress_upgrade" site_id="<?php 
            echo $website->id;
            ?>
" site_name="<?php 
            echo rawurlencode($website->name);
            ?>
" updated="<?php 
            echo count($wp_upgrades) > 0 ? '0' : '1';
            ?>
">
                    <span class="mainwp-left-col"><a href="<?php 
            echo admin_url('admin.php?page=managesites&dashboard=' . $website->id);
            ?>
"><?php 
            echo stripslashes($website->name);
            ?>
</a><input type="hidden" id="wp_upgraded_<?php 
            echo $website->id;
            ?>
" value="<?php 
            if (count($wp_upgrades) > 0) {
                echo '0';
            } else {
                echo '1';
            }
            ?>
"/></span>
                    <span class="mainwp-mid-col wordpressInfo" id="wp_upgrade_<?php 
            echo $website->id;
            ?>
"><?php 
            if (count($wp_upgrades) > 0) {
                echo $wp_upgrades['current'] . " to " . $wp_upgrades['new'];
            } else {
                if ($website->sync_errors != '') {
                    echo __('Site Error - No update Information available', 'mainwp');
                } else {
                    echo __("Hooray, No Updates Available!", 'mainwp');
                }
            }
            ?>
</span>
                    <span class="mainwp-right-col wordpressAction"><div id="wp_upgradebuttons_<?php 
            echo $website->id;
            ?>
">
                        <?php 
            if (mainwp_current_user_can("dashboard", "update_wordpress")) {
                if (count($wp_upgrades) > 0) {
                    ?>
                                    <a href="#" class="mainwp-upgrade-button button" onClick="rightnow_upgrade(<?php 
                    echo $website->id;
                    ?>
)"><?php 
                    _e('Upgrade', 'mainwp');
                    ?>
</a>
                                <?php 
                }
            }
            ?>
   
                        &nbsp; <a href="<?php 
            echo $website->url;
            ?>
" target="_blank" class="mainwp-open-button button" ><?php 
            _e('Open', 'mainwp');
            ?>
</a></div></span>
                </div>
            <?php 
        }
        ?>
        </div>
    </div>

    <?php 
        //WP plugin upgrades!
        ?>
    <div class="clear">
        <div class="mainwp-row">
            <span class="mainwp-left-col"><span class="mainwp-rightnow-number"><?php 
        echo $total_plugin_upgrades;
        ?>
 </span> <?php 
        _e('Plugin upgrade', 'mainwp');
        if ($total_plugin_upgrades != 1) {
            ?>
s<?php 
        }
        ?>
 <?php 
        _e('available', 'mainwp');
        ?>
</span>
            <span class="mainwp-mid-col"><a href="<?php 
        echo admin_url('admin.php?page=PluginsIgnore');
        ?>
"><?php 
        _e('Ignored', 'mainwp');
        ?>
 (<?php 
        echo $total_pluginsIgnored;
        ?>
)</a></span>            
            <span class="mainwp-right-col"><a href="#" id="mainwp_plugin_upgrades_show" onClick="return rightnow_show('plugin_upgrades');"><i class="fa fa-eye-slash"></i> <?php 
        _e('Show', 'mainwp');
        ?>
</a> <?php 
        if (mainwp_current_user_can("dashboard", "update_plugins")) {
            if ($total_plugin_upgrades > 0 && $userExtension->site_view == 1) {
                ?>
&nbsp; <a href="#" onClick="return rightnow_plugins_global_upgrade_all();" class="button-primary"><?php 
                echo _n('Upgrade', 'Upgrade All', $total_plugin_upgrades, 'mainwp');
                ?>
</a><?php 
            } else {
                if ($total_plugin_upgrades > 0 && $userExtension->site_view == 0) {
                    ?>
&nbsp; <a href="#" onClick="return rightnow_plugins_global_upgrade_all();" class="button-primary"><?php 
                    echo _n('Upgrade', 'Upgrade All', $total_plugin_upgrades, 'mainwp');
                    ?>
</a><?php 
                } else {
                    ?>
 &nbsp; <a class="button" disabled="disabled"><?php 
                    _e('No Upgrades', 'mainwp');
                    ?>
</a> <?php 
                }
            }
        }
        ?>
</span>
            
        </div>
        <div id="wp_plugin_upgrades" style="display: none">
            <?php 
        if ($userExtension->site_view == 1) {
            @MainWPDB::data_seek($websites, 0);
            while ($websites && ($website = @MainWPDB::fetch_object($websites))) {
                if ($website->is_ignorePluginUpdates) {
                    continue;
                }
                $plugin_upgrades = json_decode($website->plugin_upgrades, true);
                $decodedPremiumUpgrades = json_decode(MainWPDB::Instance()->getWebsiteOption($website, 'premium_upgrades'), true);
                if (is_array($decodedPremiumUpgrades)) {
                    foreach ($decodedPremiumUpgrades as $crrSlug => $premiumUpgrade) {
                        $premiumUpgrade['premium'] = true;
                        if ($premiumUpgrade['type'] == 'plugin') {
                            if (!is_array($plugin_upgrades)) {
                                $plugin_upgrades = array();
                            }
                            $plugin_upgrades[$crrSlug] = $premiumUpgrade;
                        }
                    }
                }
                $ignored_plugins = json_decode($website->ignored_plugins, true);
                if (is_array($ignored_plugins)) {
                    $plugin_upgrades = array_diff_key($plugin_upgrades, $ignored_plugins);
                }
                $ignored_plugins = json_decode($userExtension->ignored_plugins, true);
                if (is_array($ignored_plugins)) {
                    $plugin_upgrades = array_diff_key($plugin_upgrades, $ignored_plugins);
                }
                if ($globalView) {
                    ?>
                <div class="mainwp-row">
                    <span class="mainwp-left-col"><a href="<?php 
                    echo admin_url('admin.php?page=managesites&dashboard=' . $website->id);
                    ?>
"><?php 
                    echo stripslashes($website->name);
                    ?>
</a><input type="hidden" id="wp_upgraded_plugin_<?php 
                    echo $website->id;
                    ?>
" value="<?php 
                    if (count($plugin_upgrades) > 0) {
                        echo '0';
                    } else {
                        echo '1';
                    }
                    ?>
"/></span>
                    <span class="mainwp-mid-col" id="wp_upgrade_plugin_<?php 
                    echo $website->id;
                    ?>
">
                        <?php 
                    if (count($plugin_upgrades) > 0) {
                        ?>
                            <a href="#" id="mainwp_plugin_upgrades_<?php 
                        echo $website->id;
                        ?>
_show" onClick="return rightnow_show('plugin_upgrades_<?php 
                        echo $website->id;
                        ?>
', true);"><i class="fa fa-eye-slash"></i> <?php 
                        echo count($plugin_upgrades);
                        ?>
 <?php 
                        _e('Upgrade', 'mainwp');
                        echo count($plugin_upgrades) > 1 ? 's' : '';
                        ?>
</a>
                        <?php 
                    } else {
                        if ($website->sync_errors != '') {
                            echo __('Site Error - No update Information available', 'mainwp');
                        } else {
                            echo __("Hooray, No Updates Available!", 'mainwp');
                        }
                    }
                    ?>
                    </span>
                    <span class="mainwp-right-col"><div id="wp_upgradebuttons_plugin_<?php 
                    echo $website->id;
                    ?>
">
                        <?php 
                    if (mainwp_current_user_can("dashboard", "update_plugins")) {
                        if (count($plugin_upgrades) > 0) {
                            ?>
                                    <a href="#" class="mainwp-upgrade-button button" onClick="return rightnow_upgrade_plugin_all(<?php 
                            echo $website->id;
                            ?>
)"><?php 
                            echo _n('Upgrade', 'Upgrade All', count($plugin_upgrades), 'mainwp');
                            ?>
</a> &nbsp;                                 
                            <?php 
                        }
                        ?>
                        <?php 
                    }
                    ?>
                            <a href="<?php 
                    echo $website->url;
                    ?>
" target="_blank" class="mainwp-open-button button"><?php 
                    _e('Open', 'mainwp');
                    ?>
</a>
                    </div></span>
                </div>
                <?php 
                }
                ?>
                <div id="wp_plugin_upgrades_<?php 
                echo $website->id;
                ?>
" site_id="<?php 
                echo $website->id;
                ?>
" site_name="<?php 
                echo rawurlencode($website->name);
                ?>
" <?php 
                if ($globalView) {
                    ?>
style="display: none"<?php 
                }
                ?>
>
                    <?php 
                foreach ($plugin_upgrades as $plugin_name => $plugin_upgrade) {
                    $plugin_name = urlencode($plugin_name);
                    ?>
                        <div class="mainwp-row" plugin_slug="<?php 
                    echo $plugin_name;
                    ?>
" premium="<?php 
                    echo isset($plugin_upgrade['premium']) ? $plugin_upgrade['premium'] : 0 ? 1 : 0;
                    ?>
" updated="0">
                                <span class="mainwp-left-col">
                                    <?php 
                    if ($globalView) {
                        ?>
&nbsp;&nbsp;&nbsp;<?php 
                    }
                    ?>
<a href="<?php 
                    echo admin_url() . 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_upgrade['update']['slug'] . '&url=' . (isset($plugin_upgrade['PluginURI']) ? rawurlencode($plugin_upgrade['PluginURI']) : '') . '&name=' . rawurlencode($plugin_upgrade['Name']) . '&TB_iframe=true&width=640&height=477';
                    ?>
" target="_blank"
                                                                                        class="thickbox" title="More information about <?php 
                    echo $plugin_upgrade['Name'];
                    ?>
"><?php 
                    echo $plugin_upgrade['Name'];
                    ?>
</a><input type="hidden" id="wp_upgraded_plugin_<?php 
                    echo $website->id;
                    ?>
_<?php 
                    echo $plugin_name;
                    ?>
" value="0"/></span>
                                <span class="mainwp-mid-col pluginsInfo" id="wp_upgrade_plugin_<?php 
                    echo $website->id;
                    ?>
_<?php 
                    echo $plugin_name;
                    ?>
"><?php 
                    echo $plugin_upgrade['Version'];
                    ?>
 to <?php 
                    echo $plugin_upgrade['update']['new_version'];
                    ?>
</span>
                                <span class="mainwp-right-col pluginsAction">
                                    <div id="wp_upgradebuttons_plugin_<?php 
                    echo $website->id;
                    ?>
_<?php 
                    echo $plugin_name;
                    ?>
">
                                    <?php 
                    if (mainwp_current_user_can("dashboard", "ignore_unignore_updates")) {
                        ?>
                                        <a href="#" onClick="return rightnow_plugins_ignore_detail('<?php 
                        echo $plugin_name;
                        ?>
', '<?php 
                        echo urlencode($plugin_upgrade['Name']);
                        ?>
', <?php 
                        echo $website->id;
                        ?>
)" class="button"><?php 
                        _e('Ignore', 'mainwp');
                        ?>
</a> 
                                    <?php 
                    }
                    ?>
                                    <?php 
                    if (mainwp_current_user_can("dashboard", "update_plugins")) {
                        ?>
                                         &nbsp;<a href="#" class="mainwp-upgrade-button button" onClick="return rightnow_upgrade_plugin(<?php 
                        echo $website->id;
                        ?>
, '<?php 
                        echo $plugin_name;
                        ?>
')"><?php 
                        _e('Upgrade', 'mainwp');
                        ?>
</a>
                                    <?php 
                    }
                    ?>
                                    </div>
                                </span>
                        </div>
                    <?php 
                }
                ?>
                </div>
                <?php 
            }
        } else {
            foreach ($allPlugins as $slug => $cnt) {
                $plugin_name = urlencode($slug);
                if ($globalView) {
                    ?>
                    <div class="mainwp-row">
                        <span class="mainwp-left-col">
                            <a href="<?php 
                    echo admin_url() . 'plugin-install.php?tab=plugin-information&plugin=' . $pluginsInfo[$slug]['slug'] . '&url=' . (isset($plugin_upgrade['PluginURI']) ? rawurlencode($plugin_upgrade['PluginURI']) : '') . '&name=' . rawurlencode($plugin_upgrade['Name']) . '&TB_iframe=true&width=640&height=477';
                    ?>
" target="_blank"
                                                                                                                        class="thickbox" title="More information about <?php 
                    echo $pluginsInfo[$slug]['name'];
                    ?>
">
                                <?php 
                    echo $pluginsInfo[$slug]['name'];
                    ?>
                            </a>
                        </span>
                        <span class="mainwp-mid-col">
                            <a href="#" onClick="return rightnow_plugins_detail('<?php 
                    echo $plugin_name;
                    ?>
');">
                                <i class="fa fa-eye-slash"></i> <?php 
                    echo $cnt;
                    ?>
 <?php 
                    _e('Upgrade', 'mainwp');
                    echo $cnt > 1 ? 's' : '';
                    ?>
                            </a>
                        </span>
                        <span class="mainwp-right-col">
                            <?php 
                    if (mainwp_current_user_can("dashboard", "ignore_unignore_updates")) {
                        ?>
                                <a href="#" class="button" onClick="return rightnow_plugins_ignore_all('<?php 
                        echo $plugin_name;
                        ?>
', '<?php 
                        echo urlencode($pluginsInfo[$slug]['name']);
                        ?>
')"><?php 
                        _e('Ignore Globally', 'mainwp');
                        ?>
</a>
                            <?php 
                    }
                    ?>
                            <?php 
                    if (mainwp_current_user_can("dashboard", "update_plugins")) {
                        ?>
                                &nbsp; <?php 
                        if ($cnt > 0) {
                            ?>
<a href="#" class="mainwp-upgrade-button button" onClick="return rightnow_plugins_upgrade_all('<?php 
                            echo $plugin_name;
                            ?>
', '<?php 
                            echo urlencode($pluginsInfo[$slug]['name']);
                            ?>
')"><?php 
                            echo _n('Upgrade', 'Upgrade All', $cnt, 'mainwp');
                            ?>
</a><?php 
                        } else {
                            ?>
 &nbsp; <a class="button" disabled="disabled"><?php 
                            _e('No Upgrades', 'mainwp');
                            ?>
</a> <?php 
                        }
                        ?>
                            
                            <?php 
                    }
                    ?>
                            
                        </span>
                    </div>
                    <?php 
                }
                ?>
                    <div plugin_slug="<?php 
                echo $plugin_name;
                ?>
" plugin_name="<?php 
                echo urlencode($pluginsInfo[$slug]['name']);
                ?>
" premium="<?php 
                echo $pluginsInfo[$slug]['premium'] ? 1 : 0;
                ?>
" <?php 
                if ($globalView) {
                    ?>
style="display: none"<?php 
                }
                ?>
>
                        <?php 
                @MainWPDB::data_seek($websites, 0);
                while ($websites && ($website = @MainWPDB::fetch_object($websites))) {
                    if ($website->is_ignorePluginUpdates) {
                        continue;
                    }
                    $plugin_upgrades = json_decode($website->plugin_upgrades, true);
                    $decodedPremiumUpgrades = json_decode(MainWPDB::Instance()->getWebsiteOption($website, 'premium_upgrades'), true);
                    if (is_array($decodedPremiumUpgrades)) {
                        foreach ($decodedPremiumUpgrades as $crrSlug => $premiumUpgrade) {
                            $premiumUpgrade['premium'] = true;
                            if ($premiumUpgrade['type'] == 'plugin') {
                                if (!is_array($plugin_upgrades)) {
                                    $plugin_upgrades = array();
                                }
                                $plugin_upgrades[$crrSlug] = $premiumUpgrade;
                            }
                        }
                    }
                    $ignored_plugins = json_decode($website->ignored_plugins, true);
                    if (is_array($ignored_plugins)) {
                        $plugin_upgrades = array_diff_key($plugin_upgrades, $ignored_plugins);
                    }
                    if (!isset($plugin_upgrades[$slug])) {
                        continue;
                    }
                    $plugin_upgrade = $plugin_upgrades[$slug];
                    ?>
                            <div class="mainwp-row" site_id="<?php 
                    echo $website->id;
                    ?>
" site_name="<?php 
                    echo rawurlencode($website->name);
                    ?>
" updated="0">
                                <span class="mainwp-left-col">
                                    <?php 
                    if ($globalView) {
                        ?>
                                    &nbsp;&nbsp;&nbsp;<a href="<?php 
                        echo admin_url('admin.php?page=managesites&dashboard=' . $website->id);
                        ?>
"><?php 
                        echo stripslashes($website->name);
                        ?>
</a>
                                    <?php 
                    } else {
                        ?>
                                        <a href="<?php 
                        echo admin_url() . 'plugin-install.php?tab=plugin-information&plugin=' . $pluginsInfo[$slug]['slug'] . '&TB_iframe=true&width=640&height=477';
                        ?>
" target="_blank"
                                                                                                                                    class="thickbox" title="More information about <?php 
                        echo $pluginsInfo[$slug]['name'];
                        ?>
">
                                            <?php 
                        echo $pluginsInfo[$slug]['name'];
                        ?>
                                        </a>
                                    <?php 
                    }
                    ?>
                                </span>
                                <span class="mainwp-mid-col pluginsInfo"><?php 
                    echo $plugin_upgrade['Version'];
                    ?>
 to <?php 
                    echo $plugin_upgrade['update']['new_version'];
                    ?>
</span>
                                <span class="mainwp-right-col pluginsAction">
                                    <?php 
                    if (mainwp_current_user_can("dashboard", "ignore_unignore_updates")) {
                        ?>
                                    <a href="#" class="button" onClick="return rightnow_plugins_ignore_detail('<?php 
                        echo $plugin_name;
                        ?>
', '<?php 
                        echo urlencode($plugin_upgrade['Name']);
                        ?>
', <?php 
                        echo $website->id;
                        ?>
)"><?php 
                        _e('Ignore', 'mainwp');
                        ?>
</a> 
                                    <?php 
                    }
                    ?>
                                    <?php 
                    if (mainwp_current_user_can("dashboard", "update_plugins")) {
                        ?>
                                    &nbsp; <a href="#" class="mainwp-upgrade-button button" onClick="return rightnow_plugins_upgrade('<?php 
                        echo $plugin_name;
                        ?>
', <?php 
                        echo $website->id;
                        ?>
)"><?php 
                        _e('Upgrade', 'mainwp');
                        ?>
</a>
                                    <?php 
                    }
                    ?>
                                </span>
                            </div>
                        <?php 
                }
                ?>
                    </div>
                    <?php 
            }
        }
        ?>
        </div>
    </div>
    
    <?php 
        //WP theme upgrades!
        ?>
    
    <div class="clear">
        <div class="mainwp-row">
            <span class="mainwp-left-col"><span class="mainwp-rightnow-number"><?php 
        echo $total_theme_upgrades;
        ?>
 </span> <?php 
        _e('Theme upgrade', 'mainwp');
        if ($total_theme_upgrades != 1) {
            ?>
s<?php 
        }
        ?>
 <?php 
        _e('available', 'mainwp');
        ?>
</span>
            <span class="mainwp-mid-col"><a href="<?php 
        echo admin_url('admin.php?page=ThemesIgnore');
        ?>
"><?php 
        _e('Ignored', 'mainwp');
        ?>
 (<?php 
        echo $total_themesIgnored;
        ?>
)</a></span>            
            <span class="mainwp-right-col"><a href="#" id="mainwp_theme_upgrades_show" onClick="return rightnow_show('theme_upgrades');"><i class="fa fa-eye-slash"></i> <?php 
        _e('Show', 'mainwp');
        ?>
</a> 
                <?php 
        if (mainwp_current_user_can("dashboard", "update_themes")) {
            ?>
                    <?php 
            if ($total_theme_upgrades > 0 && $userExtension->site_view == 1) {
                ?>
&nbsp; <a href="#" onClick="return rightnow_themes_global_upgrade_all();" class="button-primary"><?php 
                echo _n('Upgrade', 'Upgrade All', $total_theme_upgrades, 'mainwp');
                ?>
</a><?php 
            } else {
                if ($total_theme_upgrades > 0 && $userExtension->site_view == 0) {
                    ?>
&nbsp; <a href="#" onClick="return rightnow_themes_global_upgrade_all();" class="button-primary"><?php 
                    echo _n('Upgrade', 'Upgrade All', $total_theme_upgrades, 'mainwp');
                    ?>
</a><?php 
                } else {
                    ?>
 &nbsp; <a class="button" disabled="disabled"><?php 
                    _e('No Upgrades', 'mainwp');
                    ?>
</a> <?php 
                }
            }
            ?>
                <?php 
        }
        ?>
            </span>
                
        </div>
        <div id="wp_theme_upgrades" style="display: none">
            <?php 
        if ($userExtension->site_view == 1) {
            @MainWPDB::data_seek($websites, 0);
            while ($websites && ($website = @MainWPDB::fetch_object($websites))) {
                if ($website->is_ignoreThemeUpdates) {
                    continue;
                }
                $theme_upgrades = json_decode($website->theme_upgrades, true);
                $decodedPremiumUpgrades = json_decode(MainWPDB::Instance()->getWebsiteOption($website, 'premium_upgrades'), true);
                if (is_array($decodedPremiumUpgrades)) {
                    foreach ($decodedPremiumUpgrades as $crrSlug => $premiumUpgrade) {
                        $premiumUpgrade['premium'] = true;
                        if ($premiumUpgrade['type'] == 'theme') {
                            if (!is_array($theme_upgrades)) {
                                $theme_upgrades = array();
                            }
                            $theme_upgrades[$crrSlug] = $premiumUpgrade;
                        }
                    }
                }
                $ignored_themes = json_decode($website->ignored_themes, true);
                if (is_array($ignored_themes)) {
                    $theme_upgrades = array_diff_key($theme_upgrades, $ignored_themes);
                }
                $ignored_themes = json_decode($userExtension->ignored_themes, true);
                if (is_array($ignored_themes)) {
                    $theme_upgrades = array_diff_key($theme_upgrades, $ignored_themes);
                }
                if ($globalView) {
                    ?>
                <div class="mainwp-row">
                    <span class="mainwp-left-col"><a href="<?php 
                    echo admin_url('admin.php?page=managesites&dashboard=' . $website->id);
                    ?>
"><?php 
                    echo stripslashes($website->name);
                    ?>
</a><input type="hidden" id="wp_upgraded_theme_<?php 
                    echo $website->id;
                    ?>
" value="<?php 
                    if (count($theme_upgrades) > 0) {
                        echo '0';
                    } else {
                        echo '1';
                    }
                    ?>
"/></span>
                    <span class="mainwp-mid-col" id="wp_upgrade_theme_<?php 
                    echo $website->id;
                    ?>
">
                        <?php 
                    if (count($theme_upgrades) > 0) {
                        ?>
                            <a href="#" id="mainwp_theme_upgrades_<?php 
                        echo $website->id;
                        ?>
_show" onClick="return rightnow_show('theme_upgrades_<?php 
                        echo $website->id;
                        ?>
', true);"><i class="fa fa-eye-slash"></i> <?php 
                        echo count($theme_upgrades);
                        ?>
 <?php 
                        _e('Upgrade', 'mainwp');
                        echo count($theme_upgrades) > 1 ? 's' : '';
                        ?>
</a>
                        <?php 
                    } else {
                        if ($website->sync_errors != '') {
                            echo __('Site Error - No update Information available', 'mainwp');
                        } else {
                            echo __("Hooray, No Updates Available!", 'mainwp');
                        }
                    }
                    ?>
                    </span>
                    <span class="mainwp-right-col">
                        <div id="wp_upgradebuttons_theme_<?php 
                    echo $website->id;
                    ?>
"> 
                        <?php 
                    if (mainwp_current_user_can("dashboard", "update_themes")) {
                        ?>
                        <?php 
                        if (count($theme_upgrades) > 0) {
                            ?>
 
                            <a href="#" class="mainwp-upgrade-button button" onClick="return rightnow_upgrade_theme_all(<?php 
                            echo $website->id;
                            ?>
)"><?php 
                            echo _n('Upgrade', 'Upgrade All', count($theme_upgrades), 'mainwp');
                            ?>
</a> &nbsp; 
                                <?php 
                        }
                        ?>
                        <?php 
                    }
                    ?>
                            <a href="<?php 
                    echo $website->url;
                    ?>
" target="_blank" class="mainwp-open-button button"><?php 
                    _e('Open', 'mainwp');
                    ?>
</a>
                        </div>
                    </span>
                </div>
                <?php 
                }
                ?>
                <div id="wp_theme_upgrades_<?php 
                echo $website->id;
                ?>
" site_id="<?php 
                echo $website->id;
                ?>
" site_name="<?php 
                echo rawurlencode($website->name);
                ?>
" <?php 
                if ($globalView) {
                    ?>
style="display: none"<?php 
                }
                ?>
>
                    <?php 
                foreach ($theme_upgrades as $theme_name => $theme_upgrade) {
                    $theme_name = urlencode($theme_name);
                    ?>
                        <div class="mainwp-row" theme_slug="<?php 
                    echo $theme_name;
                    ?>
"  theme_name="<?php 
                    echo $theme_upgrade['Name'];
                    ?>
" premium="<?php 
                    echo isset($themesInfo[$theme_name]['premium']) && $themesInfo[$theme_name]['premium'] ? 1 : 0;
                    ?>
" updated="0">
                            <span class="mainwp-left-col"><?php 
                    if ($globalView) {
                        ?>
&nbsp;&nbsp;&nbsp;<?php 
                    }
                    echo $theme_upgrade['Name'];
                    ?>
<input type="hidden" id="wp_upgraded_theme_<?php 
                    echo $website->id;
                    ?>
_<?php 
                    echo $theme_name;
                    ?>
" value="0"/></span>
                            <span class="mainwp-mid-col pluginsInfo" id="wp_upgrade_theme_<?php 
                    echo $website->id;
                    ?>
_<?php 
                    echo $theme_name;
                    ?>
"><?php 
                    echo $theme_upgrade['Version'];
                    ?>
 to <?php 
                    echo $theme_upgrade['update']['new_version'];
                    ?>
</span>
                            <span class="mainwp-right-col pluginsAction">
                                <div id="wp_upgradebuttons_theme_<?php 
                    echo $website->id;
                    ?>
_<?php 
                    echo $theme_name;
                    ?>
">
                                    <?php 
                    if (mainwp_current_user_can("dashboard", "ignore_unignore_updates")) {
                        ?>
                                    <a href="#" class="button" onClick="return rightnow_themes_ignore_detail('<?php 
                        echo $theme_name;
                        ?>
', '<?php 
                        echo urlencode($theme_upgrade['Name']);
                        ?>
', <?php 
                        echo $website->id;
                        ?>
)"><?php 
                        _e('Ignore', 'mainwp');
                        ?>
</a>
                                     <?php 
                    }
                    ?>
                                    <?php 
                    if (mainwp_current_user_can("dashboard", "update_themes")) {
                        ?>
                                    &nbsp; <a href="#" class="mainwp-upgrade-button button" onClick="rightnow_upgrade_theme(<?php 
                        echo $website->id;
                        ?>
, '<?php 
                        echo $theme_name;
                        ?>
')"><?php 
                        _e('Upgrade', 'mainwp');
                        ?>
</a> 
                                    <?php 
                    }
                    ?>
                                </div>
                            </span>
                        </div>
                    <?php 
                }
                ?>
                </div>
                <?php 
            }
        } else {
            foreach ($allThemes as $slug => $cnt) {
                $theme_name = urlencode($slug);
                if ($globalView) {
                    ?>
                    <div class="mainwp-row">
                        <span class="mainwp-left-col">
                            <?php 
                    echo $themesInfo[$slug]['name'];
                    ?>
                        </span>
                        <span class="mainwp-mid-col">
                            <a href="#" onClick="return rightnow_themes_detail('<?php 
                    echo $theme_name;
                    ?>
');">
                                <i class="fa fa-eye-slash"></i> <?php 
                    echo $cnt;
                    ?>
 <?php 
                    _e('Upgrade', 'mainwp');
                    echo $cnt > 1 ? 's' : '';
                    ?>
                            </a>
                        </span>
                        <span class="mainwp-right-col">
                            <?php 
                    if (mainwp_current_user_can("dashboard", "ignore_unignore_updates")) {
                        ?>
                            <a href="#" class="button" onClick="return rightnow_themes_ignore_all('<?php 
                        echo $theme_name;
                        ?>
', '<?php 
                        echo urlencode($themesInfo[$slug]['name']);
                        ?>
')"><?php 
                        _e('Ignore Globally', 'mainwp');
                        ?>
</a>
                            <?php 
                    }
                    ?>
                            <?php 
                    if (mainwp_current_user_can("dashboard", "update_themes")) {
                        ?>
                            &nbsp; <?php 
                        if ($cnt > 0) {
                            ?>
<a href="#" class="mainwp-upgrade-button button" onClick="return rightnow_themes_upgrade_all('<?php 
                            echo $theme_name;
                            ?>
', '<?php 
                            echo urlencode($themesInfo[$slug]['name']);
                            ?>
')"><?php 
                            echo _n('Upgrade', 'Upgrade All', $cnt, 'mainwp');
                            ?>
</a><?php 
                        } else {
                            ?>
 &nbsp; <a class="button" disabled="disabled"><?php 
                            _e('No Upgrades', 'mainwp');
                            ?>
</a> <?php 
                        }
                        ?>
                            <?php 
                    }
                    ?>
                        </span>
                    </div>
                    <?php 
                }
                ?>
                    <div theme_slug="<?php 
                echo $theme_name;
                ?>
"  theme_name="<?php 
                echo urlencode($themesInfo[$slug]['name']);
                ?>
" premium="<?php 
                echo $themesInfo[$slug]['premium'] ? 1 : 0;
                ?>
" <?php 
                if ($globalView) {
                    ?>
style="display: none"<?php 
                }
                ?>
>
                        <?php 
                @MainWPDB::data_seek($websites, 0);
                while ($websites && ($website = @MainWPDB::fetch_object($websites))) {
                    if ($website->is_ignoreThemeUpdates) {
                        continue;
                    }
                    $theme_upgrades = json_decode($website->theme_upgrades, true);
                    $decodedPremiumUpgrades = json_decode(MainWPDB::Instance()->getWebsiteOption($website, 'premium_upgrades'), true);
                    if (is_array($decodedPremiumUpgrades)) {
                        foreach ($decodedPremiumUpgrades as $crrSlug => $premiumUpgrade) {
                            $premiumUpgrade['premium'] = true;
                            if ($premiumUpgrade['type'] == 'theme') {
                                if (!is_array($theme_upgrades)) {
                                    $theme_upgrades = array();
                                }
                                $theme_upgrades[$crrSlug] = $premiumUpgrade;
                            }
                        }
                    }
                    $ignored_themes = json_decode($website->ignored_themes, true);
                    if (is_array($ignored_themes)) {
                        $theme_upgrades = array_diff_key($theme_upgrades, $ignored_themes);
                    }
                    if (!isset($theme_upgrades[$slug])) {
                        continue;
                    }
                    $theme_upgrade = $theme_upgrades[$slug];
                    ?>
                            <div class="mainwp-row" site_id="<?php 
                    echo $website->id;
                    ?>
" site_name="<?php 
                    echo rawurlencode($website->name);
                    ?>
" updated="0">
                                <span class="mainwp-left-col">
                                    <?php 
                    if ($globalView) {
                        ?>
                                    &nbsp;&nbsp;&nbsp;<a href="<?php 
                        echo admin_url('admin.php?page=managesites&dashboard=' . $website->id);
                        ?>
"><?php 
                        echo stripslashes($website->name);
                        ?>
</a>
                                    <?php 
                    } else {
                        echo $themesInfo[$slug]['name'];
                    }
                    ?>
</span>
                                <span class="mainwp-mid-col pluginsInfo"><?php 
                    echo $theme_upgrade['Version'];
                    ?>
 to <?php 
                    echo $theme_upgrade['update']['new_version'];
                    ?>
</span>
                                <span class="mainwp-right-col pluginsAction">
                                    <?php 
                    if (mainwp_current_user_can("dashboard", "ignore_unignore_updates")) {
                        ?>
                                    <a href="#" class="button" onClick="return rightnow_themes_ignore_detail('<?php 
                        echo $theme_name;
                        ?>
', '<?php 
                        echo urlencode($theme_upgrade['Name']);
                        ?>
', <?php 
                        echo $website->id;
                        ?>
)"><?php 
                        _e('Ignore', 'mainwp');
                        ?>
</a>
                                     <?php 
                    }
                    ?>
                                    <?php 
                    if (mainwp_current_user_can("dashboard", "update_themes")) {
                        ?>
                                    &nbsp; <a href="#" class="mainwp-upgrade-button button" onClick="return rightnow_themes_upgrade('<?php 
                        echo $theme_name;
                        ?>
', <?php 
                        echo $website->id;
                        ?>
)"><?php 
                        _e('Upgrade', 'mainwp');
                        ?>
</a>
                                    <?php 
                    }
                    ?>
                                </span>
                            </div>
                        <?php 
                }
                ?>
                    </div>
                    <?php 
            }
        }
        ?>
        </div>
    </div>
    
     <?php 
        //WP plugin Abandoned!
        ?>
    <div class="clear">
        <div class="mainwp-row">
            <span class="mainwp-left-col"><span class="mainwp-rightnow-number"><?php 
        echo $total_plugins_outdate;
        ?>
 </span> <?php 
        _e('Plugin', 'mainwp');
        if ($total_plugins_outdate != 1) {
            echo 's';
        }
        ?>
 <?php 
        _e('Possibly Abandoned', 'mainwp');
        ?>
&nbsp;<?php 
        MainWPUtility::renderToolTip(__('This feature checks the last updated status of plugins and alerts you if not updated in a specific amount of time. This gives you insight on if a plugin may have been abandoned by the author.', 'mainwp'), 'http://docs.mainwp.com/what-does-possibly-abandoned-mean/', 'images/info.png', 'float: none !important;');
        ?>
</span>
            <span class="mainwp-mid-col"><a href="<?php 
        echo admin_url('admin.php?page=PluginsIgnoredAbandoned');
        ?>
"><?php 
        _e('Ignored', 'mainwp');
        ?>
 (<?php 
        echo $total_pluginsIgnoredAbandoned;
        ?>
)</a></span>            
            <span class="mainwp-right-col"><a href="#" id="mainwp_plugins_outdate_show" onClick="return rightnow_show('plugins_outdate');"><i class="fa fa-eye-slash"></i> <?php 
        _e('Show', 'mainwp');
        ?>
</a></span>
            
        </div>
        <div id="wp_plugins_outdate" style="display: none">
            <?php 
        $str_format = __("Last Updated %s Days Ago", "mainwp");
        if ($userExtension->site_view == 1) {
            @MainWPDB::data_seek($websites, 0);
            while ($websites && ($website = @MainWPDB::fetch_object($websites))) {
                $plugins_outdate = json_decode(MainWPDB::Instance()->getWebsiteOption($website, 'plugins_outdate_info'), true);
                if (!is_array($plugins_outdate)) {
                    $plugins_outdate = array();
                }
                if (count($plugins_outdate) > 0) {
                    $pluginsOutdateDismissed = json_decode(MainWPDB::Instance()->getWebsiteOption($website, 'plugins_outdate_dismissed'), true);
                    if (is_array($pluginsOutdateDismissed)) {
                        $plugins_outdate = array_diff_key($plugins_outdate, $pluginsOutdateDismissed);
                    }
                    if (is_array($decodedDismissedPlugins)) {
                        $plugins_outdate = array_diff_key($plugins_outdate, $decodedDismissedPlugins);
                    }
                }
                if ($globalView) {
                    ?>
                <div class="mainwp-row">
                    <span class="mainwp-left-col"><a href="<?php 
                    echo admin_url('admin.php?page=managesites&dashboard=' . $website->id);
                    ?>
"><?php 
                    echo stripslashes($website->name);
                    ?>
</a><input type="hidden" id="wp_upgraded_plugin_<?php 
                    echo $website->id;
                    ?>
" value="<?php 
                    if (count($plugins_outdate) > 0) {
                        echo '0';
                    } else {
                        echo '1';
                    }
                    ?>
"/></span>
                    <span class="mainwp-mid-col" id="wp_outdate_plugin_<?php 
                    echo $website->id;
                    ?>
">
                        <?php 
                    if (count($plugins_outdate) > 0) {
                        ?>
                            <a href="#" id="mainwp_plugins_outdate_<?php 
                        echo $website->id;
                        ?>
_show" onClick="return rightnow_show('plugins_outdate_<?php 
                        echo $website->id;
                        ?>
', true);"><i class="fa fa-eye-slash"></i> <?php 
                        echo count($plugins_outdate);
                        ?>
 <?php 
                        _e('Plugin', 'mainwp');
                        echo count($plugins_outdate) > 1 ? 's' : '';
                        ?>
</a>
                        <?php 
                    } else {
                        if ($website->sync_errors != '') {
                            echo __('Site Error - No update Information available', 'mainwp');
                        } else {
                            echo __("Hooray, No Abandoned Plugins!", 'mainwp');
                        }
                    }
                    ?>
                    </span>
                    <span class="mainwp-right-col"><div id="wp_upgradebuttons_plugin_<?php 
                    echo $website->id;
                    ?>
">                       
                        <a href="<?php 
                    echo $website->url;
                    ?>
" target="_blank" class="mainwp-open-button button"><?php 
                    _e('Open', 'mainwp');
                    ?>
</a>
                    </div></span>
                </div>
                <?php 
                }
                ?>
                <div id="wp_plugins_outdate_<?php 
                echo $website->id;
                ?>
" site_id="<?php 
                echo $website->id;
                ?>
" site_name="<?php 
                echo rawurlencode($website->name);
                ?>
" <?php 
                if ($globalView) {
                    ?>
style="display: none"<?php 
                }
                ?>
>
                    <?php 
                foreach ($plugins_outdate as $slug => $plugin_outdate) {
                    $plugin_name = urlencode($slug);
                    $now = new \DateTime();
                    $last_updated = $plugin_outdate['last_updated'];
                    $plugin_last_updated_date = new \DateTime('@' . $last_updated);
                    $diff_in_days = $now->diff($plugin_last_updated_date)->format('%a');
                    $outdate_notice = sprintf($str_format, $diff_in_days);
                    ?>
                        <div class="mainwp-row" plugin_outdate_slug="<?php 
                    echo $plugin_name;
                    ?>
" dismissed="0">
                                <span class="mainwp-left-col">
                                    <?php 
                    if ($globalView) {
                        ?>
&nbsp;&nbsp;&nbsp;<?php 
                    }
                    ?>
<a href="<?php 
                    echo admin_url() . 'plugin-install.php?tab=plugin-information&plugin=' . dirname($slug) . '&url=' . (isset($plugin_outdate['PluginURI']) ? rawurlencode($plugin_outdate['PluginURI']) : '') . '&name=' . rawurlencode($plugin_outdate['Name']) . '&TB_iframe=true&width=640&height=477';
                    ?>
" target="_blank"
                                                                                        class="thickbox" title="More information about <?php 
                    echo $plugin_outdate['Name'];
                    ?>
"><?php 
                    echo $plugin_outdate['Name'];
                    ?>
</a><input type="hidden" id="wp_dismissed_plugin_<?php 
                    echo $website->id;
                    ?>
_<?php 
                    echo $plugin_name;
                    ?>
" value="0"/></span>
                                <span class="mainwp-mid-col pluginsInfo" id="wp_outdate_plugin_<?php 
                    echo $website->id;
                    ?>
_<?php 
                    echo $plugin_name;
                    ?>
"><?php 
                    echo $plugin_outdate['Version'];
                    ?>
 | <?php 
                    echo $outdate_notice;
                    ?>
</span>
                                <span class="mainwp-right-col pluginsAction">
                                    <div id="wp_dismissbuttons_plugin_<?php 
                    echo $website->id;
                    ?>
_<?php 
                    echo $plugin_name;
                    ?>
">                                   
                                    <?php 
                    if (mainwp_current_user_can("dashboard", "ignore_unignore_updates")) {
                        ?>
                                         &nbsp;<a href="#" class="button" onClick="return rightnow_plugins_dismiss_outdate_detail('<?php 
                        echo $plugin_name;
                        ?>
', '<?php 
                        echo urlencode($plugin_outdate['Name']);
                        ?>
', <?php 
                        echo $website->id;
                        ?>
)"><?php 
                        _e('Ignore', 'mainwp');
                        ?>
</a>
                                    <?php 
                    }
                    ?>
                                    </div>
                                </span>
                        </div>
                    <?php 
                }
                ?>
                </div>
                <?php 
            }
        } else {
            foreach ($allPluginsOutdate as $slug => $cnt) {
                $plugin_name = urlencode($slug);
                if ($globalView) {
                    ?>
                    <div class="mainwp-row">
                        <span class="mainwp-left-col">
                            <a href="<?php 
                    echo admin_url() . 'plugin-install.php?tab=plugin-information&plugin=' . dirname($slug) . '&url=' . (isset($plugin_outdate['PluginURI']) ? rawurlencode($plugin_outdate['PluginURI']) : '') . '&name=' . rawurlencode($plugin_outdate['Name']) . '&TB_iframe=true&width=640&height=477';
                    ?>
" target="_blank"
                                                                                                                        class="thickbox" title="More information about <?php 
                    echo $pluginsOutdateInfo[$slug]['Name'];
                    ?>
">
                                <?php 
                    echo $pluginsOutdateInfo[$slug]['Name'];
                    ?>
                            </a>
                        </span>
                        <span class="mainwp-mid-col">
                            <a href="#" onClick="return rightnow_plugins_outdate_detail('<?php 
                    echo $plugin_name;
                    ?>
');">
                                <i class="fa fa-eye-slash"></i> <?php 
                    echo $cnt;
                    ?>
 <?php 
                    _e('Plugin', 'mainwp');
                    echo $cnt != 1 ? 's' : '';
                    ?>
                            </a>
                        </span>
                        <span class="mainwp-right-col"> 
                             <?php 
                    if (mainwp_current_user_can("dashboard", "ignore_unignore_updates")) {
                        ?>
                                <a href="#" class="button" onClick="return rightnow_plugins_abandoned_ignore_all('<?php 
                        echo $plugin_name;
                        ?>
', '<?php 
                        echo urlencode($pluginsOutdateInfo[$slug]['Name']);
                        ?>
')"><?php 
                        _e('Ignore Globally', 'mainwp');
                        ?>
</a>
                            <?php 
                    }
                    ?>
                                                        
                        </span>
                    </div>
                    <?php 
                }
                ?>
                    <div plugin_outdate_slug="<?php 
                echo $plugin_name;
                ?>
" plugin_name="<?php 
                echo urlencode($pluginsOutdateInfo[$slug]['Name']);
                ?>
" <?php 
                if ($globalView) {
                    ?>
style="display: none"<?php 
                }
                ?>
>
                        <?php 
                @MainWPDB::data_seek($websites, 0);
                while ($websites && ($website = @MainWPDB::fetch_object($websites))) {
                    $plugins_outdate = json_decode(MainWPDB::Instance()->getWebsiteOption($website, 'plugins_outdate_info'), true);
                    if (!is_array($plugins_outdate)) {
                        $plugins_outdate = array();
                    }
                    if (count($plugins_outdate) > 0) {
                        $pluginsOutdateDismissed = json_decode(MainWPDB::Instance()->getWebsiteOption($website, 'plugins_outdate_dismissed'), true);
                        if (is_array($pluginsOutdateDismissed)) {
                            $plugins_outdate = array_diff_key($plugins_outdate, $pluginsOutdateDismissed);
                        }
                        if (is_array($decodedDismissedPlugins)) {
                            $plugins_outdate = array_diff_key($plugins_outdate, $decodedDismissedPlugins);
                        }
                    }
                    if (!isset($plugins_outdate[$slug])) {
                        continue;
                    }
                    $plugin_outdate = $plugins_outdate[$slug];
                    $now = new \DateTime();
                    $last_updated = $plugin_outdate['last_updated'];
                    $plugin_last_updated_date = new \DateTime('@' . $last_updated);
                    $diff_in_days = $now->diff($plugin_last_updated_date)->format('%a');
                    $outdate_notice = sprintf($str_format, $diff_in_days);
                    ?>
                            <div class="mainwp-row" site_id="<?php 
                    echo $website->id;
                    ?>
" site_name="<?php 
                    echo rawurlencode($website->name);
                    ?>
" outdate="1">
                                <span class="mainwp-left-col">
                                    <?php 
                    if ($globalView) {
                        ?>
                                    &nbsp;&nbsp;&nbsp;<a href="<?php 
                        echo admin_url('admin.php?page=managesites&dashboard=' . $website->id);
                        ?>
"><?php 
                        echo stripslashes($website->name);
                        ?>
</a>
                                    <?php 
                    } else {
                        ?>
                                        <a href="<?php 
                        echo admin_url() . 'plugin-install.php?tab=plugin-information&plugin=' . dirname($slug) . '&TB_iframe=true&width=640&height=477';
                        ?>
" target="_blank"
                                                                                                                                    class="thickbox" title="More information about <?php 
                        echo $pluginsOutdateInfo[$slug]['Name'];
                        ?>
">
                                            <?php 
                        echo $pluginsOutdateInfo[$slug]['Name'];
                        ?>
                                        </a>
                                    <?php 
                    }
                    ?>
                                </span>
                                <span class="mainwp-mid-col pluginsInfo" id="wp_outdate_plugin_<?php 
                    echo $website->id;
                    ?>
_<?php 
                    echo $plugin_name;
                    ?>
"><?php 
                    echo $plugin_outdate['Version'];
                    ?>
 | <?php 
                    echo $outdate_notice;
                    ?>
</span>
                                <span class="mainwp-right-col pluginsAction">                                    
                                    <?php 
                    if (mainwp_current_user_can("dashboard", "ignore_unignore_updates")) {
                        ?>
                                    &nbsp; <a href="#" class="button" onClick="return rightnow_plugins_dismiss_outdate_detail('<?php 
                        echo $plugin_name;
                        ?>
',  '<?php 
                        echo urlencode($plugin_outdate['Name']);
                        ?>
', <?php 
                        echo $website->id;
                        ?>
)"><?php 
                        _e('Ignore', 'mainwp');
                        ?>
</a>
                                    <?php 
                    }
                    ?>
                                </span>
                            </div>
                        <?php 
                }
                ?>
                    </div>
                    <?php 
            }
        }
        ?>
        </div>
    </div>
    
    
       <?php 
        //WP theme Abandoned!
        ?>
    <div class="clear">
        <div class="mainwp-row">
            <span class="mainwp-left-col"><span class="mainwp-rightnow-number"><?php 
        echo $total_themes_outdate;
        ?>
 </span> <?php 
        _e('Theme', 'mainwp');
        if ($total_themes_outdate != 1) {
            echo 's';
        }
        ?>
 <?php 
        _e('Possibly Abandoned', 'mainwp');
        ?>
&nbsp;<?php 
        MainWPUtility::renderToolTip(__('This feature checks the last updated status of themes and alerts you if not updated in a specific amount of time. This gives you insight on if a theme may have been abandoned by the author.', 'mainwp'), 'http://docs.mainwp.com/what-does-possibly-abandoned-mean/', 'images/info.png', 'float: none !important;');
        ?>
</span>
            <span class="mainwp-mid-col"><a href="<?php 
        echo admin_url('admin.php?page=ThemesIgnoredAbandoned');
        ?>
"><?php 
        _e('Ignored', 'mainwp');
        ?>
 (<?php 
        echo $total_themesIgnoredAbandoned;
        ?>
)</a></span>            
            <span class="mainwp-right-col"><a href="#" id="mainwp_themes_outdate_show" onClick="return rightnow_show('themes_outdate');"><i class="fa fa-eye-slash"></i> <?php 
        _e('Show', 'mainwp');
        ?>
</a></span>
            
        </div>
        <div id="wp_themes_outdate" style="display: none">
            <?php 
        if ($userExtension->site_view == 1) {
            @MainWPDB::data_seek($websites, 0);
            while ($websites && ($website = @MainWPDB::fetch_object($websites))) {
                $themes_outdate = json_decode(MainWPDB::Instance()->getWebsiteOption($website, 'themes_outdate_info'), true);
                if (!is_array($themes_outdate)) {
                    $themes_outdate = array();
                }
                if (count($themes_outdate) > 0) {
                    $themesOutdateDismissed = json_decode(MainWPDB::Instance()->getWebsiteOption($website, 'themes_outdate_dismissed'), true);
                    if (is_array($themesOutdateDismissed)) {
                        $themes_outdate = array_diff_key($themes_outdate, $themesOutdateDismissed);
                    }
                    if (is_array($decodedDismissedThemes)) {
                        $themes_outdate = array_diff_key($themes_outdate, $decodedDismissedThemes);
                    }
                }
                if ($globalView) {
                    ?>
                <div class="mainwp-row">
                    <span class="mainwp-left-col"><a href="<?php 
                    echo admin_url('admin.php?page=managesites&dashboard=' . $website->id);
                    ?>
"><?php 
                    echo stripslashes($website->name);
                    ?>
</a><input type="hidden" id="wp_upgraded_theme_<?php 
                    echo $website->id;
                    ?>
" value="<?php 
                    if (count($themes_outdate) > 0) {
                        echo '0';
                    } else {
                        echo '1';
                    }
                    ?>
"/></span>
                    <span class="mainwp-mid-col" id="wp_outdate_theme_<?php 
                    echo $website->id;
                    ?>
">
                        <?php 
                    if (count($themes_outdate) > 0) {
                        ?>
                            <a href="#" id="mainwp_themes_outdate_<?php 
                        echo $website->id;
                        ?>
_show" onClick="return rightnow_show('themes_outdate_<?php 
                        echo $website->id;
                        ?>
', true);"><i class="fa fa-eye-slash"></i> <?php 
                        echo count($themes_outdate);
                        ?>
 <?php 
                        _e('Theme', 'mainwp');
                        echo count($themes_outdate) > 1 ? 's' : '';
                        ?>
</a>
                        <?php 
                    } else {
                        if ($website->sync_errors != '') {
                            echo __('Site Error - No update Information available', 'mainwp');
                        } else {
                            echo __("Hooray, No Abandoned Themes!", 'mainwp');
                        }
                    }
                    ?>
                    </span>
                    <span class="mainwp-right-col"><div id="wp_upgradebuttons_theme_<?php 
                    echo $website->id;
                    ?>
">                       
                        <a href="<?php 
                    echo $website->url;
                    ?>
" target="_blank" class="mainwp-open-button button"><?php 
                    _e('Open', 'mainwp');
                    ?>
</a>
                    </div></span>
                </div>
                <?php 
                }
                ?>
                <div id="wp_themes_outdate_<?php 
                echo $website->id;
                ?>
" site_id="<?php 
                echo $website->id;
                ?>
" site_name="<?php 
                echo rawurlencode($website->name);
                ?>
" <?php 
                if ($globalView) {
                    ?>
style="display: none"<?php 
                }
                ?>
>
                    <?php 
                foreach ($themes_outdate as $slug => $theme_outdate) {
                    $slug = urlencode($slug);
                    $now = new \DateTime();
                    $last_updated = $theme_outdate['last_updated'];
                    $theme_last_updated_date = new \DateTime('@' . $last_updated);
                    $diff_in_days = $now->diff($theme_last_updated_date)->format('%a');
                    $outdate_notice = sprintf($str_format, $diff_in_days);
                    ?>
                        <div class="mainwp-row" theme_outdate_slug="<?php 
                    echo $slug;
                    ?>
" dismissed="0">
                                <span class="mainwp-left-col">
                                    <?php 
                    if ($globalView) {
                        ?>
&nbsp;&nbsp;&nbsp;<?php 
                    }
                    echo $theme_outdate['Name'];
                    ?>
<input type="hidden" id="wp_dismissed_theme_<?php 
                    echo $website->id;
                    ?>
_<?php 
                    echo $slug;
                    ?>
" value="0"/></span>
                                <span class="mainwp-mid-col pluginsInfo" id="wp_outdate_theme_<?php 
                    echo $website->id;
                    ?>
_<?php 
                    echo $slug;
                    ?>
"><?php 
                    echo $theme_outdate['Version'];
                    ?>
 | <?php 
                    echo $outdate_notice;
                    ?>
</span>
                                <span class="mainwp-right-col pluginsAction">
                                    <div id="wp_dismissbuttons_theme_<?php 
                    echo $website->id;
                    ?>
_<?php 
                    echo $slug;
                    ?>
">                                   
                                    <?php 
                    if (mainwp_current_user_can("dashboard", "ignore_unignore_updates")) {
                        ?>
                                         &nbsp;<a href="#" class="button" onClick="return rightnow_themes_dismiss_outdate_detail('<?php 
                        echo $slug;
                        ?>
', '<?php 
                        echo urlencode($theme_outdate['Name']);
                        ?>
', <?php 
                        echo $website->id;
                        ?>
)"><?php 
                        _e('Ignore', 'mainwp');
                        ?>
</a>
                                    <?php 
                    }
                    ?>
                                    </div>
                                </span>
                        </div>
                    <?php 
                }
                ?>
                </div>
                <?php 
            }
        } else {
            foreach ($allThemesOutdate as $slug => $cnt) {
                $slug = urlencode($slug);
                if ($globalView) {
                    ?>
                    <div class="mainwp-row">
                        <span class="mainwp-left-col">
                                <?php 
                    echo $themesOutdateInfo[$slug]['name'];
                    ?>
                        </span>
                        <span class="mainwp-mid-col">
                            <a href="#" onClick="return rightnow_themes_outdate_detail('<?php 
                    echo $slug;
                    ?>
');">
                                <i class="fa fa-eye-slash"></i> <?php 
                    echo $cnt;
                    ?>
 <?php 
                    _e('Theme', 'mainwp');
                    echo $cnt != 1 ? 's' : '';
                    ?>
                            </a>
                        </span>
                        <span class="mainwp-right-col"> 
                             <?php 
                    if (mainwp_current_user_can("dashboard", "ignore_unignore_updates")) {
                        ?>
                                <a href="#" class="button" onClick="return rightnow_themes_abandoned_ignore_all('<?php 
                        echo $slug;
                        ?>
', '<?php 
                        echo urlencode($themesOutdateInfo[$slug]['name']);
                        ?>
')"><?php 
                        _e('Ignore Globally', 'mainwp');
                        ?>
</a>
                            <?php 
                    }
                    ?>
                                                        
                        </span>
                    </div>
                    <?php 
                }
                ?>
                    <div theme_outdate_slug="<?php 
                echo $slug;
                ?>
" theme_name="<?php 
                echo urlencode($themesOutdateInfo[$slug]['name']);
                ?>
" <?php 
                if ($globalView) {
                    ?>
style="display: none"<?php 
                }
                ?>
>
                        <?php 
                @MainWPDB::data_seek($websites, 0);
                while ($websites && ($website = @MainWPDB::fetch_object($websites))) {
                    $themes_outdate = json_decode(MainWPDB::Instance()->getWebsiteOption($website, 'themes_outdate_info'), true);
                    if (!is_array($themes_outdate)) {
                        $themes_outdate = array();
                    }
                    if (count($themes_outdate) > 0) {
                        $themesOutdateDismissed = json_decode(MainWPDB::Instance()->getWebsiteOption($website, 'themes_outdate_dismissed'), true);
                        if (is_array($themesOutdateDismissed)) {
                            $themes_outdate = array_diff_key($themes_outdate, $themesOutdateDismissed);
                        }
                        if (is_array($decodedDismissedThemes)) {
                            $themes_outdate = array_diff_key($themes_outdate, $decodedDismissedThemes);
                        }
                    }
                    if (!isset($themes_outdate[$slug])) {
                        continue;
                    }
                    $theme_outdate = $themes_outdate[$slug];
                    $now = new \DateTime();
                    $last_updated = $theme_outdate['last_updated'];
                    $theme_last_updated_date = new \DateTime('@' . $last_updated);
                    $diff_in_days = $now->diff($theme_last_updated_date)->format('%a');
                    $outdate_notice = sprintf($str_format, $diff_in_days);
                    ?>
                            <div class="mainwp-row" site_id="<?php 
                    echo $website->id;
                    ?>
" site_name="<?php 
                    echo rawurlencode($website->name);
                    ?>
" outdate="1">
                                <span class="mainwp-left-col">
                                    <?php 
                    if ($globalView) {
                        ?>
                                    &nbsp;&nbsp;&nbsp;<a href="<?php 
                        echo admin_url('admin.php?page=managesites&dashboard=' . $website->id);
                        ?>
"><?php 
                        echo stripslashes($website->name);
                        ?>
</a>
                                    <?php 
                    } else {
                        ?>
                                            <?php 
                        echo $themesOutdateInfo[$slug]['name'];
                        ?>
                                    <?php 
                    }
                    ?>
                                </span>
                                <span class="mainwp-mid-col pluginsInfo" id="wp_outdate_theme_<?php 
                    echo $website->id;
                    ?>
_<?php 
                    echo $slug;
                    ?>
"><?php 
                    echo $theme_outdate['Version'];
                    ?>
 | <?php 
                    echo $outdate_notice;
                    ?>
</span>
                                <span class="mainwp-right-col pluginsAction">                                    
                                    <?php 
                    if (mainwp_current_user_can("dashboard", "ignore_unignore_updates")) {
                        ?>
                                    &nbsp; <a href="#" class="button" onClick="return rightnow_themes_dismiss_outdate_detail('<?php 
                        echo $slug;
                        ?>
',  '<?php 
                        echo urlencode($themesOutdateInfo[$slug]['name']);
                        ?>
', <?php 
                        echo $website->id;
                        ?>
)"><?php 
                        _e('Ignore', 'mainwp');
                        ?>
</a>
                                    <?php 
                    }
                    ?>
                                </span>
                            </div>
                        <?php 
                }
                ?>
                    </div>
                    <?php 
            }
        }
        ?>
        </div>
    </div>
    
    <?php 
        //Sync errors!
        if ($total_sync_errors > 0) {
            ?>
        <div class="clear">
            <div class="mainwp-row">
                <span class="mainwp-left-col"><span class="mainwp-rightnow-number"><?php 
            echo $total_sync_errors;
            ?>
</span> Error<?php 
            if ($total_sync_errors > 1) {
                ?>
s<?php 
            }
            ?>
</span>
                <span class="mainwp-mid-col">&nbsp;</span>
                <span class="mainwp-right-col"><a href="#" id="mainwp_errors_show" onClick="return rightnow_show('errors');"><i class="fa fa-eye-slash"></i> <?php 
            _e('Show', 'mainwp');
            ?>
</a></span>
            </div>
            <div id="wp_errors" style="display: none">
                <?php 
            @MainWPDB::data_seek($websites, 0);
            while ($websites && ($website = @MainWPDB::fetch_object($websites))) {
                if ($website->sync_errors == '') {
                    continue;
                }
                ?>
                <div class="mainwp-row">
                    <span class="mainwp-left-col"><a href="<?php 
                echo admin_url('admin.php?page=managesites&dashboard=' . $website->id);
                ?>
"><?php 
                echo stripslashes($website->name);
                ?>
</a></span>
                    <span class="mainwp-mid-col"><?php 
                echo $website->sync_errors;
                ?>
</span>
                    <span class="mainwp-right-col"><a href="#" class="mainwp_rightnow_site_reconnect" siteid="<?php 
                echo $website->id;
                ?>
"><?php 
                _e('Reconnect', 'mainwp');
                ?>
</a> | <a href="<?php 
                echo $website->url;
                ?>
" target="_blank"><?php 
                _e('Open', 'mainwp');
                ?>
</a></span>
                </div>
                <?php 
            }
            ?>
            </div>
        </div>
        <?php 
        }
        ?>

    <?php 
        //Good - some are up to date!
        if ($total_uptodate > 0) {
            ?>
        <div class="clear">
            <div class="mainwp-row">
                <span class="mainwp-left-col"><span class="mainwp-rightnow-number"><?php 
            echo $total_uptodate;
            ?>
</span> <?php 
            _e('Up to date', 'mainwp');
            ?>
</span>
                <span class="mainwp-mid-col">&nbsp;</span>
                <span class="mainwp-right-col"><a href="#" id="mainwp_uptodate_show" onClick="return rightnow_show('uptodate');"><i class="fa fa-eye-slash"></i> <?php 
            _e('Show', 'mainwp');
            ?>
</a></span>
            </div>
            <div id="wp_uptodate" style="display: none">
                <?php 
            @MainWPDB::data_seek($websites, 0);
            while ($websites && ($website = @MainWPDB::fetch_object($websites))) {
                if ($website->uptodate != 1) {
                    continue;
                }
                ?>
                <div class="mainwp-row">
                    <span class="mainwp-left-col"><a href="<?php 
                echo admin_url('admin.php?page=managesites&dashboard=' . $website->id);
                ?>
"><?php 
                echo stripslashes($website->name);
                ?>
</a></span>
                    <span class="mainwp-mid-col">&nbsp;</span>
                    <span class="mainwp-right-col"><a href="<?php 
                echo $website->url;
                ?>
" target="_blank"><?php 
                _e('Open', 'mainwp');
                ?>
</a></span>
                </div>
                <?php 
            }
            ?>
            </div>
        </div>
        <?php 
        }
        ?>
    
        <?php 
        @MainWPDB::data_seek($websites, 0);
        $site_ids = array();
        while ($websites && ($website = @MainWPDB::fetch_object($websites))) {
            $site_ids[] = $website->id;
        }
        do_action('mainwp_rightnow_widget_bottom', $site_ids, $globalView);
        ?>
        <div class="clear">
            <div class="mainwp-row">
                <span class="mainwp-left-col"><span class="mainwp-rightnow-number">
                    <img class="down-img" style="margin-bottom: -3px;" title="<?php 
        echo $total_sync_errors > 0 ? 'Site Disconnected' : ($total_conflict > 0 ? 'Plugin or Theme Conflict Found' : ($total_offline > 0 ? 'Site is Offline' : 'Site is Online'));
        ?>
" alt="<?php 
        echo $total_sync_errors > 0 ? 'Sync errors' : ($total_conflict > 0 ? 'Conflict Found' : ($total_offline > 0 ? 'Site Down' : 'Site Up'));
        ?>
" src="<?php 
        echo plugins_url('images/' . ($total_sync_errors > 0 ? 'disconnected' : ($total_conflict > 0 ? 'conflict' : ($total_offline > 0 ? 'down' : 'up'))) . '.png', dirname(__FILE__));
        ?>
" /></span> <span style="font-size: 18px !important;"><?php 
        _e('Status', 'mainwp');
        ?>
</span></span>
                <span class="mainwp-mid-col">&nbsp;</span>
                <span class="mainwp-right-col"><a href="#" id="mainwp_status_show" onClick="return rightnow_show('status');"><i class="fa fa-eye-slash"></i> <?php 
        _e('Show', 'mainwp');
        ?>
</a></span>
            </div>
            <div id="wp_status" style="display: none">
                <?php 
        //Loop 3 times, first we show the conflicts, then we show the down sites, then we show the up sites
        $SYNCERRORS = 0;
        $CONFLICTS = 1;
        $DOWN = 2;
        $UP = 3;
        for ($j = 0; $j <= 3; $j++) {
            @MainWPDB::data_seek($websites, 0);
            while ($websites && ($website = @MainWPDB::fetch_object($websites))) {
                $pluginConflicts = json_decode($website->pluginConflicts, true);
                $themeConflicts = json_decode($website->themeConflicts, true);
                $ignoredPluginConflicts = json_decode($website->ignored_pluginConflicts, true);
                if (!is_array($ignoredPluginConflicts)) {
                    $ignoredPluginConflicts = array();
                }
                $ignoredThemeConflicts = json_decode($website->ignored_themeConflicts, true);
                if (!is_array($ignoredThemeConflicts)) {
                    $ignoredThemeConflicts = array();
                }
                $hasSyncErrors = $website->sync_errors != '';
                $isConflict = false;
                if (!$hasSyncErrors) {
                    if (count($pluginConflicts) > 0) {
                        foreach ($pluginConflicts as $pluginConflict) {
                            if (!in_array($pluginConflict, $ignoredPluginConflicts) && !in_array($pluginConflict, $globalIgnoredPluginConflicts)) {
                                $isConflict = true;
                            }
                        }
                    }
                    if (!$isConflict && count($themeConflicts) > 0) {
                        foreach ($themeConflicts as $themeConflict) {
                            if (!in_array($themeConflict, $ignoredThemeConflicts) && !in_array($themeConflict, $globalIgnoredThemeConflicts)) {
                                $isConflict = true;
                            }
                        }
                    }
                }
                $isDown = !$hasSyncErrors && !$isConflict && $website->offline_check_result == -1;
                $isUp = !$hasSyncErrors && !$isConflict && !$isDown;
                if ($j == $SYNCERRORS && !$hasSyncErrors) {
                    continue;
                }
                if ($j == $CONFLICTS && !$isConflict) {
                    continue;
                }
                if ($j == $DOWN && !$isDown) {
                    continue;
                }
                if ($j == $UP && !$isUp) {
                    continue;
                }
                ?>
                    <div class="mainwp-row">
                        <span class="mainwp-left-col"><a href="<?php 
                echo admin_url('admin.php?page=managesites&dashboard=' . $website->id);
                ?>
"><?php 
                echo stripslashes($website->name);
                ?>
</a></span>
                        <span class="mainwp-mid-col">&nbsp;
                            <?php 
                if ($isConflict) {
                    ?>
<span class="mainwp_status_conflict"><?php 
                    _e('Conflict Found', 'mainwp');
                    ?>
</span> <?php 
                }
                ?>
                        </span>
                        <span class="mainwp-right-col">
                            <?php 
                if ($hasSyncErrors) {
                    ?>
                                    <div style="position: absolute; padding-right: 10px; right: 50px;"><a href="#" class="mainwp_rightnow_site_reconnect" siteid="<?php 
                    echo $website->id;
                    ?>
"><?php 
                    _e('Reconnect', 'mainwp');
                    ?>
</a><br /></div> <img class="down-img" title="Site Disconnected" alt="Sync Errors" src="<?php 
                    echo plugins_url('images/disconnected.png', dirname(__FILE__));
                    ?>
" />
                                    <?php 
                } else {
                    if ($isConflict) {
                        ?>
                                    <img class="down-img" title="Plugin or Theme Conflict Found" alt="Conflict Found" src="<?php 
                        echo plugins_url('images/conflict.png', dirname(__FILE__));
                        ?>
" />
                                    <?php 
                    } else {
                        if ($isDown) {
                            ?>
                                    <img class="down-img" title="Site is Offline" alt="Site Down" src="<?php 
                            echo plugins_url('images/down.png', dirname(__FILE__));
                            ?>
" />
                                    <?php 
                        } else {
                            ?>
                                    <img class="down-img" title="Site is Online" alt="Site Up" src="<?php 
                            echo plugins_url('images/up.png', dirname(__FILE__));
                            ?>
" />
                                    <?php 
                        }
                    }
                }
                ?>
                        </span>
                    </div>
                    <?php 
            }
        }
        ?>
            </div>
        </div>   
    
    <div class="clear"></div>

    <div id="rightnow-upgrade-status-box" title="Upgrade" style="display: none; text-align: center">
        <div id="rightnow-upgrade-status-progress"></div>
        <span id="rightnow-upgrade-status-current">0</span> / <span id="rightnow-upgrade-status-total"></span> <?php 
        _e('upgraded', 'mainwp');
        ?>
        <div style="height: 160px; overflow: auto; margin-top: 20px; margin-bottom: 10px; text-align: left">
            <table style="width: 100%" id="rightnow-upgrade-list">
            </table>
        </div>
        <input id="rightnow-upgrade-status-close" type="button" name="Close" value="<?php 
        _e('Close', 'mainwp');
        ?>
" class="button" />
    </div>

    <div id="rightnow-backup-box" title="Full backup required" style="display: none; text-align: center">
        <div style="height: 190px; overflow: auto; margin-top: 20px; margin-bottom: 10px; text-align: left" id="rightnow-backup-content">
        </div>
        <input id="rightnow-backup-all" type="button" name="Backup All" value="<?php 
        _e('Backup All', 'mainwp');
        ?>
" class="button-primary" />
        <input id="rightnow-backup-ignore" type="button" name="Ignore" value="<?php 
        _e('Ignore', 'mainwp');
        ?>
" class="button" />
    </div>

    <div id="rightnow-backupnow-box" title="Full backup" style="display: none; text-align: center">
        <div style="height: 190px; overflow: auto; margin-top: 20px; margin-bottom: 10px; text-align: left" id="rightnow-backupnow-content">
        </div>
        <input id="rightnow-backupnow-close" type="button" name="Ignore" value="<?php 
        _e('Cancel', 'mainwp');
        ?>
" class="button" />
    </div>

    <?php 
        @MainWPDB::free_result($websites);
    }
Пример #7
0
    public static function renderNewEdit($task)
    {
        $selected_websites = array();
        $selected_groups = array();
        if ($task != null) {
            if ($task->sites != '') {
                $selected_websites = explode(',', $task->sites);
            }
            if ($task->groups != '') {
                $selected_groups = explode(',', $task->groups);
            }
        }
        $remote_destinations = apply_filters('mainwp_backups_remote_get_destinations', null, $task != null ? array('task' => $task->id) : array());
        $hasRemoteDestinations = $remote_destinations == null ? $remote_destinations : count($remote_destinations);
        ?>
        <div class="mainwp_managbackups_taskoptions">
        <?php 
        //to add CSS Styling to the select sites box use the one below (this adds the css class mainwp_select_sites_box_right to the box)
        //MainWPUI::select_sites_box(__("Select Sites"), 'checkbox', true, true, 'mainwp_select_sites_box_right', '', $selected_websites, $selected_groups);
        ?>
        
        <?php 
        MainWPUI::select_sites_box(__("Select Sites", 'mainwp'), 'checkbox', true, true, 'mainwp_select_sites_box_right', 'float: right !important; clear: both;', $selected_websites, $selected_groups, true);
        ?>
        <div class="mainwp_config_box_left">

        <div class="postbox">
        <h3 class="mainwp_box_title"><span><i class="fa fa-history"></i> <?php 
        _e('Schedule Backup', 'mainwp');
        ?>
</span></h3>
        <div class="inside">
        <table class="form-table" style="width: 100%">
            <tr class="form-field form-required">
                <th scope="row"><?php 
        _e('Task Name:', 'mainwp');
        ?>
</th>
                <td><input type="text" id="mainwp_managebackups_add_name" class="mainwp-field mainwp-task-name" name="mainwp_managebackups_add_name" value="<?php 
        echo isset($task) ? $task->name : '';
        ?>
" /><span class="mainwp-form_hint">e.g. Site1 Daily, Site1 Full Weekly, ...</span></td>
            </tr>
            <tr>
                <th scope="row"><?php 
        _e('Task Schedule:', 'mainwp');
        ?>
</th>
                <td><a class="mainwp_action left backuptaskschedule <?php 
        echo !isset($task) || $task->schedule == 'daily' ? 'mainwp_action_down' : '';
        ?>
" href="#" id="mainwp_managebackups_schedule_daily"><?php 
        _e('DAILY', 'mainwp');
        ?>
</a><a class="mainwp_action mid backuptaskschedule <?php 
        echo isset($task) && $task->schedule == 'weekly' ? 'mainwp_action_down' : '';
        ?>
" href="#" id="mainwp_managebackups_schedule_weekly"><?php 
        _e('WEEKLY', 'mainwp');
        ?>
</a><a class="mainwp_action right backuptaskschedule <?php 
        echo isset($task) && $task->schedule == 'monthly' ? 'mainwp_action_down' : '';
        ?>
" href="#" id="mainwp_managebackups_schedule_monthly"><?php 
        _e('MONTHLY', 'mainwp');
        ?>
</a></td>
            </tr>
            <tr>
                <th scope="row"><?php 
        _e('Backup File Name:', 'mainwp');
        ?>
</th>
                <td><input type="text" name="backup_filename" id="backup_filename" class="mainwp-field mainwp-file-name" value="<?php 
        echo isset($task) ? $task->filename : '';
        ?>
" /><span class="mainwp-form_hint" style="display: inline; max-width: 500px;">Allowed Structure Tags: <strong>%url%</strong>, <strong>%date%</strong>, <strong>%time%</strong>, <strong>%type%</strong></span>
                </td>
            </tr>
            <tr><td colspan="2"><hr /></td></tr>
            <tr>
                <th scope="row"><?php 
        _e('Backup Type:', 'mainwp');
        ?>
</th>
                <td>
                    <a class="mainwp_action left <?php 
        echo !isset($task) || $task->type != 'db' ? 'mainwp_action_down' : '';
        ?>
" href="#" id="backup_type_full"><?php 
        _e('FULL BACKUP', 'mainwp');
        ?>
</a><a class="mainwp_action right <?php 
        echo isset($task) && $task->type == 'db' ? 'mainwp_action_down' : '';
        ?>
" href="#" id="backup_type_db"><?php 
        _e('DATABASE BACKUP', 'mainwp');
        ?>
</a>
                </td>
            </tr>
            <tr class="mainwp_backup_exclude_files_content" <?php 
        echo isset($task) && $task->type == 'db' ? 'style="display: none;"' : '';
        ?>
><td colspan="2"><hr /></td></tr>
            <tr class="mainwp-exclude-suggested">
                    <th scope="row" style="vertical-align: top"><?php 
        _e('Suggested Exclude', 'mainwp');
        ?>
:</th>
                    <td><p style="background: #7fb100; color: #ffffff; padding: .5em;"><?php 
        _e('Every WordPress website is different but the sections below generally do not need to be backed up and since many of them are large in size they can even cause issues with your backup including server timeouts.', 'mainwp');
        ?>
</p></td>
                </tr>
                <tr class="mainwp-exclude-backup-locations">
                    <td colspan="2"><h4><i class="fa fa-cloud-upload"></i> <?php 
        _e('Known Backup Locations', 'mainwp');
        ?>
</h4></td>
                </tr>
                <tr class="mainwp-exclude-backup-locations">
                    <td><label for="mainwp-known-backup-locations"><?php 
        _e('Exclude', 'mainwp');
        ?>
</label><input type="checkbox" id="mainwp-known-backup-locations" <?php 
        echo !isset($task) || $task->excludebackup == 1 ? 'checked' : '';
        ?>
></td>
                    <td class="mainwp-td-des"><a href="#" id="mainwp-show-kbl-folders"><?php 
        _e('+ Show Excluded Folders', 'mainwp');
        ?>
</a><a href="#" id="mainwp-hide-kbl-folders"><?php 
        _e('- Hide Excluded Folders', 'mainwp');
        ?>
</a><br/>
                        <textarea id="mainwp-kbl-content" disabled></textarea>
                        <br/><?php 
        _e('This adds known backup locations of popular WordPress backup plugins to the exclude list.  Old backups can take up a lot of space and can cause your current MainWP backup to timeout.', 'mainwp');
        ?>
</td>
                </tr>
                <tr class="mainwp-exclude-separator"><td colspan="2" style="padding: 0 !important;"><hr /></td></tr>
                <tr class="mainwp-exclude-cache-locations">
                    <td colspan="2"><h4><i class="fa fa-cubes"></i> <?php 
        _e('Known Cache Locations', 'mainwp');
        ?>
</h4></td>
                </tr>
                <tr class="mainwp-exclude-cache-locations">
                    <td><label for="mainwp-known-cache-locations"><?php 
        _e('Exclude', 'mainwp');
        ?>
</label><input type="checkbox" id="mainwp-known-cache-locations" <?php 
        echo !isset($task) || $task->excludecache == 1 ? 'checked' : '';
        ?>
></td>
                    <td class="mainwp-td-des"><a href="#" id="mainwp-show-kcl-folders"><?php 
        _e('+ Show Excluded Folders', 'mainwp');
        ?>
</a><a href="#" id="mainwp-hide-kcl-folders"><?php 
        _e('- Hide Excluded Folders', 'mainwp');
        ?>
</a><br/>
                        <textarea id="mainwp-kcl-content" disabled></textarea>
                        <br/><?php 
        _e('This adds known cache locations of popular WordPress cache plugins to the exclude list.  A cache can be massive with thousands of files and can cause your current MainWP backup to timeout.  Your cache will be rebuilt by your caching plugin when the backup is restored.', 'mainwp');
        ?>
</td>
                </tr>
                <tr class="mainwp-exclude-separator"><td colspan="2" style="padding: 0 !important;"><hr /></td></tr>
                <tr class="mainwp-exclude-nonwp-folders">
                    <td colspan="2"><h4><i class="fa fa-folder"></i> <?php 
        _e('Non-WordPress Folders', 'mainwp');
        ?>
</h4></td>
                </tr>
                <tr class="mainwp-exclude-nonwp-folders">
                    <td><label for="mainwp-non-wordpress-folders"><?php 
        _e('Exclude', 'mainwp');
        ?>
</label><input type="checkbox" id="mainwp-non-wordpress-folders" <?php 
        echo !isset($task) || $task->excludenonwp == 1 ? 'checked' : '';
        ?>
></td>
                    <td class="mainwp-td-des"><a href="#" id="mainwp-show-nwl-folders"><?php 
        _e('+ Show Excluded Folders', 'mainwp');
        ?>
</a><a href="#" id="mainwp-hide-nwl-folders"><?php 
        _e('- Hide Excluded Folders', 'mainwp');
        ?>
</a><br/>
                        <textarea id="mainwp-nwl-content" disabled></textarea>
                        <br/><?php 
        _e('This adds folders that are not part of the WordPress core (wp-admin, wp-content and wp-include) to the exclude list. Non-WordPress folders can contain a large amount of data or may be a sub-domain or add-on domain that should be backed up individually and not with this backup.', 'mainwp');
        ?>
</td>
                </tr>
                <tr class="mainwp-exclude-separator"><td colspan="2" style="padding: 0 !important;"><hr /></td></tr>
                <tr class="mainwp-exclude-zips">
                    <td colspan="2"><h4><i class="fa fa-file-archive-o"></i> <?php 
        _e('ZIP Archives', 'mainwp');
        ?>
</h4></td>
                </tr>
                <tr class="mainwp-exclude-zips">
                    <td><label for="mainwp-zip-archives"><?php 
        _e('Exclude', 'mainwp');
        ?>
</label><input type="checkbox" id="mainwp-zip-archives" <?php 
        echo !isset($task) || $task->excludezip == 1 ? 'checked' : '';
        ?>
></td>
                    <td class="mainwp-td-des"><?php 
        _e('Zip files can be large and are often not needed for a WordPress backup. Be sure to deselect this option if you do have zip files you need backed up.', 'mainwp');
        ?>
</td>
                </tr>
                <tr class="mainwp-exclude-separator"><td colspan="2" style="padding: 0 !important;"><hr /></td></tr>
            <tr class="mainwp_backup_exclude_files_content" <?php 
        echo isset($task) && $task->type == 'db' ? 'style="display: none;"' : '';
        ?>
>
                <th scope="row" style="vertical-align: top"><h4 class="mainwp-custom-excludes"><i class="fa fa-minus-circle"></i> <?php 
        _e('Custom Excludes', 'mainwp');
        ?>
</h4></th>
                <td>
                    <p style="background: #7fb100; color: #ffffff; padding: .5em;"><?php 
        _e('Exclude any additional files that you do not need backed up for this site. Click a folder name to drill down into the directory.', 'mainwp');
        ?>
</p>
                    <br />
                    <?php 
        printf(__('Click directories to navigate. Click the red sign ( <img style="margin-bottom: -3px;" src="%s"> ) to exclude a folder.', 'mainwp'), plugins_url('images/exclude.png', dirname(__FILE__)));
        ?>
<br /><br />
                    <table class="mainwp_excluded_folders_cont">
                        <tr>
                            <td style="width: 280px">
                                <div id="backup_exclude_folders" class="mainwp_excluded_folders"></div>
                            </td>
                            <td>
                                <?php 
        _e('Excluded files & directories:', 'mainwp');
        ?>
<br/>
                                <textarea id="excluded_folders_list"><?php 
        $excluded = isset($task) ? $task->exclude : "";
        if ($excluded != '') {
            $excluded = explode(',', $excluded);
            echo implode("/\n", $excluded) . "/\n";
        }
        ?>
</textarea>
                            </td>
                        </tr>
                    </table>
                    <span class="description"><strong><?php 
        _e('ATTENTION:', 'mainwp');
        ?>
</strong> <?php 
        _e('Do not exclude any folders if you are using this backup to clone or migrate the wordpress installation.', 'mainwp');
        ?>
</span>
                </td>
            </tr>
            <tr><td colspan="2"><hr /></td></tr>
            <?php 
        if ($hasRemoteDestinations !== null) {
            ?>
            <tr>
                <th scope="row"><?php 
            _e('Store Backup In:', 'mainwp');
            ?>
</th>
                <td>
                    <a class="mainwp_action left <?php 
            echo !$hasRemoteDestinations ? 'mainwp_action_down' : '';
            ?>
" href="#" id="backup_location_local"><?php 
            _e('LOCAL SERVER ONLY', 'mainwp');
            ?>
</a><a class="mainwp_action right <?php 
            echo $hasRemoteDestinations ? 'mainwp_action_down' : '';
            ?>
" href="#" id="backup_location_remote"><?php 
            _e('REMOTE DESTINATION', 'mainwp');
            ?>
</a>
                </td>
            </tr>
            <tr class="mainwp_backup_destinations" <?php 
            echo !$hasRemoteDestinations ? 'style="display: none;"' : '';
            ?>
>
                <th scope="row"><?php 
            _e('Backup Subfolder:', 'mainwp');
            ?>
</th>
                <td><input type="text" id="mainwp_managebackups_add_subfolder" name="backup_subfolder"
                                                       value="<?php 
            echo isset($task) ? $task->subfolder : 'MainWP Backups/%url%/%type%/%date%';
            ?>
"/><span class="mainwp-form_hint" style="display: inline; max-width: 500px;">Allowed Structure Tags: <strong>%sitename%</strong>, <strong>%url%</strong>, <strong>%date%</strong>, <strong>%task%</strong>, <strong>%type%</strong></span></td>
            </tr>
            <?php 
        }
        ?>
            <?php 
        do_action('mainwp_backups_remote_settings', array('task' => $task));
        ?>
            <tr><td colspan="2"><hr /></td></tr>
            <?php 
        $globalArchiveFormat = get_option('mainwp_archiveFormat');
        if ($globalArchiveFormat == false) {
            $globalArchiveFormat = 'tar.gz';
        }
        if ($globalArchiveFormat == 'zip') {
            $globalArchiveFormatText = 'Zip';
        } else {
            if ($globalArchiveFormat == 'tar') {
                $globalArchiveFormatText = 'Tar';
            } else {
                if ($globalArchiveFormat == 'tar.gz') {
                    $globalArchiveFormatText = 'Tar GZip';
                } else {
                    if ($globalArchiveFormat == 'tar.bz2') {
                        $globalArchiveFormatText = 'Tar BZip2';
                    }
                }
            }
        }
        $archiveFormat = isset($task) ? $task->archiveFormat : 'site';
        $useGlobal = $archiveFormat == 'global';
        $useSite = $archiveFormat == '' || $archiveFormat == 'site';
        ?>
            <tr>
                <th scope="row"><?php 
        _e('Archive Format', 'mainwp');
        ?>
</th>
                <td>
                    <table class="mainwp-nomarkup">
                        <tr>
                            <td valign="top">
                                <span class="mainwp-select-bg"><select name="mainwp_archiveFormat" id="mainwp_archiveFormat">
                                    <option value="site" <?php 
        if ($useSite) {
            ?>
selected<?php 
        }
        ?>
>Site specific setting</option>
                                    <option value="global" <?php 
        if ($useGlobal) {
            ?>
selected<?php 
        }
        ?>
>Global setting (<?php 
        echo $globalArchiveFormatText;
        ?>
)</option>
                                    <option value="zip" <?php 
        if ($archiveFormat == 'zip') {
            ?>
selected<?php 
        }
        ?>
>Zip</option>
                                    <option value="tar" <?php 
        if ($archiveFormat == 'tar') {
            ?>
selected<?php 
        }
        ?>
>Tar</option>
                                    <option value="tar.gz" <?php 
        if ($archiveFormat == 'tar.gz') {
            ?>
selected<?php 
        }
        ?>
>Tar GZip</option>
                                    <option value="tar.bz2" <?php 
        if ($archiveFormat == 'tar.bz2') {
            ?>
selected<?php 
        }
        ?>
>Tar BZip2</option>
                                </select><label></label></span>
                            </td>
                            <td>
                                <i>
                                <span id="info_site" class="archive_info" <?php 
        if (!$useSite) {
            ?>
style="display: none;"<?php 
        }
        ?>
>Depends on the settings of the child site</span>
                                <span id="info_global" class="archive_info" <?php 
        if (!$useGlobal) {
            ?>
style="display: none;"<?php 
        }
        ?>
><?php 
        if ($globalArchiveFormat == 'zip') {
            ?>
Uses PHP native Zip-library, when missing, the PCLZip library included in Wordpress will be used. (Good compression, fast with native zip-library)<?php 
        } elseif ($globalArchiveFormat == 'tar') {
            ?>
Uses PHP native Zip-library, when missing, the PCLZip library included in Wordpress will be used. (Good compression, fast with native zip-library)<?php 
        } elseif ($globalArchiveFormat == 'tar.gz') {
            ?>
Creates a GZipped tar-archive. (Good compression, fast, low memory usage)<?php 
        } elseif ($globalArchiveFormat == 'tar.bz2') {
            ?>
Creates a BZipped tar-archive. (Best compression, fast, low memory usage)<?php 
        }
        ?>
</span>
                                <span id="info_zip" class="archive_info" <?php 
        if ($archiveFormat != 'zip') {
            ?>
style="display: none;"<?php 
        }
        ?>
>Uses PHP native Zip-library, when missing, the PCLZip library included in Wordpress will be used. (Good compression, fast with native zip-library)</span>
                                <span id="info_tar" class="archive_info" <?php 
        if ($archiveFormat != 'tar') {
            ?>
style="display: none;"<?php 
        }
        ?>
>Creates an uncompressed tar-archive. (No compression, fast, low memory usage)</span>
                                <span id="info_tar.gz" class="archive_info" <?php 
        if ($archiveFormat != 'tar.gz') {
            ?>
style="display: none;"<?php 
        }
        ?>
>Creates a GZipped tar-archive. (Good compression, fast, low memory usage)</span>
                                <span id="info_tar.bz2" class="archive_info" <?php 
        if ($archiveFormat != 'tar.bz2') {
            ?>
style="display: none;"<?php 
        }
        ?>
>Creates a BZipped tar-archive. (Best compression, fast, low memory usage)</span>
                                </i>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>

            <?php 
        $maximumFileDescriptorsOverride = isset($task) ? $task->maximumFileDescriptorsOverride == 1 : false;
        $maximumFileDescriptorsAuto = isset($task) ? $task->maximumFileDescriptorsAuto == 1 : false;
        $maximumFileDescriptors = isset($task) ? $task->maximumFileDescriptors : 150;
        ?>
            <tr class="archive_method archive_zip" <?php 
        if ($archiveFormat != 'zip') {
            ?>
style="display: none;"<?php 
        }
        ?>
>
                <th scope="row"><?php 
        _e('Maximum File Descriptors on Child', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip('The maximum number of open file descriptors on the child hosting.', 'http://docs.mainwp.com/maximum-number-of-file-descriptors/');
        ?>
</th>
                <td>
                    <div class="mainwp-radio" style="float: left;">
                      <input type="radio" value="" name="mainwp_options_maximumFileDescriptorsOverride" id="mainwp_options_maximumFileDescriptorsOverride_global" <?php 
        echo !$maximumFileDescriptorsOverride ? 'checked="true"' : '';
        ?>
"/>
                      <label for="mainwp_options_maximumFileDescriptorsOverride_global"></label>
                    </div>Global Setting (<a href="<?php 
        echo admin_url('admin.php?page=Settings');
        ?>
">Change Here</a>)<br/>
                    <div class="mainwp-radio" style="float: left;">
                      <input type="radio" value="override" name="mainwp_options_maximumFileDescriptorsOverride" id="mainwp_options_maximumFileDescriptorsOverride_override" <?php 
        echo $maximumFileDescriptorsOverride ? 'checked="true"' : '';
        ?>
"/>
                      <label for="mainwp_options_maximumFileDescriptorsOverride_override"></label>
                    </div>Override<br/><br />

                    <div style="float: left">Auto detect:&nbsp;</div><div class="mainwp-checkbox"><input type="checkbox" id="mainwp_maximumFileDescriptorsAuto" name="mainwp_maximumFileDescriptorsAuto" <?php 
        echo $maximumFileDescriptorsAuto ? 'checked="checked"' : '';
        ?>
 /> <label for="mainwp_maximumFileDescriptorsAuto"></label></div><div style="float: left"><i>(<?php 
        _e('Enter a fallback value because not all hosts support this function.', 'mainwp');
        ?>
)</i></div><div style="clear:both"></div>
                    <input type="text" name="mainwp_options_maximumFileDescriptors" id="mainwp_options_maximumFileDescriptors"
                           value="<?php 
        echo $maximumFileDescriptors;
        ?>
"/><span class="mainwp-form_hint"><?php 
        _e('The maximum number of open file descriptors on the child hosting.  0 sets unlimited.', 'mainwp');
        ?>
</span>
                </td>
            </tr>
            <tr class="archive_method archive_zip" <?php 
        if ($archiveFormat != 'zip') {
            ?>
style="display: none;"<?php 
        }
        ?>
>
                <th scope="row">Load files in memory before zipping <?php 
        MainWPUtility::renderToolTip('This causes the files to be opened and closed immediately, using less simultaneous I/O operations on the disk. For huge sites with a lot of files we advise to disable this, memory usage will drop but we will use more file handlers when backing up.', 'http://docs.mainwp.com/load-files-memory/');
        ?>
</th>
                <td>
                    <input type="radio" name="mainwp_options_loadFilesBeforeZip" id="mainwp_options_loadFilesBeforeZip_global" value="1" <?php 
        if (!isset($task) || $task->loadFilesBeforeZip == false || $task->loadFilesBeforeZip == 1) {
            ?>
checked="true"<?php 
        }
        ?>
/> Global setting (<a href="<?php 
        echo admin_url('admin.php?page=Settings');
        ?>
">Change Here</a>)<br />
                    <input type="radio" name="mainwp_options_loadFilesBeforeZip" id="mainwp_options_loadFilesBeforeZip_yes" value="2" <?php 
        if (isset($task) && $task->loadFilesBeforeZip == 2) {
            ?>
checked="true"<?php 
        }
        ?>
/> Yes<br />
                    <input type="radio" name="mainwp_options_loadFilesBeforeZip" id="mainwp_options_loadFilesBeforeZip_no" value="0" <?php 
        if (isset($task) && $task->loadFilesBeforeZip == 0) {
            ?>
checked="true"<?php 
        }
        ?>
/> No<br />
                </td>
            </tr>
        </table>
        </div>
        </div>
        </div>
        <div class="clear"></div>

        </div>
        <?php 
        if ($task != null) {
            ?>
            <input type="hidden" id="backup_task_id" value="<?php 
            echo $task->id;
            ?>
" />
            <script>mainwp_managebackups_updateExcludefolders();</script>
        <?php 
        }
    }
Пример #8
0
    public static function renderMainWPTools()
    {
        if (!mainwp_current_user_can("dashboard", "manage_dashboard_settings")) {
            mainwp_do_not_have_permissions("manage dashboard settings");
            return;
        }
        self::renderHeader('MainWPTools');
        ?>
            <div class="postbox" id="mainwp-tools">
                <h3 class="mainwp_box_title"><span><i class="fa fa-wrench"></i> <?php 
        _e('MainWP Tools', 'mainwp');
        ?>
</span></h3>
                <div class="inside">
                    <table class="form-table">
                        <tbody>
                            <tr>
                                <th scope="row"><?php 
        _e('Force Dashboard to Establish New Connection', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip(__('Use this option to establish new connection with child sites.', 'mainwp'));
        ?>
</th>
                                <td>
                                    <input type="submit" name="" id="force-destroy-sessions-button" class="button-primary button" value="<?php 
        _e('Establish New Connection', 'mainwp');
        ?>
"/><br/>
                                    <em>
                                        <?php 
        _e('Forces your Dashboard to reconnect with your Child sites. This feature will log out any currently logged in users on the Child sites and require them to re-log in. Only needed if suggested by MainWP Support.', 'mainwp');
        ?>
                                    </em>
                                </td>
                            </tr>
                            <tr>
                                <th scope="row"><?php 
        _e('Scan child sites for known issues', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip(__('Use this option to scan child sites for known issues.', 'mainwp'));
        ?>
</th>
                                <td>
                                    <a href="<?php 
        echo admin_url('admin.php?page=MainWPChildScan');
        ?>
" class="button-primary button"><?php 
        _e('Scan', 'mainwp');
        ?>
</a><br/>
                                    <em>
                                        <?php 
        _e('Scans each site individually for known issues.', 'mainwp');
        ?>
                                    </em>
                                </td>
                            </tr>
                            </tbody>
                    </table>
                </div>
            </div>
        <?php 
        self::renderFooter('MainWPTools');
    }
Пример #9
0
    public static function renderSettings()
    {
        $userExtension = MainWPDB::Instance()->getUserExtension();
        $pluginDir = $userExtension == null || ($userExtension->pluginDir == null || $userExtension->pluginDir == '') ? 'default' : $userExtension->pluginDir;
        $user_email = MainWPUtility::getNotificationEmail();
        $siteview = $userExtension->site_view;
        $snAutomaticDailyUpdate = get_option('mainwp_automaticDailyUpdate');
        $backup_before_upgrade = get_option('mainwp_backup_before_upgrade');
        $lastAutomaticUpdate = MainWPDB::Instance()->getWebsitesLastAutomaticSync();
        if ($lastAutomaticUpdate == 0) {
            $nextAutomaticUpdate = 'Any minute';
        } else {
            if (MainWPDB::Instance()->getWebsitesCountWhereDtsAutomaticSyncSmallerThenStart() > 0 || MainWPDB::Instance()->getWebsitesCheckUpdatesCount() > 0) {
                $nextAutomaticUpdate = 'Processing your websites.';
            } else {
                $nextAutomaticUpdate = MainWPUtility::formatTimestamp(MainWPUtility::getTimestamp(mktime(0, 0, 0, date('n'), date('j') + 1)));
            }
        }
        if ($lastAutomaticUpdate == 0) {
            $lastAutomaticUpdate = 'Never';
        } else {
            $lastAutomaticUpdate = MainWPUtility::formatTimestamp(MainWPUtility::getTimestamp($lastAutomaticUpdate));
        }
        ?>
    <div class="postbox" id="mainwp-hide-child-plugin-settings">
        <h3 class="mainwp_box_title"><span><i class="fa fa-cog"></i> <?php 
        _e('Hide MainWP Child Plugin', 'mainwp');
        ?>
</span></h3>
        <div class="inside">
        <div class="mainwp_info-box-red" style="margin-top: 5px;"><?php 
        _e('<strong>STOP BEFORE TURNING ON!</strong> Hiding the Child Plugin does require the plugin to make changes to your .htaccess file that in rare instances or server configurations could cause problems.', 'mainwp');
        ?>
</div>
        <table class="form-table">
            <tbody>
            <tr>
                <th scope="row"><?php 
        _e('Hide Network on Child Sites', 'mainwp');
        ?>
</th>
                <td>
                    <table>
                        <tr>
                            <td valign="top" style="padding-left: 0; padding-right: 5px; padding-top: 0px; padding-bottom: 0px; vertical-align: top;">
                                <div class="mainwp-checkbox">
                                <input type="checkbox" value="hidden" name="mainwp_options_footprint_plugin_folder" id="mainwp_options_footprint_plugin_folder_default" <?php 
        echo $pluginDir == 'hidden' ? 'checked="true"' : '';
        ?>
/><label for="mainwp_options_footprint_plugin_folder_default"></label>
                            </div>
                            </td>
                            <td valign="top" style="padding: 0">
                              <label for="mainwp_options_footprint_plugin_folder_default">
                                  <em><?php 
        _e('This will make anyone including Search Engines trying find your Child Plugin encounter a 404 page. Hiding the Child Plugin does require the plugin to make changes to your .htaccess file that in rare instances or server configurations could cause problems.', 'mainwp');
        ?>
</em>
                              </label>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    </div>

    <div class="postbox" id="mainwp-global-options-settings">
    <h3 class="mainwp_box_title"><span><i class="fa fa-cog"></i> <?php 
        _e('Global Options', 'mainwp');
        ?>
</span></h3>
    <div class="inside">
    <table class="form-table">
        <tbody>
        <tr>
            <th scope="row"><?php 
        _e('Notification Email', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip(__('This address is used to send monitoring alerts.', 'mainwp'));
        ?>
</th>
            <td>
                <input type="text"  class="mainwp-field mainwp-email" name="mainwp_options_email" size="35" value="<?php 
        echo $user_email;
        ?>
"/><span class="mainwp-form_hint"><?php 
        _e('This address is used to send monitoring alerts.', 'mainwp');
        ?>
</span>
            </td>
        </tr>
        <tr>
            <th scope="row"><?php 
        _e('Use WP-Cron', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip(__('When not using WP-Cron you will need to set up a cron job via your hosting.', 'mainwp'), 'http://docs.mainwp.com/disable-wp-cron/');
        ?>
</th>
            <td>
                <div class="mainwp-checkbox">
                <input type="checkbox" name="mainwp_options_wp_cron"
                       id="mainwp_options_wp_cron" <?php 
        echo get_option('mainwp_wp_cron') == 1 || get_option('mainwp_wp_cron') === false ? 'checked="true"' : '';
        ?>
/>
                <label for="mainwp_options_wp_cron"></label>
                </div>
            </td>
        </tr>
<!--        todo: RS: Re-enable-->
<!--        <tr>-->
<!--            <th scope="row">Tips on login</th>-->
<!--            <td>-->
<!--                <input type="checkbox" name="mainwp_options_tips"-->
<!--                       id="mainwp_options_tips" --><?php 
        //echo ($userExtension->tips == 1 ? 'checked="true"' : '');
        ?>
<!--"/>-->
<!--                <label for="mainwp_options_tips">Enable "Did you know" tips</label>-->
<!--            </td>-->
<!--        </tr>-->
        <?php 
        if (MainWPUtility::isAdmin()) {
            ?>
        <tr>
            <th scope="row"><?php 
            _e('Optimize for Shared Hosting or Big Networks', 'mainwp');
            ?>
 <?php 
            MainWPUtility::renderToolTip(__('Updates will be cached for quick loading. A manual refresh from the Dashboard is required to view new plugins, themes, pages or users. Recommended for Networks over 50 sites.', 'mainwp'));
            ?>
</th>
            <td>
            	<div class="mainwp-checkbox">
                <input type="checkbox" name="mainwp_optimize"
                       id="mainwp_optimize" <?php 
            echo get_option('mainwp_optimize') == 1 ? 'checked="true"' : '';
            ?>
 />
                <label for="mainwp_optimize"></label>
               </div>
            </td>
        </tr>
        <tr>
            <th scope="row"><?php 
            _e('Show Basic SEO Stats', 'mainwp');
            ?>
 <?php 
            MainWPUtility::renderToolTip(__('This requires your Dashboard to query the Google servers for this information.', 'mainwp'));
            ?>
</th>
            <td>
            	<div class="mainwp-checkbox">
                <input type="checkbox" name="mainwp_seo"
                       id="mainwp_seo" <?php 
            echo get_option('mainwp_seo') == 1 ? 'checked="true"' : '';
            ?>
"/>
                <label for="mainwp_seo"></label>
               </div>
            </td>
        </tr>
         <tr>
            <th scope="row"><?php 
            _e('Use Child Site Favicon', 'mainwp');
            ?>
 <?php 
            MainWPUtility::renderToolTip(__('Set to YES if you want to use Child Site Favicon.', 'mainwp'));
            ?>
</th>
            <td>
            	<div class="mainwp-checkbox">
                <input type="checkbox" name="mainwp_use_favicon"
                       id="mainwp_use_favicon" <?php 
            echo get_option('mainwp_use_favicon', 1) == 1 ? 'checked="true"' : '';
            ?>
"/>
                <label for="mainwp_use_favicon"></label>
               </div>
            </td>
        </tr>
        <?php 
        }
        ?>
        </tbody>
    </table>
    </div>
    </div>

    <div class="postbox" id="mainwp-upgrade-options-settings">
    <h3 class="mainwp_box_title"><span><i class="fa fa-cog"></i> <?php 
        _e('Upgrade Options', 'mainwp');
        ?>
</span></h3>
    <div class="inside">
    <table class="form-table">
        <tbody>
        <tr>
            <th scope="row"><?php 
        _e('View Upgrades per Site', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip(__('When this is disabled, the upgrades are shown per plugin/theme with a sublist of sites. When this is enabled, all the sites are shown with the plugin/theme upgrades available per site.', 'mainwp'));
        ?>
</th>
            <td>
            	<div class="mainwp-checkbox">
                <input type="checkbox" name="mainwp_options_siteview" id="mainwp_options_siteview" size="35" <?php 
        echo $siteview == 1 ? 'checked="true"' : '';
        ?>
/> <label for="mainwp_options_siteview"></label>
               </div>
            </td>
        </tr>
        <tr>
            <th scope="row"><?php 
        _e('Require Backup Before Upgrade', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip(__('With this option enabled, when you try to upgrade a plugin, theme or WordPress core, MainWP will check if there is a full backup created for the site(s) you are trying to upgrade in last 7 days. If you have a fresh backup of the site(s) MainWP will proceed to the upgrade process, if not it will ask you to create a full backup.', 'mainwp'));
        ?>
</th>
            <td>
            	<div class="mainwp-checkbox">
                <input type="checkbox" name="mainwp_backup_before_upgrade" id="mainwp_backup_before_upgrade" size="35" <?php 
        echo $backup_before_upgrade == 1 ? 'checked="true"' : '';
        ?>
/> <label for="mainwp_backup_before_upgrade"></label>
               </div>
            </td>
        </tr>
        <tr>
            <th scope="row"><?php 
        _e('Automatic Daily Update', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip(__('Choose to have MainWP install updates, or notify you by email of available updates.  Updates apply to WordPress Core files, Plugins and Themes.', 'mainwp'));
        ?>
</th>
            <td>
                <table class="mainwp-nomarkup">
                    <tr>
                        <td valign="top">
                            <span class="mainwp-select-bg"><select name="mainwp_automaticDailyUpdate" id="mainwp_automaticDailyUpdate">
                                <option value="2" <?php 
        if ($snAutomaticDailyUpdate === false || $snAutomaticDailyUpdate == 2) {
            ?>
selected<?php 
        }
        ?>
>E-mail Notifications of New Updates
                                </option>
                                <option value="1" <?php 
        if ($snAutomaticDailyUpdate == 1) {
            ?>
selected<?php 
        }
        ?>
>Install Trusted Updates
                                </option>
                                <option value="0" <?php 
        if ($snAutomaticDailyUpdate !== false && $snAutomaticDailyUpdate == 0) {
            ?>
selected<?php 
        }
        ?>
>Off
                                </option>
                            </select><label></label></span>
                        </td>
                        <td>
                            &nbsp;&nbsp;Last run: <?php 
        echo $lastAutomaticUpdate;
        ?>
                            <br />&nbsp;&nbsp;Next run: <?php 
        echo $nextAutomaticUpdate;
        ?>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        </tbody>
    </table>
    </div>
    </div>
    
    <div class="postbox" id="mainwp-date-return-options-settings">
    <h3 class="mainwp_box_title"><span><i class="fa fa-cog"></i> <?php 
        _e('Data Return Options', 'mainwp');
        ?>
</span></h3>
    <div class="inside">
    <table class="form-table">
        <tbody>
        <tr>
            <th scope="row"><?php 
        _e('Maximum Number of Posts/Pages', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip(__('0 for unlimited, CAUTION: a large amount will decrease the speed and might crash the communication.', 'mainwp'));
        ?>
</th>
            <td>
                <input type="text" name="mainwp_maximumPosts"  class="mainwp-field mainwp-settings-icon"
                       id="mainwp_maximumPosts" value="<?php 
        echo get_option('mainwp_maximumPosts') === false ? 50 : get_option('mainwp_maximumPosts');
        ?>
"/>
            </td>
        </tr>
        <tr>
            <th scope="row"><?php 
        _e('Maximum Number of Comments', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip(__('0 for unlimited, CAUTION: a large amount will decrease the speed and might crash the communication.', 'mainwp'));
        ?>
</th>
            <td>
                <input type="text" name="mainwp_maximumComments" class="mainwp-field mainwp-settings-icon"
                       id="mainwp_maximumComments" value="<?php 
        echo get_option('mainwp_maximumComments') === false ? 50 : get_option('mainwp_maximumComments');
        ?>
"/>
            </td>
        </tr>
        </tbody>
    </table>
    </div>
    </div>
    <?php 
    }
Пример #10
0
    public static function renderAllThemesTable($output = null)
    {
        $keyword = null;
        $search_status = 'all';
        if ($output == null) {
            $keyword = isset($_POST['keyword']) && !empty($_POST['keyword']) ? trim($_POST["keyword"]) : null;
            $search_status = isset($_POST['status']) ? $_POST['status'] : "all";
            $search_theme_status = isset($_POST['theme_status']) ? $_POST['theme_status'] : "all";
            $output = new stdClass();
            $output->errors = array();
            $output->themes = array();
            if (get_option('mainwp_optimize') == 1) {
                //Fetch all!
                //Build websites array
                //Search in local cache
                $websites = MainWPDB::Instance()->query(MainWPDB::Instance()->getSQLWebsitesForCurrentUser());
                while ($websites && ($website = @MainWPDB::fetch_object($websites))) {
                    $allThemes = json_decode($website->themes, true);
                    for ($i = 0; $i < count($allThemes); $i++) {
                        $theme = $allThemes[$i];
                        if ($search_theme_status != "all") {
                            if ($theme['active'] == 1 && $search_theme_status !== "active") {
                                continue;
                            } else {
                                if ($theme['active'] != 1 && $search_theme_status !== "inactive") {
                                    continue;
                                }
                            }
                        }
                        if ($keyword != '' && stristr($theme['name'], $keyword) === false) {
                            continue;
                        }
                        $theme['websiteid'] = $website->id;
                        $theme['websiteurl'] = $website->url;
                        $output->themes[] = $theme;
                    }
                }
                @MainWPDB::free_result($websites);
            } else {
                //Fetch all!
                //Build websites array
                $dbwebsites = array();
                $websites = MainWPDB::Instance()->query(MainWPDB::Instance()->getSQLWebsitesForCurrentUser());
                while ($websites && ($website = @MainWPDB::fetch_object($websites))) {
                    $dbwebsites[$website->id] = MainWPUtility::mapSite($website, array('id', 'url', 'name', 'adminname', 'nossl', 'privkey', 'nosslkey'));
                }
                @MainWPDB::free_result($websites);
                $post_data = array('keyword' => $keyword);
                if ($search_theme_status == "active" || $search_theme_status == "inactive") {
                    $post_data['status'] = $search_theme_status;
                    $post_data['filter'] = true;
                } else {
                    $post_data['status'] = "";
                    $post_data['filter'] = false;
                }
                MainWPUtility::fetchUrlsAuthed($dbwebsites, 'get_all_themes', $post_data, array(MainWPThemes::getClassName(), 'ThemesSearch_handler'), $output);
                if (count($output->errors) > 0) {
                    foreach ($output->errors as $siteid => $error) {
                        echo '<strong>Error on ' . MainWPUtility::getNiceURL($dbwebsites[$siteid]->url) . ': ' . $error . ' <br /></strong>';
                    }
                    echo '<br />';
                }
                if (count($output->errors) == count($dbwebsites)) {
                    session_start();
                    $_SESSION['SNThemesAll'] = $output;
                    return;
                }
            }
            if (session_id() == '') {
                session_start();
            }
            $_SESSION['SNThemesAll'] = $output;
            $_SESSION['SNThemesAllStatus'] = array('keyword' => $keyword, 'status' => $search_status, 'theme_status' => $search_theme_status);
        } else {
            if (isset($_SESSION['SNThemesAllStatus'])) {
                $keyword = $_SESSION['SNThemesAllStatus']['keyword'];
                $search_status = $_SESSION['SNThemesAllStatus']['status'];
                $search_theme_status = $_SESSION['SNThemesAllStatus']['theme_status'];
            }
        }
        if (count($output->themes) == 0) {
            ?>
        No themes found
        <?php 
            return;
        }
        ?>
    <div class="alignleft">
        <select name="bulk_action" id="mainwp_bulk_action">
            <option value="none"><?php 
        _e('Choose Action', 'mainwp');
        ?>
</option>
            <option value="trust"><?php 
        _e('Trust', 'mainwp');
        ?>
</option>
            <option value="untrust"><?php 
        _e('Untrust', 'mainwp');
        ?>
</option>
        </select> <input type="button" name="" id="mainwp_bulk_trust_themes_action_apply" class="button" value="<?php 
        _e('Confirm', 'mainwp');
        ?>
"/> <span id="mainwp_bulk_action_loading"><i class="fa fa-spinner fa-pulse"></i></span>
    </div>
    <div class="clear"></div>
    <?php 
        //Map per siteId
        $themes = array();
        //name_version -> slug
        foreach ($output->themes as $theme) {
            $themes[$theme['slug']] = $theme;
        }
        asort($themes);
        $userExtension = MainWPDB::Instance()->getUserExtension();
        $decodedIgnoredThemes = json_decode($userExtension->ignored_themes, true);
        $trustedThemes = json_decode($userExtension->trusted_themes, true);
        if (!is_array($trustedThemes)) {
            $trustedThemes = array();
        }
        $trustedThemesNotes = json_decode($userExtension->trusted_themes_notes, true);
        if (!is_array($trustedThemesNotes)) {
            $trustedThemesNotes = array();
        }
        ?>
        <table id="mainwp_themes_all_table" class="wp-list-table widefat fixed posts tablesorter" cellspacing="0">
            <thead>
            <tr>
                <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input name="themes" type="checkbox"></th>
                <th scope="col" id="info" class="manage-column column-cb check-column" style=""></th>
                <th scope="col" id="theme" class="manage-column column-title sortable desc" style="">
                    <a href="#"><span><?php 
        _e('Theme', 'mainwp');
        ?>
</span><span class="sorting-indicator"></span></a>
                </th>
                 <th scope="col" id="thmstatus" class="manage-column column-title sortable desc" style="">
                    <a href="#"><span><?php 
        _e('Status', 'mainwp');
        ?>
</span><span class="sorting-indicator"></span></a>
                </th>
                <th scope="col" id="trustlvl" class="manage-column column-title sortable desc" style="">
                    <a href="#"><span><?php 
        _e('Trust Level', 'mainwp');
        ?>
</span><span class="sorting-indicator"></span></a>
                </th>
                <th scope="col" id="ignoredstatus" class="manage-column column-title sortable desc" style="">
                    <a href="#"><span><?php 
        _e('Ignored Status', 'mainwp');
        ?>
</span><span class="sorting-indicator"></span></a>
                </th>
                <th scope="col" id="notes" class="manage-column column-posts" style=""><?php 
        _e('Notes', 'mainwp');
        ?>
</th>
            </tr>
            </thead>

            <tfoot>
            <tr>
                <th scope="col" class="manage-column column-cb check-column" style=""><input name="themes" type="checkbox"></th>
                <th scope="col" id="info_footer" class="manage-column column-cb check-column" style=""></th>
                <th scope="col" id="theme_footer" class="manage-column column-title sortable desc" style=""><span><?php 
        _e('Theme', 'mainwp');
        ?>
</span></th>
                <th scope="col" id="thmstatus_footer" class="manage-column column-posts" style=""><?php 
        _e('Status', 'mainwp');
        ?>
</th>
                <th scope="col" id="trustlvl_footer" class="manage-column column-posts" style=""><?php 
        _e('Trust Level', 'mainwp');
        ?>
</th>
                <th scope="col" id="ignoredstatus_footer" class="manage-column column-posts" style=""><?php 
        _e('Ignored Status', 'mainwp');
        ?>
</th>
                <th scope="col" id="notes_footer" class="manage-column column-posts" style=""><?php 
        _e('Notes', 'mainwp');
        ?>
</th>
            </tr>
            </tfoot>

            <tbody id="the-posts-list" class="list:posts">
                <?php 
        foreach ($themes as $slug => $theme) {
            $name = $theme['name'];
            if (!empty($search_status) && $search_status != "all") {
                if ($search_status == "trust" && !in_array($slug, $trustedThemes)) {
                    continue;
                } else {
                    if ($search_status == "untrust" && in_array($slug, $trustedThemes)) {
                        continue;
                    } else {
                        if ($search_status == "ignored" && !isset($decodedIgnoredThemes[$slug])) {
                            continue;
                        }
                    }
                }
            }
            ?>
                    <tr id="post-1" class="post-1 post type-post status-publish format-standard hentry category-uncategorized alternate iedit author-self" valign="top" theme_slug="<?php 
            echo urlencode($slug);
            ?>
" theme_name="<?php 
            echo rawurlencode($name);
            ?>
">
                        <th scope="row" class="check-column"><input type="checkbox" name="theme[]" value="<?php 
            echo urlencode($slug);
            ?>
"></th>
                        <td scope="col" id="info_content" class="manage-column" style=""> <?php 
            if (isset($decodedIgnoredThemes[$slug])) {
                MainWPUtility::renderToolTip('Ignored themes will NOT be auto-updated.', null, 'images/icons/mainwp-red-info-16.png');
            }
            ?>
</td>
                        <td scope="col" id="theme_content" class="manage-column sorted" style="">
                            <?php 
            echo $name;
            ?>
                        </td>
                        <td scope="col" id="plgstatus_content" class="manage-column" style="">
                            <?php 
            echo $theme['active'] == 1 ? __("Active", "mainwp") : __("Inactive", "mainwp");
            ?>
                        </td>
                        <td scope="col" id="trustlvl_content" class="manage-column" style="">
                            <?php 
            if (in_array($slug, $trustedThemes)) {
                echo '<font color="#7fb100">Trusted</font>';
            } else {
                echo '<font color="#c00">Not Trusted</font>';
            }
            ?>
                        </td>
                        <td scope="col" id="ignoredstatus_content" class="manage-column" style="">
                            <?php 
            if (isset($decodedIgnoredThemes[$slug])) {
                echo '<font color="#c00">Ignored</font>';
            }
            ?>
                        </td>
                        <td scope="col" id="notes_content" class="manage-column" style="">
                            <img src="<?php 
            echo plugins_url('images/notes.png', dirname(__FILE__));
            ?>
" class="mainwp_notes_img" <?php 
            if (!isset($trustedThemesNotes[$slug]) || $trustedThemesNotes[$slug] == '') {
                echo 'style="display: none;"';
            }
            ?>
 />
                            <a href="#" class="mainwp_trusted_theme_notes_show"><i class="fa fa-pencil"></i> <?php 
            _e('Open', 'mainwp');
            ?>
</a>
                            <div style="display: none" class="note"><?php 
            if (isset($trustedThemesNotes[$slug])) {
                echo $trustedThemesNotes[$slug];
            }
            ?>
</div>
                        </td>
                    </tr>
                            <?php 
        }
        ?>
            </tbody>
        </table>
        <div id="mainwp_notes_overlay" class="mainwp_overlay"></div>
        <div id="mainwp_notes" class="mainwp_popup">
            <a id="mainwp_notes_closeX" class="mainwp_closeX" style="display: inline; "></a>

            <div id="mainwp_notes_title" class="mainwp_popup_title"></span>
            </div>
            <div id="mainwp_notes_content">
                <textarea style="width: 580px !important; height: 300px;"
                          id="mainwp_notes_note"></textarea>
            </div>
            <form>
                <div style="float: right" id="mainwp_notes_status"></div>
                <input type="button" class="button cont button-primary" id="mainwp_trusted_theme_notes_save" value="<?php 
        _e('Save Note', 'mainwp');
        ?>
"/>
                <input type="button" class="button cont" id="mainwp_notes_cancel" value="<?php 
        _e('Close', 'mainwp');
        ?>
"/>
                <input type="hidden" id="mainwp_notes_slug" value=""/>
            </form>
        </div>
        <div class="pager" id="pager">
            <form>
                <img src="<?php 
        echo plugins_url('images/first.png', dirname(__FILE__));
        ?>
" class="first">
                <img src="<?php 
        echo plugins_url('images/prev.png', dirname(__FILE__));
        ?>
" class="prev">
                <input type="text" class="pagedisplay">
                <img src="<?php 
        echo plugins_url('images/next.png', dirname(__FILE__));
        ?>
" class="next">
                <img src="<?php 
        echo plugins_url('images/last.png', dirname(__FILE__));
        ?>
" class="last">
                <span>&nbsp;&nbsp;<?php 
        _e('Show:', 'mainwp');
        ?>
 </span><select class="pagesize">
                    <option selected="selected" value="10">10</option>
                    <option value="20">20</option>
                    <option value="30">30</option>
                    <option value="40">40</option>
                </select><span> <?php 
        _e('Plugins per page', 'mainwp');
        ?>
</span>
            </form>
        </div>

        <?php 
    }
Пример #11
0
    public static function renderAdvanced()
    {
        if (!mainwp_current_user_can("dashboard", "manage_dashboard_settings")) {
            mainwp_do_not_have_permissions("manage dashboard settings");
            return;
        }
        if (isset($_POST['submit'])) {
            MainWPUtility::update_option('mainwp_maximumRequests', $_POST['mainwp_maximumRequests']);
            MainWPUtility::update_option('mainwp_minimumDelay', $_POST['mainwp_minimumDelay']);
            MainWPUtility::update_option('mainwp_maximumIPRequests', $_POST['mainwp_maximumIPRequests']);
            MainWPUtility::update_option('mainwp_minimumIPDelay', $_POST['mainwp_minimumIPDelay']);
            MainWPUtility::update_option('mainwp_sslVerifyCertificate', isset($_POST['mainwp_sslVerifyCertificate']) ? 1 : 0);
        }
        self::renderHeader('Advanced');
        ?>
    <form method="POST" action="" id="mainwp-settings-page-form">
    <div class="postbox" id="mainwp-advanced-options">
        <h3 class="mainwp_box_title"><span><i class="fa fa-cog"></i> <?php 
        _e('Cross IP Settings', 'mainwp');
        ?>
</span></h3>
        <div class="inside">

        <table class="form-table">
            <tbody>
                <tr>
                    <th scope="row"><?php 
        _e('Maximum simultaneous requests', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip(__('Maximum simultaneous requests. When too many requests are sent out, they will begin to time out. This will cause child sites to be shown as offline while they are online. With a typical shared host you should set this at 4, set to 0 for unlimited.', 'mainwp'));
        ?>
</th>
                    <td>
                        <input type="text" name="mainwp_maximumRequests" class="mainwp-field mainwp-settings-icon"
                               id="mainwp_maximumRequests" value="<?php 
        echo get_option('mainwp_maximumRequests') === false ? 4 : get_option('mainwp_maximumRequests');
        ?>
"/> <i>Default: 4</i>
                    </td>
                </tr>
                <tr>
                    <th scope="row"><?php 
        _e('Minimum delay between requests (milliseconds)', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip(__('Minimum delay between requests (milliseconds). With a typical shared host you should set this at 200.', 'mainwp'));
        ?>
</th>
                    <td>
                        <input type="text" name="mainwp_minimumDelay"  class="mainwp-field mainwp-settings-icon"
                               id="mainwp_minimumDelay" value="<?php 
        echo get_option('mainwp_minimumDelay') === false ? 200 : get_option('mainwp_minimumDelay');
        ?>
"/> <i>Default: 200</i>
                    </td>
                </tr>
                 </tbody>
        </table>
        </div>
    </div>
    <div class="postbox" id="mainwp-advanced-options">
        <h3 class="mainwp_box_title"><span><i class="fa fa-cog"></i> <?php 
        _e('IP Settings', 'mainwp');
        ?>
</span></h3>
        <div class="inside">
        <table class="form-table">
            <tbody>
                <tr>
                    <th scope="row"><?php 
        _e('Maximum simultaneous requests per ip', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip(__('Maximum simultaneous requests per IP. When too many requests are sent out, they will begin to time out. This will cause child sites to be shown as offline while they are online. With a typical shared host you should set this at 1, set to 0 for unlimited.', 'mainwp'));
        ?>
</th>
                    <td>
                        <input type="text" name="mainwp_maximumIPRequests"  class="mainwp-field mainwp-settings-icon"
                               id="mainwp_maximumIPRequests" value="<?php 
        echo get_option('mainwp_maximumIPRequests') === false ? 1 : get_option('mainwp_maximumIPRequests');
        ?>
"/> <i>Default: 1</i>
                    </td>
                </tr>
                <tr>
                    <th scope="row"><?php 
        _e('Minimum delay between requests to the same ip (milliseconds)', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip(__('Minimum delay between requests (milliseconds) per IP. With a typical shared host you should set this at 1000.', 'mainwp'));
        ?>
</th>
                    <td>
                        <input type="text" name="mainwp_minimumIPDelay"  class="mainwp-field mainwp-settings-icon"
                               id="mainwp_minimumIPDelay" value="<?php 
        echo get_option('mainwp_minimumIPDelay') === false ? 1000 : get_option('mainwp_minimumIPDelay');
        ?>
"/> <i>Default: 1000</i>
                    </td>
                </tr>
                </tbody>
        </table>
        </div>
    </div>
    <div class="postbox" id="mainwp-advanced-options">
        <h3 class="mainwp_box_title"><span><i class="fa fa-cog"></i> <?php 
        _e('SSL Settings', 'mainwp');
        ?>
</span></h3>
        <div class="inside">
        <table class="form-table">
            </tbody>
                <tr><th scope="row"><?php 
        _e('Verify certificate', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip(__('Verify the childs SSL certificate. This should be disabled if you are using out of date or self signed certificates.', 'mainwp'));
        ?>
</th>
                   <td  style="width: 100px;">
                        <div class="mainwp-checkbox">
                            <input type="checkbox" name="mainwp_sslVerifyCertificate"
                               id="mainwp_sslVerifyCertificate" value="checked" <?php 
        echo get_option('mainwp_sslVerifyCertificate') === false || get_option('mainwp_sslVerifyCertificate') == 1 ? 'checked="checked"' : '';
        ?>
/><label for="mainwp_sslVerifyCertificate"></label>
                        </div>
                   </td>
                   <td><em><?php 
        _e('Default: YES', 'mainwp');
        ?>
</em></td>
                </tr>
            </tbody>
        </table>
    </div>
    </div>
    <p class="submit"><input type="submit" name="submit" id="submit" class="button-primary" value="<?php 
        _e('Save Settings', 'mainwp');
        ?>
"/></p>
    </form>
        <?php 
        self::renderFooter('Advanced');
    }
Пример #12
0
    public static function renderHeader($shownPage, &$extensions)
    {
        ?>
    <div class="wrap">
        <a href="https://mainwp.com" id="mainwplogo" title="MainWP" target="_blank"><img
                src="<?php 
        echo plugins_url('images/logo.png', dirname(__FILE__));
        ?>
" height="50"
                alt="MainWP"/></a>
        <h2><i class="fa fa-plug"></i> <?php 
        _e('Extensions', 'mainwp');
        ?>
</h2><div style="clear: both;"></div><br/><br/>
        <?php 
        if ($shownPage === '') {
            ?>
        <div id="mainwp-extensions-categories-menu" class="postbox">
                <div class="mainwp-inside"><span id="mainwp-extensions-menu-title"><?php 
            _e('Get MainWP Extensions', 'mainwp');
            ?>
</span></div>
                <div style="border-bottom: 1px Solid #e5e5e5;"></div>
                <div class="mainwp-inside mainwp-align-center" style="clear: both;">
                <div id="mainwp-extensions-cat-menu">
                    <ul id="mainwp-extensions-menu-cat-list">
                        <li class="mainwp-extensions-menu-item mainwp-category-1"><a href="https://extensions.mainwp.com/product-category/mainwp-extensions/administrative/"><?php 
            _e('Administrative', 'mainwp');
            ?>
</a></li>
                        <li class="mainwp-extensions-menu-item mainwp-category-2"><a href="https://extensions.mainwp.com/product-category/mainwp-extensions/content/"><?php 
            _e('Content', 'mainwp');
            ?>
</a></li>
                        <li class="mainwp-extensions-menu-item mainwp-category-3"><a href="https://extensions.mainwp.com/product-category/mainwp-extensions/visitor-data/"><?php 
            _e('Visitor Data', 'mainwp');
            ?>
</a></li>
                        <li class="mainwp-extensions-menu-item mainwp-category-4"><a href="https://extensions.mainwp.com/product-category/mainwp-extensions/free/"><?php 
            _e('Free Extensions', 'mainwp');
            ?>
</a></li>
                        <li class="mainwp-extensions-menu-item mainwp-category-5"><a href="https://extensions.mainwp.com/shop/"><?php 
            _e('All Extensions', 'mainwp');
            ?>
</a></li>
                    </ul>
                </div>
                    <div style="clear: both;"></div>
                </div>
        </div>        
       
<?php 
            $loader_url = '<i class="fa fa-spinner fa-pulse"></i>';
            if (mainwp_current_user_can("dashboard", "bulk_install_and_activate_extensions")) {
                $username = $password = "";
                $checked_save = false;
                if (get_option("mainwp_extensions_api_save_login") == true) {
                    $enscrypt_u = get_option('mainwp_extensions_api_username');
                    $enscrypt_p = get_option('mainwp_extensions_api_password');
                    $username = !empty($enscrypt_u) ? MainWPApiManagerPasswordManagement::decrypt_string($enscrypt_u) : "";
                    $password = !empty($enscrypt_p) ? MainWPApiManagerPasswordManagement::decrypt_string($enscrypt_p) : "";
                    $checked_save = true;
                }
                if (!MainWPUtility::resetUserCookie('api_bulk_install')) {
                    ?>
            <span id="mainwp_api_postbox_reset_showhide"></span>
        <?php 
                }
                ?>
        
    <div class="postbox mainwp_api_postbox" section="1" >
           <!-- <div class="handlediv"><br></div> -->
           <h3 class="mainwp_box_title"><span><i class="fa fa-cog"></i> <?php 
                _e("Bulk Install and Activate Extensions", "mainwp");
                ?>
</span></h3>                          
           <div class="mainwp-inside" style="clear: both;">
            <div style="padding: 0 5px;">
            <?php 
                $apisslverify = get_option('mainwp_api_sslVerifyCertificate');
                if (defined('OPENSSL_VERSION_NUMBER') && OPENSSL_VERSION_NUMBER <= 0x9080bf && $apisslverify === false) {
                    $apisslverify = 0;
                    MainWPUtility::update_option("mainwp_api_sslVerifyCertificate", $apisslverify);
                }
                $_selected_1 = $apisslverify === false || $apisslverify == 1 ? "selected" : '';
                $_selected_0 = empty($_selected_1) ? "selected" : "";
                ?>
                
                <div class="mainwp_info-box-red">
                <?php 
                if (defined('OPENSSL_VERSION_NUMBER') && OPENSSL_VERSION_NUMBER <= 0x9080bf) {
                    ?>
                        <p><?php 
                    _e("<strong style=\"color:#a00\">WARNING:</strong> MainWP has detected an older install of OpenSSL that does not support Server Name Indication (SNI). This will cause API Activation failure.", "mainwp");
                    ?>
</p>
                        <p><?php 
                    _e("We highly recommend, for your security, that you have your host update your OpenSSL to a current version that does support Server Name Indication (SNI).", "mainwp");
                    ?>
</p>
                        <p><?php 
                    _e("If you do not want to or cannot update your OpenSSL to a current version you can change the verify certificate option to No <strong>(Not recommended)</strong>", "mainwp");
                    ?>
</p>
                    <?php 
                } else {
                    ?>
                        <p><?php 
                    _e("<strong>Notice:</strong> We did not detect any SSL issues.", "mainwp");
                    ?>
</p>                         
                        <p><?php 
                    _e("However, if you are having an issue connecting to, logging in or updating Extensions try setting the verify certificate option below to No and pressing Save.", "mainwp");
                    ?>
</p>                         
                    <?php 
                }
                ?>
                    <table class="form-table">
                        </tbody>
                            <tr>
                                <th scope="row"><?php 
                _e('Verify certificate', 'mainwp');
                ?>
 <?php 
                MainWPUtility::renderToolTip(__('Verify the childs SSL certificate. This should be disabled if you are using out of date or self signed certificates.', 'mainwp'));
                ?>
</th>
                                   <td>
                                       <span><select name="mainwp_api_sslVerifyCertificate" id="mainwp_api_sslVerifyCertificate" style="width: 200px;">
                                            <option value="0" <?php 
                echo $_selected_0;
                ?>
 ><?php 
                _e("No", "mainwp");
                ?>
</option>
                                            <option value="1" <?php 
                echo $_selected_1;
                ?>
 ><?php 
                _e("Yes", "mainwp");
                ?>
</option>                                               
                                        </select><label></label></span>&nbsp;&nbsp;&nbsp;&nbsp;
                                        <span class="extension_api_sslverify_loading">
                                            <input type="button" value="<?php 
                _e("Save", "mainwp");
                ?>
" id="mainwp-extensions-api-sslverify-certificate" class="button-primary">
                                            <i class="fa fa-spinner fa-pulse" style="display: none;"></i><span class="status hidden"></span>
                                        </span>
                                </td>
                            </tr>
                        </tbody>
                    </table>                
                </div>
                  
                <strong><?php 
                _e("Step 1", "mainwp");
                ?>
</strong>
                <p><span class="description"><?php 
                _e("Enter your MainWP Extensions (https://extensions.mainwp.com) Login to automatically install and activate purchased extensions.");
                ?>
</span></p>
                <span><?php 
                _e("MainWP Extensions Login:"******"mainwp");
                ?>
</span><br /><br />
                <div class="api-grabbing-fields">              
                    <input type="text" class="input username" placeholder="<?php 
                echo __("Username", "mainwp");
                ?>
" value="<?php 
                echo $username;
                ?>
"/>&nbsp;
                    <input type="password" class="input passwd" placeholder="<?php 
                echo __("Password", "mainwp");
                ?>
" value="<?php 
                echo $password;
                ?>
"/>&nbsp;
                    <label><input type="checkbox" <?php 
                echo $checked_save ? 'checked="checked"' : "";
                ?>
 name="extensions_api_savemylogin_chk" id="extensions_api_savemylogin_chk"><?php 
                _e("Save API login", "mainwp");
                ?>
</label>
                </div>  
                <p>
                    <span class="extension_api_loading">
                        <input type="button" class="button-primary" id="mainwp-extensions-savelogin" value="<?php 
                _e("Save Login", "mainwp");
                ?>
">
                        <i class="fa fa-spinner fa-pulse" style="display: none;"></i><span class="status hidden"></span>
                    </span>
                </p>  
                <p><hr></p>            
                <strong><?php 
                _e("Step 2", "mainwp");
                ?>
</strong>
                <div id="mainwp-install-purchased-extensions">
                <p><span class="description"><?php 
                _e("The Install Purchased Extensions button will automatically install all your MainWP Extensions. You can also install them manually using the directions <a href=\"http://docs.mainwp.com/how-to-install-mainwp-extensions/\" >here</a>.");
                ?>
</span></p>
                <p>
                    <span class="extension_api_loading">
                        <input type="button" class="mainwp-upgrade-button button-primary" id="mainwp-extensions-bulkinstall" value="<?php 
                _e("Install purchased extensions", "mainwp");
                ?>
">
                        <i class="fa fa-spinner fa-pulse" style="display: none;"></i><span class="status hidden"></span>
                    </span>
                </p>                            
                </div>
                <p><hr></p>
                <strong><?php 
                _e("Step 3", "mainwp");
                ?>
</strong>
                <p><span class="description"><?php 
                _e("The Grab API Keys will automatically add your API Keys and activate your Extensions. You can also manually enter your API for each Extension following the steps <a href=\"http://docs.mainwp.com/enter-extensions-api-keys/\" >here</a>.");
                ?>
</span></p>
                <p>
                    <span class="extension_api_loading">
                        <input type="button" class="mainwp-upgrade-button button-primary" id="mainwp-extensions-grabkeys" value="<?php 
                _e("Grab Api Keys", "mainwp");
                ?>
">
                        <i class="fa fa-spinner fa-pulse" style="display: none;"></i><span class="status hidden"></span>
                    </span>
                </p>  
                <div style="clear: both;"></div>
            </div>
        </div>
    </div> 
       <?php 
            }
            ?>
         
<?php 
        }
        ?>
    
        
        <div class="mainwp-tabs" id="mainwp-tabs">            
            <a class="nav-tab pos-nav-tab <?php 
        if ($shownPage === '') {
            echo "nav-tab-active";
        }
        ?>
" href="admin.php?page=Extensions"><?php 
        _e('Manage Extensions', 'mainwp');
        ?>
</a>            
            <?php 
        if (isset($extensions) && is_array($extensions)) {
            foreach ($extensions as $extension) {
                if ($extension['plugin'] == $shownPage) {
                    ?>
                        <a class="nav-tab pos-nav-tab echo nav-tab-active" href="admin.php?page=<?php 
                    echo $extension['page'];
                    ?>
"><?php 
                    echo $extension['name'];
                    ?>
</a>
                        <?php 
                }
            }
        }
        ?>
        </div>
        <div id="mainwp_wrap-inside">
        <?php 
    }