dsAxayXcbKqMSobfPw_rDi31Bg.html

dsAxayXcbKqMSobfPw_rDi31Bg.html

plugin_basename = plugin_basename(__FILE__);
$this->admin_page_id = “Alexa-Internet”;
$this->certify_snippet_oid = “alexacertify_certify”;
$this->verify_tag_oid = “alexacertify_verify”;
$this->admin_init();
}

/********************
* Plugin Functions *
********************/

/**
* Add the metatag and certify snippet
* actions
*/
public function run() {
//add the alexa metatag to the header
add_action(‘wp_head’, array(&$this, ‘add_alexa_claim_metatag’));
add_action(‘login_head’, array(&$this, ‘add_alexa_claim_metatag’));
//Add the alexa certify snippet to the footer of the WP site
add_action(‘login_head’, array(&$this, ‘alexa_certify_snippet’));
add_action(‘wp_head’, array(&$this, ‘alexa_certify_snippet’));
}

public function add_alexa_claim_metatag() {

if(is_home() || is_front_page()) {
if(!defined(‘AX_PLUGIN_VERIFY_TAG’)) {
$verifyId = get_option(“alexacertify_verify”);
echo “\n”;
if ($verifyId) {
echo “\n”;
}
define(‘AX_PLUGIN_VERIFY_TAG’, “verify_tag”);
}
}
}

public function alexa_certify_snippet() {
if(!defined(‘AX_PLUGIN_CERT_SNIPPET’)) {
$certifyCode = get_option(“alexacertify_certify”);
if ($certifyCode) {
echo $certifyCode . “\n”;
}
define(‘AX_PLUGIN_CERT_SNIPPET’, “certify_snippet”);
}
}

/*******************
* Admin Setup Functions *
*******************/

/**
* Initialize the admin capabilities
*/
private function admin_init() {
//set up the settings admin page
add_action(‘admin_menu’, array(&$this, ‘add_settings_page’));
//create the link to the settings page
add_filter(“plugin_action_links_”.$this->plugin_basename, array(&$this, ‘add_settings_action_link’));
}

public function add_settings_page() {
$pageTitle = “Alexa Internet”;
$menuTitle = “Alexa Internet”;
$capability = ‘manage_options’;
$callback = array(&$this,”alexa_plugin_settings”);
add_options_page($pageTitle, $menuTitle, $capability, $this->admin_page_id, $callback);
}

/*
* Modify the $links array to add a ‘Settings’ link.
* The ‘Settings’ link will take users to a page where they can set up their claim code
* and certify snippets
*/
public function add_settings_action_link( $links ) {
$links = isset($links) ? $links : array();
$links[“_ax_settings”] = ‘ return empty($snippet) || ereg($certifyRegex, $snippet);
}

private function _validVerifyTag($tag) {
return empty($tag) || preg_match('/^([^\'"])+$/', $tag);
}

private function _clean_input($value) {
return trim(stripslashes($value));
}
}
}

if(class_exists('WP_Alexa_Certify')) {
$alexa_certify_plugin = new WP_Alexa_Certify();
$alexa_certify_plugin->run();
}

?>