PluginProbe
Patchstack – WordPress & Plugins Security / 2.2.6
Patchstack – WordPress & Plugins Security v2.2.6
2.3.7 trunk 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.17 2.1.18 2.1.19 2.1.2 2.1.20 2.1.21 2.1.22 2.1.23 2.1.24 2.1.25 2.1.3 2.1.4 2.1.5 2.1.6 All 49 releases
← All changes | assets/js/patchstack.js +10 -13 2.1.142.2.6 View file →
@@ -22,20 +22,25 @@
22 22 $('input#patchstack-activate').on( 'click', function(e) {
23 23 e.preventDefault();
24 24 var postData = {
25 25 action: 'patchstack_activate_license',
26 - clientid: $( '#patchstack_api_client_id' ).val(),
27 - secretkey: $( '#patchstack_api_client_secret_key' ).val(),
26 + key: $( '#patchstack_api_key' ).val(),
28 27 PatchstackNonce: PatchstackVars.nonce
29 28 };
30 29
31 - if ( $.trim( postData.clientid ).length == 0 || $.trim( postData.secretkey ).length == 0) {
32 - alert( 'Please enter the site id and secret key.' );
30 + if ( $.trim( postData.key ).length == 0 ) {
31 + alert( 'Please enter the API key.' );
33 32 return false;
34 33 }
35 34
35 + $( '.patchstack-resync' ).hide();
36 + $( '#patchstack-activate' ).hide();
37 + $( '.patchstack-loading' ).show();
38 +
36 39 $.post( PatchstackVars.ajaxurl, postData, function( response ) {
37 40 if ( response.result == 'error' ) {
41 + $( '#patchstack-activate' ).show();
42 + $( '.patchstack-loading' ).hide();
38 43 if ( response.error_message ) {
39 44 alert( response.error_message );
40 45 } else {
41 46 alert( PatchstackVars.error_message );
@@ -40,17 +45,9 @@
40 45 } else {
41 46 alert( PatchstackVars.error_message );
42 47 }
43 48 } else {
44 - if (response.response && response.response.free === false) {
45 - window.location.reload();
46 - } else {
47 - $( '.patchstack-license-status' ).text( 'Active' ).css( { color: '#B2D675' } );
48 - $( '.patchstack-sub-type' ).text( 'Community (Free) ');
49 - $( '.ps-b1, .ps-p1' ).hide();
50 - $( '.ps-b3' ).removeClass('patchstack-fullwidth');
51 - $( '.ps-b2, .ps-b4, .ps-p2' ).show();
52 - }
49 + window.location = window.location.href + '&resync=1';
53 50 }
54 51 });
55 52 });
56 53