The silver site taught me what fake numbers cost, so when the forex site needed its daily rates, I made a choice that sounds backwards for a developer, I built manual entry first and automation second. This post is that decision, the admin screen that made typing rates fast, and why the order was right.
The reasoning is the fake-prices lesson applied in advance. Currency sources are exactly the kind of pages that change layouts and break scrapers, and a forex site showing yesterday’s dollar rate as today’s, or a parser’s garbage, loses its only asset. A human typing rates from a source they checked is slower and always true. So the plugin’s first data feature was an admin entry screen, one row of inputs per currency, buying and selling, saving as appended history rows:
public function save_rates() {
if (!current_user_can('manage_options')) { wp_die('Not allowed'); }
check_admin_referer('pfr_save_rates');
global $wpdb;
foreach (pfr_currencies() as $code => $name) {
$buy = isset($_POST['buy'][$code]) ? floatval($_POST['buy'][$code]) : 0;
$sell = isset($_POST['sell'][$code]) ? floatval($_POST['sell'][$code]) : 0;
if ($buy <= 0 || $sell <= 0 || $sell < $buy) { continue; } // sanity gate
$wpdb->insert($wpdb->prefix . 'pfr_rates', array(
'currency' => $code,
'market_type' => sanitize_key($_POST['market']),
'buying' => $buy,
'selling' => $sell,
'recorded_at' => current_time('mysql', true),
));
}
}
Even hand-typed numbers pass a sanity gate, positive values, selling not below buying, because typos are just human scrapers failing. The screen pre-fills each field with the last saved value, so a daily update is edit-what-moved and save, two minutes for the full board. Auto-fetch came later as an assistant, not a replacement, fetched values fill the same form as suggestions the admin confirms, and everything still flows through the same save handler and sanity gate. The publish step stayed human, which is the whole design, automation proposes, a person approves, the site never shows a number nobody looked at.
A few things people ask me about this
Is manual entry not embarrassing for a developer? The visitor never sees how the number arrived, only whether it is right. A verified number entered by hand outranks an unverified automated one on the only metric that matters.
How do you make daily manual entry fast? Pre-fill every field with the last saved value so the admin edits only what moved, and keep one save for the whole board. The task drops to a couple of minutes.
Next
With trustworthy numbers flowing, the site needed to feel alive, a ticker, a converter, and a history chart. Building those three from the same table is the next post.
