How to make WordPress blog faster and minimize CPU Usage

In this article, I will share my personal experience regarding this blog performance and nightmares of disabling website everyday because of CPU Utilization. I tried all my best however I was unable to figure out the cause of high CPU Usage by wordPress. I tried many articles on Google and at last I found some pointers and able to escape from this problem.

This article is specific to my problem only, However I am sure it will help many others also.

I started with ways, which will less impact my blog and will take less time.

1. Disable WordPress Cron Job

This was my first step, disabling cron Job. In most of cases we are not using this feature. Mostly it is used when you schedule some article to publish on some day or time. To disable it, Open “wp-config.php” file and add below line at top of page.

define(“˜DISABLE_WP_CRON’, true);

What if I need this cron job ?

You can easily create a cron Job anytime, by following below process.
a. Log into your cPanel.
b. In the Advanced section, click Cron jobs.
c. Under Add New Cron Job, select the time interval. It is recommended not to add time interval less than 15 minutes.
d. Set the cron command to the following, replacing yourwebsite.com with your actual domain name:

wget -q -O – http://yourwebsite.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

The above command tells the Linux server to run wp-cron via wget, which will trigger the wp-cron.php script to do it’s job on your schedule instead of on each page view. This will lessen the amount of processes on the server.

e. Click Add New Cron Job to set the cron.

2. Disable Plugins

Now, Here comes actual reason for WordPress blog high CPU usage. I had many plugins and started to disable one by one. Continue reading “How to make WordPress blog faster and minimize CPU Usage”

AutoComplete Component in Visualforce using JQueryUI

In this tutorial, I am going to explain very Simple AJAX and JSON based Auto Complete component with the help of JQuery UI. First I am assuming that you already have Static Resource of named “AutoCompleteWithModal“. This Static resource has all images, CSS and JQuery library needed to implement this component.

In one of my old post, I have already explained that how to generate JSON in Visualforce page. So Considering same article I have create Visualforce page named “Account_JSON” which returns list of Accounts on basis of text entered in input field. Continue reading “AutoComplete Component in Visualforce using JQueryUI”

Salesforce Helptext like Custom Tooltip using JQuery

Author posted by Jitendra on Posted on under category Categories HTML, Salesforce and tagged as Tags , , , with 1 Comment on Salesforce Helptext like Custom Tooltip using JQuery

Welcome back Readers. This is my first blog entry for year 2013, i know its too late. However i can ensure that i have lots of unique post which will come this year. I am starting this year with very light post , mimic the help-text style of Salesforce.

Salesforce like Helptext - Tooltip using JQuery
Salesforce like Helptext – Tooltip using JQuery

Download Salesforce Helptext like Tooltip using JQuery – Source Code

Most of the time when i override Visualforce page, customers many time demand for same Standard page layout.

apex:inputField and apex:outputField shows their help bubble (if applicable) when nested within a pageBlockSection component automatically.

If you want to provide your own text instead you can by utilizing the helpText attribute on pageBlockSectionItem. Also you can access the help text within an expression by using the respective $ObjectType global as such: Continue reading “Salesforce Helptext like Custom Tooltip using JQuery”

CSS 3 Tutorial – Rounded Corner and Shadow Border effect

Author posted by Jitendra on Posted on under category Categories HTML and tagged as Tags , with 2 Comments on CSS 3 Tutorial – Rounded Corner and Shadow Border effect

Style the Border in HTML with the Help of CSS 3 Border Style

Previously we have seen the Transform Operations using CSS3. In this article i will depict the New Border Properties in CSS 3. With the help of CSS 3, we can perform following two operations on border :

  1. Rounded Corner/ Border
  2. Border Shadow

Live Demo – Click Here Continue reading “CSS 3 Tutorial – Rounded Corner and Shadow Border effect”

Complete CSS 3 Tutorial – Transform Operations

Author posted by Jitendra on Posted on under category Categories HTML and tagged as Tags , with Leave a comment on Complete CSS 3 Tutorial – Transform Operations

Complete CSS 3 Tutorial – Transform Operations – rotate, translate, scale, skew and matrix methods with Live Demo and source code

Cascading Style Sheet (CSS) is the language used by all the web languages like ASP.Net, PHP, JSP or Velocity (Basically HTML) to control the display style of the elements without changing the code. With the help of CSS we can control the border width, color, background color, background image, font and so on.

With the help of CSS 3 other than just style now we can even animate, translate and do lots of stuff which were not possible by the CSS 2 and needed the help of other JavaScript library like JQuery UI.

In this tutorial we are going to learn different transform operations supported by the CSS 3.

The Transform operations are supported by IE 9, Mozilla, Google Chrome, Safari and Opera.

Live Demo – Click Here.

Continue reading “Complete CSS 3 Tutorial – Transform Operations”

Handling Colon in Element ID in JQuery – Visualforce problem

Resolving the JQuery error when the Element ID contains colon with Live Demo

Today i came across very known problem of jQuery and thought of sharing same with everyone. In Salesforce the element id is in the format of “j_id0:j_id3:j_id4:c_txt“. In previous post we have already discussed about getting the elementId in Visualforce.
When i tried to find the element in JQuery like $(‘#j_id0:j_id3:j_id4:c_txt’), i was getting the error on JavaScript console of the browser. After few searches, i got to know that this is known problem and faced by many of the developers.

Live Demo

Continue reading “Handling Colon in Element ID in JQuery – Visualforce problem”

Create Simple Drag and Drop Widget like iGoogle using JQuery

Author posted by Jitendra on Posted on under category Categories HTML and tagged as Tags with 8 Comments on Create Simple Drag and Drop Widget like iGoogle using JQuery

Live Demo with source code on creating Simple Drag and Drop Widget using JQuery plugin like iGoogle

After reading this post you will come to know that how easy its to create the Drag and Drop functionality using JQuery.

To run this example you will need two javascript libraries as follow:

  1. JQuery
  2. JQueryUI
jQuery Drag and Drop Widgets
jQuery Drag and Drop Widgets

Continue reading “Create Simple Drag and Drop Widget like iGoogle using JQuery”

CSS – label control ignores the width style

Author posted by Jitendra on Posted on under category Categories HTML, Tech Tips and tagged as Tags with Leave a comment on CSS – label control ignores the width style

CSS – label control ignores the width attribute in style

Label tag does not work with css attribute “width” on some browsers like Chrome and Mozilla.

Simplest solution is :
before applying css for width, make sure “float:left” is written for label control.

Label elements are in-line style elements, so technically Chrome and Firefox are interpreting the CSS properly by not obeying my width declaration. In-line elements do not accept width attributes. The workaround is to force the label element to become a block level element by floating it.

 

Disable inputs after submit to avoid double submission using JQuery and Ajax

Author posted by Jitendra on Posted on under category Categories HTML and tagged as Tags , with 1 Comment on Disable inputs after submit to avoid double submission using JQuery and Ajax

This article will explain the safe way to submit the forms using JQuery. It will avoid accidental double submission.

This tutorial will explain one of the ways to avoid accidental submissions of form using the JQuery and Ajax. While developing the web application this is the most common bug ignored by the newbies.

I will use the JQuery library and the Ajax to accomplish this behavior.

Disable inputs after submit to avoid double submission using JQuery
Disable inputs after submit to avoid double submission using JQuery

Continue reading “Disable inputs after submit to avoid double submission using JQuery and Ajax”

Create Pure CSS based Menu – Step by Step Tutorial

Author posted by Jitendra on Posted on under category Categories HTML and tagged as Tags , with 2 Comments on Create Pure CSS based Menu – Step by Step Tutorial

Tutorial on creating step by step pure CSS based Menu without any javaScript and Why CSS Hover property is not working in Internet explorer

After a long time i am going to write the article on CSS and HTML.  In this tutorial i am going to create a pure CSS based Menu with description of lots of CSS property and problems faced by the web developer. One advantage of having CSS based Menu rather than  JavaScript based Menu is that it is very light weight and cross browse compatible. I have used CSS based Menu in my website https://www.jitendrazaa.com

Live Demo – Pure CSS based Menu

Lets consider below HTML code on which we want to create a Menu.

Continue reading “Create Pure CSS based Menu – Step by Step Tutorial”