Sunday, December 4, 2016

vps performance test: Amazon Lightsail vs. Digital Ocean vs. Linode vs. Scaleway vs. Server Mania

VPS performance test: Amazon Lightsail vs. Digital Ocean vs. Linode vs. Scaleway vs. Server Mania

Severs tested for performance

I have tested the following servers:
(i) Amazon_Linux-512MB-Virginia-1 (LIghtsail)
512 MB RAM, 1 vCPU, 20 GB SSD Amazon Linux Virginia, Zone B (us-east-1b)
(ii) Scaleway (Paris) (BareMetal server)
C2S - 4 Dedicated x86 64bit Cores, 8GB memory 50GB SSD Disk, 1 Flexible public IPv4, 300Mbit/s Internet bandwidth, 2.5Gbit/s Internal bandwidth
(iii) Scaleway (Amsterdam) (Cloud server)
2 x86 64bit Cores 2GB Memory 50GB SSD Disk 1 Flexible public IPv4 200Mbit/s Unmetered bandwidth
(iv) Ditial Ocean (Banglaore) 512 MB Memory / 20 GB Disk / BLR1 - CentOS 6.8 x64
(v) Linode (Singapore)
2 GB RAM, 1 CPU Core, 24 GB SSD Storage, 2 TB Transfer, 40 Gbps Network In, 125 Mbps Network Out (vi) Server Mania (Specials)
SSD Cached Linux
2 GB Guaranteed RAM
2 GB vSwap RAM
100 GB SSD RAID-10
4 IP Address
3 TB Bandwidth
100 Mbps Network Speed

Friday, January 1, 2016

How To Set Up Wordpress Custom Posts And Display On Page And Post

I couldn’t find any simple guides on how to set up custom posts and display them on the archives page and on single posts.

Custom posts are necessary if you want to display two different types of posts in the same wordpress installation.

E.g. suppose you have a site which has posts about movies. The template will be designed to set out information relevant to movies such as the actors’ names, the storyline, etc, etc.

If you want to write a series of posts on another subject, say cooking, using the template files that are used for movies will obviously not work.

This problem can be easily resolved by the use of custom posts.

Step 1: Install a customs post plugin:

The two most popular plugins are “WCK - Custom Fields and Custom Post Types Creator” and “Custom Post Type UI”.

I am using WCK - Custom Fields and Custom Post Types Creator for this demo.

Step 2: Go to WCK > Post Type Creator.

Create a post type called “articles”. Give it the singular label ‘article’ and the plural label “articles (you can choose any other name you want but remember to use that name in the template files as well).

Under "supports", you can leave it at default or choose any or all of the options. I chose "excerpt". You can come back later and change the options.

Clicking the “add entry” button will create an “articles” menu on the left side. Go there and add two articles called articles 1 and articles 2 with some arbitrary text in them. Open the articles to ensure that you are able to view them. If there is a 404 'not found' problem, it is probably because of a permalinks problem. Go to Settings > Permalinks and refresh the permalinks. You can also change the permalinks to default and then go back to the pretty permalinks.

I am using a nginx server built with easyengine. The wordpress pretty permalinks work effortlessly.

Step 3: Create a template page to show all the custom posts grouped under ‘articles’.

Create a new file in notepad called “page-articles.php” and paste the following code in it:



 * @package WordPress

 * @subpackage U-Design



 * Template Name: Articles


get_header(); ?>


    $args = array(

        'post_type' => 'articles',

        'posts_per_page' => 10,

        'orderby' => 'rand'


    $the_query = new WP_Query( $args );


<?php if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>

<header class="entry-header">

<h1 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h1>


<div class="entry-summary">

<?php the_excerpt(); ?>

<a href="<?php echo get_permalink(); ?>"> Read More...</a>



<?php endwhile; else : ?>

    <p>There are no articles :( </p>

<?php endif;

wp_reset_postdata(); ?>

<?php get_footer(); ?>

Upload the file to the folder which has the “page.php” template.

Now, go to Pages > Add New Page in the dashboard. Name the page whatever you want, such as “My Latest Articles” or anything else. In the “Template” section to the right, choose “Articles” from the drop down menu.

Publish the page and view it. You should be able to see the two articles titled “Article 1” and “Article 2” in it.

You can modify the look and feel of the page by tinkering with the template file called “page-articles.php” that we created earlier.

Step 4: Create a template file to show the single posts:

If you click each article, it will display in the default single page template.

To change this, download the “single.php” file. Open it in notepad and make the changes you want. Thereafter rename the file as “single-articles.php” and upload it to the same folder in which single.php resides.

Clear the cache (if you have WP Super Cache) and refresh the single post, you should be able to view the post in the new single post template.

The logic is that Wordpress will display all pages and posts in the default page.php and single.php templates respectively. However, if you create a new type of custom post and append the name of that post to a new page and single post template, Wordpress will display them in that template.

Now, you can create a menu item to append the articles. It will display separately from the other posts.

So, it is that simple to have  custom posts thanks to wordpress and the plugins.

The tutorials on pagination on wordpress custom posts are at and

Saturday, December 26, 2015

XenForo Forum: How To Show Date Of Joining, Number Of Messages, Likes Received And Trophies Of Members

If you would like to show the date of joining, number of messages, likes received and trophies of members in your Xenforo forum, go to the Admin control panel, click on the appearance tab, click on ‘style properties’ and then ‘message elements’. Select, ‘show custom user fileds’, ‘author registration date’, author message count’, ‘number of like’, ‘author trophy points’ etc, as desired.

This youtube video explains the procedure clearly:

Friday, May 8, 2015

VirtualMin: 413 “Request Entity Too Large” error with uploading a file

In a normal nginx installation, this error is solved by making an amendment to the nginx.conf file and the php.ini file.

The nginx.conf file is found at /etc/nginx/nginx.conf while php.ini is to be found at /etc/php.ini

Sunday, May 3, 2015

VirtualMin Wordpress Nginx Permalinks

VirtualMin Wordpress Nginx Permalinks

If you want to use Virtualmin with nginx, there are two nice tutorials (Using Nginx with Virtualmin and Virtualmin with NGINX+PHP-FPM+OPCACHE).

To get the Wordpress permalinks to work, do the following:

Go to Virtualmin > Services > Configure Nginx Website > Return to virtual hosts list > Edit Configuration Files.

Sunday, October 12, 2014

Nginx.conf rules for Wordfence Falcon Engine Caching when using Nginx and PHP5-FPM

Wordfence is a free Wordpress plugin that provides security for your wordpress installation. It has a nice feature that scans your wordpress files and compares it with the original to see if they have been modified.

However, the scan is not foolproof. It does not cover all the core wordpress files or the themes or the plugins. Also, if the hacker has inserted new files, that goes undetected.

Monday, September 15, 2014

Wordpress Shows Login Page For Entire Site

Today, I had an unpleasant experience. When I tried to access my site, I was presented with a peculiar login page. No page was accessible. Even the wp-admin.php page was blocked out by the login page. There was only one input box for the password (see image).