Skip to content

Commit

Permalink
Fix conditional and update description; See: wpsharks/comet-cache#754
Browse files Browse the repository at this point in the history
  • Loading branch information
kristineds committed May 21, 2016
1 parent 4d121cc commit 0d45adf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/includes/classes/MenuPageOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ public function __construct()

echo '<div class="plugin-menu-page-panel">'."\n";

if (is_multisite() && $this->plugin->applyWpFilters(GLOBAL_NS.'_exclude_hosts_option_enable', is_multisite())) {
if ($this->plugin->applyWpFilters(GLOBAL_NS.'_exclude_hosts_option_enable', is_multisite())) {
// Display option panel for Host Exclusion Patterns.

echo ' <a href="#" class="plugin-menu-page-panel-heading">'."\n";
Expand All @@ -706,10 +706,11 @@ public function __construct()

echo ' <div class="plugin-menu-page-panel-body clearfix">'."\n";
echo ' <h3>'.__('Don\'t Cache These Special Host Exclusion Patterns?', SLUG_TD).'</h3>'."\n";
echo ' <p>'.__('Sometimes there are certain cases where a particular file, or a particular group of files, should never be cached. This is where you will enter those if you need to (one per line). Searches are performed against the <a href="https://gist.github.com/jaswsinc/338b6eb03a36c048c26f" target="_blank" style="text-decoration:none;"><code>HTTP_HOST</code></a>; i.e., <code>/path/?query</code> (caSe insensitive). So, don\'t put in full URLs here, just word fragments found in the file path (or query string) is all you need, excluding the http:// and domain name. A wildcard <code>*</code> character can also be used when necessary; e.g., <code>/category/abc-followed-by-*</code> (where <code>*</code> = 0 or more characters that are NOT a slash <code>/</code>). Other special characters include: <code>**</code> = 0 or more characters of any kind, including <code>/</code> slashes; <code>^</code> = beginning of the string; <code>$</code> = end of the string. To learn more about this syntax, please see <a href ="http://cometcache.com/r/watered-down-regex-syntax/" target="_blank">this KB article</a>.', SLUG_TD).'</p>'."\n";
echo ' <p>'.__('If there are specific domains that should not be cached, you can enter them here so they are excluded automatically. The easiest way to exclude a host is to enter the full domain name on a line of it\'s own in the field below.', SLUG_TD).'</p>'."\n";
echo ' <p>'.__('This field also supports <a href ="http://cometcache.com/r/watered-down-regex-syntax/" target="_blank" style="text-decoration:none;">Watered-Down Regex</a> syntax, which means that you can also exclude a pattern like: <code>*.example.com</code> or <code>*.example.*</code>. So for instance, if you wanted to exclude all child sites and only cache pages on the Main Site of a Network installation, you could exclude all sub-domains using: <code>*.mynetwork.com</code>. That excludes <code>anything.mynetwork.com</code>, but not <code>mynetwork.com</code> by itself.', SLUG_TD).'</p>'."\n";

echo ' <p><textarea name="'.esc_attr(GLOBAL_NS).'[saveOptions][exclude_hosts]" rows="5" spellcheck="false" class="monospace">'.format_to_edit($this->plugin->options['exclude_hosts']).'</textarea></p>'."\n";

echo ' <p class="info">'.__('<strong>Tip:</strong> let\'s use this example child site that uses a sub-domain: <code>http://www.child-blog.main.com</code>. To exclude this child site, you would put this line into the field above: <code>www.child-blog.main.com</code>. Or, you could also just put in a small fragment, like: <code>^child-blog.*$</code> and that would exclude any host containing that word fragment.', SLUG_TD).'</p>'."\n";
echo ' <p class="info">'.__('<strong>Note:</strong> please remember that your entries here should be formatted as a line-delimited list; e.g., one exclusion pattern per line.', SLUG_TD).'</p>'."\n";
echo ' </div>'."\n";
}
Expand Down

0 comments on commit 0d45adf

Please sign in to comment.