Skip to content

Commit 4a624e3

Browse files
committed
remove more dead code
1 parent e91626f commit 4a624e3

File tree

10 files changed

+0
-71
lines changed

10 files changed

+0
-71
lines changed

includes/Classifai/Providers/Azure/ComputerVision.php

-6
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ class ComputerVision extends Provider {
3333
* @param \Classifai\Features\Feature $feature_instance The feature instance.
3434
*/
3535
public function __construct( $feature_instance = null ) {
36-
parent::__construct(
37-
'Microsoft Azure',
38-
'AI Vision',
39-
'computer_vision'
40-
);
41-
4236
$this->feature_instance = $feature_instance;
4337
}
4438

includes/Classifai/Providers/Azure/Personalizer.php

-6
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@ class Personalizer extends Provider {
3737
* @param \Classifai\Features\Feature $feature_instance The feature instance.
3838
*/
3939
public function __construct( $feature_instance = null ) {
40-
parent::__construct(
41-
'Microsoft Azure',
42-
'AI Personalizer',
43-
'personalizer'
44-
);
45-
4640
$this->feature_instance = $feature_instance;
4741

4842
add_action( 'rest_api_init', [ $this, 'register_endpoints' ] );

includes/Classifai/Providers/Azure/Speech.php

-6
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@ class Speech extends Provider {
4444
* @param \Classifai\Features\Feature $feature_instance The feature instance.
4545
*/
4646
public function __construct( $feature_instance = null ) {
47-
parent::__construct(
48-
'Microsoft Azure',
49-
self::FEATURE_NAME,
50-
'azure_text_to_speech'
51-
);
52-
5347
$this->feature_instance = $feature_instance;
5448

5549
do_action( 'classifai_' . static::ID . '_init', $this );

includes/Classifai/Providers/OpenAI/ChatGPT.php

-6
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,6 @@ class ChatGPT extends Provider {
4646
* @param \Classifai\Features\Feature $feature_instance The feature instance.
4747
*/
4848
public function __construct( $feature_instance = null ) {
49-
parent::__construct(
50-
'OpenAI ChatGPT',
51-
'ChatGPT',
52-
'openai_chatgpt'
53-
);
54-
5549
$this->feature_instance = $feature_instance;
5650
}
5751

includes/Classifai/Providers/OpenAI/DallE.php

-6
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@ class DallE extends Provider {
3737
* @param \Classifai\Features\Feature $feature_instance The feature instance.
3838
*/
3939
public function __construct( $feature_instance = null ) {
40-
parent::__construct(
41-
'OpenAI',
42-
'DALL·E',
43-
'openai_dalle'
44-
);
45-
4640
$this->feature_instance = $feature_instance;
4741
}
4842

includes/Classifai/Providers/OpenAI/Embeddings.php

-7
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,6 @@ class Embeddings extends Provider {
4848
* @param \Classifai\Features\Feature $feature_instance The feature instance.
4949
*/
5050
public function __construct( $feature_instance = null ) {
51-
parent::__construct(
52-
'OpenAI Embeddings',
53-
'Embeddings',
54-
'openai_embeddings',
55-
$feature_instance
56-
);
57-
5851
$this->feature_instance = $feature_instance;
5952
}
6053

includes/Classifai/Providers/OpenAI/Whisper.php

-6
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@ class Whisper extends Provider {
6262
* @param \Classifai\Features\Feature $feature_instance The feature instance.
6363
*/
6464
public function __construct( $feature_instance = null ) {
65-
parent::__construct(
66-
'OpenAI Whisper',
67-
'Whisper',
68-
'openai_whisper'
69-
);
70-
7165
$this->feature_instance = $feature_instance;
7266
}
7367

includes/Classifai/Providers/Provider.php

-21
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,6 @@ abstract class Provider {
3636
*/
3737
protected $features = array();
3838

39-
/**
40-
* Provider constructor.
41-
*
42-
* @param string $provider_name The name of the Provider that will appear in the admin tab
43-
* @param string $provider_service_name The name of the Service.
44-
* @param string $option_name Name of the option where the provider settings are stored.
45-
*/
46-
public function __construct( string $provider_name, string $provider_service_name, string $option_name ) {
47-
$this->provider_name = $provider_name;
48-
$this->provider_service_name = $provider_service_name;
49-
$this->option_name = $option_name;
50-
}
5139

5240
/**
5341
* Provides the provider name.
@@ -58,15 +46,6 @@ public function get_provider_name(): string {
5846
return $this->provider_name;
5947
}
6048

61-
/**
62-
* Returns the name of the settings section for this provider.
63-
*
64-
* @return string
65-
*/
66-
public function get_settings_section(): string {
67-
return $this->option_name;
68-
}
69-
7049
/**
7150
* Get provider features.
7251
*

includes/Classifai/Providers/Watson/NLU.php

-6
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,6 @@ class NLU extends Provider {
4242
* @param \Classifai\Features\Feature $feature Feature instance (Optional, only required in admin).
4343
*/
4444
public function __construct( $feature = null ) {
45-
parent::__construct(
46-
'IBM Watson',
47-
'Natural Language Understanding',
48-
'watson_nlu'
49-
);
50-
5145
$this->nlu_features = [
5246
'category' => [
5347
'feature' => __( 'Category', 'classifai' ),

includes/Classifai/Services/Service.php

-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ public function get_display_name(): string {
135135
* Render the start of a settings page. The rest is added by the providers
136136
*/
137137
public function render_settings_page() {
138-
$active_tab = $this->provider_classes ? $this->provider_classes[0]->get_settings_section() : '';
139138
$active_tab = isset( $_GET['provider'] ) ? sanitize_text_field( wp_unslash( $_GET['provider'] ) ) : $active_tab; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
140139
$base_url = add_query_arg(
141140
array(

0 commit comments

Comments
 (0)