Connect with us

Tips & Tricks

WordPress Security Hacks

Published

on

Hi guys this is my first post on wpcult the great site Austin built.  Hope you guys find it usefull.

If you run a blog using the wordpress software then your blog is a target to hackers.  Below I will list some hacks and just how they can help you keep your business/site safe.

The following is  code to Block Bad Queries and protect your blog from malicious URL Requests.

Place the following code into a text file and name it what ever you like for example blockbadqueries.php upload it to your plugin folder and activate it in your wordpress admin just as you would any other Plugin

<?php
/*
Plugin Name: Block Bad Queries
Plugin URI:
http://perishablepress.com/press/2009/12/22/protect-wordpress-against-malicious-url-requests/
Description: Protect WordPress Against Malicious URL Requests
Author URI:
http://perishablepress.com/
Author: Perishable Press
Version: 1.0
*/
global $user_ID; if($user_ID) {
  if(!current_user_can(‘level_10’)) {
    if (strlen($_SERVER[‘REQUEST_URI’]) > 255 ||
      strpos($_SERVER[‘REQUEST_URI’], “eval(“) ||
      strpos($_SERVER[‘REQUEST_URI’], “CONCAT”) ||
      strpos($_SERVER[‘REQUEST_URI’], “UNION+SELECT”) ||
      strpos($_SERVER[‘REQUEST_URI’], “base64”)) {
        @header(“HTTP/1.1 414 Request-URI Too Long”);
 @header(“Status: 414 Request-URI Too Long”);
 @header(“Connection: Close”);
 @exit;
    }
  }
}
?>

 This Great plugin was made by Jeff Starr of Digging into WordPress

 

 

Protecting your blog with .htaccess 

.htaccess files have lots of possibilities. below is some code that will help protect your wordpress from modification of _REQUEST and/or GLOBALS and scripts injection.

 This is real simple just paste the following code into your .htaccess file. Always make a backup of your .htaccess before editing, better to be safe.

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule ^(.*)$ index.php [F,L]

 

Thanks to Oussama for this great hack

Tips & Tricks

Add a shortcode

Published

on

This is a simple one.

/**
 * Your Blog title
 *
 */
function my_blog_title() {
	$blogname = get_bloginfo('name');
    return '<span class="blog-title">' . $blogname . '</span>';
}		  	
add_shortcode('blog-title', 'my_blog_title');

Just add this to your functions.php file and then add [blog-title] in any post or page and it will return your Blog Title. :)

Continue Reading

Tips & Tricks

Adding a external file after the first post

Published

on

How might you display a Google ad after the first post or anything you like? It is very simple. You just need to add the variable $loopcounter in the Loop. If the $loopcounter is less than or equal to 1, then include your option. Check out the code:

<?php if (have_posts()) : while (have_posts()) : the_post(); $loopcounter++; ?>

  // your loop

  <?php if ($loopcounter <= 1) { include (STYLESHEETPATH . '/you-file.php'); } ?>

<?php endwhile; ?>

<?php else : ?>

<?php endif; ?>

Pretty simple huh. Well in the $loopcounter line, you may change the include to point to any file or maybe a custom widget like so:

<?php if ($loopcounter <= 1) { dynamic_sidebar( 'Plus Post' ); } ?>

Or use your code directly in between the { & }.

Continue Reading

Tips & Tricks

A simple way to query posts

Published

on

Here is a simple way to call query_posts with an array of options. For all options you my use visit: WordPress Codex.

<?php $my_query = array('showposts' => 4, 'post__not_in' => $do_not_duplicate); ?>

    <?php query_posts($my_query); ?>
Continue Reading

Random Search Terms

Title

Recent Posts: Fully Net Worth . com

Mason Rudolph Net Worth: How Rich is the NFL Player Actually?

Mason Rudolph Net Worth: How Rich is the NFL Player Actually?

Mason Rudolph is an American football quarterback who currently plays for the Pittsburgh Steelers of the National Football League. As of 2019, Mason Rudolph net worth is estimated to be $4 million. Rudolph was born on July 17, 1955, in Rock Hill, South Carolina and was named after his father and grandfather. He went to […]

Lil TJay Net Worth: 5 Interesting Facts About The Rapper

Lil TJay Net Worth: 5 Interesting Facts About The Rapper

Tione Merritt, who is better known by his stage name as Lil Tjay is a young and rising American rapper and songwriter originally from the Bronx in New York. Here are some interesting facts about Lil Tjay: 1. Lil Tjay net worth is estimated to be $600,000 As of 2019, Lil Tjay net worth is […]

Jim Jordan Net Worth: How Rich is the Republican Congressman?

Jim Jordan Net Worth: How Rich is the Republican Congressman?

James Daniel Jordan, also known as Jim Jordan, is an American politician and former wrestler. He is part of the U.S. Representative for Ohio’s 4th congressional district since 2007. Moreover, he is also a ranking member of the House Oversight Committee since 2019. As of 2019, Jim Jordan net worth is estimated to be $400,000. […]

Catherine Tyldesley Net Worth: How Rich is the Actress Actually?

Catherine Tyldesley Net Worth: How Rich is the Actress Actually?

Catherine Tyldesley is an English actress who is best known for her role as Eva Price in the soap opera Coronation Street on ITV. She recently appeared in the popular show called Strictly Come Dancing along with Johannes Radebe in its seventeenth edition. As of 2019, Catherine Tyldesley net worth is estimated to be £800,000. […]

Trending