| @@ -28,18 +28,27 @@ | ||
| 28 | 28 | $cjtWebServer = cssJSToolbox::getCJTWebSiteURL(); |
| 29 | 29 | // Get all CJT-Plugins (Include CJT Plugin itself + all its extensions) that has activate |
| 30 | 30 | // license key! |
| 31 | 31 | $activeLicenses = $model->getStatedLicenses(); |
| 32 | + // Always REQUEST CJT server even if not key activated yet. | |
| 33 | + // FREE edition will just do normal check @Wordpress:reporioty | |
| 34 | + if (!isset($activeLicenses[CJTSetupModel::EDD_PRODUCT_NAME]) && (CJTPlugin::Edition != 'free')) { | |
| 35 | + $activeLicenses[CJTSetupModel::EDD_PRODUCT_NAME] = array( | |
| 36 | + 'plugin' => array('Version' => CJTPlugin::VERSION, 'AuthorName' => 'CTK'), | |
| 37 | + 'license' => array('key' => str_repeat('0', 32)), | |
| 38 | + 'component' => array('pluginBase' => 'css-javascript-toolbox/css-js-toolbox.php') | |
| 39 | + ); | |
| 40 | + } | |
| 32 | 41 | // Import EDD updater Class! |
| 33 | - if (!class_exists('EDD_SL_Plugin_Updater')) { | |
| 34 | - cssJSToolbox::import('framework:third-party:easy-digital-download:auto-upgrade.class.php'); | |
| 35 | - } | |
| 42 | + cssJSToolbox::import('framework:third-party:easy-digital-download:auto-upgrade.class.php'); | |
| 36 | 43 | // Activate Automatic upgrade for all activated licenses/components! |
| 37 | 44 | foreach ($activeLicenses as $name => $state) { |
| 38 | 45 | // Initializingn vars for a single state/component! |
| 39 | - $plugin =& $state['plugin']; | |
| 46 | + $pluginFile = ABSPATH . PLUGINDIR . '/' . $state['component']['pluginBase']; | |
| 47 | + // Stop using Cached Data as it causes issue, always | |
| 48 | + // get fresh plugin data. | |
| 49 | + $plugin = get_plugin_data($pluginFile); | |
| 40 | 50 | $license =& $state['license']; |
| 41 | - $componentPluginPath = ABSPATH . PLUGINDIR . "/{$state['component']['pluginBase']}"; | |
| 42 | 51 | // Edd API parameter to be send along with he check! |
| 43 | 52 | $requestParams= array( |
| 44 | 53 | 'version' => $plugin['Version'], |
| 45 | 54 | 'author' => $plugin['AuthorName'], |
| @@ -46,8 +55,8 @@ | ||
| 46 | 55 | 'license' => $license['key'], |
| 47 | 56 | 'item_name' => $name, |
| 48 | 57 | ); |
| 49 | 58 | // Set EDD Automatic Updater! |
| 50 | - $updated = new EDD_SL_Plugin_Updater($cjtWebServer, $componentPluginPath, $requestParams); | |
| 59 | + $updated = new CJT_EDD_SL_Plugin_Updater($cjtWebServer, $pluginFile, $requestParams); | |
| 51 | 60 | } |
| 52 | 61 | } |
| 53 | 62 | } // End class. |