Ejemplo n.º 1
0
" />
		</p>
		<p>
			<input type="submit" class="button" id="synthesis-scribe-submit" value="Save Scribe Key" />
			<span class="spinner" id="synthesis-scribe-save-spinner" style="float: none; display: none"></span>
		</p>
	</form>
	<?php 
}
?>
	
	<?php 
Synthesis_Resource_Monitor::disk_quota_markup();
?>
	<?php 
Synthesis_Resource_Monitor::bandwidth_quota_markup();
?>

	<h3 class="title"><?php 
_e('Database Snapshot');
?>
</h3>

	<p>
		<?php 
_e('Take a snapshot of your database before making any major changes, like activating a new theme or plugin');
?>
	</p>
	
	<p>
		<?php 
Ejemplo n.º 2
0
        $bandwidth_usage['projected_cost'] = self::BANDWIDTH_OVERAGE_COST * $bandwidth_usage['projected_difference'];
        return $bandwidth_usage;
    }
    /**
     * Determine if this user can see bandwidth warnings.
     * Will return for the super admin on multisite, or an admin on a normal install.
     *
     * @param $user_id int The id of the user to check permissions for
     * @return bool If the user should be shown the warning.
     */
    public static function user_can_see_warnings($user_id)
    {
        return function_exists('is_multisite') && is_multisite() && user_can($user_id, 'manage_network') || (!function_exists('is_multisite') || !is_multisite()) && user_can($user_id, 'install_plugins');
    }
    /**
     * Determine if bandwidth usage shows potential for overage.
     * @param array $bandwidth_usage Bandwidth usage data.
     * @return bool
     */
    public static function should_warn_about_bandwidth($bandwidth_usage)
    {
        if (self::user_can_see_warnings(get_current_user_id())) {
            if (isset($bandwidth_usage['projected_safe_usage'])) {
                return $bandwidth_usage['used'] >= $bandwidth_usage['projected_safe_usage'];
            }
        }
        return false;
    }
}
Synthesis_Resource_Monitor::start();