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
#!/usr/bin/perl | |
use cPanel::PublicAPI; | |
use Getopt::Long; | |
&Getopt::Long::config('bundling'); | |
# Options args | |
my $conf = GetOptions( | |
"H|hostname=s" => \$conf_host, | |
"P|port=i" => \$conf_port, |
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
//figure out which css to load | |
if(file_exists(get_stylesheet_directory() . "/pluginname/frontend.css")) | |
$css_url = get_stylesheet_directory_uri() . "/pluginname/frontend.css"; | |
elseif(file_exists(get_template_directory() . "/pluginname/frontend.css")) | |
$css_url = get_template_directory_uri() . "/pluginname/frontend.css"; | |
else | |
$css_url = plugins_url('css/frontend.css',dirname(__FILE__) ); | |
//load it | |
wp_enqueue_style('pluginname-frontend', $css_url); |
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 | |
//Load WorsPress quick and dirty into something not WordPress. This is horrible I know, | |
//But the database queries they are so low, and it's just so dirty | |
//install WordPress in a dir like /lib or something and stick classPageLoader.php in there, ha! | |
//Example use for a index.php or whatever, no autoloading here! | |
####################################################### | |
require('lib/classPageLoader.php'); | |
$content = new LoadWpContent(); |
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
WordPress block botnet brute force with Mod_security | |
SecAction phase:1,nolog,pass,initcol:ip=%{REMOTE_ADDR},initcol:user=%{REMOTE_ADDR},id:5000134 | |
<Locationmatch "/wp-login.php"> | |
# Setup brute force detection. | |
# React if block flag has been set. | |
SecRule user:bf_block "@gt 0" "deny,status:401,log,id:5000135,msg:'ip address blocked for 5 minutes, more than 10 login attempts in 3 minutes.'" | |
# Setup Tracking. On a successful login, a 302 redirect is performed, a 200 indicates login failed. | |
SecRule RESPONSE_STATUS "^302" "phase:5,t:none,nolog,pass,setvar:ip.bf_counter=0,id:5000136" | |
SecRule RESPONSE_STATUS "^200" "phase:5,chain,t:none,nolog,pass,setvar:ip.bf_counter=+1,deprecatevar:ip.bf_counter=1/180,id:5000137" |
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 | |
/** | |
* | |
* This removes the ability to add the FULL image size into a post, it does not alter or delete the image | |
* Add whataever extra image sizes to the insert dropdown in WordPress you create via add_image_size | |
* | |
* For now we have to do it this way to make the labels translatable, see trac ref below. | |
* | |
* If your theme has $content_width GLOBAL make sure and remove it |
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
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] | |
</IfModule> |
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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
*/ | |
$args = array( |
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 | |
/** | |
* The base configurations of the WordPress. | |
* | |
* This file has the following configurations: MySQL settings, Table Prefix, | |
* Secret Keys, WordPress Language, and ABSPATH. You can find more information | |
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing | |
* wp-config.php} Codex page. You can get the MySQL settings from your web host. | |
* | |
* This file is used by the wp-config.php creation script during the |
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 | |
function roots_root_relative_url($input) { | |
$output = preg_replace_callback( | |
'!(https?://[^/|"]+)([^"]+)?!', | |
create_function( | |
'$matches', | |
// if full URL is site_url, return a slash for relative root | |
'if (isset($matches[0]) && $matches[0] === site_url()) { return "/";' . | |
// if domain is equal to site_url, then make URL relative |
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 | |
// rewrite /wp-content/themes/theme-name/css/ to /css/ | |
// rewrite /wp-content/themes/theme-name/js/ to /js/ | |
// rewrite /wp-content/themes/theme-name/img/ to /img/ | |
// rewrite /wp-content/plugins/ to /plugins/ | |
function roots_flush_rewrites() { | |
global $wp_rewrite; | |
$wp_rewrite->flush_rules(); | |
} |
OlderNewer