PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.8
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.8
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
← All changes | config/settings/open-ai-admin.php +191 -134 4.3.84.4.8 View file →
@@ -1,134 +1,191 @@
1 -<?php
2 -return apply_filters(
3 - 'lp/settings/open-ai',
4 - array_merge(
5 - apply_filters(
6 - 'learn-press/course-settings-fields/single',
7 - [
8 - [
9 - 'title' => esc_html__( 'Open AI', 'learnpress' ),
10 - 'type' => 'title',
11 - ],
12 - [
13 - 'title' => esc_html__( 'Enable Open AI', 'learnpress' ),
14 - 'id' => 'enable_open_ai',
15 - 'default' => 'no',
16 - 'type' => 'checkbox',
17 - 'desc' => esc_html__( 'Enable this option and enter your OpenAI Secret key below to activate the feature.', 'learnpress' ),
18 - ],
19 - [
20 - 'title' => __( 'Secret key', 'learnpress' ),
21 - 'id' => 'open_ai_secret_key',
22 - 'default' => '',
23 - 'type' => 'textarea',
24 - 'desc' => sprintf(
25 - /* translators: 1. profile url */
26 - __(
27 - 'Get your Open AI secret key from <a href="%1$s" target="_blank">here</a>.
28 - Read more guide from <a href="%2$s" target="_blank">here</a>.',
29 - 'learnpress'
30 - ),
31 - 'https://platform.openai.com/account/api-keys',
32 - 'https://platform.openai.com/docs/quickstart'
33 - ),
34 - ],
35 - [
36 - 'title' => __( 'Text Model Type', 'learnpress' ),
37 - 'id' => 'open_ai_text_model_type',
38 - 'default' => 'gpt-4.1',
39 - 'type' => 'select',
40 - 'options' => array(
41 - 'gpt-5.2' => esc_html__( 'ChatGPT 5.2', 'learnpress' ),
42 - 'gpt-5' => esc_html__( 'ChatGPT 5', 'learnpress' ),
43 - 'gpt-5-mini' => esc_html__( 'ChatGPT 5 mini', 'learnpress' ),
44 - 'gpt-5-nano' => esc_html__( 'ChatGPT 5 nano', 'learnpress' ),
45 - 'gpt-4.1' => esc_html__( 'ChatGPT 4.1', 'learnpress' ),
46 - //'chatgpt-4o-latest' => esc_html__( 'ChatGPT 4o-Latest', 'learnpress' ),
47 - 'gpt-4o' => esc_html__( 'GPT 4o', 'learnpress' ),
48 - 'gpt-4o-mini' => esc_html__( 'GPT 4o Mini', 'learnpress' ),
49 - 'gpt-4' => esc_html__( 'GPT 4', 'learnpress' ),
50 - 'gpt-3.5-turbo' => esc_html__( 'GPT 3.5 Turbo', 'learnpress' ),
51 - 'gpt-3.5-turbo-instruct' => esc_html__( 'GPT 3.5 Turbo Instruct', 'learnpress' ),
52 - ),
53 - ],
54 - [
55 - 'title' => __( 'Image Model Type', 'learnpress' ),
56 - 'id' => 'open_ai_image_model_type',
57 - 'default' => 'gpt-image-1',
58 - 'type' => 'select',
59 - 'options' => array(
60 - 'gpt-image-1' => esc_html__( 'GPT image 1', 'learnpress' ),
61 - 'dall-e-3' => esc_html__( 'DALL E 3', 'learnpress' ),
62 - 'dall-e-2' => esc_html__( 'DALL E 2 ', 'learnpress' ),
63 - ),
64 - ],
65 - [
66 - 'title' => __( 'Frequency Penalty Level', 'learnpress' ),
67 - 'id' => 'open_ai_frequency_penalty_level',
68 - 'default' => '0.0',
69 - 'type' => 'select',
70 - 'options' => array(
71 - '-2.0' => esc_html__( 'Very High Repetition (-2.0)', 'learnpress' ),
72 - '-1.5' => esc_html__( 'High Repetition (-1.5)', 'learnpress' ),
73 - '-1.0' => esc_html__( 'Moderate Repetition (-1.0)', 'learnpress' ),
74 - '-0.5' => esc_html__( 'Low Repetition (-0.5)', 'learnpress' ),
75 - '0.0' => esc_html__( 'No Penalty (0.0)', 'learnpress' ),
76 - '0.5' => esc_html__( 'Low Penalty (0.5)', 'learnpress' ),
77 - '1.0' => esc_html__( 'Moderate Penalty (1.0)', 'learnpress' ),
78 - '1.5' => esc_html__( 'High Penalty (1.5)', 'learnpress' ),
79 - '2.0' => esc_html__( 'Very High Penalty (2.0)', 'learnpress' ),
80 - ),
81 - ],
82 - [
83 - 'title' => __( 'Presence Penalty Level', 'learnpress' ),
84 - 'id' => 'open_ai_presence_penalty_level',
85 - 'default' => '0.0',
86 - 'type' => 'select',
87 - 'options' => array(
88 - '-2.0' => esc_html__( 'Very High Repetition Allowed (-2.0)', 'learnpress' ),
89 - '-1.5' => esc_html__( 'High Repetition Allowed (-1.5)', 'learnpress' ),
90 - '-1.0' => esc_html__( 'Moderate Repetition Allowed (-1.0)', 'learnpress' ),
91 - '-0.5' => esc_html__( 'Low Repetition Allowed (-0.5)', 'learnpress' ),
92 - '0.0' => esc_html__( 'No Penalty (0.0)', 'learnpress' ),
93 - '0.5' => esc_html__( 'Low Penalty (0.5)', 'learnpress' ),
94 - '1.0' => esc_html__( 'Moderate Penalty (1.0)', 'learnpress' ),
95 - '1.5' => esc_html__( 'High Penalty (1.5)', 'learnpress' ),
96 - '2.0' => esc_html__( 'Very High Penalty (2.0)', 'learnpress' ),
97 - ),
98 - ],
99 - [
100 - 'title' => __( 'Creativity Level', 'learnpress' ),
101 - 'id' => 'open_ai_creativity_level',
102 - 'default' => '1.0',
103 - 'type' => 'select',
104 - 'options' => array(
105 - '0.0' => esc_html__( 'Very Low Creativity (0.0)', 'learnpress' ),
106 - '0.2' => esc_html__( 'Low Creativity (0.2)', 'learnpress' ),
107 - '0.3' => esc_html__( 'Low Creativity (0.3)', 'learnpress' ),
108 - '0.5' => esc_html__( 'Moderate Creativity (0.5)', 'learnpress' ),
109 - '0.7' => esc_html__( 'High Creativity (0.7)', 'learnpress' ),
110 - '0.8' => esc_html__( 'High Creativity (0.8)', 'learnpress' ),
111 - '1.0' => esc_html__( 'Very High Creativity (1.0)', 'learnpress' ),
112 - '1.1' => esc_html__( 'Extreme Creativity (1.1)', 'learnpress' ),
113 - '1.5' => esc_html__( 'Extreme Creativity (1.5)', 'learnpress' ),
114 - '2.0' => esc_html__( 'Maximum Creativity (2.0)', 'learnpress' ),
115 - ),
116 - ],
117 - [
118 - 'title' => __( 'Max Token', 'learnpress' ),
119 - 'id' => 'open_ai_max_token',
120 - 'default' => 4000,
121 - 'type' => 'number',
122 - 'desc' => esc_html__( 'Set 0 for no limit.', 'learnpress' ),
123 - 'custom_attributes' => array(
124 - 'min' => 0,
125 - 'step' => 1,
126 - ),
127 - ],
128 - [
129 - 'type' => 'sectionend',
130 - ],
131 - ]
132 - ),
133 - )
134 -);
1 +<?php
2 +return apply_filters(
3 + 'lp/settings/open-ai',
4 + array_merge(
5 + apply_filters(
6 + 'learn-press/course-settings-fields/single',
7 + [
8 + [
9 + 'title' => esc_html__( 'OpenAI', 'learnpress' ),
10 + 'type' => 'title',
11 + ],
12 + [
13 + 'title' => esc_html__( 'Enable OpenAI', 'learnpress' ),
14 + 'id' => 'enable_open_ai',
15 + 'default' => 'no',
16 + 'type' => 'checkbox',
17 + 'desc' => esc_html__( 'Enable this option and enter your OpenAI secret key below to activate this feature.', 'learnpress' ),
18 + ],
19 + [
20 + 'title' => __( 'Secret Key', 'learnpress' ),
21 + 'id' => 'open_ai_secret_key',
22 + 'default' => '',
23 + 'type' => 'textarea',
24 + 'desc' => sprintf(
25 + /* translators: 1. profile url */
26 + __(
27 + 'Get your OpenAI secret key <a href="%1$s" target="_blank" rel="noopener noreferrer">here</a>. Read the quickstart guide <a href="%2$s" target="_blank" rel="noopener noreferrer">here</a>.',
28 + 'learnpress'
29 + ),
30 + 'https://platform.openai.com/account/api-keys',
31 + 'https://platform.openai.com/docs/quickstart'
32 + ),
33 + ],
34 + [
35 + 'title' => __( 'Text Model', 'learnpress' ),
36 + 'id' => 'open_ai_text_model_type',
37 + 'default' => 'gpt-4.1',
38 + 'type' => 'select',
39 + 'options' => array(
40 + 'gpt-5.6' => esc_html__( 'GPT-5.6', 'learnpress' ),
41 + 'gpt-5.5' => esc_html__( 'GPT-5.5', 'learnpress' ),
42 + 'gpt-5.4' => esc_html__( 'GPT-5.4', 'learnpress' ),
43 + 'gpt-5.3' => esc_html__( 'GPT-5.3', 'learnpress' ),
44 + 'gpt-5.2' => esc_html__( 'GPT-5.2', 'learnpress' ),
45 + 'gpt-5.1' => esc_html__( 'GPT-5.1', 'learnpress' ),
46 + 'gpt-5' => esc_html__( 'GPT-5', 'learnpress' ),
47 + 'gpt-5-mini' => esc_html__( 'GPT-5 Mini', 'learnpress' ),
48 + 'gpt-5-nano' => esc_html__( 'GPT-5 Nano', 'learnpress' ),
49 + 'gpt-4.1' => esc_html__( 'GPT-4.1', 'learnpress' ),
50 + ),
51 + ],
52 + [
53 + 'title' => __( 'Image Model', 'learnpress' ),
54 + 'id' => 'open_ai_image_model_type',
55 + 'default' => 'gpt-image-1',
56 + 'type' => 'select',
57 + 'options' => array(
58 + 'gpt-image-1' => esc_html__( 'GPT Image 1', 'learnpress' ),
59 + 'gpt-image-2' => esc_html__( 'GPT Image 2', 'learnpress' ),
60 + ),
61 + ],
62 + [
63 + 'title' => __( 'Frequency Penalty', 'learnpress' ),
64 + 'id' => 'open_ai_frequency_penalty_level',
65 + 'default' => '0.0',
66 + 'type' => 'select',
67 + 'options' => array(
68 + '-2.0' => esc_html__( 'Very High Repetition (-2.0)', 'learnpress' ),
69 + '-1.5' => esc_html__( 'High Repetition (-1.5)', 'learnpress' ),
70 + '-1.0' => esc_html__( 'Moderate Repetition (-1.0)', 'learnpress' ),
71 + '-0.5' => esc_html__( 'Low Repetition (-0.5)', 'learnpress' ),
72 + '0.0' => esc_html__( 'No Penalty (0.0)', 'learnpress' ),
73 + '0.5' => esc_html__( 'Low Penalty (0.5)', 'learnpress' ),
74 + '1.0' => esc_html__( 'Moderate Penalty (1.0)', 'learnpress' ),
75 + '1.5' => esc_html__( 'High Penalty (1.5)', 'learnpress' ),
76 + '2.0' => esc_html__( 'Very High Penalty (2.0)', 'learnpress' ),
77 + ),
78 + ],
79 + [
80 + 'title' => __( 'Presence Penalty', 'learnpress' ),
81 + 'id' => 'open_ai_presence_penalty_level',
82 + 'default' => '0.0',
83 + 'type' => 'select',
84 + 'options' => array(
85 + '-2.0' => esc_html__( 'Very High Repetition Allowed (-2.0)', 'learnpress' ),
86 + '-1.5' => esc_html__( 'High Repetition Allowed (-1.5)', 'learnpress' ),
87 + '-1.0' => esc_html__( 'Moderate Repetition Allowed (-1.0)', 'learnpress' ),
88 + '-0.5' => esc_html__( 'Low Repetition Allowed (-0.5)', 'learnpress' ),
89 + '0.0' => esc_html__( 'No Penalty (0.0)', 'learnpress' ),
90 + '0.5' => esc_html__( 'Low Penalty (0.5)', 'learnpress' ),
91 + '1.0' => esc_html__( 'Moderate Penalty (1.0)', 'learnpress' ),
92 + '1.5' => esc_html__( 'High Penalty (1.5)', 'learnpress' ),
93 + '2.0' => esc_html__( 'Very High Penalty (2.0)', 'learnpress' ),
94 + ),
95 + ],
96 + [
97 + 'title' => __( 'Creativity Level', 'learnpress' ),
98 + 'id' => 'open_ai_creativity_level',
99 + 'default' => '1.0',
100 + 'type' => 'select',
101 + 'options' => array(
102 + '0.0' => esc_html__( 'Very Low Creativity (0.0)', 'learnpress' ),
103 + '0.2' => esc_html__( 'Low Creativity (0.2)', 'learnpress' ),
104 + '0.3' => esc_html__( 'Low Creativity (0.3)', 'learnpress' ),
105 + '0.5' => esc_html__( 'Moderate Creativity (0.5)', 'learnpress' ),
106 + '0.7' => esc_html__( 'High Creativity (0.7)', 'learnpress' ),
107 + '0.8' => esc_html__( 'High Creativity (0.8)', 'learnpress' ),
108 + '1.0' => esc_html__( 'Very High Creativity (1.0)', 'learnpress' ),
109 + '1.1' => esc_html__( 'Extreme Creativity (1.1)', 'learnpress' ),
110 + '1.5' => esc_html__( 'Extreme Creativity (1.5)', 'learnpress' ),
111 + '2.0' => esc_html__( 'Maximum Creativity (2.0)', 'learnpress' ),
112 + ),
113 + ],
114 + [
115 + 'title' => __( 'Max Tokens', 'learnpress' ),
116 + 'id' => 'open_ai_max_token',
117 + 'default' => 4000,
118 + 'type' => 'number',
119 + 'desc' => esc_html__( 'Set to 0 for no limit.', 'learnpress' ),
120 + 'custom_attributes' => array(
121 + 'min' => 0,
122 + 'step' => 1,
123 + ),
124 + ],
125 + [
126 + 'type' => 'sectionend',
127 + ],
128 + [
129 + 'title' => esc_html__( 'AI Assistant', 'learnpress' ),
130 + 'type' => 'title',
131 + ],
132 + [
133 + 'title' => esc_html__( 'Enable AI Assistant', 'learnpress' ),
134 + 'id' => 'ai_assistant_enabled',
135 + 'default' => 'no',
136 + 'type' => 'checkbox',
137 + 'desc' => esc_html__( 'Enable the AI Assistant for learners on lesson pages. Requires OpenAI to be enabled and a valid secret key.', 'learnpress' ),
138 + ],
139 + [
140 + 'title' => esc_html__( 'Enable Free Chat', 'learnpress' ),
141 + 'id' => 'ai_assistant_free_chat',
142 + 'default' => 'no',
143 + 'type' => 'checkbox',
144 + 'desc' => esc_html__( 'Allow learners to type free-form questions. When disabled, only quick action buttons are shown.', 'learnpress' ),
145 + ],
146 + [
147 + 'title' => esc_html__( 'Enable Summarize Lesson', 'learnpress' ),
148 + 'id' => 'ai_assistant_summarize_enabled',
149 + 'default' => 'yes',
150 + 'type' => 'checkbox',
151 + 'desc' => esc_html__( 'Allow learners to use the Summarize Lesson action.', 'learnpress' ),
152 + ],
153 + [
154 + 'title' => esc_html__( 'Enable Explain Concept', 'learnpress' ),
155 + 'id' => 'ai_assistant_explain_enabled',
156 + 'default' => 'yes',
157 + 'type' => 'checkbox',
158 + 'desc' => esc_html__( 'Allow learners to use the Explain Concept action.', 'learnpress' ),
159 + ],
160 + [
161 + 'title' => esc_html__( 'Enable Quick Quiz', 'learnpress' ),
162 + 'id' => 'ai_assistant_quick_quiz_enabled',
163 + 'default' => 'yes',
164 + 'type' => 'checkbox',
165 + 'desc' => esc_html__( 'Allow learners to start and continue quick quizzes.', 'learnpress' ),
166 + ],
167 + [
168 + 'title' => esc_html__( 'Enable Smart Review', 'learnpress' ),
169 + 'id' => 'ai_assistant_smart_review_enabled',
170 + 'default' => 'yes',
171 + 'type' => 'checkbox',
172 + 'desc' => esc_html__( 'Allow learners to use the Smart Review action.', 'learnpress' ),
173 + ],
174 + [
175 + 'title' => esc_html__( 'Max Usage Tokens Per Day', 'learnpress' ),
176 + 'id' => 'ai_assistant_max_usage_tokens_per_day',
177 + 'default' => 0,
178 + 'type' => 'number',
179 + 'desc' => esc_html__( 'Maximum total AI tokens each learner can use per day. Set to 0 for no limit.', 'learnpress' ),
180 + 'custom_attributes' => [
181 + 'min' => 0,
182 + 'step' => 1,
183 + ],
184 + ],
185 + [
186 + 'type' => 'sectionend',
187 + ],
188 + ]
189 + ),
190 + )
191 +);