Skip to content

Commit

Permalink
Fill replacement codes before showing manual .htaccess config
Browse files Browse the repository at this point in the history
  • Loading branch information
raamdev committed Jul 6, 2016
1 parent 6bf5dac commit 2dc6e73
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/includes/classes/MenuPageOptions.php
Expand Up @@ -1060,7 +1060,7 @@ public function __construct()
echo ' <p>'.__('Or, you can update your configuration manually: [<a href="#" data-toggle-target=".'.esc_attr(GLOBAL_NS.'-apache-optimizations--gzip-configuration').'"><i class="si si-eye"></i> .htaccess configuration <i class="si si-eye"></i></a>]', SLUG_TD).'</p>'."\n";
echo ' <div class="'.esc_attr(GLOBAL_NS.'-apache-optimizations--gzip-configuration').'" style="display:none; margin-top:1em;">'."\n";
echo ' <p>'.__('<strong>To enable GZIP compression:</strong> Create or edit the <code>.htaccess</code> file in your WordPress installation directory and add the following lines to the top:', SLUG_TD).'</p>'."\n";
echo ' <pre class="code"><code>'.esc_html(file_get_contents(dirname(__DIR__).'/templates/htaccess/gzip-enable.txt')).'</code></pre>'."\n";
echo ' <pre class="code"><code>'.esc_html($this->plugin->fillReplacementCodes(file_get_contents(dirname(__DIR__).'/templates/htaccess/gzip-enable.txt'))).'</code></pre>'."\n";
echo ' <p class="info" style="display:block;">'.__('<strong>Or</strong>, if your server is missing <code>mod_deflate</code>/<code>mod_filter</code>; open your <code>php.ini</code> file and add this line: <a href="http://php.net/manual/en/zlib.configuration.php" target="_blank" style="text-decoration:none;"><code>zlib.output_compression = on</code></a>', SLUG_TD).'</p>'."\n";
echo ' </div>'."\n";

Expand All @@ -1081,7 +1081,7 @@ public function __construct()
echo ' <p>'.__('Or, you can update your configuration manually: [<a href="#" data-toggle-target=".'.esc_attr(GLOBAL_NS.'-apache-optimizations--leverage-browser-caching').'"><i class="si si-eye"></i> .htaccess configuration <i class="si si-eye"></i></a>]', SLUG_TD).'</p>'."\n";
echo ' <div class="'.esc_attr(GLOBAL_NS.'-apache-optimizations--leverage-browser-caching').'" style="display:none; margin-top:1em;">'."\n";
echo ' <p>'.__('<strong>To enable Browser Caching:</strong> Create or edit the <code>.htaccess</code> file in your WordPress installation directory and add the following lines to the top:', SLUG_TD).'</p>'."\n";
echo ' <pre class="code"><code>'.esc_html(file_get_contents(dirname(__DIR__).'/templates/htaccess/browser-caching-enable.txt')).'</code></pre>'."\n";
echo ' <pre class="code"><code>'.esc_html($this->plugin->fillReplacementCodes(file_get_contents(dirname(__DIR__).'/templates/htaccess/browser-caching-enable.txt'))).'</code></pre>'."\n";
echo ' </div>'."\n";
}

Expand All @@ -1097,9 +1097,9 @@ public function __construct()
echo ' <div class="'.esc_attr(GLOBAL_NS.'-apache-optimizations--enforce-cononical-urls').'" style="display:none; margin-top:1em;">'."\n";
echo ' <p>'.__('<strong>To enforce Canonical URLs:</strong> Create or edit the <code>.htaccess</code> file in your WordPress installation directory and add the following lines to the top:', SLUG_TD).'</p>'."\n";
if ($GLOBALS['wp_rewrite']->use_trailing_slashes) {
echo ' <pre class="code"><code>'.esc_html(file_get_contents(dirname(__DIR__).'/templates/htaccess/canonical-urls-ts-enable.txt')).'</code></pre>'."\n";
echo ' <pre class="code"><code>'.esc_html($this->plugin->fillReplacementCodes(file_get_contents(dirname(__DIR__).'/templates/htaccess/canonical-urls-ts-enable.txt'))).'</code></pre>'."\n";
} else {
echo ' <pre class="code"><code>'.esc_html(file_get_contents(dirname(__DIR__).'/templates/htaccess/canonical-urls-no-ts-enable.txt')).'</code></pre>'."\n";
echo ' <pre class="code"><code>'.esc_html($this->plugin->fillReplacementCodes(file_get_contents(dirname(__DIR__).'/templates/htaccess/canonical-urls-no-ts-enable.txt'))).'</code></pre>'."\n";
}
echo ' </div>'."\n";
}
Expand All @@ -1118,7 +1118,7 @@ public function __construct()
echo ' <p>'.__('Or, you can update your configuration manually: [<a href="#" data-toggle-target=".'.esc_attr(GLOBAL_NS.'-apache-optimizations--access-control-allow-origin').'"><i class="si si-eye"></i> .htaccess configuration <i class="si si-eye"></i></a>]', SLUG_TD).'</p>'."\n";
echo ' <div class="'.esc_attr(GLOBAL_NS.'-apache-optimizations--access-control-allow-origin').'" style="display:none; margin-top:1em;">'."\n";
echo ' <p>'.__('<strong>To send the Access-Control-Allow-Origin header:</strong> Create or edit the <code>.htaccess</code> file in your WordPress installation directory and add the following lines to the top:', SLUG_TD).'</p>'."\n";
echo ' <pre class="code"><code>'.esc_html(file_get_contents(dirname(__DIR__).'/templates/htaccess/access-control-allow-origin-enable.txt')).'</code></pre>'."\n";
echo ' <pre class="code"><code>'.esc_html($this->plugin->fillReplacementCodes(file_get_contents(dirname(__DIR__).'/templates/htaccess/access-control-allow-origin-enable.txt'))).'</code></pre>'."\n";
echo ' </div>'."\n";
}
echo ' </div>'."\n";
Expand Down

0 comments on commit 2dc6e73

Please sign in to comment.