Update for getting settings
authorSteve Sutton <ssutton@gmail.com>
Sat, 17 Mar 2018 18:55:08 +0000 (14:55 -0400)
committerSteve Sutton <ssutton@gmail.com>
Sat, 17 Mar 2018 18:55:08 +0000 (14:55 -0400)
make sure the db version is set before getting any setting or management

index.php

index 14ac901..932b64b 100644 (file)
--- a/index.php
+++ b/index.php
@@ -145,11 +145,13 @@ if (is_file(GLM_MEMBERS_BILLING_PLUGIN_DB_SCRIPTS.'/dbVersions.php')) {
 // Load Add-On Management Settings data
 /* None - Need to figure out a smooth way to do this.
  */
-$glmMembersBillingSettings = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX."settings WHERE id = 1", ARRAY_A );
-unset($glmMembersBillingSettings['id']);
+if ( $glmMembersDatabasePluginVersion ) {
+    $glmMembersBillingSettings = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX."settings WHERE id = 1", ARRAY_A );
+    unset($glmMembersBillingSettings['id']);
 
-$glmMembersBillingManagement = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX."management WHERE id = 1", ARRAY_A );
-unset($glmMembersBillingManagement['id']);
+    $glmMembersBillingManagement = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX."management WHERE id = 1", ARRAY_A );
+    unset($glmMembersBillingManagement['id']);
+}
 
 function glmMembersBillingRegisterAddOn($addOns) {