This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add some debug info just before </head> | |
if ( $this->debug ) { | |
$tag = "<!--\n\tgenerated in " . $cache['timer'] . " seconds\n\t" . strlen(serialize($cache)) . " bytes batcached for " . $this->max_age . " seconds\n-->\n"; | |
if ( false !== $tag_position = strpos($output, '</head>') ) { | |
$tag = "<!--\n\tgenerated in " . $cache['timer'] . " seconds\n\t" . strlen(serialize($cache)) . " bytes batcached for " . $this->max_age . " seconds\n-->\n"; | |
$output = substr($output, 0, $tag_position) . $tag . substr($output, $tag_position); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add some debug info just before </head> | |
if ( $batcache->debug ) { | |
if ( false !== $tag_position = strpos($batcache->cache['output'], '</head>') ) { | |
$tag = "<!--\n\tgenerated " . (time() - $batcache->cache['time']) . " seconds ago\n\tgenerated in " . $batcache->cache['timer'] . " seconds\n\tserved from batcache in " . $batcache->timer_stop(false, 3) . " seconds\n\texpires in " . ($batcache->max_age - time() + $batcache->cache['time']) . " seconds\n-->\n"; | |
$batcache->cache['output'] = substr($batcache->cache['output'], 0, $tag_position) . $tag . substr($batcache->cache['output'], $tag_position); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This order might seem weird - this is attempted to match last if rules below fail. | |
# http://wiki.nginx.org/HttpCoreModule | |
location / { | |
try_files $uri $uri/ /index.php?$args; | |
index index.html index.htm index.php; | |
# WordPress multisite files rule | |
rewrite .*/files/(.*)$ /wp-includes/ms-files.php?file=$1 last; | |
if (!-e $request_filename) { | |
rewrite ^.+/?(/wp-.*) $1 last; | |
rewrite ^.+/?(/.*\.php)$ $1 last; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
##DM - uncomment following line for domain mapping | |
#listen 80 default_server; | |
server_name example.com *.example.com ; | |
##DM - uncomment following line for domain mapping | |
#server_name_in_redirect off; | |
access_log /var/log/nginx/example.com.access.log; | |
error_log /var/log/nginx/example.com.error.log; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
##DM - uncomment following line for domain mapping | |
#listen 80 default_server; | |
server_name example.com *.example.com ; | |
##DM - uncomment following line for domain mapping | |
#server_name_in_redirect off; | |
access_log /var/log/nginx/example.com.access.log; | |
error_log /var/log/nginx/example.com.error.log; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user www-data; | |
worker_processes 1; | |
error_log /var/log/nginx/error.log warn; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Before: | |
Transactions: 675 hits | |
Availability: 100.00 % | |
Elapsed time: 119.88 secs | |
Data transferred: 9.48 MB | |
Response time: 15.89 secs | |
Transaction rate: 5.63 trans/sec | |
Throughput: 0.08 MB/sec | |
Concurrency: 89.46 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{Stub}} | |
While the LAMP stack is very popular (Linux + Apache + MySQL + PHP) for powering WordPress, a lot of people have started using Nginx in place of Apache. This page aims to help those looking to configure WordPress with Nginx. | |
Before you consider using Nginx, be aware that PHP APC or a similar opcode cache with a WordPress caching plugin is going to offer significant performance improvements over just switching from Apache to nginx. If you aren't already using a PHP opcode cache and WordPress caching plugin, Nginx will do little for your WordPress-based website's performance. WordPress development is intertwined with the Apache world, and as a result, support for Nginx-based setups is limited; but it is growing. Factor these things into your decision to use Nginx. | |
This is '''not going to cover''' how to install and configure Nginx, so this assumes that you have already installed Nginx and have a basic understanding of how to work with it. | |
'''Note''': This has been tested on and known to work with |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Plugin Name: My Sites Search | |
* Plugin URI: trepmal.com | |
* Description: https://twitter.com/trepmal/status/443189183478132736 | |
* Version: | |
* Author: Kailey Lampert | |
* Author URI: kaileylampert.com | |
* License: GPLv2 or later | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Block Brute Plugins | |
* Description: Custom magic | |
* Version: 1.0 | |
* Author: Eric Mann | |
* Author URI: http://10up.com | |
* License: MIT | |
*/ | |
function block_brute_address( $ip_address ) { |
OlderNewer