From: Chuck Scott Date: Wed, 11 Sep 2019 20:55:27 +0000 (-0400) Subject: Fixed problem with activivation due to where mysqli_init() was run. X-Git-Tag: v4.0.0^2~4 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=dd9e276f4ca2d3633836fa8ce7f979cb465bd8d1;p=WP-Plugins%2Fglm-serverstats.git Fixed problem with activivation due to where mysqli_init() was run. --- diff --git a/index.php b/index.php index 4ba66b6..b3ceb5d 100755 --- a/index.php +++ b/index.php @@ -41,7 +41,7 @@ require_once 'defines.php'; require_once GLM_SERVERSTATS_PLUGIN_LIB_PATH.'/smartyTemplateSupport.php'; // Connect to bandwidth database and get all settings for this site -$bwdb = mysqli_init(); +$bwdb = false; $websiteSettings = bandwidthDataConnect(GLM_SERVERSTATS_PLUGIN_HOSTNAME); if (!$websiteSettings) { wp_die('FAILURE: Unable to connect to GLM Bandwidth database. Please check connection settings in defines.php of this plugin.'); @@ -409,7 +409,9 @@ if (apply_filters('glm-serverstats-is-provider', false) || true) { */ function bandwidthDataConnect($website = false) { + // Moved msqli_init() to here to be compatible with activation global $bwdb; + $bwdb = mysqli_init(); $settings = false;