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

Remove the title attribute using jQuery

Published

on

In WordPress, when you use wp_page_menu your anchor attribute’s usually carry a title with the same name. I’m not sure if it’s correct to do this, but it bother me when I hover over a page menu navigation link and I get a hover of the title.

So on my site I used jQuery to remove the title:

  $("#nav a").removeAttr("title");  

Pretty simple huh?

Continue Reading

Tips & Tricks

How to: Open external links in a new window

Published

on

Over the weekend, I attended WordCamp Denver, and I was asked by John Hawkins how to force links to open in a new tab with out editing the source code. So, today lets learn a simple jQuery trick to open all external links in your site in a new tab or window. We are going to make sure you have jQuery active on your site, you can do this easily in WordPress, since it’s bundled with the latest installations. Use this code in your header: <?php wp_enqueue_script('jquery'); ?> then, below the wp_head add the following:

  <script type="text/javacript">  var $j = jQuery.noConflict();    $j(document).ready(function() {  //external attribute      $j("a:not([@href*=http://YOURSITE.com/])").not("[href^=#]")          .addClass("external")          .attr({ target: "_blank" });      }  );  </script>  

That’s it, just make sure you change the http://YOURSITE.com to your website.

Update

If you like you can remove the var $j = and replace all $j with simply just $

 

Continue Reading

Themes

Fixing plugins not compatible with hybrid 0.4.2

Published

on

Hey everyone, as you may have noticed I have a running on the site. While everything almost everything moved over smoothly, there was an issue with how my parent theme striped text in typography. This caused some plugins, like cformsII to not be allowed to print to the screen. Justin had helped to find a fix to filter the hybrid_typography function.

Originally this function filtered out and changed some text that would not validate as XHTML. This had to be removed by running a new function in the child theme’s function.php file.

add_action('init', 'remove_typography');    function remove_typography() {  	remove_filter('the_content', 'hybrid_typography', 11);  }
Continue Reading

Random Search Terms

Title

Recent Posts: Fully Net Worth . com

Juice Wrld Net Worth: 5 Interesting Facts You Should Know

Juice Wrld Net Worth: 5 Interesting Facts You Should Know

Juice Wrld, which is a stage name of the famous American rapper, singer and songwriter Jarad Higgins. The rapper who was born in Illinois, Chicago was brought to limelight by his hit single “Lucid dreams” which he officially released in 2018. The song went viral making it to the number two spot on the Billboard […]

Mike Bibby Net Worth.

Mike Bibby Net Worth.

Mike Bibby Net Worth. Among the world-famous basketball players, Mike Bibby is undeniably one of the top players. He is, at present, a global personality. Mike Bibby is a national champion of the year 1997 and a Pac 10 1998 player in Arizona. He is one of the most highly regarded players of the National […]

Chelsea Houska Net Worth: How Rich is the ‘Teen Mom’ Star?

Chelsea Houska Net Worth: How Rich is the ‘Teen Mom’ Star?

Chelsea Anne Houskais an American television personality who is best known for being a part of the reality television show “Teen Moms 2.” Before this, she had been a part of the show called 16 and Pregnant. As of 2019, Chelsea Houska net worth is estimated to be $80,000. Houska was born on August 29, […]

Molly Yeh Net Worth: How Rich is the American Chef Actually?

Molly Yeh Net Worth: How Rich is the American Chef Actually?

Molly Yeh is an American chef, blogger, and cookbook author. She is also an Instagrammer where she presents her cooking techniques on her profile. As of 2019, Molly Yeh net worth is estimated to be $1.5 million. Molly was born on May 22, 1988, in Glenview, Illinois to parents John Bruce Yeh and Jody Yeh. […]

Trending