Install drush on CentOS using command line with simple steps

Drush is great native application for development of drupal project. I really like to use this tool in every project. There are some good steps to install drush on Linux or windows environment. I recently installed drush on my centos machine. Here are those steps:

Commands has been highlighted in blue color.

[root@ap107 purab]# wget http://files.drush.org/drush.phar
–2016-04-21 11:50:43–  http://files.drush.org/drush.phar
Resolving files.drush.org… 54.231.81.40
Connecting to files.drush.org|54.231.81.40|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 5264426 (5.0M) [application/octet-stream]
Saving to: “drush.phar”

100%[===========================================================================================================================================================>] 5,264,426    221K/s   in 65s

2016-04-21 11:51:50 (78.5 KB/s) – “drush.phar” saved [5264426/5264426]

[root@ap107 purab]# php drush.phar core-status
PHP configuration      :  /etc/php.ini
PHP OS                 :  Linux
Drush script           :  /home/purab/drush.phar
Drush version          :  8.0.5
Drush temp directory   :  /tmp
Drush configuration    :
Drush alias files      :

[root@ap107 purab]# chmod +x drush.phar

[root@ap107 purab]# mv /usr/local/bin/drush /usr/bin/drush
[root@ap107 purab]# drush init
Copied example Drush configuration file to /root/.drush/drushrc.php                                                                                                                       [ok]
Copied example Drush bash configuration file to /root/.drush/drush.bashrc                                                                                                                 [ok]
Copied Drush completion file to /root/.drush/drush.complete.sh                                                                                                                            [ok]
Copied example Drush prompt file to /root/.drush/drush.prompt.sh                                                                                                                          [ok]
# Include Drush bash customizations.
if [ -f “/root/.drush/drush.bashrc” ] ; then
source /root/.drush/drush.bashrc
fi

# Include Drush completion.
if [ -f “/root/.drush/drush.complete.sh” ] ; then
source /root/.drush/drush.complete.sh
fi

# Include Drush prompt customizations.
if [ -f “/root/.drush/drush.prompt.sh” ] ; then
source /root/.drush/drush.prompt.sh
fi

Append the above code to /root/.bashrc? (y/n): y
Updated bash configuration file /root/.bashrc                                                                                                                                             [ok]
Start a new shell in order to experience the improvements (e.g. `bash`).                                                                                                                  [ok]
[root@ap107 purab]# drush

How to delete all wordpress comments

In wordpress comments most effective way of discussion and communication with people. Some times we want to delete some or all comments from wordpress website. Here in this tutorial, we given some basic ways to delete the wordpress comments from your site.

How to delete all wordpress comments

Note: Before doing anything, it is important to take backup of your database is very important. Always take backup of your database and file system before performing any major database of plugin related operation.

  1. Delete comments through database

If you have access to your database through PHPmyadmin than go to there. If you have shared hosting panel than in dashboard page you will find the PHPmyadmin link or icon there. Login to PHPmyadmin and select your wordpess database. You are able to see page like as follows:

wordpress-delete-comments
wordpress-delete-comments

Select the wp_comments and wp_commentmeta table and select empty option from dropdown. Do not press drop icon. It is very dangerous. Only make it empty table. Above tables are very important to run your wordpess site.

2. Use delete all comments wordpress plugin.

Go to this page “Delete All Comments” and download this plugin. Install wordpress plugin your site using admin panel. Do not forget to activate this plugin through plugins option.

After activating this plugin go to Tools->Delete all comments section or page.

Delete_All_Comments-wordpress
Delete_All_Comments-wordpress

Check above checkbox (Delete all comments) and hit Delete All button. It will delete all comments from your wordpress site.

I hope this tutorial found useful.

 

How to hide unwanted items from wordpress Admin Area

If you want to disable or hide unwanted items from wordpress admin area. There are many solutions and wordpress plugins available for admin features. I always like one wordpress plugin which is really great for admin area enhancement.

Main advantage of plugin is, it is truly opensource. you can modify this plugin as per your client and development needs. If you are wordpress developer than following information will be informative to you.

For development see this repository: https://github.com/bueltge/Adminimize The master branch is the current version and the new will leave in the v2.0 branch.

hide unwanted items from wordpress admin

Adminimize

WordPress-Adminimize-plugin

If you manage a multi-author WordPress blog or WordPress sites for clients, then you may have wondered if it was possible to clean up the WordPress admin area for your users? There are lots of things in the WordPress admin area that your users don’t need to see or use. This plugin help you to hide unnecessary items from WordPress admin area.

Adminimize makes it easy to remove items from view based on a user’s role.

Search for helping hands

Over the time the plugin was extended the plugin with much requirements and his solutions. But the source is not easy to maintain for me, I’m unhappy with the source. I have learned about coding, architecture etc.

Currently I search for developer there will help on dev and support the plugin. The plugin have a github repository to easy add a issue or a create a fork, pull request. Also to add issues to understand problems.

Especially the functionality for WP Multisite is currently more a hack as a solution. But is very complex, not easy to create a solution for this.

Following are some admin screen of this plugin.

hide unwanted items from wordpress admin
hide unwanted items from wordpress admin

 

Support Custom Options on all different post types

With version 1.6.1 it is possible to add own options for hide areas in the backend of WordPress. It is easy and you must only forgive ID or class of the tag. Also it is possible to use a fixed menu and header.

Support Custom Post Type

Also it is possible with version 1.7.18 to use on custom post types; hide ‘unnecessary’ areas on the custom post types for different roles and post types.

Compatibility with the plugins for MetaBoxes in Write-area

  1. You can add your own options, you must only see for css selectors

Requirements

  1. WordPress version 2.8 and later

This plugin has wide range of version support.

Optimize Your WordPress Blog for Speed and Performance

Out of all the websites in the world, only 39.8% websites use a Content Management System (CMS), although this percentage is constantly improving, but out of those 39.8% websites which use CMS, WordPress (WP) constitutes of 60.3% market. In short, WP dominates the CMS world. Since its inception in the year 2003, WordPress has come a long way. And companies providing CMS web development services understand the powerful capabilities of the WordPress. It started just as a blogging platform which is unarguably the biggest CMS platform today and has been the most popular CMS platform from past 5 years.

More than 60 million websites are powered by WP today, but not all perform equally, and in today’s fast paced world where every second counts, your blog must be optimized for speed and performance, and here’s why:

  • The longer it takes for your website to load, it’s more likely that the visitor will leave.
  • The percentage of page abandonment increases with every second it takes more to load the page.

change-in-response-time

  • Conversions are reduced by 7% rate by every 1 second it takes to load the page.
  • 47% users expect the page to load within 2 seconds.
  • If an e-commerce site is making $400,000 per day, a 1 second page delay could potentially cost you $10 million in lost sales every year.

 

How to check the Page speed

Before rectifying the problem, you must know the problem, and you don’t need to be a rocket scientist to check that. There are many websites on which you can check the performance of your website:

pingdom

 

As you can see, the test result from Pingdom of blog from Xicom Technologies.

 

Page Load Time

Page load time should should be minimum as possible. So, try to aim for less than 2 seconds. I know it’s a tough task to optimize a blog, optimizing images, minimizing CSS, HTML, and Java coding, etc., but it’s possible.

 

How to Boost the speed and performance

80% speed of the blog depends upon:

  • Size of the Image
  • Hosting
  • Plugins
  • Caching
  • Embeds

So optimizing these above factors means, optimizing your blog for faster and better performance.

 

Optimizing Images

I won’t recommend removing images because they give a website an attractive look, but the size of the images needs to be optimized for best performance and you can do that by :

  • Install the WP smushit plugin; this plugin compresses all the images without any considerable loss in quality. It’s called smush it because it smushes all the data from the images like camera used, date, location, etc.
  • Upload images of smaller size in the first place itself.
  • Image Spirite: This is a technique used to combine all images into one. A web page with multiple images generates server request every time to load an image and that add additional time. Using this technique will reduce the server requests and save bandwidth.

 

Enable Dynamic Caching

Configure a good caching plugin into the WP, as caching will deliver static HTML files instead to make your pages load faster. You can use services like APC, Varnish, or Supercacher as well as install WP plugins like W3 Total Cache.

wp-cachce

Browser Caching

Leveraging the browser cache means how long the user’s browser will cache your images, JS, and CSS files. It’s really effective when a user visits your site again. To enable browser caching you have to edit your HTTP headers to set expiry dates on certain files. For more on leveraging browser cache, click here.

apache-cache-setting

Minify your CSS and JavaScript files

It means removing all the unnecessary data like from them like empty new lines, double spaces, comments, etc. If you use W3 Total cache plugin, it has an option to automatically minimizing the JavaScript and CSS files.

Enable gZIP Compression

gZIP reduces the size of the files transferred between the server and the visitor, and as a result reduces the size of the page upto 70%.

Hosting

Often it is the most overlooked component of a successful website, most of the focus goes into the design, the layout, the coding, that web hosting is often overlooked and the owner goes for the cheap hosting plan which affect the ranking of the website on search engine to its load-time, increase bounce-rate of the website as result. On the contrary a good hosting plan can help boost the search engine ranking and increase sales.

 

Other Performance Improvements

Remove query strings from static resources.

Add this code to your theme’s functions.php:

function ewp_remove_script_version( $src ){

if ( stripos( $src, ‘?ver=’ ) ) {

$parts = explode( ‘?’, $src );

return $parts[0];

}

elseif ( stripos( $src, ‘ver=’ ) ) {

$position = strripos( $src, ‘&’ );

return substr( $src, 0, $position );

}

else {

return $src;

}

}

add_flter( ‘script_loader_src’, ‘ewp_remove_script_version’, 15

 

Conclusion:

Optimizing your blog will not only lead to a faster blog but eventually lead to more business conversions.

Change a Admin Color Scheme for All Users in WordPress

If you want to change user color scheme for all users on your site and change user experience. You can change default admin color scheme without any plugin. You need need to add small code snippet into your theme’s functions.php file. You can find this file in your theme folder.

Open functions.php file and put following code in that file.


function set_default_admin_color($user_id) {
	$args = array(
		'ID' => $user_id,
		'admin_color' => 'sunrise'
	);
	wp_update_user( $args );
}
add_action('user_register', 'set_default_admin_color');

There are many wordpress admin related methods and code snippet written in my site. simply use search functionality for more code snippets or check wordpress tutorials section.

 

Enable Sales Alerts for Digital Downloads wihtout plugin

Selling digital downloads is something that not a single one of the large WordPress ecommerce plugins has ever gotten really right. This plugin aims to fix that. Instead of focusing on providing every single feature under the sun, Easy Digital Downloads tries to provide only the ones that you really need. It aims to make selling digital downloads through WordPress easy, and complete.

Enable Sales Alerts for Digital Downloads wihtout plugin. You will first need to add the ID of the download you wish to be alerted about. You can then set the default milestone amount, currently the snippet is at 100.

You can download his full code base from following URL

https://github.com/easydigitaldownloads/Easy-Digital-Downloads

function sumobi_edd_milestone_sales_alert( $purchase_id ) {
// ID of download to check
$download_id = 8;
// sales milestone to reach
$milestone = 100;
// email/s to send the notification to. Add more emails to array if necessary
$send_to = get_option( ‘admin_email’ );
// get the current number of sales for the download
$sales = get_post_meta( $download_id, ‘_edd_download_sales’, true );
// message to be included in the email
$message = sprintf( ‘Congratulations, you have just reached your milestone of %s sales for %s! View this sale here: %s’, $milestone, get_the_title( $download_id ), admin_url( ‘edit.php?post_type=download&page=edd-payment-history&view=view-order-details&id=’ . $purchase_id ) );
// send email is milestone is reached
if ( $milestone == $sales ) {
wp_mail( $send_to, ‘Milestone reached!’, $message );
}
}
add_action( ‘edd_complete_purchase’, ‘sumobi_edd_milestone_sales_alert’ );

 

Credit goes to Andrew Munro. Thanks him for this snippet.

10 Best WordPress websites of the world

WordPress websites are in popular demand since their emergence. Easy accessibility, uncomplicated management, compatibility with Search engines, 100 % customization, built in blogs and ready to grow business assists multiple users to grow their business.

Since 2003, many word press websites have come into picture but the top 10 that have gathered maximum attention worldwide due to magnanimous inbuilt features are-

10 Best WordPress websites of the world

  1. This is Your Kingdom:

This is Your Kingdom

This wordpress website is a perfect blend of style and substance. Visitors can easily have an idea of all the activities going in any local area. Its concept is pretty simple and incorporates enormous content. The website keeps getting updated on regular basis consecrating its visitors with loads of information making them return to the website. Its charismatic looks and playful designs provoke the visitors to stick to the website for pretty longer period of time. It’s a perfect blend of wide range of illustrations leading to imaginations and explorations.

  1. TravelPortland:

TravelPortland

This is a highly commendable website that highlights enticing opportunities to the visitors of Portland in Oregon, US. The websites reveals immaculate designs citing great stories of waterfalls and food trucks. It employs customised responsive themes adding magnetism. Zurb’s Foundation framework is its platform that utilizes the third party APIs at all places. Storify, ChooseCulture, Weather Underground are some of its special attractions. Based on the location of the visitor, MaxMind’s Geolocation customises the content present on the homepage. The website is good for visitors in planning phase or for in- town visitors.

  1. WorryFreeLabs:

WorryFreeLabs

Based in New York, it caters rich mobile experiences. This tantalising facet has increased the web traffic on mobile and tablets to remarkable extent. It’s highly responsive website that employs HTML5 offering mind arresting touches, browsing thereby becomes highly fascinating. Some of the features include smooth sliding to animation, automated scroll slides or swipe button on the contact form.

  1. Great Lengths Hair:

Great Lengths Hair

This is a highly powerful and responsive WordPress website popularly known for hair extensions fashion brands located in Leeds. Various Java Scripts and frameworks have offered it excellence above par. The website is enormously heavy as images of various dimensions have been loaded on it, however the super clean navigation and quick touch enhances its accessibility. New HTML5 and W3C Geolocation API elements are its other attractive facets.

  1. Toronto Standard:

Toronto Standard

This is a purely digital creative agency that uses CSS3 and HTML5 on its websites. These tools assist in reorganising the dynamic grid elevating the rich experience of the users while browsing. The intricate proprietary system has lot to offer to its contributors in terms of learning.

  1. Harvey Nichols:

Harvey Nichols

The site is dedicated to international scale luxury fashion destination. It supports an exhilarating ecommerce proposal while delivering the best shopping proposals. Retailers can make their presence widespread while upgrading the website via Magento Enterprise. It is an open source platform that has made it a great success.

  1. Captain Creative:

Captain Creative

It is an enriching wordpress website that offers a common platform for portfolio and blog management.

  1. Little:

Little

The WordPress website has been designed to meet the challenges faced by the businesses internally as well as externally. Little wordpress website has been surviving in the industry since 30 year diverting the website traffic on tablets and mobiles. It is easy to use and uses responsive framework via Bootstrap and CMS. The homepage offers succinct portfolio of eminent clients adding weight to the page. The website has hit the mark highlighting its beauty.

  1. Poster Roast:

Poster Roast

It is a distinguished website that promotes screen printed gig and exhibition posters for UK artists. The website uses exceptional WPE- Commerce and the golden cart plug-ins. The plug-in can be used flexibly and facilitates the integration of any theme structure easily. You can drive traffic at any place via widgets and short codes while adding categories and products.

  1. Customizr:

Customizr

This is one of the best free WordPress themes available on web. You can customize your website in the way you want. Whether you want to add layouts, sliders, or featured blocks to make the homepage more enticing or want to do anything else, you have complete leverage to customize anytime. This wordpress website is linked with Twitter Bootstrap framework to open new doors of creativity for the users.

So, go and choose the best one based on your preferences to build an eye-catching blog enjoying hundreds of benefits.

Disable sending password email to new wordpress users

Some days before I installed new wordpress 4.3 version, I came across with issue of sending email forcefully to new wordpress user on their email address. Many times wordpress admin wants to create users like authors, contributers and subscribers in their website. But with newer version of wordpress, we cannot create wordpress users without informing them.

This password email change is added for better security. This feature has following feature.

– Strong admin control over options

– Random generator is fine, but

– Strong passwords mandatory, at least XX (16? 20?) characters

Here is tutorial for disable sending password email to new wordpress users

Following is screen shot of user creation form in wordpress 4.3 and newer version.

Disable sending password email to new wordpress users
Disable sending password email to new wordpress users

Issue

Many times, I requested to add guest post so, I wanted to create contributes. But due to this feature, I cannot create users without email confirmation.

Here is solution:

You can add following code in your functions.php file, which you can find in your wordpress theme folder.

// Fix New User Email Send
if ( !function_exists('wp_new_user_notification') ) :
function wp_new_user_notification( $user_id, $notify = '' ) { }
endif;

After adding this code, I am able to create wordpress user without sending email to user.

Do’s and Don’ts of WordPress Theme Customization

WordPress theme customization gives you an opportunity to add some extra features to your website. In website development, there is always more than one way to perform a job, however, these quick do’s and don’ts will show you which way to choose to get better results within stipulated time period.

Do and Dont of WordPress Theme Customization

Don’t Hack Parent Theme’s Code

This is the first and foremost thing to keep in mind. Do not ever alter or change the core! There are many bloggers who keep making the same mistake of changing the parent code. Constant updates of wordpress makes it difficult for a blogger or developer to keep the modifications made previously. With every update of wordpress, the modifications get lost. Also, the changes made in the core may lead to the failure of wordpress plugins or other important aspects.

Do Use Child Themes

One of the best ways to make changes in your wordpress theme is to create a child theme. It will allow you to make as many changes as you want in your wordpress theme while keeping the basic functionality alive and in proper working condition.

Wordpress Theme Customization-1
Do’s and Don’ts of WordPress Theme Customization

Don’t Use Inline Styles

Never use inline styles! This may seem convenient and easy at first, but you will definitely end up regretting. Inline styles have high preference and therefore, it will always win whether you have created external CSS style sheet or not. In addition, unlike external style sheets, inline styles are not easy to maintain. With infinite coding lines, you wouldn’t want to waste your time and effort on figuring out which inline style needs modification to get the required result.

Wordpress Theme Customization-2

In case you must put inline styles, use embedded style sheets in the <head> section instead. At least this way you can easily manage and modify them whenever you need.

Do Make Use of Core Options

WordPress comes with many options, plugins and functions, which are so easy to incorporate into your theme. Though these options don’t get used very often, they are a great way to enhance the functionality of your theme. One such example is of “date format”. You can simply incorporate it to users date or time format on comments.

Don’t Hardcode URLs

For some obvious reasons, don’t hardcore URLs. Make sure to use actions available in the coding.

Reasons why you shouldn’t hardcode URLs:

Plan on changing your domain name in the near future? If so, you’ll also need to change your hard-coded URLs.

If you are working on a local server and going to move it to server anytime soon, you should rather avoid hard-coding URLs.

You theme will break down if you are going to use it on another website.

Do use Enqueue function

Using enqueue function lets wordpress manage the queuing of all the files which are loaded at the right time. There are numerous reasons of avoiding the addition of resource into the init action. First of all, there is no way of checking whether or not a file has been loaded. Secondly, the scripts and styles will be loaded on every page when using in it. Also, it may lead to failure of some plugins.

Wordpress Theme Customization-3

Make wordpress customization easy with these tips.

Happy coding!

Free social icons and vector art and images for download

Free social icons and vector images are needed for every application and websites. For android, iphone apps we need the vector art and images for download. We found many free social icons and vector images. There are thousands of free social icons and vector images we can find for download on many websites.

Social icons and vector images are required for creating websites and mobile applications. Free images and arts are very important for that.

I liked following social images and vector images.  You can download these free images from here.

Vector graphs pack

vector-graphs-pack-preview (4)

vector graphs pack preview

vector-graphs-pack-preview (3)

Best Twitter icons

twitter-bird-icon-bubble-vector-preview (3)

sport and diet vector icons

sport-and-diet-vector-icons-preview (2)

social media icons

social-media-icons-preview (5)

smart vector info-graphics

smart-vector-infographics-preview (5)

smart vector infographics 5

smart-vector-infographics-preview (4)

retro office icons

retro-office-icons

hipster vector items

hipster-vector-items-preview (1)

Floral Backgrounds Vector Pack

Floral-Backgrounds-Vector-Pack-preview (3)

flat responsive vector web design

flat-responsive-vector-web-design-preview (3)

eagle logo design pack

eagle-logo-design-pack-preview (2)

City Skyline Vector

City-Skyline-Vector-preview (5)

bird silhouettes

bird-silhouettes-preview (4)

banking icon set

banking-icon-set (1)

You can to above website for free download.