• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » WordPress Optimization Tricks : The PHP Files

By Abhishek Ghosh October 17, 2013 7:06 pm Updated on October 17, 2013

WordPress Optimization Tricks : The PHP Files

Advertisement

WordPress optimization tricks offers you some uncommon and common hacks to optimize the Page Loading speed specific to WordPress files only. As basically only few (versus the need) are interested and fully active in WordPress core development, some features actually reflects the need of one developer as a human plus some are not possible to deliver as customized version for your website or domain, so this is not the fact that – this WordPress optimization tricks guide is going to Fix some bugs. There are definite bugs like abnormally growing WP_commentmeta Table Database Size which we have fixed in the linked guide, but most of these falls among modification or rather an average user are not supposed to use these tricks.

 

WordPress Optimization Tricks : Understanding and Not Understanding

 

Understanding and not understanding can be very relative ! Understanding Page Loading Speed is important, more important is to really perform some basic and advanced settings, like we described in WordPress 3.6 on Rackspace Cloud Sites and W3 Total Cache 0.9.3 Plugin, which is relevant now at the time of writing this article. Not understanding why and how WordPress Works with which intention is most important.

There are many themes available, which basically makes WordPress to act badly. One of the known manufacturer of such Themes is Elegant Themes, its ugly for the structure. More badly coded Themes can be found in Theme Forest. Understanding the basic facts about WordPress Theme is important. Except few Theme and Theme Frameworks, all basically are dangerous by coding. StudioPress Genesis, Thesis, Woo Themes, some themes of Templatic, all default official Themes are the standard. StudioPress Genesis definitely the best at this time, but unfortunately Free option is not present, so take the default WordPress Theme’s your custom Child Theme as the Standard for the mass. All tricks will work for these mentioned themes.

Advertisement

---

 

WordPress Optimization Tricks : The PHP Files

 

Obviously, you WordPress Backend mast be tweaked for faster performance. Backend here is the FTP files of WordPress not the server side. Server optimization can not be named as WordPress Optimization Tricks but possibly as PHP-MySQL Web Software Optimization Tricks. Lesser these are used in Theme Template is better :

Vim
1
2
3
4
5
if (is_page ()) {}
elseif (is_home ()) {}
elseif (is_single (1067)) {}
elseif (is_single ()) {}
elseif (is_archive ()) {}

UTF-8 meta, is usually fetched by :

Vim
1
<meta charset = "<php ??bloginfo ('charset')?>" />

Which can be replaced by :

Vim
1
<meta charset = "UTF-8">

WordPress, by default has utf8 (or closer to it) in wp-config.php file, not UTF-8. That is a known bug which creates issue by adding odd characters after server migration. This is a thing, which is important to remember. In the same way like meta charset, others can be modified or rather customized, like :

Vim
1
<Link rel = "pingback" href = "<php ??bloginfo ('pingback_url');?>" />

It is quite obvious that these will be better :

Vim
1
<Link rel = "pingback" href = "http://your-site.com/xmlrpc.php" />

To simplify the code, it is also highly advisable to remove the empty blocks. They are often used to target an element with CSS or javascript. It is also interesting to minimize unnecessarily nested codes, for example in the case where you have a happy div that contains only a div class named article. Dom Monster is a great tool for this purpose :

Vim
1
http://mir.aculo.us/dom-monster/

Another kind of tool is Visual Event :

Vim
1
https://github.com/DataTables/VisualEvent

Another is available for CSS Stress Testing :

Vim
1
https://github.com/andyedinborough/stress-css

WordPress Optimization Tricks

Also consider to clean lines of unnecessary code added in the WordPress header : they bring nothing to the visitors or search engines. To disable these additions, copy the code into the functions.php file of WordPress Theme :

Vim
1
2
3
4
5
6
automatic_feed_links (false);
remove_action ('wp_head', 'wp_generator');
remove_action ('wp_head', 'wp_shortlink_wp_head', 10, 0);
remove_action ('wp_head', 'wp_dlmp_l10n_style');
remove_action ('wp_head', 'rsd_link');
remove_action ('wp_head', 'wlwmanifest_link');

You will get more on WordPress Codex.

WordPress Transients API offers a simple and standardized way of storing cached data in the database temporarily by giving it a custom name and a timeframe after which it will expire and be deleted. This allows in particular to avoid recalculating which are identical on all pages of your site or have little interest in being modified in real time. It may be, for example the list of recent comments, links from your blogroll or a list of keywords related to an article. Feel free to know what content should be in transient, knowing that it is up to you to determine how long each data will be cached. Reference :

Vim
1
http://codex.wordpress.org/Transients_API

The operation of a transient is quite simple. For each, you ask WordPress to retrieve the associated transient. If it does not exist or no longer exists, you will then generate the transient with a simple echo (for example). Caching using the WordPress Transients API is a clever trick.
We will avoid Javascript tricks in this guide. Previously, WordPress had a native system cache which was enabled with the following line:

Vim
1
define ('ENABLE_CACHE', true);

Unfortunately, it does not work since version 2.5. However, cache plugins add this line for cache function :

Vim
1
define ('WP_CACHE', true);

We are talking about wp-config.php file now. People know many wp-config tricks, but less known fact – using other domain names, allows to accelerate the loading time of the data, only problem is, WordPress sends a useless cookie for each of these queries. To avoid this, use these two lines of code in the wp-config.php file:

Vim
1
2
define ('COOKIE_DOMAIN', 'www.mysite.com');
define ("WP_CONTENT_URL", "http://static.yourdomain.com");

People, including many developers do not understand the usage. The first is the URL of your site. The second is that the location of your static files. In the example above, it is a subdomain but it may be another URI. Other all things are known by the advanced users.

Tagged With wordpress optimization , wordpress optimization mysql php , wordpress php optimization

This Article Has Been Shared 173 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to WordPress Optimization Tricks : The PHP Files

  • Repairing WordPress Database : Using Cloud Database Server

    Repairing WordPress Database is easy by using Cloud Database Server like from The Rackspace Cloud which provides MySQL database server with PHPmyAdmin software.

  • Scalable MySQL Database for WordPress with Rackspace Cloud

    Scalable MySQL Database for WordPress is very easy to create as Rackspace allows Cloud Database,so does Amazon. Here is a guide for high performance WordPress.

  • Fixing WordPress After Update : Fix For White Page

    Fixing WordPress After Update Video Guide practically shows you all the possible ways to fix your WordPress website in case you are facing the White Page issue.

  • Twitter Bootstrap Guide For Newbies

    Twitter Bootstrap guide is written in a way, so that the basic users can use Free Twitter Bootstrap Source Code and use customize for own website design.

  • HTML5, WordPress and Cloud : What We Learnt From Redesign

    HTML5, WordPress and Cloud – with new redesign,not complete yet at the time of publishing this post we learnt important points with this old blog with 5K posts.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • What is an Automatic Ethanol Fireplace February 8, 2023
  • Disadvantages of Cloud-Native Computing February 7, 2023
  • Projector Screen Basics February 6, 2023
  • What is Configuration Management February 5, 2023
  • What is ChatGPT? February 3, 2023

About This Article

Cite this article as: Abhishek Ghosh, "WordPress Optimization Tricks : The PHP Files," in The Customize Windows, October 17, 2013, February 9, 2023, https://thecustomizewindows.com/2013/10/wordpress-optimization-tricks-the-php-files/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT