Visual Website Optimizer for more details. Author: Andy Bailey Version: 1.0 Author URI: http://fiddyp.co.uk This relies on the actions being present in the themes header.php and footer.php * header.php code before the closing tag * wp_head(); * * footer.php code before (maybe before last ) * do_action('wp_footer'); * */ //------------------------------------------------------------------------// //---Config---------------------------------------------------------------// //------------------------------------------------------------------------// $clhf_header_script = ' '; $clhf_footer_script = ' '; //------------------------------------------------------------------------// //---Hook-----------------------------------------------------------------// //------------------------------------------------------------------------// add_action ( 'wp_footer', 'clhf_footercode',10 ); add_action ( 'wp_head', 'clhf_headercode',1 ); add_action( 'admin_menu', 'clhf_plugin_menu' ); add_action( 'admin_init', 'clhf_register_mysettings' ); add_action( 'admin_notices','clhf_warn_nosettings'); //------------------------------------------------------------------------// //---Functions------------------------------------------------------------// //------------------------------------------------------------------------// // options page link function clhf_plugin_menu() { add_options_page('Visual Website Optimizer', 'VWO', 'create_users', 'clhf_vwo_options', 'clhf_plugin_options'); } // whitelist settings function clhf_register_mysettings(){ register_setting('clhf_vwo_options','vwo_id','intval'); } //------------------------------------------------------------------------// //---Output Functions-----------------------------------------------------// //------------------------------------------------------------------------// function clhf_headercode(){ // runs in the header global $clhf_header_script; $vwo_id = get_option('vwo_id'); if($vwo_id){ // only output if options were saved echo str_replace('VWO_ID',$vwo_id,$clhf_header_script); } } function clhf_footercode(){ // runs in the footer global $clhf_footer_script; $vwo_id = get_option('vwo_id'); if($vwo_id){ // only output if header was done echo $clhf_footer_script; } } //------------------------------------------------------------------------// //---Page Output Functions------------------------------------------------// //------------------------------------------------------------------------// // options page function clhf_plugin_options() { echo '
';?>

Visual Website Optimizer

You need to have a Visual Website Optimizer account in order to use this plugin. This plugin inserts the neccessary code into your Wordpress site automatically without you having to touch anything. In order to use the plugin, you need to enter your VWO Account ID in the field below:

Your VWO Account ID

Your Account ID (a number) can be found in Settings area (top-left, just under the logo) after you login into your Visual Website Optimizer account.

Your ID Here','
'),htmlspecialchars($clhf_header_script)); ?>
'; } function clhf_warn_nosettings(){ if (!is_admin()) return; $clhf_option = get_option("vwo_id"); if (!$clhf_option || $clhf_option < 1){ echo "

Visual Website Optimizer is almost ready. You must enter your Account ID for it to work.

"; } } ?>