WordPress Alexa Backlink , Rank, Reach |
X

Congrats, You are Subscribed to Receive Updates.

WordPress Alexa Backlink , Rank, Reach


WordPress Alexa Backlink , Rank, and Reach Status for your blog. Now adays monitoring Your Blog and your Site is very important aspect to know your Website status. Which will help you to improve your ranking and popularity based on the rank. Now, we are going to get Alexa traffic Rank, Backlink, and reach, And bring it to your WordPress Dashboard and Separate page.  Just follow the steps to create your own plugin for the things.

Kv-alexa-status

Lets start writing functions to get the alexa values for a site.

1. Alexa Rank : 

Alexa rank is described in two terms Global and local . You can get the both values by using the following script.

function kv_alexa_rank($kv_site) { 
	$xml = simplexml_load_file('http://data.alexa.com/data?cli=10&dat=snbamz&url='.$kv_site);
	return isset($xml->SD[1]->POPULARITY)?$xml->SD[1]->POPULARITY->attributes()->TEXT:0; 
}
function kv_alexa_local_rank($kv_site) { 
	$xml = simplexml_load_file('http://data.alexa.com/data?cli=10&dat=snbamz&url='.$kv_site);
	$kv_local_rank =  isset($xml->SD[1]->COUNTRY)?$xml->SD[1]->COUNTRY->attributes()->NAME:0 .'   ' . isset($xml->SD[1]->COUNTRY)?$xml->SD[1]->COUNTRY->attributes()->RANK:0; 
	return $kv_local_rank; 
}

The above functions will get you the local and global rank of your site.

2. Alexa Backlink: 

The below function will get you the total Alexa Backlinks which points to your site.

function kv_alexa_backlinks($kv_site) { 
	$xml = simplexml_load_file('http://data.alexa.com/data?cli=10&dat=snbamz&url='.$kv_site);
	return isset($xml->SD[0]->LINKSIN)?$xml->SD[0]->LINKSIN->attributes()->NUM:0; 
}

And finally,

3. Alexa Reach:

The following function will help you to get the Alexa Reach for your site,

function kv_alexa_reach($kv_site) { 
	$xml = simplexml_load_file('http://data.alexa.com/data?cli=10&dat=snbamz&url='.$kv_site);
	return isset($xml->SD[1]->REACH)?$xml->SD[1]->REACH->attributes()->RANK:0; 
}

 4. Creating Dashboard widget to Display the Status.

The following function will help you to create dashboard and show the report.

function kv_dashboard_widgets() {
	wp_add_dashboard_widget('dashboard_widget', 'Your SEO Status', 'kv_print_backlink_result');
}

add_action('wp_dashboard_setup', 'kv_dashboard_widgets' );

function kv_print_backlink_result() {

$kv_domain = 'kvcodes.com';  

 ?>
<table width="100%" > 								
	<tr> <td> Alexa Rank : </td> <td> <?php echo kv_alexa_rank($kv_domain); ?>( Global) <br> <?php echo kv_alexa_local_rank($kv_domain); ?> (Local) </td> </tr>
	<tr> <td> Alexa Backlinks : </td> <td> <?php echo kv_alexa_backlinks($kv_domain); ?> </td> </tr>
	<tr> <td> Alexa Reach : </td> <td> <?php echo kv_alexa_reach($kv_domain); ?> </td> </tr>
</table> 
							
<?php } 
?>

That’s it for implementation , Here Instead of “ kvcodes.com” use your domain name to get your site statistics.  Also here is a plugin source code.

 

Download Source

 

commenter

About Varadharaj V

The founder of Kvcodes, Varadharaj V is an ERP Analyst and a Web developer specializing in WordPress(WP), WP Theme development, WP Plugin development, Frontaccounting(FA), Sales, Purchases, Inventory, Ledgers, Payroll & HRM, CRM, FA Core Customization, PHP and Data Analyst. Database Management Advance Level

Comment Below

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

*

Current ye@r *

Menu

Sidebar