From 3d2d8e56ac9877b96ff961e64490f52bbe03e22c Mon Sep 17 00:00:00 2001 From: amartya-dev Date: Mon, 18 Dec 2023 14:11:15 +0530 Subject: [PATCH] add capability check again --- bootstrap.php | 2 +- includes/SiteGen/SiteGen.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bootstrap.php b/bootstrap.php index a85a724..cd33374 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -17,7 +17,7 @@ function () { if ( ! defined( 'NFD_AI_SERVICE_BASE' ) ) { define( 'NFD_AI_SERVICE_BASE', 'https://hiive.cloud/workers/ai-proxy/v1/' ); - define( 'NFD_AI_BASE', 'https://hiive.cloud/workers/ai-proxy/' ); + define( 'NFD_AI_BASE', 'http://localhost:8787/' ); define( 'NFD_PATTERNS_BASE', 'https://patterns.hiive.cloud/' ); define( 'NFD_SITEGEN_OPTION', 'nfd-ai-site-gen' ); } diff --git a/includes/SiteGen/SiteGen.php b/includes/SiteGen/SiteGen.php index 2879002..930e6f8 100644 --- a/includes/SiteGen/SiteGen.php +++ b/includes/SiteGen/SiteGen.php @@ -342,6 +342,11 @@ public static function generate_site_meta( $site_info, $identifier, $skip_cache * @param boolean $regenerate If we need to regenerate. */ public static function get_home_pages( $site_description, $content_style, $target_audience, $regenerate = false ) { + if ( ! self::check_capabilities() ) { + return array( + 'error' => __( 'You do not have the permissions to perform this action' ), + ); + } // Check if we have the response in cache already if ( ! $regenerate ) {