Get your website on https and get ranked higher on Google

In a recent blog, Google has announced that TLS, SSL enabled websites(https://) will be getting added advantages in SEO ranking. In order to make the Internet more safe and secure, Google has started using HTTPS as a ranking signal, that means if you site is HTTPS enabled you will get ranked higher. However they have also cleared that this ranking signal weighs less than signals like high-quality content etc.HTTPS as Google's ranking signal

Even though, some may think it as hypocritical of Google who has products which doesn’t follow HTTPS( like the BlogSpot), but Google has made this a part of SEO and may increase the weight of this ranking signal in near future. The whole purpose of this initiative is to keep everyone safe on the web. Website owners !! its time to switch from http to https. Encryption is going to be the key to SEO !! So, Get your website on https and get ranked higher on Google.

For more details visit the official Google Webmaster Central blog: http://googlewebmastercentral.blogspot.in/2014/08/https-as-ranking-signal.html

How to block the USSD notification/balance update messages on Android smart-phones ? [Solved]

Problem description:
In India, whatever internet plans you take for your smartphones, be it 3G, 2G Internet, GPRS etc. it always keeps randomly disconnecting. Sometimes it reconnects automatically, sometimes it takes a while. So, during this process we keep getting a remaining balance message or notification for the data usage which is nothing but a USSD.

What is USSD ?
USSD (Unstructured Supplementary Service Data) is a Global System for Mobile(GSM) communication technology that is used to send text between a mobile phone and an application program in the network. USSD is similar to Short Messaging Service (SMS), but,unlike SMS, USSD transactions occur during the session only. USSD is commonly used by prepaid GSM cellular phones to query the available balance.

These USSD messages for remaining balance and used balance are such that: these will asks the user to press the “OK” button and unless you press that, it stays like that on the screen and prevents you from performing any other task on the phone. It creates an overlay kind of screen which doesn’t allow the user to touch anything else unless you click ok button for each popup. Each time you send a sms, each time your internet gets disconnected etc. a notification popup will be displayed to be read by the user. These are so much in numbers that some one gets irritated.

There are times when you keep your smart-phone unused for more than one hour, and when you get a call, you have to press the “Ok” button 20-25 times on these popups to receive the call. Its really annoying !! Now, how to block those type of messages ? These frequent balance updates, data usage status are of no use/very less use.

Solution:
There is a nice app called Quiet Balance. Named as Balance Update / USSD blocker on Google Play. This app specializes in blocking USSD messages.

  • It provides ways you can block only specific type of messages. It has three types of matching methods for blocking USSD messages.
    1. Substring match: You may choose to block messages that contain a specific text.
    2. Keyword list: a list of keywords (comma separated keyword list)
    3. Regular expression: for advanced users by writing regular expression.
    When these conditions are matched, it triggers a block of that ussd message.
  • You can also choose to show the balance update message once per day (or week/month). This will cause the first balance update message to show up, and all other messages will be blocked for the rest of the day.
  • Last 25 messages are saved in the message log, along with indication if the message was blocked or allowed.

Go get the app and install on your Android phone and make it Smart 🙂 🙂
Get it on Google Play

 

 

Slide to see all the screen shots of the App:

Matt Mullenweg (the founder of WordPress) becomes the new CEO of Automattic

autmattic

Matt Mullenweg (the founder of  WordPress) becomes the new CEO of Automattic. 

Toni Schneider, a senior executive spearheading Yahoo’s Developer Network was on this position as CEO of Automattic (a company started by Matt Mullenweg of WordPressfor last eight years. 

After eight years, I’ve decided to hang up my CEO hat and ask Matt to take over the job.
— Toni

Find out more details here regarding the news “A new CEO for Automattic” : http://toni.org/2014/01/13/a-new-ceo-for-automattic/

 

How to disable responsiveness in the admin theme of WordPress 3.8

How to disable responsiveness in the admin theme of WordPress 3.8 ? How do I disable responsiveness of WP 3.8 admin ? Is there any way to disable responsiveness ? I want to disable the responsive hiding feature for tablets and mobile for the newly introduced WordPress 3.8 admin back end.

The question comes, Why do you need to disable the responsiveness ? So, here is a problem/situation that describes WHY ?
Stop Responsiveness WordPress 3.8
Problem/Situation:
I just updated my WordPress setup to WP 3.8 and most of my custom functionality are either inaccessible or very hard to manage on mobile devices. There are some things which doesn’t even get displayed on mobile devices. Earlier, I was able to manage my site’s functionality from backend on a mobile device too. Even though it was not responsive and not so cool. The problem is that I have installed some custom made plugins which were made keeping an eye on the old style admin theme and it provides me some custom made interface on the admin side. Obviously these were not made responsive. Now, with this new WordPress admin theme, all those custom interfaces are completely messed up. So I have two options:

  • Either revert back to WP 3.6/3.7 ( but I really like the look and feel of the new WP 3.8 theme yet I don’t need the responsive property 🙁 )
  • Or make changes to all the custom made screens/interfaces in the admin side to be responsive. ( I can do that, but it would take much time to accomplish. Also, does it worth doing just for the sake of a new responsive admin theme in mobile devices ? 😕 )

How can I keep the new, super cool, awesome theme of WordPress 3.8 yet disable responsiveness of the theme ? ❓ ❓ ❓

Solution:
I tried to search for any solution but didn’t find any. Here is a quick solution that I have done to get back my custom functionality in the admin screen.

  1. Create a plugin to add custom code.
  2. Take the css file that is responsible for the wp-admin side styling and responsiveness. Make changes to remove the responsive property out of it. Basically remove all the media queries written for mobile devices.
  3. De-register the default admin styling that comes with WordPress.
  4. Register and enqueue the changed css file again to apply the custom styling.

Download the code as a plugin: disable-responsive-admin

Code for disabling responsiveness:

Download the above code as a plugin: Plugin to disable responsiveness in WP 3.8 admin

Note: This never a proper/good way of doing changes to admin styling. Still, as I have upgraded and would like to keep the theme and remove responsiveness, I am using the above quick solution. If you are facing the same problem as I am, use the above procedure or download and install the plugin. You can modify the css file present inside the plugin directory too. Caution: Use with your own risk. 🙂 🙂

Do you need an admin interface to stop / disable auto update feature of WordPress ?

Now that the “Automatic update of WordPress core” has been introduced in WP version 3.7, there are some obvious questions those come into mind. Where can I control this automatic update functionality of WordPress 3.7 ? Is there any admin interface for it ? How can I disable auto update of WP ? So, before going to show you how can you control the automatic update feature on admin settings page, let me tell you some facts.

This newly introduced auto update of WordPress core files is only for security and maintenance releases which is considered to be MINOR releases. That means this auto-update feature won’t be affecting the major releases of WP.

automatic-update-wordpressMajor releases: 3.x –> 3.(x+1)  OR  3.x.x –> 3.(x+1)
Version 3.6 to Version 3.7 or Version 3.8

Minor releases: 3.7 –> 3.7.(x+1)  OR  3.7.x –> 3.7.(x+1)
Version 3.7 to Version 3.7.1 or Version 3.7.2 or Version 3.7.3

As this feature is not for major releases rather only for the minor ones, it won’t break your site and won’t create any major problems. So stay cool and don’t worry !!   🙂

Somehow, if you don’t need this auto-update feature for some reasons like:

  • You manage your site using version control.
  • You implement your own deployment mechanism.
  • You think there is no guarantees in this auto-update feature.
  • You want to upgrade manually with complete control and at you own convenience.
  • OR if you think there is any error in the stats provided by Nacin regarding zero failures 😉 

 

Now the Solution (Plugin that creates an settings interface for WordPress admin to manage & control auto updates):
By default, there is NO admin interface provided by WordPress to have control over this. However there are some hooks and config variables to manage this. Like:

 

Certainly there is a cool plugin called “Update Control” in the WordPress repo which provides a nice and easy interface to manage this newly introduced feature along with some more options. Plugin URL: http://wordpress.org/plugins/update-control/
 
disable auto update wordpress
Various features & controls provided by this plugin:

  • Enable/Disable automatic updates.
  • Set the level of releases for Auto Updates.
  • Enable/Disable automatic Plugin updates
  • Enable/Disable automatic Theme updates
  • Enable/Disable automatic Translation(languages) updates.
  • Enable/Disable the code versioning check
  • Enable/Disable sending emails for updates etc.

If you are developer and you want to do this in your existing code then read this answer by Chip Bennett at stackexchange. http://wordpress.stackexchange.com/a/120082/13615

Integrate PHP CodeSniffer with NetBeans IDE [Steps]

CodeSniffer, an essential development tool that ensures your code remains clean and consistent, should always be with you while writing code to check and fix the messy things. For those people who use NetBeans IDE to write PHP applications, here are the steps to integrate PHP CodeSniffer with NetBeans IDE.

Steps:
  • Open NetBeans IDE. ( Let me tell you, I am using NetBeans IDE 7.3 for this demo )
  • Install the NetBeans plugin ‘phpCS-MD’ by going to Tools -> Plugins screen.
    Click on the “Available Plugins” tab and search for ‘phpCS’ in the search box provided on top-right corner. Click and check the plugin and click on the “Install” button.
  • Once installed, lets configure it.
    Go to “Tools” -> “Options”.
  • Click on the tab “CodeSniffer”.
    Here you have to provide the path to phpcs.bat file present under your PHP installation directory. Do this by clicking the “Change” button there.
  • Click on the “Test Settings” button and if it shows the PHP CodeSniffer version details, then its configured successfully.

Now, click OK and go back to your code for checking against a particular coding standard. If you want to set a different coding standard definition, then setup that standard before hand on CodeSniffer. How to do that ? Follow my previous post to know how to install CodeSniffer and various Coding Standard definitions. Go to the CodeSniffer setting tab on NetBeans and set the Coding Standard definition name there in the input box named “Standard”.

On the code screen, you can see a new button with a single Blue Eye on the tool bar. This is to check any file for code issues. Click on that and you can see a new section comes below your code named “PHP CS/MD” and displays all the problems in the code row-wise. Now fix the messy code. Happy Coding 🙂

Here are the step by step screen shots to make it easier to follow.
subharanjan_codesniffer_neatbeans_1

subharanjan_codesniffer_neatbeans_2

subharanjan_codesniffer_neatbeans_3

subharanjan_codesniffer_neatbeans_4

subharanjan_codesniffer_neatbeans_5

How to setup PHP CodeSniffer on Windows machine ?

How to use CodeSniffer on Windows ? How to setup the PHP CodeSniffer on Windows ? These questions come to mind when you see various articles, tutorials which provides ways/steps to setup this on Linux. So here are simple steps to setup PHP CodeSniffer on Windows. Before going into this, for those who don’t know what is CodeSniffer? here is a simple answer.

If you are a developer or code reviewer and you want to check the code for any mistakes/if the code following particular coding standards, then CodeSniffer is a good tool to achieve that.

PHP_CodeSniffer is a PHP5 script that tokenises PHP, JavaScript and CSS files to detect violations of a defined coding standard. It is an essential development tool that ensures your code remains clean and consistent. It can also help prevent some common semantic errors made by developers.

Now, lets setup CodeSniffer to check if our code follows a defined coding standard. 🙂

My setup environment:

  • Windows 7 Professional,
  • XAMPP for Windows( Apache, MySQL, PHP and Perl ) and the PHP install directory is C:xamppphp
Steps:
  • Open windows command prompt by going.
    Start -> Run -> type in ‘ cmd ‘ -> press Enter
  • Go to your php install directory.
  • Then type in the command to install PHP Code_Sniffer from the pear.php.net
  • subharanjan_codesniffer_installation

  • After completion, to check successfull installation run this command.
    if everything goes well, then it should show list of coding standard definitions found.

As the CodeSniffer is installed now, you can start using this to check files by using below commands. ( To run any commands, you should be inside C:xamppphp )

Checking a single file or folder:

Sample PHP_CodeSniffer output with no warnings:

Specifying a coding standard to use:

For more usage commands: http://pear.php.net/manual/en/package.php.php-codesniffer.usage.php

How to add a new coding standard definition into PHP CodeSniffer ?

Lets take WordPress coding standard for demo purpose found here: https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards

Steps:
– If you have git installed on you machine, then run this command on git bash.

subharanjan_codesniffer_git_bash
OR

If you don’t have git on your machine, then

subharanjan_codesniffer_directory_structure
Now you can check any file for WordPress coding standard.

How to reduce 404 errors created by ++liker.profile_URL++

Are you getting lots of 404 errors in the log because of some urls having patterns like ” ++liker.profile_URL++ ” ? How to reduce 404 errors created by ++liker.profile_URL++ ? Here is the solution to stop those 404 errors and convert those urls to result in 301 permanent redirects to your homepage.

Problem:
Some days back, when I saw the log created by Better WP Security plugin installed on my blog, there were a lot of 404 errors because of some weird URLs something like this:

  1. subharanjan.com/subharanjan.com/subharanjan.com/remove-or-override-functions-attached-to-a-specified-filter-hook/++liker.profile_URL++
  2. subharanjan.com/++liker.profile_URL++

I tried to find out about this and seems like this is a link dropping spambot. I am not sure what exactly it does but here is a solution to stop this.

Solution:

  • Open you .htaccess file.
  • Add these lines below into your .htaccess file which can be found at the root of your WordPress installation.
    Add these lines before the lines( url rewrites ) added by WordPress for permalink support. It should look like this:
  • Save the .htaccess file and check by accessing one of the urls having ++liker.profile_URL++ and see if it results in a 404 Page not found error OR simply redirects to your home page.

Explanation of the above htaccess code snippet:
RewriteCond will be looking for the pattern “++liker.profile_URL++” in the requested urls. Once it finds that piece of text in the requested url, it will redirect the request to home page in place of creating a 404 error as mentioned in the RewriteRule section.

RewriteRule defines a particular rule.
The first string of characters after RewriteRule defines what the original URL looks like.
The second string after RewriteRule defines the new URL. This is in relation to the document root (html) directory. / means the html directory itself, and subfolders can also be specified.

  • ^ begins the line to match.
  • . stands for “any non-whitespace character”
  • * means that the previous character can be matched zero or more times.
    So, ^uploads.*$ matches uploads2009, uploads2010, etc.
    ^.*$ means “match anything and everything.” This is useful if you don’t know what your users might type for the URL.
  • () designates which portion to preserve for use again in the $1 variable in the second string. This is useful for handling requests for particular files that should be the same in the old and new versions of the URL.
  • [NC] matches both upper- and lower-case versions of the URL.
  • [R=301,L] – this performs a 301 redirect and also stops any later rewrite rules from affecting this URL. It’s on the same line as RewriteRule, at the end.

Source: https://kb.mediatemple.net/questions/85/Using+.htaccess+rewrite+rules#gs

Lightweight and better responsive navigation menu with “responsive-nav.js”

Responsive Nav is a tiny JavaScript plugin which weighs only 1.7 KB minified and Gzip’ed, and helps you to create a toggled navigation for small screens. It uses touch events and CSS3 transitions for the best possible performance. It also contains a “clever” workaround that makes it possible to transition from height: 0 to height: auto, which isn’t normally possible with CSS3 transitions.

http://responsive-nav.com/