checkpoint: pre-audit baseline state
This commit is contained in:
@@ -48,10 +48,33 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
<div class="col-6 col-md-3">
|
||||
<div class="p-3 rounded bg-warning bg-opacity-10 text-center">
|
||||
<div class="fs-4 fw-bold text-warning" id="wpaw-stat-avg">$0.0000</div>
|
||||
<div class="text-muted small"><?php esc_html_e( 'Avg Per Post', 'wp-agentic-writer' ); ?></div>
|
||||
<div class="text-muted small d-flex justify-content-center align-items-center gap-1">
|
||||
<span><?php esc_html_e( 'Avg Per Post', 'wp-agentic-writer' ); ?></span>
|
||||
<span class="dashicons dashicons-info-outline" title="<?php esc_attr_e( 'All-time OpenRouter cost divided by total posts with OpenRouter usage.', 'wp-agentic-writer' ); ?>"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-sm table-hover mb-0" id="wpaw-action-summary-table">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th><?php esc_html_e( 'Action', 'wp-agentic-writer' ); ?></th>
|
||||
<th class="text-end"><?php esc_html_e( 'Calls', 'wp-agentic-writer' ); ?></th>
|
||||
<th class="text-end"><?php esc_html_e( 'Total Cost', 'wp-agentic-writer' ); ?></th>
|
||||
<th class="text-end"><?php esc_html_e( 'Avg / Call', 'wp-agentic-writer' ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="wpaw-action-summary-tbody">
|
||||
<tr>
|
||||
<td colspan="4" class="text-center text-muted py-3"><?php esc_html_e( 'Loading action summary...', 'wp-agentic-writer' ); ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -218,6 +218,18 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="form-check mt-3">
|
||||
<input class="form-check-input" type="checkbox" id="wpaw-allow-openrouter-fallback"
|
||||
name="wp_agentic_writer_settings[allow_openrouter_fallback]" value="1"
|
||||
<?php checked( ! empty( $allow_openrouter_fallback ) ); ?> />
|
||||
<label class="form-check-label" for="wpaw-allow-openrouter-fallback">
|
||||
<?php esc_html_e( 'Allow automatic fallback to OpenRouter when selected provider fails', 'wp-agentic-writer' ); ?>
|
||||
</label>
|
||||
<div class="form-text text-warning">
|
||||
<?php esc_html_e( 'Off by default to prevent unexpected OpenRouter charges.', 'wp-agentic-writer' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -119,6 +119,66 @@ if ( ! function_exists( 'wpaw_get_provider_badge' ) ) {
|
||||
<div class="card-body">
|
||||
<div id="wpaw-models-message" class="alert d-none mb-3"></div>
|
||||
|
||||
<div class="border rounded p-3 mb-4">
|
||||
<div class="d-flex align-items-start justify-content-between gap-3">
|
||||
<div>
|
||||
<h6 class="mb-1"><?php esc_html_e( 'OpenRouter Provider Routing', 'wp-agentic-writer' ); ?></h6>
|
||||
<p class="text-muted small mb-0"><?php esc_html_e( 'Optional. Use this to pin OpenRouter requests to a provider such as OpenAI, Anthropic, Google, or Z.ai when you manage BYOK/provider routing in OpenRouter.', 'wp-agentic-writer' ); ?></p>
|
||||
</div>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox"
|
||||
id="openrouter_provider_routing_enabled"
|
||||
name="wp_agentic_writer_settings[openrouter_provider_routing_enabled]"
|
||||
value="1"
|
||||
<?php checked( ! empty( $openrouter_provider_routing_enabled ) ); ?>>
|
||||
<label class="form-check-label small" for="openrouter_provider_routing_enabled">
|
||||
<?php esc_html_e( 'Enable', 'wp-agentic-writer' ); ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row g-3 mt-1">
|
||||
<div class="col-md-4">
|
||||
<label for="openrouter_provider_slug" class="form-label small fw-semibold">
|
||||
<?php esc_html_e( 'Provider slug', 'wp-agentic-writer' ); ?>
|
||||
</label>
|
||||
<input type="text"
|
||||
id="openrouter_provider_slug"
|
||||
name="wp_agentic_writer_settings[openrouter_provider_slug]"
|
||||
value="<?php echo esc_attr( $openrouter_provider_slug ?? 'auto' ); ?>"
|
||||
class="form-control form-control-sm"
|
||||
placeholder="openai">
|
||||
<div class="form-text"><?php esc_html_e( 'Examples: openai, anthropic, google, z-ai. Use OpenRouter provider slugs.', 'wp-agentic-writer' ); ?></div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-check mt-4">
|
||||
<input class="form-check-input" type="checkbox"
|
||||
id="openrouter_provider_only"
|
||||
name="wp_agentic_writer_settings[openrouter_provider_only]"
|
||||
value="1"
|
||||
<?php checked( ! empty( $openrouter_provider_only ) ); ?>>
|
||||
<label class="form-check-label" for="openrouter_provider_only">
|
||||
<?php esc_html_e( 'Only use this provider', 'wp-agentic-writer' ); ?>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-text"><?php esc_html_e( 'Prevents Azure or other providers when the slug is openai.', 'wp-agentic-writer' ); ?></div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-check mt-4">
|
||||
<input class="form-check-input" type="checkbox"
|
||||
id="openrouter_allow_provider_fallbacks"
|
||||
name="wp_agentic_writer_settings[openrouter_allow_provider_fallbacks]"
|
||||
value="1"
|
||||
<?php checked( ! empty( $openrouter_allow_provider_fallbacks ) ); ?>>
|
||||
<label class="form-check-label" for="openrouter_allow_provider_fallbacks">
|
||||
<?php esc_html_e( 'Allow fallback providers', 'wp-agentic-writer' ); ?>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-text"><?php esc_html_e( 'Leave off for BYOK-only behavior. Also enable Always use for this provider in OpenRouter.', 'wp-agentic-writer' ); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row g-4">
|
||||
<!-- Chat Model -->
|
||||
<div class="col-md-6">
|
||||
|
||||
Reference in New Issue
Block a user