Showing posts with label wordpress. Show all posts
Showing posts with label wordpress. Show all posts

Thursday, March 27, 2014

11 tips on setting up wp-config.php file in WordPress

In the distribution of the most popular package for WordPress blogs delivered more than 900 files and 100 folders without small. None of these files does not require manual changes, except the configuration file wp-config.php. Thus, if you are satisfied with the default setting, then edit this file and do not need, but should get to safety tricks your blog to be fully prepared. 





Backup! Backup

Better safe than sorry: make a backup, right now! Use the built-in export page or use the plugin, or make a backup via phpMyAdmin, but always give yourself the opportunity to cancel the made when setting up your website.
Your manipulation can affect the database, but they will not do anything with any files except the file with which you will be working, so make a backup of wp-config.php, but if you did not make a copy of your files more than a month, I would advise to do it too. Frequent backups - it's always good.

Ready? Let's go!

Speed: Disable saved versions ... Now!

The function of maintaining versions of records is enabled by default, but can lead to significant "inflate" the database. Saved versions exist in order to enable you to rollback to a previous version of the record, if you need to. If you do not plan to use the save versions to check the "early version" of your records, you just need to disable this feature by adding this code in wp-config.php:

define ('WP_POST_REVISIONS', false);


However, if you are satisfied with the version, but you do not have an infinite number of copies of your modified records, you can limit the amount of
saved versions for each post using this line of code:

define ('WP_POST_REVISIONS', 2);


Speed: Set Cookie Domain

If you handle static content (such as downloaded media) subdomain, a good idea to install the «cookie domain».If you do this, cookies will not be sent whenever requested static content.

define ('COOKIE_DOMAIN', 'www.yourwebsite.com');


Tip: To download the media to handle subdomain, simply fill in the last two text fields on the page Media Options path (for example, / home / myblog / public_html / mysubdomain) and URL (eg http://mysubdomain.myblog.com/) your subdomain.


Speed: Modify the file system

If you frequently install, update or delete your plugins and themes, it is very likely that you hate entering your FTP password each time you do something. The following code makes it for you, making the file system to use direct request via PHP - in other words, you no longer need to enter the FTP login details.

define ('FS_METHOD', 'direct');


Please note that this may not work with all web hosting providers, and even if the work can cause security problems on a poorly tuned hosting. So make sure that you use it on a good server.

Safety: Denying access to the file wp-config.php

This trick does not require editing the file wp-config.php, and the file. Htaccess in your root folder. In fact, it prevents attackers upload yourblog.com / wp-config.php through the browser:

# Protect wpconfig.php
<files wp-config.php>
order allow, deny
deny from all
</ Files>


Just add it to your. Htaccess file and you're done!

Security: SSL in the admin panel

SSL is enabled on your server? Excellent! You can get WordPress to use a secure connection for authorization using this line of code:

define ('FORCE_SSL_LOGIN', true);


And if you are very suspicious of the security (which is actually good), you can get WordPress to use SSL on each page administrator to all that you are doing there, done over an encrypted connection:

define ('FORCE_SSL_ADMIN', true);


For more information about how to configure SSL, you can find in the WordPress Codex page Administration Over SSL.

Safety: Changing the database prefix

If WordPress has a security hole that allows attackers to use the hack, known as «SQL injection", they can easily use standard table prefixes your WordPress database to remove them. But if you have table prefixes are different from the standard (wp_), they will not be able to guess them, is not it?
So, setting a new site WordPress, change the default value on the installation page or change the following line in your wp-config.php:

$ Table_prefix = 'wooh00yeah_';


Note: If you want to make it work on an existing site, you can not just change the prefix in the file wp-config.php - you get a connection error with the database. You need to use a plugin that will change the wp-config.php file and database tables, and some of the values ​​in the tables. Recommended plugin DB Prefix Change .


Security: Add security keys ... Now!

Let's just read on WordPress Codex:
In simple words, the secret key - the password with elements that complicate the selection of a sufficient number of options for hacking. Password like "password" or "test" simple and can be easily hacked. To pick a random, unpredictable password type «88a7da62429ba6ad3cb3c76a09641fc» take years.


This is one of the necessary security measures for WordPress - and it's just copy and paste randomly generated on the page content in your file wp-config.php. The hardest part - is to insert a standard, blank value of these constants and their removal!

Other: Change the autosave interval

If you sometimes work on your record 4:00, you can irritate that WordPress automatically saves a record every 60 seconds. I think this is not a bad thing, but sometimes it's very, very annoying. In any case, if you want to set the autosave interval greater value, you can do this by setting the value in the file wp-config.php like this:

define ('AUTOSAVE_INTERVAL', 240); / / the value should be in seconds!


Other: Transfer your WordPress site easily

WordPress is full of surprises and this is one of them. If you ever need to move your site to another domain (or a new subdomain or folder), define this constant in your wp-config.php file before transferring your files and databases:

define ('RELOCATE', true); / / We're not done yet!


After installation of this magnitude and transfer your files and database log in with your data on WP yournewwebsite.com / login.php and then check whether the changed home page URL on the General settings.After confirming the changes, remove the constant from your file wp-config.php. This simple trick to WordPress will save you from editing the database manually.

Tip: although it is literally "transfer" your site, it does not affect the hard-coded links in your content. To change them, you must use a plug type Search Regex to replace the old and new links.


Other: Disable file editing plugin and theme

If you are a web designer and sites using WordPress for your customers, you may want to disable file editing themes and plugins by adding the following constant:

define ('DISALLOW_FILE_EDIT', true);


Moreover, you can also disable the installation of new themes and plugins, and their update:

define ('DISALLOW_FILE_MODS', true);


Just remember that the theme and plugin update often very important when they fix security holes. So if you want to disable the update and install new plugins / themes, you need to check for updates in another way.

Other: Including the development WP_DEBUG

It's simple: if you are developing a plugin or theme, it will be good to include the ability to debug in WordPress to see what notifications and warnings you get:

define ('WP_DEBUG', true);


Sometimes it's just great to see what simple mistakes you can make when designing!

4 Easy Ways to improve the performance WordPress



Some sites on WordPress are slow, especially if they have a big attendance. This may be due to large files, or because of inefficient code. There is nothing worse than a slow site. Here are some ways to improve the performance of your WordPress sites. If your site is hosted on wordpress.com, it is usually no performance problems.
1. Keep your WordPress 
WordPress developers are developing updates are not for fun, but to improve it.
The same situation is with plug-ins for WordPress, try to download the latest version.Plugin developers to release new versions of WordPress, because they change the code in some way, making it more efficient and safer.
2. Unplug or remove unused plugins 
This is one of the main reasons for the decline of productivity sites running on WordPress. Junk plugin can have a ton of scripts and code. And so, if you do not use plug, unplug it, and remove the best hosting. Try to find plugins that are not used, or severely hamper the work site, and make them the same. It is not so difficult.
3. Clean code
Optimmizatsiya code can significantly reduce the download time. Here are some ways to clean your code to improve performance.
  • Remove unused code you are not using code snippets. Some encoders like to use a lot of extra code (the indentation formatting line break, etc.) for better readability and user-friendly organization. But removing these unimportant elements reduces the file size, thereby reducing the speed zagruzki.Primer unused code:
    .test {
    font-family: Georgia, Times, serif;
    font-size: 12px;
    color: #000000;
    }
    Example minimize unused code:
    .test {font-family:Georgia,serif; font-size:12px; color:#000;}
  • Use external scripts Avoid unnecessary code in the file header.php, use external scripts. Then they get into the browser cache and will not be loaded with every stranitsey.Primer use external scripts:
    <script type="text/javascript" src="example.js"></script>
  • Use abbreviated CSS recommend to anyone using the shorthand CSS. It is convenient for you, your browser, and your readers. This will make the size of the CSS code smaller and faster loading! Example of using the usual CSS:
    .test {margin-top: 7px; margin-right: 1px; margin-bottom: 5px; margin-left: 3px;}
    Example using the shorthand CSS:
    .test {margin: 7px 1px 5px 3px;}
4. Minimize calls and PHP to access a database 
It is very important for intensive calls to PHP and database. The time required to initialize the PHP code is added to the page loading time. If you convert the excess pieces of PHP code in static HTML, then the browser will be given the code much faster.
Example of redundant requests and complaints:
<title> <?php bloginfo('name'); ?> <?php bloginfo('description'); ?> </title>
<meta http-equiv="Content-Type" content=" <?php bloginfo('html_type'); ?> ; charset= <?php bloginfo('charset'); ?> ” />
<meta name="generator" content="WordPress <?php bloginfo('version'); ?> ” />
<link rel="stylesheet" href=" <?php bloginfo('stylesheet_url'); ?> ” type=”text/css” media=”screen” />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href=" <?php bloginfo('rss2_url'); ?> ” />
<script type="text/javascript" src=" <?php bloginfo('template_url'); ?>/mootools.js”> </script>
Example minimize requests and complaints:
<title>WPCandy - The Best of WordPress</title>
<meta http-equiv="Content-Type" content=" text/html ; charset= UTF-8 ” />
<meta name="generator" content=" WordPress 2.3 ” />
<link rel="stylesheet" href=" http://wpcandy.com/wp-content/themes/wpcandy/files/style.css ” type=”text/css” media=”screen” />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://feeds.feedburner.com/wpcandy ” />
<script type="text/javascript" src="http://wpcandy.com/wp-content/themes/wpcandy/files/mootools.js “></script>

Hyper Cache plugin for caching WordPress.

When a blog has few visitors, the caching is not that relevant. But if the number of visitors per day passes for 1000, it may be a problem with loading. To prevent this, you must install the Hyper Cache plugin for caching WordPress.

To install the plugin to start you need to download. Then you can install in the usual way, but you can use the file manager in the admin or via FTP client.
When you install the latest two ways to unpack the zip file and put the folder in the directory wp-content/plugins /, which can be found in the root folder. Folder path looks something like: public_html / inetsecret.ru / wp-content / plugins. Anyway, so on most hostings.
Once we installed the plugin, go into the Settings tab and find there a plugin to check whether it is established. Now you need to enable caching wordpress, which you need to add to the configuration file wp-config.php the following code: define ('WP_CACHE', true), just paste it to the line / ** WordPress absolute path to the WordPress directory. * /
Then go to admin panel and activate the plugin, then the parameters we click the mouse on the name of the plugin. Plugin settings window appears. There you will be able to produce all the changes you need.

7 myths about the security of the site by WordPress

7 myths about the security of the site by WordPress




Myth One: No one will break into my blog

Hacking attempts, basically everything is done automatically. Few would crack for some personal reasons. If your site does not sell anything, then you may decide that your site no one will crack. But hackers can not concern information and the resource itself.
Here are the reasons why hacking attempts can be committed: 1) to redirect traffic to other resources, 2) data to steal cash resources of your visitors, 3) to insert spam articles

Myth Two: My blog is protected by 100%

One hundred is not protected any site. You can always find a vulnerability in the security of the site. So be sure to backup the site, if necessary you can have it restored.

Myth Three: If you download plugins from the official site WordPress, then they are absolutely safe

Yes, workers do WordPress plugins pre-qualified before placing them on the site, but they are unable to verify their subsequent updates. They are created by programmers from around the world that can tolerate the errors. Each plug-in contains the error log where you can see their presence.

Myth Four: as soon as I found a blog on this whole job ended

On the contrary, everything is just beginning. You need to install plug-ins and update them regularly. Also, you need to insert a subject and do publish articles. Abandoned website or blog - the best target for hackers.

Myth Five: I installed the plugin fully protect my blog

Only installing plugins will achieve nothing. You need to consider many other factors, such as the level of complexity of the password.

Myth Six: When you hacked my blog, I will immediately know about it

In fact, you can find out about it only a few days later. Most difficult - is to detect the emergence of hidden links to your articles and redirect traffic.

Myth Seven: my password is reliable enough

If your password is not similar to this: Hd # 29 &! @ <RTzL ~ 43Zp, it is not enough reliable. The password must consist of letters and numbers, and special characters such as!, №,? etc.
Do not defeat the safety of your site, you do not lose what you have created over the years, in a few minutes.

TAC plugin for malicious code and hidden links in the template.

The plugin is very good for those who use their blogs for free templates. The authors of these templates can cheat and put in the template link to the resource. And there are.are added to the "free" theme malicious code that can knock down all your settings.TAS plugin is able to detect such things and you will have no problems to get rid of unnecessary references. But, here's the situation with the code more complicated.Simply removing the code will fly all the theme settings as often encoded with a link and a portion of the template code. Therefore, it is best to delete the topic and look for another, on proven sources.

To install a plugin, you must:
1. Download the plugin on the website or from the panel and install WordPress.
2. Then need to activate the plugin.
3. Thereafter, the left appears on the menu section "Design". Open the "Themes", there you will see the "TAS". Clicks on it.
All plug-in has started to work. Now it will scan all your files for malicious codes and hidden links. The links will be marked in yellow, and the code - red. When you click the Details button plugin will show you the way to him. Next, click on the link found at the template editor opens. You need to find and remove the link. And if the path to the links protected, type the address in the right hand, and we seek the file link, delete it.Do not forget after all the action to save the modified file.
You have been dreaming to learn a foreign langua

ge, but do not know where you'd better contact? The highest quality and the best training - is studying abroad in prestigious schools in the English-speaking teachers.

Blogger Widgets