Secure WordPress with .htaccess file

Securing WordPress involves many many techniques, tricks. I don’t want to go too far on this topic, here let me share with you some useful code snippets that you can throw into .htaccess file without thinking. These code snippets will greatly enhance the security level of your WordPress blog/website, keeping 90% hackers outside of your site!

This tutorial applies to Apache, Lightspeed servers only.

Before we start , make sure you have this tiny, yet powerful file name .htaccess on your site root folder.

Note: if your WordPress installation is not on site root folder, don’t take .htaccess file with WordPress, this file must be kept on website root folder, it could, theoretically, be reached with this url :  http://www.domain.com/.htaccess   (due to security reasons, it could be reached using this way, but it’s there, right under the root folder ! )
Continue reading

Posted in WordPress | Leave a comment

How to Extract Photos from Microsoft Windows Themes

What is a Windows Theme?

A theme is a combination of desktop background pictures, window colors, and sounds. You can preview each theme’s image collection by clicking Details. To get a theme, click Download, and then click Open. This saves the theme to your PC and puts it on your desktop. See Personalize your PC to learn more.

These themes offered by Windows are just so beautiful, so amazing. I’d like to collect some of the photos within the theme, but what I downloaded is Windows Theme Pack File (.themepack), like this:
Continue reading

Posted in Windows / Linux | 1 Comment

How to Load JavaScript Libraries from Google CDN & Why It’s Not Recommended

Tons of articles smartly tell us that we should add the following piece of code to theme’s functions.php file in order to harness the advantage of Google CDN:

//dequeue jQuery from any plugin
 add_action( 'wp_enqueue_scripts', 'dequeue_jquery', 999999 );
//enqueue jQuery from Google CDN
 function dequeue_jquery() {
 wp_deregister_script( 'jquery' );
 wp_register_script( 'jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js');
 wp_enqueue_script( 'jquery' );
 }

This code snippet will dequeue jQuery library from WordPress, and enqueue Google hosted jQuery.

Continue reading

Posted in WordPress | Leave a comment

HTML 5 – Using attribute ‘id’ instead of attribute ‘name’ for Anchors

HTML 5As discussed on stackoverflow.com HTML Anchors with ‘name’ or ‘id’?

According to the HTML 5 specification, we should use id attribute instead of name for anchors.

Right:

<a id="anchorname"></a>
<h1 id="anchorname">TEXT</h1>

Wrong:

<a name="anchorname"></a>

Insisting on using name attribute might cause many problems, such as “browser not scrolling to the right anchor position
Continue reading

Posted in WordPress | 2 Comments

How to Reinstall WordPress Plugins Wisely

Reinstalling WordPress itself is very easy, just go to Update Center and hit the reinstall button.

reinstall WordPress is easy

How about reinstalling plugins? You might answer :

I firstly remove the old plugin then install it again.  OR I firstly remove it then go to FTP and upload a fresh new copy.

Come on, that’s so silly, and slow. Here’s a quick handy way of reinstalling WordPress plugins and themes (from WordPress.org)
Continue reading

Posted in WordPress | 9 Comments