@@ -63,7 +63,7 @@ jQuery(document).ready(($) => {
63
63
jQuery ( "#bibleget_ajax_spinner" ) . hide ( ) ;
64
64
} ,
65
65
success : ( returndata ) => {
66
- if ( returndata == "datarefreshed" ) {
66
+ if ( returndata === "datarefreshed" ) {
67
67
jQuery ( "#bibleget-settings-notification" )
68
68
. append (
69
69
'Data from server retrieved successfully, now refreshing page... <span id="bibleget-countdown">3 secs...</span>'
@@ -72,7 +72,7 @@ jQuery(document).ready(($) => {
72
72
let seconds = 3 ;
73
73
let interval1 = setInterval ( ( ) => {
74
74
jQuery ( "#bibleget-countdown" ) . text (
75
- -- seconds + ( seconds == 1 ? " sec..." : " secs..." )
75
+ -- seconds + ( seconds === 1 ? " sec..." : " secs..." )
76
76
) ;
77
77
} , 1000 ) ;
78
78
setTimeout ( ( ) => {
@@ -113,7 +113,7 @@ jQuery(document).ready(($) => {
113
113
jQuery ( "#bibleget_ajax_spinner" ) . hide ( ) ;
114
114
} ,
115
115
success : ( returndata ) => {
116
- if ( returndata == "cacheflushed" ) {
116
+ if ( returndata === "cacheflushed" ) {
117
117
jQuery ( "#bibleget-settings-notification" )
118
118
. append ( "Bible quotes cache emptied successfully" )
119
119
. fadeIn ( "slow" ) ;
@@ -145,7 +145,7 @@ jQuery(document).ready(($) => {
145
145
gfontsBatch . job . hasOwnProperty ( "gfontsPreviewJob" ) &&
146
146
gfontsBatch . job . gfontsPreviewJob === true &&
147
147
gfontsBatch . job . hasOwnProperty ( "gfontsWeblist" ) &&
148
- typeof gfontsBatch . job . gfontsWeblist == "object" &&
148
+ typeof gfontsBatch . job . gfontsWeblist === "object" &&
149
149
gfontsBatch . job . gfontsWeblist . hasOwnProperty ( "items" )
150
150
) {
151
151
//console.log('We have a gfontsPreviewJob to do! gfontsBatch: ');
@@ -159,7 +159,7 @@ jQuery(document).ready(($) => {
159
159
. append (
160
160
$ ( "<div>" , {
161
161
html :
162
- "!!! Impossible to write data to the BibleGet plugin directory, please check permissions!" ,
162
+ "!!! Impossible to write data to the BibleGet plugin directory, please check permissions!<br>" + wpFsErrors . join ( '<br>' ) ,
163
163
style :
164
164
"color: white; background-color: red; padding: 3px 9px; display: inline-block; font-weight: bold; font-family: sans-serif;" ,
165
165
} )
@@ -185,6 +185,8 @@ jQuery(document).ready(($) => {
185
185
//console.log('gfontsCount = '+gfontsCount);
186
186
//console.log('batchLimit = '+batchLimit);
187
187
}
188
+ //We actually need to run one more time than the batchlimit, in order for the minify stage to take place
189
+ numRuns ++ ;
188
190
189
191
//$gfontsBatchRunProgressbarOverlay, $gfontsBatchRunProgressbarWrapper, and $gfontsBatchRunProgressbar are global variables so don't use "var" here
190
192
$gfontsBatchRunProgressbarOverlay = jQuery ( "<div>" , {
@@ -323,9 +325,9 @@ const gfontsBatchRun = (postdata) => {
323
325
//console.log(returndataJSON.errorinfo);
324
326
if (
325
327
( returndataJSON . hasOwnProperty ( "httpStatus2" ) &&
326
- returndataJSON . httpStatus2 == 504 ) ||
328
+ returndataJSON . httpStatus2 === 504 ) ||
327
329
( returndataJSON . hasOwnProperty ( "httpStatus3" ) &&
328
- returndataJSON . httpStatus3 == 504 )
330
+ returndataJSON . httpStatus3 === 504 )
329
331
) {
330
332
//there was a timeout at some point during the communication with the Google Fonts server
331
333
//we haven't finished yet, but let's try not to get stuck
@@ -367,7 +369,7 @@ const gfontsBatchRun = (postdata) => {
367
369
case "COMPLETE" :
368
370
$gfontsBatchRunProgressbar . progressbar ( "value" , 100 ) ;
369
371
370
- // if (thisRun == postdata.numRuns) {
372
+ // if (thisRun === postdata.numRuns) {
371
373
// console.log("gfontsBatchRun has finished the job!");
372
374
// } else {
373
375
// console.log(
@@ -460,14 +462,14 @@ const bibleGetForceRefreshGFapiResults = () => {
460
462
//send ajax request to the server to have the transient deleted
461
463
//console.log('we should have an nonce for this action: '+gfontsBatch.gfontsRefreshNonce);
462
464
if (
463
- typeof gfontsBatch != "undefined" &&
464
- typeof gfontsBatch == "object" &&
465
+ typeof gfontsBatch !== "undefined" &&
466
+ typeof gfontsBatch === "object" &&
465
467
gfontsBatch . hasOwnProperty ( "job" ) &&
466
- typeof gfontsBatch . job == "object" &&
468
+ typeof gfontsBatch . job === "object" &&
467
469
gfontsBatch . job . hasOwnProperty ( "gfontsRefreshNonce" ) &&
468
- gfontsBatch . job . gfontsRefreshNonce != "" &&
470
+ gfontsBatch . job . gfontsRefreshNonce !== "" &&
469
471
gfontsBatch . job . hasOwnProperty ( "gfontsApiKey" ) &&
470
- gfontsBatch . job . gfontsApiKey != ""
472
+ gfontsBatch . job . gfontsApiKey !== ""
471
473
) {
472
474
const postProps = {
473
475
action : "bibleget_refresh_gfonts" ,
0 commit comments