---Ring
---Turn
---Ray
---AhDo
---AhGo
---AhSa
---AhTa
---SaOnDo
Mathorian Kagodora
šŸ”µ Wallet
Kagodora Updates

Kagodora Updates

May 12, 2026 | by | 0 comments

Development Journal – Ray 2044 – 2026-05-12

Issue Summary

The Kagodora KaDo time system exhibited two critical problems:

  1. Ring (AhReIEnGo) did not advance correctly
    • The plugin stored a manual ring value (ahreienqo) in the database, but the front‑page display computed the ring from ray using an incorrect starting point (ray 2009 = ring 1).
    • The correct timeline requires ring 6 to begin at ray 1801, with ray 2009 being the 208th ray of ring 6, and ring 7 starting at ray 2161.
  2. Front‑end time reset to a future value on refresh
    • The JavaScript used a staticĀ updatedĀ timestamp from the database that never changed after a ā€œSave Current Timeā€ operation.
    • Without updating the reference timestamp, each page refresh added the elapsed time since the original save, causing the displayed time to jump ahead of real time.

Root Causes

Remedies Applied

1. Corrected Ring Calculation

In PHP (helper function):

phpCopyDownload

function mathorian_kagodora_compute_ring($ray) {
    return 6 + floor(($ray - 1801) / 360);
}

In JavaScript (mirrored logic):

javascriptCopyDownload

function computeRing(ray) {
    let ring = 6 + Math.floor((ray - 1801) / 360);
    return ring < 1 ? 1 : ring;
}

Now ray 1801 → ring 6, ray 2161 → ring 7, etc.

2. Unified Ring Source

3. Fixed Timestamp Drift

In the AJAX save handler (PHP):

phpCopyDownload

$wpdb->update($table, compact('ahta','ahsa','ahgo','ahdo','ray','ahreienqo'), ['id'=>1]);
$wpdb->update($table, ['updated' => current_time('mysql')], ['id' => 1]);

In JavaScript (saveCurrentTime function):

javascriptCopyDownload

fetch(ajaxUrl, { method: 'POST', body: params })
    .then(res => {
        if (res.ok) {
            state.timestamp = Date.now() / 1000; // reset local reference
        }
    });

Now every ā€œSave Current Timeā€ operation updates both the database updated column and the JavaScript state.timestamp, so the elapsed time calculation starts fresh from that moment.

Outcome

Next Steps

Leave a Reply

Your email address will not be published. Required fields are marked *