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>
0 comments:
Post a Comment