Archive for July, 2012 performance monitoring / debuging

Performance Analysis of Logs (PAL) Tool

Analysis Performance Monitor Data

Debug Diagnostic Tool v1.2

Network Monitoring

Download and Install Debugging Tools for


No Comments

Steps to Deploy WordPress From Localhost To Your Web Server

  1. Export your DB from the localhost using phpMyAdmin as a .zip
  2. Extract the zip locally somewhere for editing
  3. Open the .sql file in jEdit (or equivalent UTF-8 capable editor) and do a string search for localhost
  4. Find the string you need to replace, usually http://localhost/your-site depending on how you’ve setup your local server.
  5. Do a global string replace using the replacement string you found and replace it with your new domain, something like
  6. Save in UTF-8 format. You might want to save as a new file just in case you need to revert.
  7. Using phpMyAdmin on your destination web server create a database and import the new .sql file. With some cPanel hosts like Bluehost it’s easier to create using cPanel’s tools then edit in phpMyAdmin for importing the file. If all is okay you should now have your database setup.
  8. Using FileZilla (or equivalent FTP program) upload your website’s files to the web server.
  9. While the upload is happening, it’s time to create the wp-config.php file for your production instance, make a copy of the existing wp-config.php file in your WP root directory.
  10. Open and change the database value to the name of your web server’s database for your site. Also, change the username and password for the database as required.
  11. Save this as wp-config.production.php and upload to your web server.
  12. Once all uploading is complete, using FileZilla rename the existing wp-config.php file on your web server to wp-config.development.php and also rename wp-config.production.php to wp-config.php. Your new config file is now in effect.
  13. Before you get all happy and try to visit your website you need to login to the WordPress admin and navigate to the Permalink settings. Once there just click the save button (don’t change anything, just re-save it). This resets the permalinks to your new URLs so the links to pages and posts will work throughout your site.

No Comments

  1. Make sure that jQuery library loads before the other (non jQuery) libraries.
  2. Insert the jQuery.noConflict(); after the main jQuery library is loaded, but before the other (non jQuery) libraries. In my case, when I viewed the source code of my WP pages, the jQuery.noConflict() was already loaded, so I didn’t have to do it manually. But, the mootools libraries of the FCG plugin were loaded before the jQuery.noConflict(); and we need to move it below. In order to achieve that:
    • I placed the following function, in the functions.php of my theme, to remove the FCG JS libraries from loading the way they were originally programmed:
      function remove_featured_gallery_scripts() {
             remove_action('wp_head', 'gallery_styles');
      add_action('init','remove_featured_gallery_scripts', 1);
    • Then I added this function to load the FCG JS scripts last in general script loading order:
      function addscripts_featured_gallery() {
      	if(!function_exists(gallery_styles)) return;
      add_action('wp_head', 'addscripts_featured_gallery', 12);
    • Make sure that after inserting those function you clear your browser’s cache and refresh you page.
    • Again, the order of our JS libraries should be the following:
      1. jQuery.
      2. jQuery.noConflict(); function.
      3. All other JS scripts and libraries including non-jQuery ones.



No Comments

WordPress Template Hierarchy

No Comments


in theme’s functions.php

add the following php code


No Comments

Making WordPress as Web Site

1. Make a tailor made template


Following is the code for index.php or page.php, which is the empty theme for every page…

<!--?php get_header(); ?--></pre>
<div id="head_content"></div>
	<!--?php while ( have_posts() ) : the_post() ?-->
	<!--?php the_content(); ?-->
	<!--?php endwhile; ?-->

<!--?php get_footer(); ?-->

WordPress looks for several Page template files in your active WordPress Theme based upon the Template Hierarchy. The first one it finds will be used to display any given Page. WordPress will look for files in the following order:

  1. The Page’s selected “Page Template”
  2. page.php
  3. index.php

The WordPress Template Hierarchy also recognized specific Pages or posts automatically without the need to assign them to a specific Page template file. If the Page with ID or slug in the template file name is automatically generated by the user, the appropriate Page template file is used.

  • page-{id}.php
  • page-{slug}.php

If the Page ID number is 42, the page-42.php template file is automatically used. If the Page slug is “About,” the page-about.php template file is used.

2. Using Permalink:
Need to enable apache mod_rewrite !!

No Comments