These keys power the Intelligence panel with real, verified articles. Both are free with no credit card required.
Finnhub (financial markets & alternative investments): sign up at finnhub.io → your key appears on the dashboard immediately.
NewsData.io (leadership, voice & broader business news): sign up at newsdata.io → key appears in your account dashboard.
This snippet handles three things: routes ClickUp and Anthropic API calls through your server (avoiding CORS blocks), and stores your VERITAS data in WordPress so it syncs across all your devices — laptop, Mac, tablet, mobile.
Option A — WPCode (recommended): Install the free WPCode plugin → Code Snippets → Add New → paste the snippet below → set type to PHP Snippet → Activate.
Option B — functions.php: Appearance → Theme File Editor → functions.php → paste at the very end.
If you previously installed the old snippet, replace it entirely with this one.
/**
* VERITAS Dashboard — API Proxy + Cross-Device Data Sync
* v12 — replaces all previous versions of this snippet
* Compatible with PHP 5.4+ and all WordPress versions
* In WPCode: paste as-is. In functions.php: paste at the end.
*/
// ── API PROXY (ClickUp, Anthropic, Yahoo Finance, etc.) ──────────
add_action( 'wp_ajax_veritas_proxy', 'veritas_proxy_handler' );
add_action( 'wp_ajax_nopriv_veritas_proxy', 'veritas_proxy_handler' );
function veritas_proxy_handler() {
$raw = isset( $_POST['payload'] ) ? stripslashes( $_POST['payload'] ) : '{}';
$payload = json_decode( $raw, true );
if ( empty( $payload ) || ! isset( $payload['url'] ) ) {
wp_send_json_error( 'No URL provided' ); return;
}
$url = esc_url_raw( $payload['url'] );
$method = isset( $payload['method'] ) ? strtoupper( $payload['method'] ) : 'GET';
$headers = isset( $payload['headers'] ) ? $payload['headers'] : array();
$body = isset( $payload['body'] ) ? $payload['body'] : null;
$args = array( 'method' => $method, 'headers' => $headers, 'timeout' => 30, 'sslverify' => true );
if ( ! empty( $body ) ) { $args['body'] = $body; }
$response = wp_remote_request( $url, $args );
if ( is_wp_error( $response ) ) {
wp_send_json( array( 'error' => array( 'message' => $response->get_error_message() ) ) ); return;
}
$body_raw = wp_remote_retrieve_body( $response );
$decoded = json_decode( $body_raw, true );
if ( $decoded !== null ) { echo json_encode( $decoded ); } else { echo $body_raw; }
wp_die();
}
// ── DATA SYNC (cross-device storage) ─────────────────────────────
add_action( 'wp_ajax_veritas_sync_save', 'veritas_sync_save' );
add_action( 'wp_ajax_nopriv_veritas_sync_save', 'veritas_sync_save' );
function veritas_sync_save() {
$raw = isset( $_POST['payload'] ) ? stripslashes( $_POST['payload'] ) : '{}';
$data = json_decode( $raw, true );
if ( empty( $data ) || ! isset( $data['key'] ) || ! isset( $data['value'] ) ) {
wp_send_json_error( 'Invalid payload' ); return;
}
// Whitelist allowed keys — only VERITAS data, never WP internals
$allowed = array(
'captures','content_ideas','drafts','energy','energy_history',
'local_tasks','priority','priority_history','session_notes',
'task_history','task_state','tasks_cache','watchlist','watchlist_prices',
'wins','weekly_archive','airtable_key','airtable_base','airtable_table',
'clickup_token','clickup_team','clickup_list','anthropic_key',
'finnhub_key','newsdata_key','password','watchlist'
);
$key = sanitize_key( $data['key'] );
if ( ! in_array( $key, $allowed, true ) ) {
wp_send_json_error( 'Key not permitted' ); return;
}
$value = wp_json_encode( $data['value'] );
update_option( 'veritas_data_' . $key, $value, false );
wp_send_json_success( array( 'key' => $key, 'saved' => true ) );
}
add_action( 'wp_ajax_veritas_sync_load', 'veritas_sync_load' );
add_action( 'wp_ajax_nopriv_veritas_sync_load', 'veritas_sync_load' );
function veritas_sync_load() {
$raw = isset( $_POST['payload'] ) ? stripslashes( $_POST['payload'] ) : '{}';
$data = json_decode( $raw, true );
$key = isset( $data['key'] ) ? sanitize_key( $data['key'] ) : '';
if ( empty( $key ) ) {
// Load all keys at once
$all_keys = array(
'captures','content_ideas','drafts','energy','energy_history',
'local_tasks','priority','priority_history','session_notes',
'task_history','task_state','watchlist','wins','weekly_archive',
'airtable_key','airtable_base','airtable_table',
'clickup_token','clickup_team','clickup_list','anthropic_key',
'finnhub_key','newsdata_key','password','watchlist'
);
$result = array();
foreach ( $all_keys as $k ) {
$raw_val = get_option( 'veritas_data_' . $k, null );
if ( $raw_val !== null ) { $result[ $k ] = json_decode( $raw_val, true ); }
}
wp_send_json_success( $result );
return;
}
$raw_val = get_option( 'veritas_data_' . $key, null );
if ( $raw_val === null ) { wp_send_json_success( array( 'key' => $key, 'value' => null ) ); return; }
wp_send_json_success( array( 'key' => $key, 'value' => json_decode( $raw_val, true ) ) );
}
add_action( 'wp_ajax_veritas_sync_delete', 'veritas_sync_delete' );
add_action( 'wp_ajax_nopriv_veritas_sync_delete', 'veritas_sync_delete' );
function veritas_sync_delete() {
$raw = isset( $_POST['payload'] ) ? stripslashes( $_POST['payload'] ) : '{}';
$data = json_decode( $raw, true );
$key = isset( $data['key'] ) ? sanitize_key( $data['key'] ) : '';
if ( empty( $key ) ) { wp_send_json_error( 'No key' ); return; }
delete_option( 'veritas_data_' . $key );
wp_send_json_success( array( 'deleted' => $key ) );
}
Once the PHP snippet above is installed, VERITAS syncs your data to WordPress automatically — every change you make is written to the server within 2 seconds. On any new device, log in and your data pulls down immediately. No accounts, no third-party services.
Export a complete snapshot of all your VERITAS data as a JSON file. Use this as a backup, or to migrate to a new device manually if WP sync is not yet active.