Visual Website Optimizer for more details. Author: Wingify Version: 2.8 visual-website-optimizer.php Author URI: https://wingify.com This relies on the actions being present in the themes header.php and footer.php * header.php code before the closing tag * wp_head(); * */ //------------------------------------------------------------------------// //---Config---------------------------------------------------------------// //------------------------------------------------------------------------// $clhf_header_script_sync = ' '; $clhf_header_script_async = ' '; //------------------------------------------------------------------------// //---Hook-----------------------------------------------------------------// //------------------------------------------------------------------------// add_action( 'wp_head', 'vwo_clhf_headercode',1 ); add_action( 'admin_menu', 'vwo_clhf_plugin_menu' ); add_action( 'admin_init', 'vwo_clhf_register_mysettings' ); add_action( 'admin_notices','vwo_clhf_warn_nosettings'); //------------------------------------------------------------------------// //---Functions------------------------------------------------------------// //------------------------------------------------------------------------// // options page link function vwo_clhf_plugin_menu() { add_options_page('Visual Website Optimizer', 'VWO', 'create_users', 'clhf_vwo_options', 'vwo_clhf_plugin_options'); } // whitelist settings function vwo_clhf_register_mysettings(){ register_setting('clhf_vwo_options','vwo_id','intval'); register_setting('clhf_vwo_options','code_type'); register_setting('clhf_vwo_options','settings_tolerance','intval'); register_setting('clhf_vwo_options','library_tolerance','intval'); } //------------------------------------------------------------------------// //---Output Functions-----------------------------------------------------// //------------------------------------------------------------------------// function vwo_clhf_headercode(){ // runs in the header global $clhf_header_script_sync, $clhf_header_script_async; $vwo_id = get_option('vwo_id'); $code_type = get_option('code_type'); if($vwo_id){ if($code_type == 'SYNC') echo str_replace('VWO_ID', $vwo_id, $clhf_header_script_sync); // only output if options were saved else { $settings_tolerance = get_option('settings_tolerance'); if(!is_numeric($settings_tolerance)) $settings_tolerance = 2000; $library_tolerance = get_option('library_tolerance'); if(!is_numeric($library_tolerance)) $library_tolerance = 2500; $clhf_header_script_async = str_replace('VWO_ID', $vwo_id, $clhf_header_script_async); $clhf_header_script_async = str_replace('SETTINGS_TOLERANCE', $settings_tolerance, $clhf_header_script_async); echo str_replace('LIBRARY_TOLERANCE', $library_tolerance, $clhf_header_script_async); } } } //------------------------------------------------------------------------// //---Page Output Functions------------------------------------------------// //------------------------------------------------------------------------// // options page function vwo_clhf_plugin_options() { echo '
';?>

VWO

You need to have a VWO 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:

> >
Your VWO Account ID
Code (default: Asynchronous) /> Asynchronous    /> Synchronous  [Help]
Settings Timeout ms (default: 2000)
Library Timeout ms (default: 2500)

Your Account ID (a number) can be found in Settings area (top-right) after you login into your VWO account.

'; } function vwo_clhf_warn_nosettings(){ if (!is_admin()) return; $clhf_option = get_option("vwo_id"); if (!$clhf_option || $clhf_option < 1){ echo "

VWO is almost ready. You must enter your Account ID for it to work.

"; } } ?>