Changeset 2793402
- Timestamp:
- 10/03/2022 11:39:15 AM (4 years ago)
- Location:
- myshopkit-popup-smartbar-slidein/trunk
- Files:
-
- 6 edited
-
README.md (modified) (1 diff)
-
myshopkit-popup-smartbar-slidein.php (modified) (2 diffs)
-
src/Dashboard/Assets/Js/Script.js (modified) (2 diffs)
-
src/Dashboard/Controllers/AuthController.php (modified) (3 diffs)
-
src/Dashboard/Controllers/DashboardController.php (modified) (1 diff)
-
src/Dashboard/Shared/GeneralHelper.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
myshopkit-popup-smartbar-slidein/trunk/README.md
r2790696 r2793402 6 6 Tested up to: 6.0.2 7 7 Requires PHP: 7.4 8 Stable tag: 1.0. 68 Stable tag: 1.0.7 9 9 License: GPLv2 or later 10 10 -
myshopkit-popup-smartbar-slidein/trunk/myshopkit-popup-smartbar-slidein.php
r2790696 r2793402 4 4 * Plugin URI: https://popup-smartbar-slidein.myshopkit.app 5 5 * Description: The one kit to boost sales 6 * Version: 1.0. 66 * Version: 1.0.7 7 7 * Author: Wiloke 8 8 * Author URI: https://woocommerce.myshopkit.app/ … … 33 33 34 34 35 define('MYSHOOKITPSS_VERSION', '1.0. 6');35 define('MYSHOOKITPSS_VERSION', '1.0.7'); 36 36 define('MYSHOOKITPSS_NAMESPACE', 'mskpss'); 37 37 define('MYSHOOKITPSS_HOOK_PREFIX', 'mskpss/'); -
myshopkit-popup-smartbar-slidein/trunk/src/Dashboard/Assets/Js/Script.js
r2790696 r2793402 3 3 4 4 const ajax_init = { 5 url: window.MYSHOOKITPSS_GLOBAL.restBase, 5 url: window.MYSHOOKITPSS_GLOBAL.purchaseCodeUrl, 6 purchaseCodeUrl: window.MYSHOOKITPSS_GLOBAL.purchaseCodeUrl, 7 // url: window.MYSHOOKITPSS_GLOBAL.restBase, 6 8 token: "", 7 9 plan: window.MYSHOOKITPSS_GLOBAL.purchaseCode === "free" || window.MYSHOOKITPSS_GLOBAL.purchaseCode === "" ? "free" : "enterprise", … … 71 73 return; 72 74 } 73 const { payload, type} = event.data75 const {payload, type} = event.data 74 76 75 77 /** Dashboard page */ -
myshopkit-popup-smartbar-slidein/trunk/src/Dashboard/Controllers/AuthController.php
r2786223 r2793402 32 32 add_filter('determine_current_user', [$this, 'determineCurrentUser']); 33 33 34 add_action('wp_ajax_mks_popup_purchase_code', [$this, 'ajaxSavePurchaseCode']); 34 35 add_filter('wp_is_application_passwords_available', function () { 35 36 return $this->isSSL(); … … 168 169 ] 169 170 ); 171 } 172 173 public function ajaxSavePurchaseCode() 174 { 175 if (current_user_can('administrator')) { 176 wp_send_json_error(); 177 } 178 179 if (isset($_POST['purchase_code']) && !empty($_POST['purchase_code'])) { 180 update_option(AutoPrefix::namePrefix('purchase_code'), sanitize_text_field($_POST['purchase_code'])); 181 } 170 182 } 171 183 … … 333 345 throw new Exception($aResponse['message'], $aResponse['code']); 334 346 } 335 update_option(AutoPrefix::namePrefix('purchase_code'), ' ');347 update_option(AutoPrefix::namePrefix('purchase_code'), 'free'); 336 348 return MessageFactory::factory('ajax')->success($aResponse['message'], $aResponse['code']); 337 349 } -
myshopkit-popup-smartbar-slidein/trunk/src/Dashboard/Controllers/DashboardController.php
r2790696 r2793402 26 26 wp_localize_script('jquery', self::MYSHOOKITPSS_GLOBAL, [ 27 27 'url' => admin_url('admin-ajax.php'), 28 'purchaseCodeUrl' => add_query_arg([ 29 'action' => 'mks_popup_purchase_code' 30 ], admin_url('admin-ajax.php')), 28 31 'restBase' => trailingslashit(rest_url(MYSHOOKITPSS_REST_BASE)), 29 32 'email' => get_option('admin_email'), -
myshopkit-popup-smartbar-slidein/trunk/src/Dashboard/Shared/GeneralHelper.php
r2786223 r2793402 10 10 trait GeneralHelper 11 11 { 12 protected string $dashboardSlug = 'dashboard';13 protected string $authSlug= 'auth-settings';12 protected string $dashboardSlug = 'dashboard'; 13 protected string $authSlug = 'auth-settings'; 14 14 15 protected function getDashboardSlug(): string16 {17 return AutoPrefix::namePrefix($this->dashboardSlug);18 }15 protected function getDashboardSlug(): string 16 { 17 return AutoPrefix::namePrefix($this->dashboardSlug); 18 } 19 19 20 protected function getAuthSlug(): string21 {22 return AutoPrefix::namePrefix($this->authSlug);23 }20 protected function getAuthSlug(): string 21 { 22 return AutoPrefix::namePrefix($this->authSlug); 23 } 24 24 25 25 private function getToken()
Note: See TracChangeset
for help on using the changeset viewer.