update plugins
This commit is contained in:
139
wp/wp-content/plugins/visual-web-optimizer/readme.txt
Normal file
139
wp/wp-content/plugins/visual-web-optimizer/readme.txt
Normal file
@@ -0,0 +1,139 @@
|
||||
=== Visual Website Optimizer ===
|
||||
Contributors: VWO
|
||||
Plugin Name: VWO
|
||||
Plugin URI: https://vwo.com/
|
||||
Tags: split testing, analytics, stats, visual web optimizer, vwo, cro
|
||||
Requires at least: 2.7
|
||||
Tested up to: 6.4.3
|
||||
Stable tag: 4.3
|
||||
|
||||
VWO is the all-in-one platform that helps you conduct visitor research, build an optimization roadmap, and run continuous experimentation.
|
||||
|
||||
== Description ==
|
||||
This plugin will allow you to automatically insert the VWO tracking code. Just enter your VWO Account ID from https://app.vwo.com/#/settings
|
||||
|
||||
== Installation ==
|
||||
Wordpress : Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation and then activate the Plugin from Plugins page.
|
||||
|
||||
WordpressMu : Same as above
|
||||
|
||||
== Frequently Asked Questions ==
|
||||
= I can't see any code added to my header or footer when I view my page source =
|
||||
Your theme needs to have the header and footer actions in place before the `</head>` and before the `</body>`
|
||||
|
||||
= If I use this plugin, do I need to enter any other code on my website? =
|
||||
No, this plugin is sufficient by itself
|
||||
|
||||
== Screenshots ==
|
||||
1. Settings page (Asynchronous Code)
|
||||
2. Settings page (Synchronous Code)
|
||||
|
||||
== ChangeLog ==
|
||||
= 4.3 =
|
||||
* Minor bug fix
|
||||
|
||||
= 4.2 =
|
||||
* Tested with latest version
|
||||
* VWO SmartCode 2.1 updated
|
||||
|
||||
= 4.1 =
|
||||
* Tested with latest version
|
||||
* PHPCS Errors resolved
|
||||
* WP Rocket support added
|
||||
|
||||
= 4.0 =
|
||||
* Tested with latest version
|
||||
* VWO SmartCode updated
|
||||
|
||||
= 3.9 =
|
||||
* Tested with latest version
|
||||
* Code improvement and add Rocket loader handling
|
||||
|
||||
= 3.8 =
|
||||
* Tested with latest version
|
||||
* Fix WP Rocket Issue
|
||||
|
||||
= 3.7 =
|
||||
* Tested with latest version
|
||||
* Fix Divi Frontend Editor Issue
|
||||
|
||||
= 3.6 =
|
||||
* Tested with latest version
|
||||
|
||||
= 3.5 =
|
||||
* Tested with latest version
|
||||
* Rename label "Handle Rocket Loader Issue" to "Skip Deferred Execution"
|
||||
* Set field default value of "Skip Deferred Execution" to "yes"
|
||||
|
||||
= 3.4 =
|
||||
* Tested with latest version
|
||||
* Code improvement and add Rocket loader handling
|
||||
|
||||
= 3.3 =
|
||||
* Tested with latest version
|
||||
* Add new options in settings
|
||||
|
||||
= 3.2 =
|
||||
* Tested with latest version
|
||||
|
||||
= 3.1 =
|
||||
* Add Setting link in plugin listing page
|
||||
|
||||
= 3.0 =
|
||||
* Update Logo and links
|
||||
|
||||
= 2.9 =
|
||||
* Tested with latest version
|
||||
|
||||
= 2.8 =
|
||||
* Tested with latest version
|
||||
|
||||
= 2.7 =
|
||||
* Update Plugin Name, Author and Description
|
||||
|
||||
= 2.6 =
|
||||
* Remove Conflict Errors
|
||||
|
||||
= 2.5 =
|
||||
* Update tested upto version
|
||||
|
||||
= 2.4 =
|
||||
* Update links
|
||||
|
||||
= 2.3 =
|
||||
* Minor bug fix
|
||||
|
||||
= 2.2 =
|
||||
* Bug fix to have default tolerance values when plugin is updated
|
||||
|
||||
= 2.1 =
|
||||
* Better documentation
|
||||
|
||||
= 2.0 =
|
||||
* Option to choose between asynchronous or synchronous code
|
||||
* Updated code snippet
|
||||
* Faster website loading
|
||||
|
||||
= 1.3 =
|
||||
* code snippet updated
|
||||
|
||||
= 1.0.1 =
|
||||
* use Website instead of Web in name of functions and readme (branding)
|
||||
|
||||
= 1.0 =
|
||||
* First Version
|
||||
|
||||
== Upgrade Notice ==
|
||||
Option to choose the new asynchronous code. This will make the website load faster
|
||||
|
||||
== Configuration ==
|
||||
|
||||
Enter your ID in the field marked 'YOUR VWO ACCOUNT ID'
|
||||
|
||||
== Adding to your template ==
|
||||
|
||||
header code :
|
||||
`<?php wp_head();?>`
|
||||
|
||||
footer code :
|
||||
`<?php wp_footer();?>`
|
||||
@@ -0,0 +1,378 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* Plugin Name: VWO
|
||||
* Plugin URI: https://vwo.com/
|
||||
* Description: VWO is the all-in-one platform that helps you conduct visitor research, build an optimization roadmap, and run continuous experimentation. Simply enable the plugin and start running tests on your WordPress website without doing any other code changes. Visit <a href="https://vwo.com/">VWO</a> for more details.
|
||||
* Author: VWO
|
||||
* Version: 4.3
|
||||
* visual-website-optimizer.php
|
||||
* Author URI: https://vwo.com/
|
||||
*
|
||||
* @package VWO
|
||||
* @author VWO
|
||||
* @version 4.3
|
||||
**/
|
||||
|
||||
/**
|
||||
* Generate Common Code
|
||||
*
|
||||
* @param integer $vwo_clicks integer. Defaults to 10.
|
||||
*/
|
||||
function get_vwo_clhf_script_common_code( $vwo_clicks = 10 ) {
|
||||
ob_start();
|
||||
// @codingStandardsIgnoreStart
|
||||
?>
|
||||
<!-- Start VWO Common Smartcode -->
|
||||
<script <?php echo vwo_clhf_ignore_js_attr(); ?> type='text/javascript'>
|
||||
var _vwo_clicks = <?php echo esc_html( $vwo_clicks ); ?>;
|
||||
</script>
|
||||
<!-- End VWO Common Smartcode -->
|
||||
<?php
|
||||
// @codingStandardsIgnoreEnd
|
||||
$script_code = ob_get_clean();
|
||||
return $script_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ignore js field setting
|
||||
*
|
||||
* @return bool boolean
|
||||
*/
|
||||
function get_vwo_clhf_ignore_js() {
|
||||
$ignore_js = get_option( 'ignore_js' );
|
||||
$ignore_js = ( '1' === $ignore_js ) ? true : false;
|
||||
return $ignore_js;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ignore js script attribute value
|
||||
*
|
||||
* @return string Returns script attribute value
|
||||
*/
|
||||
function vwo_clhf_ignore_js_attr() {
|
||||
$ignore_js = get_vwo_clhf_ignore_js();
|
||||
$js_attr = '';
|
||||
if ( function_exists( 'get_vwo_clhf_ignore_js' ) && $ignore_js ) {
|
||||
$js_attr = 'data-cfasync="false" nowprocket';
|
||||
}
|
||||
return $js_attr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate Synchronous Code
|
||||
*
|
||||
* @param int $vwo_id integer. Defaults to 0.
|
||||
* @return string string for sync script.
|
||||
*/
|
||||
function get_vwo_clhf_script_sync_code( $vwo_id = 0 ) {
|
||||
ob_start();
|
||||
// @codingStandardsIgnoreStart
|
||||
?>
|
||||
<!-- Start VWO Smartcode -->
|
||||
<script <?php echo vwo_clhf_ignore_js_attr(); ?> src="https://dev.visualwebsiteoptimizer.com/lib/<?php echo esc_html( $vwo_id ); ?>.js"></script>
|
||||
<!-- End VWO Smartcode -->
|
||||
<?php
|
||||
// @codingStandardsIgnoreEnd
|
||||
$sync_script = ob_get_clean();
|
||||
return $sync_script;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate Asynchronous Code
|
||||
*
|
||||
* @param int $vwo_id integer.
|
||||
* @param int $settings_tolerance integer.
|
||||
* @param int $library_tolerance integer.
|
||||
* @param bool $use_existing_jquery boolean.
|
||||
* @return string String for async script.
|
||||
*/
|
||||
function get_vwo_clhf_script_async_code( $vwo_id, $settings_tolerance, $library_tolerance, $use_existing_jquery ) {
|
||||
ob_start();
|
||||
// @codingStandardsIgnoreStart
|
||||
?>
|
||||
<!-- Start VWO Async SmartCode -->
|
||||
<link rel="preconnect" href="https://dev.visualwebsiteoptimizer.com" />
|
||||
<script <?php echo vwo_clhf_ignore_js_attr(); ?> type='text/javascript' id='vwoCode'>
|
||||
/* Fix: wp-rocket (application/ld+json) */
|
||||
window._vwo_code || (function () {
|
||||
var account_id=<?php echo esc_html( $vwo_id ); ?>, // replace 1 with ${accountId} in release string
|
||||
version=2.1,
|
||||
settings_tolerance=<?php echo esc_html( $settings_tolerance ); ?>,
|
||||
library_tolerance=<?php echo esc_html( $library_tolerance ); ?>,
|
||||
use_existing_jquery=<?php echo ( $use_existing_jquery ) ? 'true' : 'false'; ?>,
|
||||
hide_element='body',
|
||||
hide_element_style='opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important',
|
||||
/* DO NOT EDIT BELOW THIS LINE */
|
||||
f=false,w=window,d=document,v=d.querySelector('#vwoCode'),cK='_vwo_'+account_id+'_settings',cc={};try{var c=JSON.parse(localStorage.getItem('_vwo_'+account_id+'_config'));cc=c&&typeof c==='object'?c:{}}catch(e){}var stT=cc.stT==='session'?w.sessionStorage:w.localStorage;code={use_existing_jquery:function(){return typeof use_existing_jquery!=='undefined'?use_existing_jquery:undefined},library_tolerance:function(){return typeof library_tolerance!=='undefined'?library_tolerance:undefined},settings_tolerance:function(){return cc.sT||settings_tolerance},hide_element_style:function(){return'{'+(cc.hES||hide_element_style)+'}'},hide_element:function(){if(performance.getEntriesByName('first-contentful-paint')[0]){return''}return typeof cc.hE==='string'?cc.hE:hide_element},getVersion:function(){return version},finish:function(e){if(!f){f=true;var t=d.getElementById('_vis_opt_path_hides');if(t)t.parentNode.removeChild(t);if(e)(new Image).src='https://dev.visualwebsiteoptimizer.com/ee.gif?a='+account_id+e}},finished:function(){return f},addScript:function(e){var t=d.createElement('script');t.type='text/javascript';if(e.src){t.src=e.src}else{t.text=e.text}d.getElementsByTagName('head')[0].appendChild(t)},load:function(e,t){var i=this.getSettings(),n=d.createElement('script'),r=this;t=t||{};if(i){n.textContent=i;d.getElementsByTagName('head')[0].appendChild(n);if(!w.VWO||VWO.caE){stT.removeItem(cK);r.load(e)}}else{var o=new XMLHttpRequest;o.open('GET',e,true);o.withCredentials=!t.dSC;o.responseType=t.responseType||'text';o.onload=function(){if(t.onloadCb){return t.onloadCb(o,e)}if(o.status===200){_vwo_code.addScript({text:o.responseText})}else{_vwo_code.finish('&e=loading_failure:'+e)}};o.onerror=function(){if(t.onerrorCb){return t.onerrorCb(e)}_vwo_code.finish('&e=loading_failure:'+e)};o.send()}},getSettings:function(){try{var e=stT.getItem(cK);if(!e){return}e=JSON.parse(e);if(Date.now()>e.e){stT.removeItem(cK);return}return e.s}catch(e){return}},init:function(){if(d.URL.indexOf('__vwo_disable__')>-1)return;var e=this.settings_tolerance();w._vwo_settings_timer=setTimeout(function(){_vwo_code.finish();stT.removeItem(cK)},e);var t;if(this.hide_element()!=='body'){t=d.createElement('style');var i=this.hide_element(),n=i?i+this.hide_element_style():'',r=d.getElementsByTagName('head')[0];t.setAttribute('id','_vis_opt_path_hides');v&&t.setAttribute('nonce',v.nonce);t.setAttribute('type','text/css');if(t.styleSheet)t.styleSheet.cssText=n;else t.appendChild(d.createTextNode(n));r.appendChild(t)}else{t=d.getElementsByTagName('head')[0];var n=d.createElement('div');n.style.cssText='z-index: 2147483647 !important;position: fixed !important;left: 0 !important;top: 0 !important;width: 100% !important;height: 100% !important;background: white !important;';n.setAttribute('id','_vis_opt_path_hides');n.classList.add('_vis_hide_layer');t.parentNode.insertBefore(n,t.nextSibling)}var o='https://dev.visualwebsiteoptimizer.com/j.php?a='+account_id+'&u='+encodeURIComponent(d.URL)+'&vn='+version;if(w.location.search.indexOf('_vwo_xhr')!==-1){this.addScript({src:o})}else{this.load(o+'&x=true')}}};w._vwo_code=code;code.init();})();
|
||||
</script>
|
||||
<!-- End VWO Async SmartCode -->
|
||||
<?php
|
||||
// @codingStandardsIgnoreEnd
|
||||
$async_script = ob_get_clean();
|
||||
return $async_script;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------//
|
||||
// ---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
|
||||
|
||||
/**
|
||||
* Generate a function comment for the given function body.
|
||||
*
|
||||
* @throws Exception Description of exception.
|
||||
* @return void
|
||||
*/
|
||||
function vwo_clhf_plugin_menu() {
|
||||
add_options_page( 'Visual Website Optimizer', 'VWO', 'create_users', 'clhf_vwo_options', 'vwo_clhf_plugin_options' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the settings for the VWO options.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
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', 'vwo_clicks' );
|
||||
register_setting( 'clhf_vwo_options', 'ignore_js', 'boolval' );
|
||||
register_setting( 'clhf_vwo_options', 'settings_tolerance', 'intval' );
|
||||
register_setting( 'clhf_vwo_options', 'library_tolerance', 'intval' );
|
||||
register_setting( 'clhf_vwo_options', 'use_existing_jquery', 'boolval' );
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------//
|
||||
// ---Output Functions-----------------------------------------------------//
|
||||
// ------------------------------------------------------------------------//
|
||||
|
||||
|
||||
/**
|
||||
* Generates the action vwo_clhf_headercode function.
|
||||
*
|
||||
* @throws Exception Description of exception.
|
||||
* @return void
|
||||
*/
|
||||
function vwo_clhf_headercode() {
|
||||
// Runs in the header.
|
||||
$vwo_id = get_option( 'vwo_id' );
|
||||
$code_type = get_option( 'code_type' );
|
||||
|
||||
if ( $vwo_id ) {
|
||||
if ( empty( get_option( 'vwo_clicks' ) ) ) {
|
||||
update_option( 'vwo_clicks', '10' );
|
||||
}
|
||||
$vwo_clicks = get_option( 'vwo_clicks' );
|
||||
|
||||
// Common script code.
|
||||
// @codingStandardsIgnoreLine
|
||||
echo get_vwo_clhf_script_common_code( $vwo_clicks );
|
||||
|
||||
if ( 'SYNC' === $code_type ) {
|
||||
// Sync script code.
|
||||
// @codingStandardsIgnoreLine
|
||||
echo get_vwo_clhf_script_sync_code( $vwo_id );
|
||||
} 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;
|
||||
}
|
||||
|
||||
$use_existing_jquery = get_option( 'use_existing_jquery' );
|
||||
$use_existing_jquery = ( '1' === $use_existing_jquery ) ? true : false;
|
||||
|
||||
// Async script code.
|
||||
// @codingStandardsIgnoreLine
|
||||
echo get_vwo_clhf_script_async_code( $vwo_id, $settings_tolerance, $library_tolerance, $use_existing_jquery );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------//
|
||||
// ---Page Output Functions------------------------------------------------//
|
||||
// ------------------------------------------------------------------------//
|
||||
// options page
|
||||
|
||||
|
||||
/**
|
||||
* Generates the options page for the VWO plugin.
|
||||
*
|
||||
* @throws Exception Description of exception.
|
||||
* @return void
|
||||
*/
|
||||
function vwo_clhf_plugin_options() {
|
||||
// Set value for checkbox by default.
|
||||
$ignore_js_options = get_option( 'ignore_js' );
|
||||
$show_ignore_js = $ignore_js_options;
|
||||
if ( false === $ignore_js_options ) {
|
||||
// Nothing is set, so apply the default here.
|
||||
$show_ignore_js = 1;
|
||||
update_option( 'ignore_js', '1' );
|
||||
}
|
||||
|
||||
echo '<div class="wrap">';
|
||||
?>
|
||||
<h2>VWO</h2>
|
||||
<p>You need to have a <a href="https://vwo.com/">VWO</a> 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:</p>
|
||||
<form method="post" action="options.php">
|
||||
<?php settings_fields( 'clhf_vwo_options' ); ?>
|
||||
<table class="form-table">
|
||||
<tr valign="top">
|
||||
<th scope="row">Your VWO Account ID</th>
|
||||
<td><input type="text" name="vwo_id" value="<?php echo esc_html( get_option( 'vwo_id' ) ); ?>" /></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th scope="row">No. of Heatmap Clicks</th>
|
||||
<td><input type="number" name="vwo_clicks" value="<?php echo get_option( 'vwo_clicks' ) ? esc_html( get_option( 'vwo_clicks' ) ) : 10; ?>" min="3"/></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th scope="row">Code (default: Asynchronous)</th>
|
||||
<td>
|
||||
<input style="vertical-align: text-top;" type="radio" onclick="selectCodeType();" name="code_type" id="code_type_async" value="ASYNC"
|
||||
<?php
|
||||
if ( get_option( 'code_type' ) !== 'SYNC' ) {
|
||||
echo 'checked';}
|
||||
?>
|
||||
/> Asynchronous
|
||||
<input style="vertical-align: text-top;" type="radio" onclick="selectCodeType();" name="code_type" id="code_type_sync" value="SYNC"
|
||||
<?php
|
||||
if ( get_option( 'code_type' ) === 'SYNC' ) {
|
||||
echo 'checked';}
|
||||
?>
|
||||
/> Synchronous
|
||||
<a href="https://vwo.com/blog/asynchronous-code" target="_blank">[Help]</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top" id='asyncOnly1'
|
||||
<?php
|
||||
if ( get_option( 'code_type' ) === 'SYNC' ) {
|
||||
echo "style='display:none;'";}
|
||||
?>
|
||||
>
|
||||
<th scope="row">Settings Timeout</th>
|
||||
<td style="vertical-align: middle;"><input type="text" name="settings_tolerance" value="<?php echo get_option( 'settings_tolerance' ) ? esc_html( get_option( 'settings_tolerance' ) ) : 2000; ?>" />ms (default: 2000)</td>
|
||||
</tr>
|
||||
<tr valign="top" id='asyncOnly2'
|
||||
<?php
|
||||
if ( get_option( 'code_type' ) === 'SYNC' ) {
|
||||
echo "style='display:none;'";}
|
||||
?>
|
||||
>
|
||||
<th scope="row">Library Timeout</th>
|
||||
<td style="vertical-align: middle;"><input type="text" name="library_tolerance" value="<?php echo get_option( 'library_tolerance' ) ? esc_html( get_option( 'library_tolerance' ) ) : 2500; ?>" />ms (default: 2500)</td>
|
||||
</tr>
|
||||
<tr valign="top" id='asyncOnly3'
|
||||
<?php
|
||||
if ( get_option( 'code_type' ) === 'SYNC' ) {
|
||||
echo "style='display:none;'";}
|
||||
?>
|
||||
>
|
||||
<th scope="row">Use Existing jQuery</th>
|
||||
<td style="vertical-align: middle;"><input type="checkbox" name="use_existing_jquery" value="1"
|
||||
<?php
|
||||
if ( get_option( 'use_existing_jquery' ) === '1' ) {
|
||||
echo 'checked';}
|
||||
?>
|
||||
/>Yes</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th scope="row">Skip Deferred Execution</th>
|
||||
<td style="vertical-align: middle;"><input type="checkbox" name="ignore_js" value="1"
|
||||
<?php
|
||||
if ( '1' === $show_ignore_js ) {
|
||||
echo 'checked';}
|
||||
?>
|
||||
/>Yes</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
function selectCodeType() {
|
||||
var code_type = 'ASYNC';
|
||||
if(document.getElementById('code_type_sync').checked)
|
||||
code_type = 'SYNC';
|
||||
|
||||
if(code_type == 'ASYNC') {
|
||||
document.getElementById('asyncOnly1').style.display = 'table-row';
|
||||
document.getElementById('asyncOnly2').style.display = 'table-row';
|
||||
document.getElementById('asyncOnly3').style.display = 'table-row';
|
||||
}
|
||||
else {
|
||||
document.getElementById('asyncOnly1').style.display = 'none';
|
||||
document.getElementById('asyncOnly2').style.display = 'none';
|
||||
document.getElementById('asyncOnly3').style.display = 'none';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<p class="submit"><input type="submit" class="button-primary" value="<?php echo esc_html( 'Save Changes' ); ?>" /></p>
|
||||
<p>Your Account ID (a number) can be found in <i>Settings</i> area (top-right) after you <a href="https://app.vwo.com">login</a> into your VWO account.</p>
|
||||
<?php
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a warning message if VWO settings are not configured.
|
||||
* This function checks if the user is an admin and if the VWO ID option is set. If the user is not an admin or
|
||||
* the VWO ID option is not set, it displays a warning message.
|
||||
*
|
||||
* @throws Exception Description of exception.
|
||||
* @return void
|
||||
*/
|
||||
function vwo_clhf_warn_nosettings() {
|
||||
if ( ! is_admin() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$clhf_option = get_option( 'vwo_id' );
|
||||
if ( ! $clhf_option || $clhf_option < 1 ) {
|
||||
echo "<div id='vwo-warning' class='updated fade'><p><strong>VWO is almost ready.</strong> You must <a href=\"options-general.php?page=clhf_vwo_options\">enter your Account ID</a> for it to work.</p></div>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'vwo_clhf_add_plugin_page_settings_link' );
|
||||
|
||||
/**
|
||||
* Function to add Settings Links on Plugin page
|
||||
*
|
||||
* @param array $links Array of links.
|
||||
* @return array
|
||||
*/
|
||||
function vwo_clhf_add_plugin_page_settings_link( $links ) {
|
||||
$links[] = '<a href="' .
|
||||
admin_url( 'options-general.php?page=clhf_vwo_options' ) .
|
||||
'">' . __( 'Settings' ) . '</a>';
|
||||
return $links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables VWO in Divi Builder.
|
||||
*
|
||||
* @throws Exception Description of exception.
|
||||
* @return void
|
||||
*/
|
||||
function disable_vwo_in_divi_builder() {
|
||||
if ( has_action( 'wp_head', 'vwo_clhf_headercode' ) && function_exists( 'et_core_is_fb_enabled' ) && et_core_is_fb_enabled() ) {
|
||||
remove_action( 'wp_head', 'vwo_clhf_headercode', 1 );
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'wp_head', 'disable_vwo_in_divi_builder', 0 );
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user