コード例 #1
0
ファイル: wss-functions.php プロジェクト: yarwalker/ecobyt
/**
 * make sure we can display any of the plugin's pages
 * @return bool
 */
function wpsCanDisplayPage()
{
    if (!WsdUtil::canLoad()) {
        return false;
    }
    if (!WsdUtil::isAdministrator()) {
        return false;
    }
    if (!wpsIsValidInstall()) {
        wpsDisplayInstallErrorNotices();
        return false;
    }
    return true;
}
コード例 #2
0
<?php

if (!WsdUtil::canLoad()) {
    return;
}
if (!WsdUtil::isAdministrator()) {
    return;
}
$progress = WsdWPScanSettings::getSetting('SCAN_PROGRESS');
if ($progress == WsdWPScanSettings::SCAN_PROGRESS_NONE) {
    $currentlyScanning = 'nothing';
} elseif ($progress == WsdWPScanSettings::SCAN_PROGRESS_ROOT) {
    $currentlyScanning = '<strong>root</strong> directory';
} elseif ($progress == WsdWPScanSettings::SCAN_PROGRESS_ADMIN) {
    $currentlyScanning = '<strong>wp-admin</strong> directory';
} elseif ($progress == WsdWPScanSettings::SCAN_PROGRESS_CONTENT) {
    $currentlyScanning = '<strong>wp-content</strong> directory';
} elseif ($progress == WsdWPScanSettings::SCAN_PROGRESS_INCLUDES) {
    $currentlyScanning = '<strong>wp-includes</strong> directory';
}
?>
<style type="text/css">
    #progressBar { width: 400px; padding: 0 0; line-height: normal; }
    #step { display:block; background: #e0e0e0; border: solid 1px #bebebe;padding: 3px 0; margin: 0 0; line-height: normal; text-align: center;}
    #step span { font-weight: 800; color: #000; font-size: 12px; }
</style>

<h3 style="margin-bottom: 2px;">Scan State: In Progress</h3>
<hr style="height:1px; color: #eee; margin-top: 0; width: 75%;"/>

<div id="progressBar"><p id="step"><span></span></p></div>
コード例 #3
0
 /** Remove the version parameter from urls */
 public static function fix_removeWpVersionFromLinks($src = '')
 {
     global $wpsPluginAlertsArray;
     $actionName = $wpsPluginAlertsArray['fix_remove_wp_version_links']['name'];
     $alertType = $wpsPluginAlertsArray['fix_remove_wp_version_links']['type'];
     /* This check is important so this function will run only if the user enables it. */
     if (!self::isSettingEnabled(__FUNCTION__)) {
         self::alert($actionName, $alertType, WpsSettings::ALERT_CRITICAL, __('WordPress version is displayed in links for all users', WpsSettings::TEXT_DOMAIN), __('<p>By default, WordPress will display the current version in links to javascript scripts or stylesheets.
                 Therefore, if anyone has access to this information it might be a security risk because if a hacker knows which version of WordPress a website is running,
                 it can make it easier for him to target a known WordPress security issue.</p>', WpsSettings::TEXT_DOMAIN), sprintf(__('<p>This plugin can automatically hide the WordPress version from links if the option <strong>"%s"</strong> is checked on the plugin\'s settings page.</p>', WpsSettings::TEXT_DOMAIN), 'Remove the version parameter from urls'));
         return;
     }
     if (!WsdUtil::isAdministrator()) {
         add_filter('script_loader_src', array('WsdSecurityHelper', '__removeWpVersionFromLinks'));
         add_filter('style_loader_src', array('WsdSecurityHelper', '__removeWpVersionFromLinks'));
     }
     self::alert($actionName, $alertType, WpsSettings::ALERT_INFO, __('WordPress version displayed in links only for administrator users.', WpsSettings::TEXT_DOMAIN), __('<p>By default, WordPress will display the current version in links to javascript scripts or stylesheets.
                 Therefore, if anyone has access to this information it might be a security risk because if a hacker knows which version of WordPress a website is running,
                 it can make it easier for him to target a known WordPress security issue.</p>', WpsSettings::TEXT_DOMAIN));
 }