theselected('super_static_cache_mode', 'phprewrite');
?>
><label><?php 
_e('PHP Mode', 'super_static_cache');
?>
</label>
                <input type="radio" name="super_static_cache_mode" value="serverrewrite" <?php 
theselected('super_static_cache_mode', 'serverrewrite');
?>
><label><?php 
_e('Rewrite Mode (Recommend)', 'super_static_cache');
?>
</label>

                <div class="updaterewrite" <?php 
if (get_option('super_static_cache_mode') == 'serverrewrite' && !is_rewrite_ok()) {
    echo 'style="display:block"';
}
?>
>
                    <span><?php 
_e('Please Add This Rewrite Rules to your webserver:', 'super_static_cache');
?>
</span>
                    <pre><?php 
echo showrewriterule();
?>
</pre>
                </div>

            </div>
Esempio n. 2
0
function notice_msg()
{
    $permalink_structure = get_option("permalink_structure");
    $cachemod = get_option("super_static_cache_mode");
    $isstrict = get_option("super_static_cache_strict");
    $siteurl = get_option("siteurl");
    //对固定链接进行分析
    //反斜杠出现的的次数
    $dircount = substr_count($permalink_structure, '/');
    //去掉目录之后的文件名
    $fname = substr($permalink_structure, strripos($permalink_structure, "/") + 1);
    if ($cachemod == 'close') {
        return array(false, __('Cache feature is turned off', 'super_static_cache'));
    } else {
        if (empty($permalink_structure)) {
            return array(false, __('You Must update Permalink to enable Super Static Cache', 'super_static_cache'));
        } else {
            if ($cachemod == 'serverrewrite' && !is_rewrite_ok()) {
                return array(false, __('Rewrite Rules Not Update!', 'super_static_cache'));
            } else {
                if ($isstrict && $fname != "" && !strstr($fname, ".")) {
                    return array(false, __('Strict Cache Mode not Support current Permalink!', 'super_static_cache'));
                } else {
                    if ($cachemod == 'direct' && $dircount > 2) {
                        return array(false, __('Cache is enabled, But Some Pages May return 403 status or a index page cause your Permalink Settings', 'super_static_cache'));
                    }
                }
            }
        }
    }
    return array(true, __('OK', 'super_static_cache'));
}