' . esc_html__( 'Enter the API endpoint URL for your AI service (e.g., https://api.openai.com/v1/chat/completions)', 'ai-summary-generator' ) . '
';
}
/**
* Callback for API token setting field.
*/
public static function api_token_callback() {
$value = get_option( 'ai_summary_generator_api_token', '' );
echo '';
echo '
' . esc_html__( 'Your API authentication token or key. Keep this secure and do not share it publicly.', 'ai-summary-generator' ) . '
';
}
/**
* Callback for model name setting field.
*/
public static function model_name_callback() {
$value = get_option( 'ai_summary_generator_model_name', '' );
echo '';
echo '
' . esc_html__( 'Specify the AI model to use (e.g., gpt-3.5-turbo, gpt-4, claude-3, etc.)', 'ai-summary-generator' ) . '
';
}
/**
* Callback for prompt setting field.
*/
public static function prompt_callback() {
$value = get_option( 'ai_summary_generator_prompt' );
$default_prompt = __( 'Your task is to generate an English summary of the article. Please generate a summary of 100 words or less based on the content of the following article, and output the summary directly. Only Plain Text is allowed.', 'ai-summary-generator' );
echo '';
echo ' ';
echo '
' . esc_html__( 'Custom system prompt for generating summaries. Click "Reset to Default" to restore the original prompt.', 'ai-summary-generator' ) . '
';
// Add JavaScript for the reset functionality.
echo '';
}
/**
* Callback for CSS classes information field.
*/
public static function css_classes_info_callback() {
echo '
' . sprintf(
/* translators: %1$s and %2$s are opening and closing tags, %3$s and %4$s are opening and closing tags for the first link, %5$s and %6$s are opening and closing tags for the second link */
esc_html__( 'You can customize the appearance of AI summaries by adding CSS in %1$sAppearance → Customize → Additional CSS%2$s (located at %3$s/wp-admin/customize.php%4$s) or if you use a block theme, please add it in %1$sAppearance → Editor%2$s (located at %5$s/wp-admin/site-editor.php%6$s).', 'ai-summary-generator' ),
'',
'',
'',
'',
'',
''
) . '
';
echo '
';
echo '
.ai-summary - ' . esc_html__( 'Main container for the AI summary', 'ai-summary-generator' ) . '
';
}
/**
* Callback for homepage override setting field.
*/
public static function homepage_override_callback() {
$value = get_option( 'ai_summary_generator_homepage_override', 'no' );
echo '';
echo '
' . sprintf(
/* translators: %1$s and %2$s are opening and closing tags, %3$s and %4$s are opening and closing tags */
esc_html__( 'Enable this to display AI summaries on your homepage instead of full post content. %1$sNote:%2$s This may not work with all themes as it depends on the theme calling %3$sget_the_excerpt()%4$s. If this doesn\'t work, use %3$sai_summary_generator_get_summary($post_id)%4$s function in your theme templates.', 'ai-summary-generator' ),
'',
'',
'',
''
) . '
';
}
/**
* Callback for update on post update setting field.
*/
public static function update_on_post_update_callback() {
$value = get_option( 'ai_summary_generator_update_on_post_update', 'no' );
echo '';
echo '
' . esc_html__( 'Automatically regenerate AI summary when a post is updated or modified.', 'ai-summary-generator' ) . '
';
}
/**
* Callback for max retries setting field.
*/
public static function max_retries_callback() {
$value = get_option( 'ai_summary_generator_max_retries', 3 );
echo '';
echo '
' . esc_html__( 'Number of retry attempts for failed API requests. Uses exponential backoff (1s, 2s, 4s, etc.)', 'ai-summary-generator' ) . '