time(), 'event' => $event, 'result' => sanitize_key($result)));
update_option('wplocation_activity_log', array_slice($rows, 0, 50), false);
}
/** wp-config.php wins over saved options. Saved keys are not encrypted at rest. */
function wplocation_maxmind_credentials() {
$account = defined('WPLOCATION_MAXMIND_ACCOUNT_ID') ? (string) WPLOCATION_MAXMIND_ACCOUNT_ID : (string) get_option('wplocation_maxmind_account_id', '');
$key = defined('WPLOCATION_MAXMIND_LICENSE_KEY') ? (string) WPLOCATION_MAXMIND_LICENSE_KEY : (string) get_option('wplocation_maxmind_license_key', '');
return array($account, $key);
}
function wplocation_render_activity_log() {
$rows = get_option('wplocation_activity_log', array());
if (!is_array($rows)) { $rows = array(); }
echo ' ' . esc_html__('SITE OPERATIONS', 'wplocation') . ' ' . esc_html__('Recent database, rule and setting changes on this site. Only the latest 50 events are kept. Visitor IP addresses, test addresses, account keys and file paths are never written to this log. An event shows an attempted update; check its result before assuming it succeeded.', 'wplocation') . ' ' . esc_html__('No activity recorded yet. New events will appear here.', 'wplocation') . '' . esc_html__('Activity log', 'wplocation') . '
| ' . esc_html__('Time', 'wplocation') . ' | ' . esc_html__('Event', 'wplocation') . ' | ' . esc_html__('Result', 'wplocation') . ' |
|---|---|---|
| ' . esc_html($time ? wp_date(get_option('date_format') . ' ' . get_option('time_format'), $time) : '—') . ' | ' . esc_html(isset($names[$event]) ? $names[$event] : $event) . ' | ' . esc_html(str_replace('_', ' ', $result)) . ' |