Changeset 2578886
- Timestamp:
- 08/05/2021 04:28:36 PM (4 years ago)
- Location:
- popup-builder
- Files:
-
- 4 edited
-
tags/4.0/com/classes/Actions.php (modified) (3 diffs)
-
tags/4.0/public/js/sgpbDetect.js (modified) (1 diff)
-
trunk/com/classes/Actions.php (modified) (3 diffs)
-
trunk/public/js/sgpbDetect.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
popup-builder/tags/4.0/com/classes/Actions.php
r2578675 r2578886 69 69 } 70 70 71 private function checkIfLicenseIsActive($license, $itemId, $storeURL, $key) { 72 $transient = 'sgpb-license-key-'.$key.'-requested'; 73 if ( false !== ( $value = get_transient( $transient ) ) ) { 74 return; 75 } 76 $apiParams = array( 77 'edd_action' => 'activate_license', 78 'license' => $license, 79 'item_id' => $itemId, // The ID of the item in EDD 80 'url' => home_url() 81 ); 82 $response = wp_remote_post($storeURL, array('timeout' => 15, 'sslverify' => false, 'body' => $apiParams)); 83 if (!is_wp_error($response) || 200 == wp_remote_retrieve_response_code($response)) { 84 $licenseData = json_decode(wp_remote_retrieve_body($response)); 85 update_option('sgpb-license-status-'.$key, $licenseData->license); 86 set_transient($transient, $licenseData->item_name, WEEK_IN_SECONDS); 87 } 88 89 } 71 90 public function updatesInit() 72 91 { … … 79 98 $key = @$license['key']; 80 99 $storeURL = @$license['storeURL']; 100 $itemId = @$license['itemId']; 81 101 $pluginMainFilePath = @$license['file']; 82 102 $pluginMainFilePath = SG_POPUP_PLUGIN_PATH.$pluginMainFilePath; … … 88 108 continue; 89 109 } 90 110 $this->checkIfLicenseIsActive($licenseKey, $itemId, $storeURL, $key); 91 111 $version = @constant('SG_VERSION_'.$key); 92 112 -
popup-builder/tags/4.0/public/js/sgpbDetect.js
r2578740 r2578886 101 101 css += '.sgpb.sgpb-modal-detection .sgpb-modal-body a, .sgpb.sgpb-modal-detection .sgpb-modal-body .sgpb-plugins-list .sgpb-update-plugin {font-weight: normal; font-size: 17px; color: #2873EB;}'; 102 102 css += '.sgpb.sgpb-modal-detection .sgpb-modal-body p{font-size: 20px;margin: 0;}'; 103 css += '.sgpb.sgpb-modal-detection .sgpb-plugins-list-auto-update {max-width: 7 0%; margin: 0 auto;}';103 css += '.sgpb.sgpb-modal-detection .sgpb-plugins-list-auto-update {max-width: 73%; margin: 0 auto;}'; 104 104 css += '.sgpb.sgpb-modal-detection .sgpb-modal-body p.sgpb-modal-footer-message{font-size: 15px;}'; 105 105 css += '.sgpb-plugins-list {display: flex; flex-direction: column;} .sgpb-update-plugin { display: inline-flex;justify-content: space-between;color: #2873eb} .sgpb-update-plugin:after { content: "";font: normal 20px/1 dashicons;display: block;}.sgpb-update-plugin-success{color:#00ae5d}.sgpb-update-plugin-success:after { content: "\\f147";}.sgpb-update-plugin-failed{color:#c00}.sgpb-update-plugin-failed:after { content: "\\f534";}.sgpb-update-plugin-progress:after { content: "\\f463";}.sgpb-update-plugin-progress.updating:after{animation: sgpbRotation 2s infinite linear;}@keyframes sgpbRotation { 0% { transform: rotate(0deg); } 100% { transform: rotate(359deg);}}'; -
popup-builder/trunk/com/classes/Actions.php
r2578665 r2578886 69 69 } 70 70 71 private function checkIfLicenseIsActive($license, $itemId, $storeURL, $key) { 72 $transient = 'sgpb-license-key-'.$key.'-requested'; 73 if ( false !== ( $value = get_transient( $transient ) ) ) { 74 return; 75 } 76 $apiParams = array( 77 'edd_action' => 'activate_license', 78 'license' => $license, 79 'item_id' => $itemId, // The ID of the item in EDD 80 'url' => home_url() 81 ); 82 $response = wp_remote_post($storeURL, array('timeout' => 15, 'sslverify' => false, 'body' => $apiParams)); 83 if (!is_wp_error($response) || 200 == wp_remote_retrieve_response_code($response)) { 84 $licenseData = json_decode(wp_remote_retrieve_body($response)); 85 update_option('sgpb-license-status-'.$key, $licenseData->license); 86 set_transient($transient, $licenseData->item_name, WEEK_IN_SECONDS); 87 } 88 89 } 71 90 public function updatesInit() 72 91 { … … 79 98 $key = @$license['key']; 80 99 $storeURL = @$license['storeURL']; 100 $itemId = @$license['itemId']; 81 101 $pluginMainFilePath = @$license['file']; 82 102 $pluginMainFilePath = SG_POPUP_PLUGIN_PATH.$pluginMainFilePath; … … 88 108 continue; 89 109 } 90 110 $this->checkIfLicenseIsActive($licenseKey, $itemId, $storeURL, $key); 91 111 $version = @constant('SG_VERSION_'.$key); 92 112 -
popup-builder/trunk/public/js/sgpbDetect.js
r2578740 r2578886 101 101 css += '.sgpb.sgpb-modal-detection .sgpb-modal-body a, .sgpb.sgpb-modal-detection .sgpb-modal-body .sgpb-plugins-list .sgpb-update-plugin {font-weight: normal; font-size: 17px; color: #2873EB;}'; 102 102 css += '.sgpb.sgpb-modal-detection .sgpb-modal-body p{font-size: 20px;margin: 0;}'; 103 css += '.sgpb.sgpb-modal-detection .sgpb-plugins-list-auto-update {max-width: 7 0%; margin: 0 auto;}';103 css += '.sgpb.sgpb-modal-detection .sgpb-plugins-list-auto-update {max-width: 73%; margin: 0 auto;}'; 104 104 css += '.sgpb.sgpb-modal-detection .sgpb-modal-body p.sgpb-modal-footer-message{font-size: 15px;}'; 105 105 css += '.sgpb-plugins-list {display: flex; flex-direction: column;} .sgpb-update-plugin { display: inline-flex;justify-content: space-between;color: #2873eb} .sgpb-update-plugin:after { content: "";font: normal 20px/1 dashicons;display: block;}.sgpb-update-plugin-success{color:#00ae5d}.sgpb-update-plugin-success:after { content: "\\f147";}.sgpb-update-plugin-failed{color:#c00}.sgpb-update-plugin-failed:after { content: "\\f534";}.sgpb-update-plugin-progress:after { content: "\\f463";}.sgpb-update-plugin-progress.updating:after{animation: sgpbRotation 2s infinite linear;}@keyframes sgpbRotation { 0% { transform: rotate(0deg); } 100% { transform: rotate(359deg);}}';
Note: See TracChangeset
for help on using the changeset viewer.