Vijay Lathiya

Php Opensource Developer with writing articles on Php,HTML,CSS,jQuery, Google Map etc technologies area on blogger

Welcome to Vijay Lathiya Blog

I'm very thankfull for visiting my blog.

Wordpress Website development Surat

Google Map API Services

Google Map API V3 for get location with Lat-Long, Distance between two place and many more stuff you will get from my blog

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara -

Saturday, January 3, 2015

Lazy Load jQuery for Image loading faster with Page speed improve

Website page load time play an important part for get daily total number of visitor and good rank in search engine like Google, Yahoo Bing. if your site developed according to SEO standard with good quality content with proper maintained keyword ration, images etc but page loading time more compare to average than it is enough to dropped your daily number of visitor, As per survey record if page load time more than 4 sec than 70%  user quit that website and move on another result which are loading quickly.

To decrease website page load time you may follow some techniques that help you reduce your overall page loading time like.

- Divide number of HTTP request on diff diff domain and reduce load on single server
- use Yahoo to compress images size maximum possible.
- Combine all possible js and css into one with Minify each.
- use Lazy load jQuery plugin script

Lazy load jQuery plugin load only images which are available in user viewport. while outside of view port images load one by one on user scroll down action. hence it helpful for long page with many images to load page  faster by calling images as per visibility on user screen instead of calling all at once.

jQuery lazy load plugin developer Mika Tuupola also added that "Use of Lazy Load on long web pages will make the page load faster. In some cases it can also help to reduce server load. "
in Wordpress, jQuery lazy load plugin easily integrate by using wp plugin jquery image lazy loading

using below jQuery script you should also achieve almost same benefit. here we assigning images src from image attr on jQuery document loading load event with windows load. add below code in js file or inside page and add class lazy-show to all images element which you want to load with lazy load techniques

Saturday, December 27, 2014

Currency convert using Google and Yahoo services in Php

In Php programming, Convert Amount from one currency to another currency is very easy using Google & Yahoo Finance services. even you can direct convert using Google Currency Converter and Yahoo Currency Converter

Currency convert Using Google Finance in Php


$get = file_get_contents("$amount&from=$from_Currency&to=$to_Currency");
$get = explode("",$get);
$get = explode("",$get[1]);  
$rawdata = preg_replace("/[^0-9\.]/", null, $get[0]);
$to_amount = $rawdata;
return $to_amount;


Currency Convert using YAHOOO Finance in Php

function convert_currencyi($from, $to)
  $url = ''. $from . $to .'=X';
  $handle = @fopen($url, 'r');
  if ($handle) 
      $result = fgets($handle, 4096);
  $allData = explode(',',$result); 
  $dollarValue = $allData[1];
  return $dollarValue;
  //return number_format($dollarValue, 2, '.', '');

Tuesday, December 16, 2014

Find Infected Code in Nulled WP theme plugin

Are you Wordpress Developer ?
Are you using nulled Wordpress Theme or Plugin ?
Very Sad

Because, As a Popularity and usage of Wordpress in Web Development field many many website available on Web that provides Premium Wordpress Themes and Plugin at free of cost. it called Nulled Wordpress Theme, Nulled Wordpress Plugin.

Main problem in use of these type nulled Theme and plugin is Security safety. you can not trust them. Because Except Wordpress Official repository all free listed nulled themes and plugins infected with malicious hack code that Harms your website as well as your Business.

 List of Possible harms of nulled free WordPress premium themes / Plugin
  • Access Blog as hidden Administrator or Completely hack
  • Redirect Blog to spam links and Google etc Search Engine not index / remove indexed Pages of blog
  • Display their Ads on Blog
  • Get backlink from your blog to unknowingly site
  • Theme / Plugin Company may take legal action
  • Hosting Company suspend Account
  • Security issue on other hosted same server sites
Now Onward stop to use Nulled Theme and Plugin and also download / Purchase it only from Trusted repository.
Check your Running Wordpress site and make sure it does not infected by any harmful Malicious hacking code.

Check for Malicious codes

After downloading the theme and plugin, The first step you must need to take is to check downloaded themes, Plugin file not infected by virus.

Check for Virus

Go to and check by uploading the zip file. If your file is infected than you will get a red signal with list or detected Malicious script and if not then you can move on to next step.

Check unwanted codes in Wordpress blog

Using Exploit Scanner Wordpress free plugin you can check for unwanted codes exist or not in your install wordpress and used other plugins file.

Check encrypted links codes in Wordpress

One another Wordpress free plugin Theme Authenticity Checker (TAC) also very helpful for you in the process of Check installed Theme, plugins not infected by unwanted Malicious code. Theme Authenticity Checker (TAC) Wordpress plugin give you a warning if any encrypted links are found in a theme with with their authenticity result.

Saturday, December 13, 2014

Remove Query String From CSS & Javascript In WP

To see your website Top in Google search result it is required that your site well developed and according to google standard. Site loading time is the most important factor to get good position in Google and other search engine result.

Today, Gtmetrix, Pingdom, Google page speed insight tool etc Many online tools available on web to check site designed or not according to SEO standard.

According to Pingdom & Gtmetrix tool suggestion removing query strings from static resources like css style sheet and java-script url is the higher priority which is considered during the speed test of website which contain query sting in css and javascript file.

Why used query string in CSS JS Url?

Query string with version in url is a method followed by Developer to instantly render new updates and carry the different plugins version details with file. Normally Query string are used for both java-script and style-sheets file calling url.

Why need to remove query string From CSS JS url

As per Pingdom tools suggestion " Resources with a "?" in the URL are not cached by some proxy caching servers. Remove the query string and encode the parameters into the URL for the following resources:"
Some Proxy server not cache the url which has Query string hence to get good speed performance for website it better to store static CSS, Js files store in Browser cache and render quickly on user second visit.

Remove query string from static resources in Wordpress

There are 2 easy method in Wordpress to remove Query String from Static CSS, Javascript file.

# 1 Add Few line code in Wordpress theme function.php file

Very basic Programming Skill required to add following code in current theme function.php file. You can either choose to edit your theme via wordpress dashboard or use ftp software or online file manager from your hosting cpanel.
// Remove query string from static files 

function remove_css_js_ver( $src ) 
   if( strpos( $src, '?ver' ) ) 
    $rqs = explode( '?ver', $src );
    return $rqs[0];
   if( strpos( $src, '?rev' ) ) 
       $rqs = explode( '?rev', $src );
       return $rqs[0];
   return $src;

add_filter( 'style_loader_src', 'remove_css_js_ver', 15, 2 );
add_filter( 'script_loader_src', 'remove_css_js_ver', 15, 2 ); 

# 2 Use WP Plugin Remove query strings from static Resources

It is very easiest way to deal with Query sting in Wordpress. no need to edit any file or no need back up of Live Database just add and activate remove query strings from static resources plugin.

Still If you have any query or facing problem kindly share in comment.

Saturday, December 6, 2014

301 Redirect Importance in SEO

Are you planing to move your already running website to new platform or in seo friendly url structure that is preferred by  Google SEO team ?

Well, Its good step to run your website with new latest web technologies as well as according to  suggestion of Google search result team.
Im sharing here one important tips that help you keep your traffic without any drop as well as by redirect user and search engine robots crawler to new site url once you migrate old site to new domain or mould in new structure. in such cases its very helpful for good SEO to use 301 Redirection technique and redirect old site indexed pages to relevant new Url.
301 Redirect  mean permanently redirection. it redirect search engine crawler, visitor to new redirection url.

Methods of 301 Redirection

1  301 redirect using javascript

2  PHP for Linux / Unix / Apache put this at the very top of the page

Using Php Script

header( "HTTP/1.1 301 Moved Permanently" );

header( "Location:" ); ?>

Using .Htaccess rule
RewriteCond %{HTTP_HOST} ^$

RewriteRule (.*)$1 [R=301,L]   #add WWW prefix

3 ASP for Windows Servers

<%@ Language=VBScript %> <% ' Permanent redirection Response.Status = "301 Moved Permanently" Response.AddHeader "Location", "" Response.End %>

4 HTML Page Redirect

<meta http-equiv="refresh" content="0;url=">

Google Search engine team also recommend that use a server-side 301 redirect.

301 redirects are useful in the following circumstances.
- Move site to new domain
- Change url structure of existing site 
- Static website migrate to dynamic platform
- Canonical URL
Access site main/home page with one url if either user hit etc etc than redirect user to any one preferred url by 301 redirect

301 Redirect all possible url to one specific url using .htaccess
# Redirect index.php to main domain url

RewriteCond %{THE_REQUEST} ^.*/index.php

RewriteRule ^(.*)index.php$$1 [QSA]

For IP Canonicalization – Url Canonicalization Solution by htaccess and Web.config visit

More Info  Google Webmaster Support

Sunday, November 16, 2014

Import Outlook Email to Gmail

Import Email from Outlook / Hotmail to Gmail

Yesterday I have call from my friend as he need my help to import all emails from his recently used account mail to his newly created Gmail account. After searching on Internet I see that on internet there are a number of articles for how to import your email from Gmail Account to Outlook, but no any clear instructions for importing the outlook (hotmail) mail to Gmail.
After checking Gmail account setting I found that it’s very easy to migrate mail from Outloook to Gmail.

Follow below simple step and relax by import your all existing mail to Gmail Account
  • 1. Log into your new Gmail account and click the gear icon and choose the Settings.
  • 2. In the Settings tabs, click on 4th tab "Accounts and Import"
  • 3. In Next step look at Check mail from other accounts (using POP3), click "Add a POP3 mail account you own"
  • 4. Put an email address in the Email Address Textbox to get email from that account and press next step button.
  • 5. Add your mail account username and password.
  • 6. Check – uncheck other option if you want to leave a copy of retrieved message on the Outlook account.
  • 7. If you getting connection error, you need to enable POP connection on to activate Go to your settings, click on "Connect devices and apps with POP" and make it enable Pop.

Sunday, August 31, 2014

Generate Thumb in WP

In Wordpress its very easy to generate any size thumb of uploaded image using wp add_theme_support function.

WP add_theme_support() function create a thumb copy of the uploaded image with the specified dimensions when a new image is uploaded from the media gallery.

<?php add_image_size( $thumb-type-name, $width, $height, $crop); ?>

Note: To enable featured images with add_image_size function  in current theme it must include add_theme_support( 'post-thumbnails' ); in itsfunctions.php file. 

Parameters :
$thumb-type-name (string) (required)
- The new image size name.
Default: None

$width (int) (optional)
- The post thumbnail width in pixels.
Default: 0

$height (int) (optional)
- The post thumbnail height in pixels.
Default: 0

$crop (boolean/array) (optional) see Hard crop vs Soft crop
- crop images to specified height and width or resize based on soft and hard crop
  • false - Soft proportional crop mode.
  • true - Hard crop mode.
  • array - Specify positioning of the crop area (x_crop_position, y_crop_position).

Saturday, August 30, 2014

WP hard crop vs soft crop

In Wordpress, During work with Media Gallery Image upload i see that my uploaded image hard cropped to a specif size thumnail with some part of the image is chopped off.

so i tried to find out reason and setting provided by Wordpress framework. within few moment search i find out that in Wordpress there is setting for "Crop thumbnail to exact dimensions" with checkbox inside WordPress Dashboard > Media > Thumbnail size

With “Crop thumbnail to exact dimensions” option check and uncheck  we getting different types uploaded images thumbnail.

See Generate Custom size thumb in Wordpress

Example  : Im using following Wordpress logo image with orizinal size width 473 px and height  348 px

Checkbox checked - Hard Crop Image

The uploaded image is cropped to a thumbnail of 150 x 150 Px. here we can see that how some part of the image is chopped off so that it can fit it into the hard set 150px x 150px size.

Checkbox un-checked - Soft Crop Image
with soft crop case thumb of image should be generated with  either given width or height width (Contstrain Proportions) and corresponding width or height without chopped images.

Below thumbnail generated with 150px width and 110px height in soft cropped case.

while we install wordpress than by default checkbox checked so all thumbnail images will be hard cropped by default and all uploaded images  chopped off as .

WordPress by default checks this checkbox for you when installed so all your thumbnail images will be hard cropped by default. I personally don’t think that’s a good idea and always turn the checkbox off so my resized thumbnails still sees the full picture, instead of a cropped/chopped off thumbnail image.

if you want your uploaded images all thumbnail generated with the full picture instead of a cropped/chopped original image than i suggest keep unchecked (off) option "Crop thumbnail to exact dimensions" checkbox that is inside WordPress Dashboard > Media > Thumbnail size

References  :

Monday, August 25, 2014

Paypal customer return to Site

- Like our functionality for E-commerce Online Shopping site, mostly all require to get back thier customer on the website with Payment responce status to update on website after  payment done on Paypal

Follow below step & Image snap to Return back Customers to Website after payment done using Paypal

1 Log in and click the Profile subtab under My Account.
2 Click the My Selling Tools
3 Website Payment Preferences
4 Click the On radio button to enable Auto Return.  Enter the Return URL. Note: You must meet the Return URL requirements in order to set up Auto Return. Learn more about Return URL.
5 Click the On radio button to Payment Datat Transfer

 Source : Paypal 

Wednesday, August 20, 2014

Use WP Site Theme url in Javascript

To use wordpress Site URL, Theme Url or any information that you are fetching using wordpress default function and want to use it in Javascript that is either Internal or external.

If javascript code used in internal .php file than you can directly call wp function using <?php ?> in Javascript but main confusion is what is the best way while want to use in External .js file because we cant use Php script in External .js file.

In this case  2 possible solution.
1 Declare JS variable in header.php and assign value it
2 use WP wp_localize_script function : Localizes a registered script with data for a JavaScript variable. more

Example :
wp_localize_script( 'custom-js', 'wpcj_variable', array( 'template_url' => get_bloginfo('template_url'),   'site_url' => get_bloginfo('url')));
To use in Javascript