PHP Notice on line 46 of optimizely.php
-
Using Optimizely with WP_DEBUG turned on generates a PHP Notice:
PHP Notice: Undefined index: HTTPS in /wp-content/plugins/optimizely/optimizely.php on line 46
The line in question:
if (!$_SERVER['HTTPS']) {
I’d recommend replacing this entire block with the code below, as the HTTPS value could be set and be ‘off’:
if( isset($_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] != 'off' ) { $script = "https:" . $projectScript; } else { $script = "http:" . $projectScript; }
I tried to find a GitHub repo for this plugin but couldn’t, otherwise I would have submitted a pull request. Please add this to the next version of the plugin.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘PHP Notice on line 46 of optimizely.php’ is closed to new replies.