Wordpress – Which file is the most important?




Tagged Under : , ,

Version: 13.1
Revision: 15 Build 33

Wordpress – Which file is the most important?

Introduction:
In this tutorial, we are going to learn the basic about files, directory and study how important these files can be! But, for those who already knew these, then I am not going to argue. But, you may want to continue and learn something new… it’s your choice!

————————

Everyday, when we login and operate Wordpress, there is a file that controls your SQL database and your administrator panel. This file is called: “wp-config.php”. However, if there is a server problem or your blog was hacked, there is a chance that you may lose your “Wordpress password and SQL Database”. Therefore, you have to create a plan and keep these files in a safe place!

On the other hand, your SQL database, it can be ‘backed up’ with your Cpanel and export it to your external devices, such as: removable drive or compact disk. But, please be aware about your internal hard drive. They can crash and cause serious problem! So, get yourself an external hard drive, if you don’t have one yet!

Secondly, if you have a large collection of plug-ins, you may also want to compress all of these as a ZIP file and download them to your external hard drive. So, if your server had a crash… again… there is always a backup for you to upload! This will also reduce your time and bandwidth. Well… technically, if you are a busy guy, like me, you may want to learn this word “Logic” and keep yourself happy from these miserable nightmares! But, don’t forget about your “Themes” directory. There must be a lot of work going into these folders!

Thirdly, if you have a large “htaccess” file, you will need to create a backup of that too. Don’t forget it! It will come in handy!!

Finally, here is a short version, if you are confused or clueless…

To make this short and simple, there are four areas that you need to back up. These are your “wp-config.php file, htaccess file, wp-plugin directory and your theme’s folder.” If you are not bother about these files, then you are on your own. But, I am not going to be around and flick my wand.

That is today lesson! Better get working on my art profile…

Copyrighted By Lair360




How to repair Wordpress from hackers!




Tagged Under : , , ,

Version: 12.1
Revision: 13 Build 11

How to repair Wordpress from hackers!

Introduction:
When you are working really hard on your Wordpress and gain a good amount of visitors, you are in the line as a target practice for hackers and cyber-space criminals. In other terms, if you get hacked by these idiots, then you are in big trouble! This can also effect your rankings, offending readers to expose ‘Virus and Trojans’ attacks and infect other reader’s computer; making you as an unwilling promoter to subject materials that is not related to the article or the blog. Nevertheless, It can also be classified into many sources, for example: “spam, rude topics, swearing and pranks.” But, the worse dilemma is losing your articles and valuable contents. However, if this happens to you, it is best to not postpone on the clean up process, since a speedy restore will generally minimize the damage that was caused by the morons. That is right… the crazy hackers!

On the other hand, there are many sources that will suggest you to upgrade your Wordpress to the latest version. However, there is a flaw in the upgrade, as most users will not notify you that the hacker may have left a backdoor (hidden file) in a directory where it wouldn’t get overwritten with the actually upgrade, or injected code into your theme. Therefore, I am writing this article to completely clean and restore a Wordpress installation that has been hacked.

1.] Backup your website and database.

Backing up a hacked copy of your blog or database, it is still a crucial process as it contains valuable information and files. You really don’t want to lose your data if something goes wrong with the cleanup process. Even worse, you can take a risk and restore things back to their hacked state and start over.

2.] Create a copy of your uploaded files and images.

Images are generally safe from posing a security risk and ones that you uploaded by yourself (for example: the ones that was included with a theme, for instance) will be harder to trace and replace after things are fixed again. Therefore, I would recommend you to grab a copy of all the images in your uploaded folder to avoid broken images in your posts (later on). If you have any non-image files that may possibly been compromised, such as zip files, plugins or php scripts that you were offering people, it is a good idea to grab fresh copies of those from the original source.

3.] Download a fresh copy of WP, plugins and a clean template.

Upgrading Wordpress automatically, it will make life easier for you and everyone! However, it will only replace specific files, and it doesn’t delete obsolete ones. It will also leave your current themes and plugins in its original place. This means, if you use to upgrade a blog that has already been compromised, it can very well leave attackers a door to get back in. So, it is best to start from scratch as far as your file portion and installation goes.

4.] Delete all files and folders in WP directory & upload!

FTP protocol = Slower (depends on your file size and folders).
Cpanel Manager = Faster (depends on your server responses).

When you have a fresh copy of all your files and folders, you will need to completely wipe (Erase) the entire directory and the structure of your blog. This is the only (possible) way to completely remove all infected files. You can do all of these through FTP protocol, but due to the way that FTP handle folder’s deletion, this can be slow as hell! This can also disconnect you from your server, due to flooding with FTP commands. Nevertheless, if you have Cpanel, you can compress everything in a Zip file and extract them within the server, and it will also shorten your time!

Notes: if you are uploading your files and folders in a Zip file, there is a high chance that your codes, they are not broken or corrupted. Therefore, if you have Cpanel, please take the advantage and safe your time and bandwidth.

6.] Run a database update!

At this stage, you will need to give WP a little boot in the backside. In other words, you will need to point your browser at “/wp-admin/upgrade.php”.

7.] Change your Admin password!

From this level, if you have more than one Admin, and you can’t get the others to change their passwords, then I would suggest you to change their user levels (privileges) until they can change their password. Simple…

On the other hand, if there is anyone in your user list that has ‘editing’ capabilities, and you don’t recognize them, it’s best to kick (remove) them out of your blog. But, for the best security, I would recommend you to delete everyone!

8.] Check all posts and articles for ‘iframe’ hacks!

Inside your Cpanel, you will need to direct yourself to “phpMyAdmin” and run the following sql scripts.

This script searches your SQL database for hidden iframes, script injection and display.
Also, please note that you can delete these rows if it exists (it should be rebuilt dynamically)
———————————-

SELECT * FROM wp_posts WHERE post_content LIKE '%iframe%'

SELECT * FROM wp_posts WHERE post_content LIKE '%noscript%'

SELECT * FROM wp_posts WHERE post_content LIKE '%display:%'

———————————-

If you want to combine the above script into a single batch – process, you can use this scripts as an alternative.
———————————-

SELECT * FROM wp_posts WHERE post_content LIKE '%iframe%' OR post_content LIKE  '%noscript%' OR post_content LIKE  '%display:%';

———————————-

9.] Double check your blog (for a second time) and look into your SQL database for anything suspicious!
Don’t just sit back and think it’s all done like a paper airplane!!

Keep a lookout at all time and manually update your Wordpress!

Copyrighted By Lair360




Encrypt your Wordpress from attackers!




Tagged Under : , , ,

Version: 13.1
Revision: 43 Build 13

Encrypt your Wordpress from attackers!

Introduction:
This year is nearly Christmas! Therefore, here is a short tutorial that can help publishers enable SSL or Secure Sockets Layer for Wordpress. But, don’t panic! If you don’t know how to install it on your server, then why don’t you ask your hosting provider to install it for you? It’s not that bad…

Advantages: Encrypting your admin pages, it will provide more security for your Wordpress login – session and your control panel. In order to enforce SSL in your admin pages you need to apply some codes into your “wp-config.php” file.

1.] In order to install SSL encryption, you will need to have a dedicated IP address. You can get this from your hosting provider. However, when you have your dedicated IP address, you will need to wait for another 24 hrs for your website to propagate.

Notes: It’s best if you ask the staff to install your SSL encryption. It’s a lot safer and they can install it without a single – fuss! However, if you decide to install it by yourself, there might be a problems like… the page is not appearing correctly or the passport control is warning the users to stay away from your website. So, please be careful and ask the staff!

2.] When you got a dedicated IP address and SSL encryption, you will need to modify your “wp-config.php” file. Here is the following code…

define(’AUTH_KEY’, ‘the auth key’);
define(’SECURE_AUTH_KEY’, ‘the secure auth key’);
define(’LOGGED_IN_KEY’, ‘the logged in key’);

Notes: you will need to generate your personal codes from this link: http://api.wordpress.org/secret-key/1.1/ and insert it into your “wp-config” file.

3.] Now, you’ll need to add these codes and set it as: “TRUE”.

define(’FORCE_SSL_ADMIN’, true); // integrate this if you want your admin site to use SSL
define(’FORCE_SSL_LOGIN’, true); // integrate this if you want the login page to use SSL

Warning: “FORCE_SSL_ADMIN” is a little strict on your plug-ins. So, you will need to double – check your plug-ins, before you try this setting. But, don’t worry about “FORCE_SSL_LOGIN”. This setting will only encrypt your login page so that your login password will be encrypted.

4.] You are done!

Copyrighted By Lair360




Secure Wordpress & Hide Your Errors!




Tagged Under : , , ,

Version: 13.1
Revision: 33.2

Secure Wordpress & Hide Your Errors!

padlock_image_wordpressIntroduction:
When I was designing my new homepage, I was really worried, especially the “wp-config” file and your “Wordpress debug” configurations. In other words, if a hacker can access this file and retrieve your “SQL Database” and collect your server errors, then you are seriously in trouble! So, I would suggest you to implement these codes and place them into your HTA Script file. This is a safety precaution and its your last line of defense against criminal cyberspace!

When you access your ‘WP control panel’, it is like a blackened that will only allow the administrators to access the information by login in with their username and password. However, if the user creates an error, it will provide related tips or information to ease the login. So, it is a pretty useful toy for unwanted intruders!

Part 1: disable “wp-debug” from unwanted intruders.
——————————-

To disable “wp-debug”, you will need to access your “wp-config.php” file and set it on FALSE or delete the strings. Otherwise, any error in WordPress, it will be displayed in your browser. Nevertheless, these ‘debug tools’, it should only be used in the development area of WordPress.

1.] Login to your Cpanel and edit your “wp-config.php” file. But, don’t forget to make a copy of the original file, before you try to disable it.

define('WP_DEBUG', false);

2.] Save your changes and move onto part two!

Part 2: protect your “wp-config.php” file.
——————————-

In part one, you have disabled “wp-debug” configurations. But, to stop your offender from hacking into your “wp-config.php” file, you will need to create a ‘.htaccess’ file and place this code into your main – blog – directory. This will hide the files or forbidden the intruders from seeing your “SQL database’s passwords” and other important information.

# protect wp-config.php
<files wp-config.php>
Order deny,allow
deny from all
</files>

2.] When you are done, please double check your source and save your changes.
After that, just delete your old “.htaccess” files and upload your new version.

3.] Move to part three!

Part 3: hide your login messages from hackers.
——————————-

At this stage, you will be modifying your theme’s “functions.php” file. Therefore, I would recommend you to create a backup of your original file. After that, you can proceed with the instructions.

Notes: when a user tries to login on your blog, but failed, the login screen will display a message to let you know what happened. Sure, it may be useful to you. But, it will be even more useful to potential hackers and criminal cyberspace!

To solve this problem, you will need to find your “functions.php” file and add this source. After that, you will need to double check the codes and save your changes.

<?php add_filter(’login_errors’,create_function('$a', "return null;")); ?>

That is all! This will secure your Wordpress like a crystal ball! But, don’t rely on it too much! In other words, you will need to keep track of spammers, comments and make sure that they are not injecting any type of worms or infections. If this happens, it could cause a security breach to your login area and your database. Therefore, if you see a suspicious comment / email, please delete it and always update your Wordpress, change your database password and your login password.

Good Luck to all of you and Merry Christmas!

Copyrighted By Lair360




Wordpress – Change that horrible login screen!




Tagged Under : ,

Version: 17.2
Revision: 13 Build 11

Wordpress – Change that horrible login screen!

Wordpress Version: 2.8+

Wp-Login-ExIntroduction:
On the 17th of November, I had a short reply from my readers. They told me that my previous “Wordpress Login Screen” tutorials, they are old and outdated. This is because, everyone is now using “Wordpress 2.8+” for their project. So, for those who are using the old version, please click on this link and change your login screen.

http://lair360.co.uk/blog/537/

For the other readers and publishers who are using the latest version, please read this article. But, don’t forget to create a backup of your SQL database!

Have fun and be careful with the modification!

Warning: If you’re unsure about this modification, then please stop reading. This article is only provided for advance users. So, if you want to try this out, please create a dummy area and install Wordpress under your new directory.

—————————————
1.] Log-in to your Cpanel and click on your FTP server. But, do not download each file and modify them outside the server! It is very unstable and dangerous when you upload your modified version.

2.] Look for these files and directories.

…/wp-login.php
…/wp-admin/css/login.css
…/wp-admin/images/

Notes: if you want to change your image, you will need to keep the formats as PNG or GIF and the size must not exceed 400 pixels in width and height.

3.] Search for your “wp-login.php” file and look for these codes.
It’s located at line 73 – 75.

Notes: you will need to replace this phrase: “Powered by WordPress” and its default Url: “http://wordpress.org/”.

<div id="login"><h1><a href="<?php echo apply_filters('login_headerurl', 'http://wordpress.org/'); ?>" title="<?php echo apply_filters('login_headertitle', __('Powered by WordPress')); ?>"><?php bloginfo('name'); ?></a></h1>

4.] Save your changes and look for this file: “login.css”.

…/wp-admin/css/login.css

h1 a {
	background: url(../images/logo-login.gif) no-repeat top center;
	width: 326px;
	height: 67px;
	text-indent: -9999px;
	overflow: hidden;
	padding-bottom: 15px;
	display: block;
}

5.] Modify the image’s location and save your changes.

6.] You are done!

Copyrighted By Lair360