Changeset 2149744
- Timestamp:
- 09/02/2019 06:55:20 PM (7 years ago)
- Location:
- pluginpass-pro-plugintheme-licensing/trunk
- Files:
-
- 2 added
- 1 deleted
- 7 edited
-
README.txt (modified) (2 diffs)
-
constants.php (modified) (1 diff)
-
docs/PluginPass-overview.graphml (deleted)
-
docs/pluginpass-overview.graphml (added)
-
docs/pluginpass-overview.png (added)
-
inc/admin/class-pluginpass-table.php (modified) (2 diffs)
-
inc/common/class-pluginpass-guard.php (modified) (7 diffs)
-
inc/common/traits/class-pluginpass-validatable.php (modified) (2 diffs)
-
pluginpass.php (modified) (1 diff)
-
screenshot-1.png (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
pluginpass-pro-plugintheme-licensing/trunk/README.txt
r2148795 r2149744 8 8 Tested up to: 5.2.2 9 9 Requires PHP: 5.6 10 Stable tag: 0.9. 510 Stable tag: 0.9.6 11 11 License: GPLv2 or later 12 12 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 129 129 == Changelog == 130 130 131 = 0.9.6 = 132 * TODO 133 131 134 = 0.9.5 = 132 135 * Update: plugin documentation -
pluginpass-pro-plugintheme-licensing/trunk/constants.php
r2148795 r2149744 8 8 define( __NAMESPACE__ . '\NS', __NAMESPACE__ . '\\' ); 9 9 10 define( NS . 'PLUGIN_VERSION', '0.9. 5' );10 define( NS . 'PLUGIN_VERSION', '0.9.6' ); 11 11 12 12 define( NS . 'PLUGIN_NAME', 'pluginpass' ); -
pluginpass-pro-plugintheme-licensing/trunk/inc/admin/class-pluginpass-table.php
r2146523 r2149744 13 13 use Exception; 14 14 use DateTime; 15 use PluginPass as NS; 15 16 16 17 /** … … 53 54 'ajax' => false, // If true, the parent class will call the _js_vars() method in the footer 54 55 ) ); 56 57 NetLicensingService::getInstance()->curl()->setUserAgent( 'NetLicensing/PHP/' . NS\PLUGIN_NAME . ' ' . PHP_VERSION . '/' . NS\PLUGIN_VERSION . ' (https://netlicensing.io)' . '; ' . $_SERVER['HTTP_USER_AGENT'] ); 58 55 59 } 56 60 -
pluginpass-pro-plugintheme-licensing/trunk/inc/common/class-pluginpass-guard.php
r2148795 r2149744 4 4 5 5 use NetLicensing\Constants; 6 use NetLicensing\NetLicensingService; 6 7 use NetLicensing\Token; 7 8 use NetLicensing\TokenService; … … 9 10 use PluginPass\Inc\Common\Traits\PluginPass_Plugable; 10 11 use PluginPass\Inc\Common\Traits\PluginPass_Validatable; 12 use PluginPass as NS; 11 13 12 14 class PluginPass_Guard { … … 47 49 ? $this->create_plugin( $data ) 48 50 : $this->update_plugin( $data, [ 'product_number' => $product_number ] ); 51 52 NetLicensingService::getInstance()->curl()->setUserAgent( 'NetLicensing/PHP/' . NS\PLUGIN_NAME . ' ' . PHP_VERSION . '/' . NS\PLUGIN_VERSION . ' (https://netlicensing.io)' . '; ' . $_SERVER['HTTP_USER_AGENT'] ); 49 53 } 50 54 … … 73 77 * Validate plugin feature for the current wordpress instance. 74 78 * 75 * @param string $ feature The plugin feature to be checked.79 * @param string $module The plugin module to be checked. 76 80 * 77 81 * @return boolean The status, whether this feature is available. … … 80 84 * @access public 81 85 */ 82 public function validate( $ feature ) {86 public function validate( $module ) { 83 87 84 88 if ( ! $this->has_consent() ) { … … 108 112 } 109 113 110 if ( ! $this->plugin->validation_result || ! PluginPass_Dot::has( $this->plugin->validation_result, $ feature ) ) {114 if ( ! $this->plugin->validation_result || ! PluginPass_Dot::has( $this->plugin->validation_result, $module ) ) { 111 115 return false; 112 116 } 113 117 114 $ feature_parsed = explode( '.', $feature );115 $product_module = reset( $ feature_parsed );118 $module_parsed = explode( '.', $module ); 119 $product_module = reset( $module_parsed ); 116 120 $licensingModel = PluginPass_Dot::get( $this->plugin->validation_result, "$product_module.licensingModel" ); 117 121 … … 120 124 } 121 125 122 $ feature .= ( $licensingModel === Constants::LICENSING_MODEL_MULTI_FEATURE )126 $module .= ( $licensingModel === Constants::LICENSING_MODEL_MULTI_FEATURE ) 123 127 ? '.0.valid' : '.valid'; 124 128 125 return PluginPass_Dot::get( $this->plugin->validation_result, $ feature ) === 'true';126 } 127 128 /** 129 * Get validation result for feature130 * 131 * @param null $ feature129 return PluginPass_Dot::get( $this->plugin->validation_result, $module ) === 'true'; 130 } 131 132 /** 133 * Get validation result for module 134 * 135 * @param null $module 132 136 * 133 137 * @return mixed 134 138 */ 135 public function validation_result( $ feature = null ) {136 if ( ! $ feature ) {139 public function validation_result( $module = null ) { 140 if ( ! $module ) { 137 141 return $this->plugin->validation_result; 138 142 } 139 143 140 return PluginPass_Dot::get( $this->plugin->validation_result, $ feature );144 return PluginPass_Dot::get( $this->plugin->validation_result, $module ); 141 145 } 142 146 -
pluginpass-pro-plugintheme-licensing/trunk/inc/common/traits/class-pluginpass-validatable.php
r2146523 r2149744 6 6 use NetLicensing\Context; 7 7 use NetLicensing\LicenseeService; 8 use NetLicensing\NetLicensingService;9 8 use NetLicensing\ValidationParameters; 10 use PluginPass as NS;11 9 12 10 trait PluginPass_Validatable { … … 27 25 $validation_parameters->setLicenseeName( get_bloginfo( 'name' ) ); 28 26 29 30 NetLicensingService::getInstance()->curl()->setUserAgent( 'NetLicensing/PHP/' . NS\PLUGIN_NAME . ' ' . PHP_VERSION . '/' . NS\PLUGIN_VERSION . ' (https://netlicensing.io)' . '; ' . $_SERVER['HTTP_USER_AGENT'] );31 32 27 return LicenseeService::validate( $context, self::get_licensee_number(), $validation_parameters ); 33 28 } -
pluginpass-pro-plugintheme-licensing/trunk/pluginpass.php
r2148795 r2149744 16 16 * Plugin URI: https://github.com/Labs64/PluginPass 17 17 * Description: WordPress Plugin/Theme Licensing powered by Labs64 NetLicensing 18 * Version: 0.9. 518 * Version: 0.9.6 19 19 * Author: Labs64 20 20 * Author URI: https://netlicensing.io
Note: See TracChangeset
for help on using the changeset viewer.