Skip to content
Open
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e6c1e2c
Add a proto type for setup instructions uder the Service Provider.
BhargavBhandari90 Jul 7, 2025
ad9a9a9
Merge branch 'develop' of github.com:BhargavBhandari90/classifai into…
BhargavBhandari90 Jul 11, 2025
598ed6f
Add popup modal to display AI setup instructions to users
BhargavBhandari90 Jul 13, 2025
2a254d4
Set configuration instructions for all features
BhargavBhandari90 Jul 13, 2025
b35091b
phpcs fixes
BhargavBhandari90 Jul 13, 2025
92c9816
Add ollama instruction
BhargavBhandari90 Jul 13, 2025
4087e02
Merge branch 'develop' of github.com:BhargavBhandari90/classifai into…
BhargavBhandari90 Jul 16, 2025
451743e
Add helper component with modal for additional info for setting field
BhargavBhandari90 Jul 16, 2025
519748f
Remove debuge code
BhargavBhandari90 Jul 16, 2025
2d11e51
Add component documentation
BhargavBhandari90 Jul 16, 2025
61eebf6
Fix js lint and improve error handling
BhargavBhandari90 Jul 16, 2025
c8a6749
Merge branch 'develop' of github.com:BhargavBhandari90/classifai into…
BhargavBhandari90 Jul 18, 2025
9df3b7c
Get readme content from github
BhargavBhandari90 Jul 18, 2025
2e35bce
Use VIP function when possible
BhargavBhandari90 Jul 18, 2025
a10091c
Ignore phpcs for wp_remote_get
BhargavBhandari90 Jul 18, 2025
21dbfbf
Merge branch 'develop' of github.com:BhargavBhandari90/classifai into…
BhargavBhandari90 Jul 19, 2025
fc0acc8
Update marked package
BhargavBhandari90 Jul 19, 2025
e4cd4d8
Code improvisation as per feedback
BhargavBhandari90 Aug 20, 2025
3bd36e9
Update Marked Package
BhargavBhandari90 Aug 20, 2025
dfa5704
Merge branch 'develop' of github.com:BhargavBhandari90/classifai into…
BhargavBhandari90 Aug 20, 2025
2690e1b
Use safe_wp_remote_get for getting data from readme
BhargavBhandari90 Aug 20, 2025
6d5b9c1
Merge branch 'develop' of github.com:BhargavBhandari90/classifai into…
BhargavBhandari90 Aug 22, 2025
ba6ce18
Remove unnecessary code from package.lock
BhargavBhandari90 Aug 22, 2025
6685563
Remove unnecessary file
BhargavBhandari90 Aug 22, 2025
f818a15
Merge branch 'develop' of github.com:BhargavBhandari90/classifai into…
BhargavBhandari90 Aug 23, 2025
ceb18ed
Made change as per new folder structure for getting feature instructions
BhargavBhandari90 Sep 2, 2025
6f85c00
Fix phpcs
BhargavBhandari90 Sep 2, 2025
ed53fe9
Merge branch 'develop' into feat/925
BhargavBhandari90 Sep 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ classifai_define( 'CLASSIFAI_PLUGIN_VERSION', $plugin_version );
classifai_define( 'CLASSIFAI_PLUGIN_DIR', __DIR__ );
classifai_define( 'CLASSIFAI_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
classifai_define( 'CLASSIFAI_PLUGIN_BASENAME', plugin_basename( __DIR__ . '/classifai.php' ) );
classifai_define( 'CLASSIFAI_PLUGIN_README_URL', 'https://raw.githubusercontent.com/10up/classifai/refs/heads/develop/README.md' );

// IBM Watson constants

Expand Down
1 change: 1 addition & 0 deletions includes/Classifai/Admin/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ public function get_features( bool $with_instance = false ): array {
'roles' => $feature->get_roles(),
'enable_description' => $feature->get_enable_description(),
'taxonomies' => $feature->get_taxonomies(),
'providers_data' => $feature->supported_providers_data,
);

// Add taxonomies under post types for language processing features to allow filtering by post type.
Expand Down
10 changes: 10 additions & 0 deletions includes/Classifai/Features/AudioTranscriptsGeneration.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ public function __construct() {
$this->supported_providers = [
SpeechToText::ID => __( 'OpenAI Audio Transcription', 'classifai' ),
];

// Get readme content.
$readme_content = $this->get_readme_content();

// Contains supported providers data.
$this->supported_providers_data = [
'instruction' => [
SpeechToText::ID => preg_match( '/## Set Up Audio Transcripts Generation \(via OpenAI Speech to Text\)(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
],
];
}

/**
Expand Down
13 changes: 13 additions & 0 deletions includes/Classifai/Features/Classification.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@ public function __construct() {
AzureEmbeddings::ID => __( 'Azure OpenAI Embeddings', 'classifai' ),
OllamaEmbeddings::ID => __( 'Ollama', 'classifai' ),
];

// Get readme content.
$readme_content = $this->get_readme_content();

// Contains supported providers data.
$this->supported_providers_data = [
'instruction' => [
NLU::ID => preg_match( '/## Set Up Classification \(via IBM Watson\)(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
OpenAIEmbeddings::ID => preg_match( '/## Set Up Classification \(via OpenAI Embeddings\)(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
AzureEmbeddings::ID => '',
OllamaEmbeddings::ID => preg_match( '/## Run locally hosted LLMs(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
],
];
}

/**
Expand Down
12 changes: 12 additions & 0 deletions includes/Classifai/Features/ContentGeneration.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,18 @@ public function __construct() {
OpenAI::ID => __( 'Azure OpenAI', 'classifai' ),
Ollama::ID => __( 'Ollama', 'classifai' ),
];

// Get readme content.
$readme_content = $this->get_readme_content();

// Contains supported providers data.
$this->supported_providers_data = [
'instruction' => [
ChatGPT::ID => preg_match( '/## Set Up Language Processing Features \(via OpenAI ChatGPT\)(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
OpenAI::ID => preg_match( '/## Set Up Language Processing Features \(via Azure OpenAI\)(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
Ollama::ID => preg_match( '/## Run locally hosted LLMs(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
],
];
}

/**
Expand Down
15 changes: 15 additions & 0 deletions includes/Classifai/Features/ContentResizing.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,21 @@ public function __construct() {
ChromeAI::ID => __( 'Chrome AI (experimental)', 'classifai' ),
Ollama::ID => __( 'Ollama', 'classifai' ),
];

// Get readme content.
$readme_content = $this->get_readme_content();

// Contains supported providers data.
$this->supported_providers_data = [
'instruction' => [
ChatGPT::ID => preg_match( '/## Set Up Language Processing Features \(via OpenAI ChatGPT\)(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
GeminiAPI::ID => preg_match( '/## Set Up Language Processing Features \(via Google AI \(Gemini API\)\)(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
OpenAI::ID => preg_match( '/## Set Up Language Processing Features \(via Azure OpenAI\)(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
Grok::ID => '',
ChromeAI::ID => '',
Ollama::ID => preg_match( '/## Run locally hosted LLMs(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
],
];
}

/**
Expand Down
13 changes: 13 additions & 0 deletions includes/Classifai/Features/DescriptiveTextGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,19 @@ public function __construct() {
Grok::ID => __( 'xAI Grok', 'classifai' ),
OllamaMM::ID => __( 'Ollama', 'classifai' ),
];

// Get readme content.
$readme_content = $this->get_readme_content();

// Contains supported providers data.
$this->supported_providers_data = [
'instruction' => [
ComputerVision::ID => preg_match( '/## Set Up Image Processing features \(via Microsoft Azure\)(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
ChatGPT::ID => '',
Grok::ID => '',
OllamaMM::ID => preg_match( '/## Run locally hosted LLMs(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
],
];
}

/**
Expand Down
15 changes: 15 additions & 0 deletions includes/Classifai/Features/ExcerptGeneration.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,21 @@ public function __construct() {
ChromeAI::ID => __( 'Chrome AI (experimental)', 'classifai' ),
Ollama::ID => __( 'Ollama', 'classifai' ),
];

// Get readme content.
$readme_content = $this->get_readme_content();

// Contains supported providers data.
$this->supported_providers_data = [
'instruction' => [
ChatGPT::ID => preg_match( '/## Set Up Language Processing Features \(via OpenAI ChatGPT\)(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
GeminiAPI::ID => preg_match( '/## Set Up Language Processing Features \(via Google AI \(Gemini API\)\)(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
OpenAI::ID => preg_match( '/## Set Up Language Processing Features \(via Azure OpenAI\)(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
Grok::ID => '',
ChromeAI::ID => '',
Ollama::ID => preg_match( '/## Run locally hosted LLMs(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
],
];
}

/**
Expand Down
42 changes: 42 additions & 0 deletions includes/Classifai/Features/Feature.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ abstract class Feature {
*/
public $supported_providers = [];

/**
* Array of providers data supported by the feature.
*
* @var \Classifai\Providers\Provider[]
*/
public $supported_providers_data = [];

/**
* Set up necessary hooks.
*/
Expand Down Expand Up @@ -1411,4 +1418,39 @@ public function run( ...$args ) {
$this
);
}

/**
* Get content from README.md file.
*
* @return string
*/
public function get_readme_content() {

// Get readme content from cache.
$readme_content = get_transient( 'classifai_readme_content' );

if ( ! empty( $readme_content ) ) {
return $readme_content;
}

// Get readme content.
$readme_request = function_exists( 'vip_safe_wp_remote_get' )
? vip_safe_wp_remote_get( CLASSIFAI_PLUGIN_README_URL )
: wp_remote_get( CLASSIFAI_PLUGIN_README_URL ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get

if ( is_wp_error( $readme_request ) ) {
return esc_html__( 'Readme cannot be downloaded.', 'classifai' );
}

$readme_content = wp_remote_retrieve_body( $readme_request );

if ( empty( $readme_content ) || ! is_string( $readme_content ) ) {
return esc_html__( 'Readme cannot be downloaded.', 'classifai' );
}

// Cache readme content.
set_transient( 'classifai_readme_content', $readme_content, DAY_IN_SECONDS );

return $readme_content;
}
}
10 changes: 10 additions & 0 deletions includes/Classifai/Features/ImageCropping.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ public function __construct() {
$this->supported_providers = [
ComputerVision::ID => __( 'Microsoft Azure AI Vision', 'classifai' ),
];

// Get readme content.
$readme_content = $this->get_readme_content();

// Contains supported providers data.
$this->supported_providers_data = [
'instruction' => [
ComputerVision::ID => preg_match( '/## Set Up Image Processing features \(via Microsoft Azure\)(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
],
];
}

/**
Expand Down
11 changes: 11 additions & 0 deletions includes/Classifai/Features/ImageGeneration.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ public function __construct() {
OpenAIImages::ID => __( 'OpenAI Images', 'classifai' ),
GoogleAIImagen::ID => __( 'Google AI Imagen', 'classifai' ),
];

// Get readme content.
$readme_content = $this->get_readme_content();

// Contains supported providers data.
$this->supported_providers_data = [
'instruction' => [
OpenAIImages::ID => preg_match( '/## Set Up Image Generation \(via OpenAI\)(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
GoogleAIImagen::ID => preg_match( '/## Set Up Image Generation \(via Google AI Imagen\)(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
],
];
}

/**
Expand Down
12 changes: 12 additions & 0 deletions includes/Classifai/Features/ImageTagsGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ public function __construct() {
ChatGPT::ID => __( 'OpenAI ChatGPT', 'classifai' ),
OllamaMM::ID => __( 'Ollama', 'classifai' ),
];

// Get readme content.
$readme_content = $this->get_readme_content();

// Contains supported providers data.
$this->supported_providers_data = [
'instruction' => [
ComputerVision::ID => preg_match( '/## Set Up Image Processing features \(via Microsoft Azure\)(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
ChatGPT::ID => '',
OllamaMM::ID => preg_match( '/## Run locally hosted LLMs(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
],
];
}

/**
Expand Down
12 changes: 12 additions & 0 deletions includes/Classifai/Features/ImageTextExtraction.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ public function __construct() {
ChatGPT::ID => __( 'OpenAI ChatGPT', 'classifai' ),
OllamaMM::ID => __( 'Ollama', 'classifai' ),
];

// Get readme content.
$readme_content = $this->get_readme_content();

// Contains supported providers data.
$this->supported_providers_data = [
'instruction' => [
ComputerVision::ID => preg_match( '/## Set Up Image Processing features \(via Microsoft Azure\)(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
ChatGPT::ID => '',
OllamaMM::ID => preg_match( '/## Run locally hosted LLMs(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
],
];
}

/**
Expand Down
12 changes: 12 additions & 0 deletions includes/Classifai/Features/KeyTakeaways.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ public function __construct() {
OpenAI::ID => __( 'Azure OpenAI', 'classifai' ),
Ollama::ID => __( 'Ollama', 'classifai' ),
];

// Get readme content.
$readme_content = $this->get_readme_content();

// Contains supported providers data.
$this->supported_providers_data = [
'instruction' => [
ChatGPT::ID => '',
OpenAI::ID => '',
Ollama::ID => preg_match( '/## Run locally hosted LLMs(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
],
];
}

/**
Expand Down
10 changes: 10 additions & 0 deletions includes/Classifai/Features/Moderation.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ public function __construct() {
$this->supported_providers = [
ModerationProvider::ID => __( 'OpenAI Moderation', 'classifai' ),
];

// Get readme content.
$readme_content = $this->get_readme_content();

// Contains supported providers data.
$this->supported_providers_data = [
'instruction' => [
ModerationProvider::ID => preg_match( '/## Set Up Comment Moderation \(via OpenAI Moderation\)(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
],
];
}

/**
Expand Down
10 changes: 10 additions & 0 deletions includes/Classifai/Features/PDFTextExtraction.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ public function __construct() {
$this->supported_providers = [
ComputerVision::ID => __( 'Microsoft Azure AI Vision', 'classifai' ),
];

// Get readme content.
$readme_content = $this->get_readme_content();

// Contains supported providers data.
$this->supported_providers_data = [
'instruction' => [
ComputerVision::ID => preg_match( '/## Set Up Image Processing features \(via Microsoft Azure\)(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
],
];
}

/**
Expand Down
11 changes: 11 additions & 0 deletions includes/Classifai/Features/RecommendedContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ public function __construct() {
OpenAIEmbeddings::ID => __( 'OpenAI Embeddings', 'classifai' ),
PersonalizerProvider::ID => __( 'Microsoft Azure AI Personalizer', 'classifai' ),
];

// Get readme content.
$readme_content = $this->get_readme_content();

// Contains supported providers data.
$this->supported_providers_data = [
'instruction' => [
OpenAIEmbeddings::ID => preg_match( '/## Set Up Recommended Content \(via OpenAI Embeddings\)(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
PersonalizerProvider::ID => '',
],
];
}

/**
Expand Down
11 changes: 11 additions & 0 deletions includes/Classifai/Features/Smart404.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ public function __construct() {
OpenAIEmbeddings::ID => __( 'OpenAI Embeddings', 'classifai' ),
AzureEmbeddings::ID => __( 'Azure OpenAI Embeddings', 'classifai' ),
];

// Get readme content.
$readme_content = $this->get_readme_content();

// Contains supported providers data.
$this->supported_providers_data = [
'instruction' => [
OpenAIEmbeddings::ID => preg_match( '/## Set Up the Smart 404 Feature(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
AzureEmbeddings::ID => preg_match( '/## Set Up the Smart 404 Feature(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
],
];
}

/**
Expand Down
11 changes: 11 additions & 0 deletions includes/Classifai/Features/TermCleanup.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ public function __construct() {
OpenAIEmbeddings::ID => __( 'OpenAI Embeddings', 'classifai' ),
AzureEmbeddings::ID => __( 'Azure OpenAI Embeddings', 'classifai' ),
];

// Get readme content.
$readme_content = $this->get_readme_content();

// Contains supported providers data.
$this->supported_providers_data = [
'instruction' => [
OpenAIEmbeddings::ID => preg_match( '/## Set Up the Term Cleanup Feature(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
AzureEmbeddings::ID => preg_match( '/## Set Up the Term Cleanup Feature(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
],
];
}

/**
Expand Down
12 changes: 12 additions & 0 deletions includes/Classifai/Features/TextToSpeech.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,18 @@ public function __construct() {
Speech::ID => __( 'Microsoft Azure AI Speech', 'classifai' ),
OpenAITTS::ID => __( 'OpenAI Text to Speech', 'classifai' ),
];

// Get readme content.
$readme_content = $this->get_readme_content();

// Contains supported providers data.
$this->supported_providers_data = [
'instruction' => [
AmazonPolly::ID => preg_match( '/## Set Up Text to Speech \(via Amazon Polly\)(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
Speech::ID => preg_match( '/## Set Up Text to Speech \(via Microsoft Azure\)(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
OpenAITTS::ID => preg_match( '/## Set Up Text to Speech \(via OpenAI\)(.*?)(?:\n## |\z)/s', $readme_content, $matches ) ? $matches[1] : '',
],
];
}

/**
Expand Down
Loading
Loading