How to check the CMS version is up-to-date?

Why this post is important?

Exactly! We all are concern about the security of our websites; this security measure is directly related with the software version installed for your website. Now-a-days almost all Blogs are developed by WordPress and many of the eCommerce sites are designed by CMSs like Joomla, Drupal etc..

Here CryBit going to explain the Linux commands to check the version details of those CMS installed for your websites. This is very important to keep the software updated. An outdated CMS can cause major security issues on your websites or server. Keep things up-to-date and stay away hackers.

In this blog article you can see the commands to check the CMS version for a single website and all similar accounts on your server. If you are the server admin, you can check the versions of CMS on different accounts on your server and notify clients regarding this outdated software.

How to check the version of WordPress installed on your domain?

The version details can be identified from “version.php” file under the WordPress installation folder. The file location is pasted below:

/path/to/home_directory/wp-includes/version.php

wordpress-logo-crybit_new

For a cPanel server this should be look like:

/home/username/public_html/wp-includes/version.php

Command to check version:

# grep wp_version wp-includes/version.php

Sample output:

# [email protected] [/home/$user/public_html]# grep wp_version wp-includes/version.php
$wp_version = '1.5.2';

To check the version details of all WordPress installations on your server, execute the following command:

# find /home/*/public_html/ -type f -iwholename "*/wp-includes/version.php" -exec grep -H "\$wp_version =" {} \;

Sample output; tested on our server

[email protected]# find /home/*/public_html/ -type f -iwholename "*/wp-includes/version.php" -exec grep -H "\$wp_version =" {} \;

/home/122/public_html/a*****o.com/wp-includes/version.php:$wp_version = '4.4.5';
/home/123/public_html/t*****t.com/wp-includes/version.php:$wp_version = '4.4.2';
/home/124/public_html/g*****i.com/wp-includes/version.php:$wp_version = '4.4.2';
/home/125/public_html/c*****d.com/wp-includes/version.php:$wp_version = '4.4.5';
/home/126/public_html/c*****o.com/wp-includes/version.php:$wp_version = '4.4.3';

On a Plesk server the path to home directory should be like “/var/www/vhosts/domain.com/httpdocs/

Execute the following command on Plesk server:

# find /var/www/vhosts/*/httpdocs/ -type f -iwholename "*/wp-includes/version.php" -exec grep -H "\$wp_version =" {} \;

How to check the version of Joomla installed on your domain?

The version details can be identified from “version.php” file under the Joomla¬†installation folder. The file location is pasted below:

/path/to/home_directory/libraries/joomla/version.php

joomla-crybit

For a cPanel server this should be look like:

/home/$user/public_html/libraries/joomla/version.php

For a Plesk server this should be look like:

/var/www/vhosts/domain.com/httpdocs/libraries/joomla/version.php

Example:

[email protected] [~]# grep -E "DEV_LEVEL|RELEASE" /home/alohatog/public_html/libraries/joomla/version.php|grep var
        var $RELEASE    = '1.5';
        var $DEV_LEVEL  = '23';

Which means current version is 1.5.23

How to check version details of all Joomla installations on your server?

For cPanel; execute the following command; tested on our server

find /home/*/public_html/ -type f \( -iwholename '*/libraries/joomla/version.php' -o -iwholename '*/libraries/cms/version.php' -o -iwholename '*/libraries/cms/version/version.php' \) -print -exec perl -e 'while (<
>) { $release = $1 if m/ \$RELEASE\s+= .([\d.]+).;/; $dev = $1 if m/ \$DEV_LEVEL\s+= .(\d+).;/; } print qq($release.$dev\n);' {} \; && echo "-"

For Plesk;

find /var/www/vhosts/*/httpdocs/ -type f \( -iwholename '*/libraries/joomla/version.php' -o -iwholename '*/libraries/cms/version.php' -o -iwholename '*/libraries/cms/version/version.php' \) -print -exec perl -e 'while (< >) { $release = $1 if m/ \$RELEASE\s+= .([\d.]+).;/; $dev = $1 if m/ \$DEV_LEVEL\s+= .(\d+).;/; } print qq($release.$dev\n);' {} \; && echo "-"

Sample output

/home/123/public_html/i*****e.com/libraries/joomla/version.php
1.5.23
/home/123/public_html/e*****d.net/home/libraries/joomla/version.php
1.5.20
/home/123/public_html/a*****r.com/components/com_akeeba/backup/backupfiles/libraries/cms/version/version.php
2.5.11
/home/122/public_html/l*****s.net/cms/version/version.php
2.5.17
/home/111/public_html/ra****an/libraries/joomla/version.php

How to check the version of Drupal installed on your domain?

This time, the file name is system.info not version.php. The exact location is pasted below:

/path/to/home_directory/modules/system/system.info

drupal-logo

Example

[email protected] [~]# grep version /home/1234/public_html/update/modules/system/system.info
version = VERSION
version = "7.17"

How to check version details of all Drupal installations on your server?

For cPanel; execute the following command:

find /home/*/public_html/ -type f -iwholename "*/modules/system/system.info" -exec grep -H "version = \"" {} \;

For Plesk;

find /var/www/vhosts/*/httpdocs -type f -iwholename "*/modules/system/system.info" -exec grep -H "version = \"" {} \;

Sample output; tested on our server

[email protected] [~]# find /home/*/public_html/ -type f -iwholename "*/modules/system/system.info" -exec grep -H "version = \"" {} \;

/home/123/public_html/projecth/drupal/modules/system/system.info:version = "7.39"
/home/123/public_html/update/modules/system/system.info:version = "7.17"
/home/123/public_html/drupal/modules/system/system.info:version = "7.32"
/home/1234/public_html/modules/system/system.info:version = "6.10"
/home/1234/public_html/aux1/modules/system/system.info:version = "7.39"

That’s it!
Let me know if you have any questions.

Arunlal Ashok

Linux Server Administrator. I'm dealing with Linux servers since 2012. I started this blog to share and discuss my ideas with the world. Check My Profile!! in uPwork (oDesk) and let me know if you need any assistance. Thanks!!

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *