From dd9e276f4ca2d3633836fa8ce7f979cb465bd8d1 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Wed, 11 Sep 2019 16:55:27 -0400 Subject: [PATCH] Fixed problem with activivation due to where mysqli_init() was run. --- index.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.17.1