Contiuing work on Update Server support
authorChuck Scott <cscott@gaslightmedia.com>
Wed, 8 Mar 2017 21:38:22 +0000 (16:38 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Wed, 8 Mar 2017 21:38:22 +0000 (16:38 -0500)
defines.php
index.php

index e631529..93e27b3 100644 (file)
@@ -87,3 +87,10 @@ define('GLM_MEMBERS_PLUGIN_ACTIVE_DB_OPTION', 'glmMembersDatabaseDbVersion');
 $glmCurrentTheme = wp_get_theme();
 define('GLM_MEMBERS_PLUGIN_CURRENT_THEME', $glmCurrentTheme->get_template());
 define('GLM_MEMBERS_PLUGIN_CURRENT_THEME_DIR', $glmCurrentTheme->get_template_directory());
+
+// Update Server
+if (GLM_MEMBER_PLUGIN_HOST == 'CHUCK') {
+ define('GLM_MEMBERS_PLUGIN_UPDATE_SERVER', 'http://192.168.44.54/update_server');
+} else {
+ define('GLM_MEMBERS_PLUGIN_UPDATE_SERVER', 'http://www.gaslightmedia.com/update_server');
+}
index b31f7ca..9d81141 100644 (file)
--- a/index.php
+++ b/index.php
@@ -342,22 +342,6 @@ if (glmCheckDatabase('install')) {
         }
     }
 
-    /*
-     * Plugin Update Support - uses Gaslight Media update server
-     */
-    /* Not functional yet - Need to resolve JavaScript conflicts with this feature in other plugins
-    require GLM_MEMBERS_PLUGIN_LIB_PATH.'/opentools-update-checker/opentools-update-checker.php';
-    ${GLM_MEMBERS_PLUGIN_PREFIX."updateChecker"} = new OpenToolsPluginUpdateChecker(
-         'http://www.gaslightmedia.com/update_server/?action=get_metadata&slug='.GLM_MEMBERS_PLUGIN_SLUG,
-        __FILE__,
-        GLM_MEMBERS_PLUGIN_SLUG
-    );
-
-    ${GLM_MEMBERS_PLUGIN_PREFIX."updateChecker"}->declareCredentials(array(
-      'license_key' => __('License Key:')
-    ));
-    */
-
     /*
      *
      * Activate and Deactivate hooks
@@ -726,5 +710,18 @@ function glmCheckDatabase ()
     } // For each plugin
 
     return $all_db_setup_status;
+
 }
 
+/*
+ * Plugin Update Support - uses Gaslight Media update server
+ */
+require GLM_MEMBERS_PLUGIN_LIB_PATH.'/opentools-update-checker/opentools-update-checker.php';
+${GLM_MEMBERS_PLUGIN_PREFIX."updateChecker"} = new OpenToolsPluginUpdateChecker(
+    GLM_MEMBERS_PLUGIN_UPDATE_SERVER.'/?action=get_metadata&slug='.GLM_MEMBERS_PLUGIN_SLUG,
+    __FILE__,
+    GLM_MEMBERS_PLUGIN_SLUG
+);
+${GLM_MEMBERS_PLUGIN_PREFIX."updateChecker"}->declareCredentials(array(
+    'license_key' => __('License Key:')
+));