@@ -298,14 +298,14 @@ public static function UISaveOptions(): void {
298298 self ::getHookName ( 'addon_ui_save_options ' )
299299 );
300300
301- check_admin_referer ( ' wp2static-ui-options ' );
301+ check_admin_referer ( self :: getHookName ( ' ui_options ' ) );
302302
303303 wp_safe_redirect ( admin_url ( 'admin.php?page=wp2static-options ' ) );
304304 exit ;
305305 }
306306
307307 public static function adminDetectedFilesDelete (): void {
308- check_admin_referer ( ' wp2static-caches-page ' );
308+ check_admin_referer ( self :: getHookName ( ' caches_page ' ) );
309309
310310 DetectedFiles::truncate ();
311311
@@ -314,14 +314,14 @@ public static function adminDetectedFilesDelete(): void {
314314 }
315315
316316 public static function adminDetectedFilesShow (): void {
317- check_admin_referer ( ' wp2static-caches-page ' );
317+ check_admin_referer ( self :: getHookName ( ' caches_page ' ) );
318318
319319 wp_safe_redirect ( admin_url ( 'admin.php?page=wp2static-detected-files ' ) );
320320 exit ;
321321 }
322322
323323 public static function adminDeleteJobsQueue (): void {
324- check_admin_referer ( ' wp2static-ui-job-options ' );
324+ check_admin_referer ( self :: getHookName ( ' ui_job_options ' ) );
325325
326326 JobQueue::truncate ();
327327
@@ -330,7 +330,7 @@ public static function adminDeleteJobsQueue(): void {
330330 }
331331
332332 public static function adminDeleteAllCaches (): void {
333- check_admin_referer ( ' wp2static-caches-page ' );
333+ check_admin_referer ( self :: getHookName ( ' caches_page ' ) );
334334
335335 self ::deleteAllCaches ();
336336
@@ -347,7 +347,7 @@ public static function deleteAllCaches(): void {
347347 }
348348
349349 public static function adminProcessJobsQueue (): void {
350- check_admin_referer ( ' wp2static-ui-job-options ' );
350+ check_admin_referer ( self :: getHookName ( ' ui_job_options ' ) );
351351
352352 WsLog::l ( 'Manually processing JobQueue ' );
353353
@@ -358,7 +358,7 @@ public static function adminProcessJobsQueue(): void {
358358 }
359359
360360 public static function adminDeployCacheDelete (): void {
361- check_admin_referer ( ' wp2static-caches-page ' );
361+ check_admin_referer ( self :: getHookName ( ' caches_page ' ) );
362362
363363 $ deploy_namespace = strval ( filter_input ( INPUT_POST , 'deploy_namespace ' ) );
364364 if ( $ deploy_namespace !== '' ) {
@@ -372,7 +372,7 @@ public static function adminDeployCacheDelete(): void {
372372 }
373373
374374 public static function adminDeployCacheShow (): void {
375- check_admin_referer ( ' wp2static-caches-page ' );
375+ check_admin_referer ( self :: getHookName ( ' caches_page ' ) );
376376
377377 $ deploy_namespace = strval ( filter_input ( INPUT_POST , 'deploy_namespace ' ) );
378378 if ( $ deploy_namespace !== '' ) {
@@ -390,7 +390,7 @@ public static function adminDeployCacheShow(): void {
390390 }
391391
392392 public static function adminCrawledFilesDelete (): void {
393- check_admin_referer ( ' wp2static-caches-page ' );
393+ check_admin_referer ( self :: getHookName ( ' caches_page ' ) );
394394
395395 CrawledFiles::truncate ();
396396
@@ -399,14 +399,14 @@ public static function adminCrawledFilesDelete(): void {
399399 }
400400
401401 public static function adminCrawledFilesShow (): void {
402- check_admin_referer ( ' wp2static-caches-page ' );
402+ check_admin_referer ( self :: getHookName ( ' caches_page ' ) );
403403
404404 wp_safe_redirect ( admin_url ( 'admin.php?page=wp2static-crawled-files ' ) );
405405 exit ;
406406 }
407407
408408 public static function adminPostProcessedSiteDelete (): void {
409- check_admin_referer ( ' wp2static-caches-page ' );
409+ check_admin_referer ( self :: getHookName ( ' caches_page ' ) );
410410
411411 ProcessedSite::delete ();
412412
@@ -415,14 +415,14 @@ public static function adminPostProcessedSiteDelete(): void {
415415 }
416416
417417 public static function adminPostProcessedSiteShow (): void {
418- check_admin_referer ( ' wp2static-caches-page ' );
418+ check_admin_referer ( self :: getHookName ( ' caches_page ' ) );
419419
420420 wp_safe_redirect ( admin_url ( 'admin.php?page=wp2static-post-processed-site ' ) );
421421 exit ;
422422 }
423423
424424 public static function adminLogDelete (): void {
425- check_admin_referer ( ' wp2static-log-page ' );
425+ check_admin_referer ( self :: getHookName ( ' log_page ' ) );
426426
427427 WsLog::truncate ();
428428
@@ -431,7 +431,7 @@ public static function adminLogDelete(): void {
431431 }
432432
433433 public static function adminStaticSiteDelete (): void {
434- check_admin_referer ( ' wp2static-caches-page ' );
434+ check_admin_referer ( self :: getHookName ( ' caches_page ' ) );
435435
436436 StaticSite::delete ();
437437
@@ -440,7 +440,7 @@ public static function adminStaticSiteDelete(): void {
440440 }
441441
442442 public static function adminStaticSiteShow (): void {
443- check_admin_referer ( ' wp2static-caches-page ' );
443+ check_admin_referer ( self :: getHookName ( ' caches_page ' ) );
444444
445445 wp_safe_redirect ( admin_url ( 'admin.php?page=wp2static-static-site ' ) );
446446 exit ;
@@ -453,7 +453,7 @@ public static function adminUISaveJobsOptions(): void {
453453 self ::getHookName ( 'addon_ui_save_job_options ' )
454454 );
455455
456- check_admin_referer ( ' wp2static-ui-job-options ' );
456+ check_admin_referer ( self :: getHookName ( ' ui_job_options ' ) );
457457
458458 wp_safe_redirect ( admin_url ( 'admin.php?page=wp2static-jobs ' ) );
459459 exit ;
@@ -479,7 +479,7 @@ public static function adminUISaveAdvancedOptions(): void {
479479 self ::getHookName ( 'addon_ui_save_advanced_options ' )
480480 );
481481
482- check_admin_referer ( ' wp2static-ui-advanced-options ' );
482+ check_admin_referer ( self :: getHookName ( ' ui_advanced_options ' ) );
483483
484484 wp_safe_redirect ( admin_url ( 'admin.php?page=wp2static-advanced ' ) );
485485 exit ;
@@ -521,7 +521,7 @@ public static function adminToggleAddon( string $addon_slug = null ): void {
521521
522522 $ addon_slug = sanitize_text_field ( $ addon_slug );
523523 } else {
524- check_admin_referer ( ' wp2static-addons-page ' );
524+ check_admin_referer ( self :: getHookName ( ' addons_page ' ) );
525525
526526 $ addon_slug = sanitize_text_field ( strval ( filter_input ( INPUT_POST , 'addon_slug ' ) ) );
527527 }
@@ -561,7 +561,7 @@ public static function adminToggleAddon( string $addon_slug = null ): void {
561561 }
562562
563563 public static function adminManuallyEnqueueJobs (): void {
564- check_admin_referer ( ' wp2static-manually-enqueue-jobs ' );
564+ check_admin_referer ( self :: getHookName ( ' manually_enqueue_jobs ' ) );
565565
566566 // TODO: consider using a transient based notifications system to
567567 // persist through wp_safe_redirect calls
0 commit comments