ENGINEERING / SELECTED SYSTEMS

The thinking
behind the build.

Architecture, interfaces and decisions from projects I designed and developed — with real excerpts from the code, and a plain note on what each one does and doesn’t prove.

  • Three systems
  • Seven real code excerpts
OUTPUTA working product

Three kinds of work meet in every build. Choose one to see where it’s explained.

I / DATA — EVAGARAGE MIGRATION ENGINE

A migration that can stop and pick up where it left off.

Evagarage needed an existing OpenCart catalogue moved into WooCommerce — products, vehicle fitments, configurable options and their prices. I wrote the importer as my own WordPress plugin.

THE PROBLEM
An OpenCart database export with products, descriptions, option values, price adjustments, fitments and images spread across many tables — around two thousand products, far too many to convert in a single request.
CONSTRAINTS
A PHP request can time out, a browser can resend a request, and two tabs can run at once. The source is an export file read as text, not a live database.
THE APPROACH
Stream the dump through a tuple parser, process one product per request from a server-side queue, prepare the next 25 products in one pass, then import, map, audit media and checkpoint.
THE RESULT
In one documented run, 2,039 products were imported with no product failures. The admin screens from that run list 70 brands, 822 models and 249 normalised option values.
HONEST LIMITS
A successful product import didn’t mean every image existed: some historical gallery references were missing at the source, so the plugin reports them rather than hiding them. The mapping is written for this store’s option structure, it isn’t a general-purpose migrator, and the new storefront isn’t launched yet.
ONE RECORD, SIX STATES
01 / READ

The OpenCart export is read line by line; only the tables the importer asks for are parsed, with a quote- and escape-aware tuple parser. Nothing in the file is executed.

IN THE CODEscan() · parse_tuples()

THE RECORDINSERT INTO `oc_product` VALUES (1001,'SAMPLE-1001',…)

02 / QUEUE

Active products are listed into a queue. Progress is a cursor the server owns — not something the browser has to remember.

IN THE CODEindex_catalog()

THE RECORDqueue[412] → legacy_id 1001

03 / CACHE

One pass over the dump gathers the rows for the next 25 products. Each product becomes a small JSON file in a folder tied to that exact export.

IN THE CODEbuild_product_cache_chunk()

THE RECORD1001.json { product, options, fitments, images }

04 / TRANSLATE

The product is saved as a draft. Option values are matched to normalised groups, OpenCart’s price prefixes become signed adjustments, and fitments and option rules are rebuilt instead of appended.

IN THE CODEimport_product() · map()

THE RECORDlegacy 1001 → draft product · options mapped

05 / MEDIA

Images are fetched and attached. Failures are remembered and classified, and references that no longer exist at the source are reported instead of silently dropped.

IN THE CODEimport_product_media()

THE RECORDimages attached · missing references reported

06 / CHECKPOINT

The cursor advances and state is saved after each product. A replayed request is ignored, a lock keeps one worker active, and finished products are skipped on a re-run.

IN THE CODEprocess_bulk_one()

THE RECORDcursor 412 → 413 · state saved

One product per request, checkpointedEvagarage plugin · includes/class-eva-importer.php · excerpt of lines 392–483
$total = count($catalog);$cursor = min(max(0, (int)($state['cursor'] ?? 0)), $total); if ($expected_cursor !== null && (int)$expected_cursor !== $cursor) {    return [        'done' => ($cursor >= $total),        'stale' => true,        'state' => $state,        'legacy_id' => 0,        'message' => 'Stale/replayed request ignored; current cursor is '.$cursor.'.',    ];}// …// One SQL scan prepares the next 25 products, then individual imports use tiny JSON files.$cache_stats = self::ensure_bulk_cache_window($path, $cursor, 25);// …if (!$legacy_id) {    $state['skipped'] = (int)($state['skipped'] ?? 0) + 1;    $message = 'Skipped invalid queue row.';} elseif (self::bulk_product_already_complete($legacy_id, $path)) {    $state['skipped'] = (int)($state['skipped'] ?? 0) + 1;    $ok = true;    $message = 'Already fully imported from this SQL version; advanced without reprocessing.';    self::bulk_log('info', $legacy_id, $message);// …// Critical: advance/save after EACH product, before returning to browser.$cursor++;$state['cursor'] = $cursor;$state['last_message'] = $message;$state['completed'] = ($cursor >= $total);self::save_bulk_state($state);

WHAT IT SHOWSThe server keeps the queue cursor. A request whose expected cursor doesn’t match is ignored rather than processed, products already completed from the same source file are skipped, and the advanced cursor is saved before the response goes back to the browser.

WHAT IT DOESN’T PROVEThe whole import is not one database transaction: if a later step fails for a product, the draft created earlier stays and the failure is logged and counted.

Show implementation detailCaching keyed to the source file
Cache keyed to the source fileEvagarage plugin · includes/class-eva-importer.php · excerpt of lines 67–104
private static function sql_fingerprint($path) {    $real = wp_normalize_path((string)realpath($path));    $size = @filesize($path);    $mtime = @filemtime($path);    return md5($real.'|'.$size.'|'.$mtime);}// …private static function write_product_cache($path, $legacy_id, $data) {    $file = self::cache_file($path, $legacy_id);    $json = wp_json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);    if ($json === false) return false;     $tmp = $file.'.tmp-'.wp_generate_password(8, false, false);    if (file_put_contents($tmp, $json, LOCK_EX) === false) return false;    $ok = @rename($tmp, $file);    if (!$ok) @unlink($tmp);    return $ok;}

WHAT IT SHOWSCached rows live in a folder named after a fingerprint of the export (real path, size, modification time), so a new dump never reuses old rows. Each product’s JSON is written to a uniquely named temporary file and then renamed into place; if the rename fails, the temporary file is removed.

WHAT IT DOESN’T PROVETemp-and-rename avoids half-written cache files in typical same-filesystem setups. It isn’t a guarantee of atomicity on every filesystem.

View the Evagarage case study ↗

II / INTERFACE — OSTAP.WORK

Motion that serves the reading.

This website is my own project, designed and coded by me — from the type system to the page transitions. The rule I set myself: animation must never cost legibility or access.

THE PROBLEM
Headlines animate word by word, which means wrapping each word in extra elements. Done carelessly, a heading is announced as fragments, or its line breaks fall apart on a phone.
CONSTRAINTS
Inline serif emphasis and line breaks must survive; links inside text stay untouched; visitors can switch motion off, and the system’s reduced-motion setting is respected unless they turn motion back on.
THE APPROACH
Split text into masked words with GSAP SplitText, rebuild the readable sentence from the original text — as a label on headings, as one hidden copy on paragraphs — and run every effect inside one GSAP context that is reverted and rebuilt when the motion preference changes.
THE RESULT
The same markup reads the same with motion on or off. Page changes use the browser’s native View Transitions where available, a GSAP curtain where not, and neither when motion is off.
HONEST LIMITS
Earlier, animated paragraphs carried a label that screen readers don’t reliably announce; they now use a visually hidden copy instead. I’ve verified the result in the browser’s accessibility tree, not yet with every screen reader — and none of this is a certified accessibility audit.
TRY IT

Every word arrives in order.

WHAT A SCREEN READER GETS
“Every word arrives in order.”
WORD MASKS
—
MOTION
Static text
Word masks that keep the sentence readableostap.work theme · js/animations.js · lines 29–48
function prepare(){ if(prepared)return;prepared=true; document.querySelectorAll('main h1, main h2, main h3, .manifesto-large, .intro-copy, .hero-statement .line>span').forEach(el=>{  if(el.closest('.service-slide,.slider-heading,.project-caption,.simulation,.process-step')||el.querySelector('a,button'))return;  // Word masks preserve natural wrapping and inline serif emphasis at every width.  const readable=el.cloneNode(true);readable.querySelectorAll('br').forEach(br=>br.replaceWith(' '));  const label=readable.textContent.replace(/\s+/g,' ').trim();  // Headings keep SplitText's label. Paragraphs and spans can't carry a dependable aria-label,  // so assistive technology reads one hidden copy and the animated words are visual only.  const heading=/^H[1-6]$/.test(el.tagName);let target=el;  if(!heading){   const visual=document.createElement('span');visual.className='motion-visual';visual.setAttribute('aria-hidden','true');   visual.append(...el.childNodes);   const copy=document.createElement('span');copy.className='motion-copy';copy.textContent=label;   el.append(copy,visual);target=visual;  }  const split=SplitText.create(target,{type:'words',mask:'words',wordsClass:'motion-word',aria:heading?'auto':'none',autoSplit:true});  if(heading)el.setAttribute('aria-label',label);  el.classList.add('motion-text');texts.push({el,words:split.words}); });

WHAT IT SHOWSHeadlines and statement paragraphs are selected; anything containing a link or button is left alone. The readable sentence is rebuilt from the original text first. Headings keep it as their label, while paragraphs get one visually hidden copy and their animated words are hidden from assistive technology — so each sentence is read once, in order.

WHAT IT DOESN’T PROVEChecked in Chromium’s accessibility tree with motion on and off; not yet with NVDA or VoiceOver, and it isn’t a certified accessibility audit.

Show implementation detailMotion preference and page transitions
One motion preference, rebuilt not stackedostap.work theme · js/animations.js · excerpt of lines 1–63
const reduced = window.matchMedia('(prefers-reduced-motion: reduce)');let motionPreference = null;try { motionPreference = localStorage.getItem('og-motion'); } catch {}export const motionAllowed = () => motionPreference === 'on' || (motionPreference !== 'off' && !reduced.matches);// …export function setMotion(enabled) { motionPreference=enabled?'on':'off';try{localStorage.setItem('og-motion',motionPreference);}catch{} syncMotion();document.dispatchEvent(new Event('motionchange'));} // … function rebuild(initial=false){  if(context){context.revert();context=null;}  document.documentElement.classList.remove('motion-preparing');  if(!motionAllowed())return;  context=gsap.context(()=>{

WHAT IT SHOWSThe visitor’s choice (stored locally) wins; otherwise the operating system’s reduced-motion setting decides. Changing it dispatches one event, and the animation context is reverted before anything is rebuilt.

Native page transitions firstostap.work theme · js/transitions.js · excerpt of lines 4–8
const nativeTransitions='onpageswap' in window&&'onpagereveal' in window;// …window.addEventListener('pageswap',event=>{if(!motionAllowed())event.viewTransition?.skipTransition();});window.addEventListener('pagereveal',event=>{if(!motionAllowed())event.viewTransition?.skipTransition();});

WHAT IT SHOWSWhere the browser supports cross-document View Transitions, it handles the page change natively; when motion is off, the transition is skipped on both the outgoing and the incoming page.

See it across the homepage ↗

III / LOGIC — PROFICLEAN

Prices a customer can follow, rules a business can keep.

ProfiClean is a cleaning company in Ternopil. Its owner, Olexandr, wanted a site that would do real work: estimate a price, collect enquiries and show completed jobs. I designed and built it as an original WordPress theme.

THE PROBLEM
An estimate has to be useful without becoming a promise. Every service has its own rate and minimum order, add-ons can be combined, and someone may order add-ons alone.
CONSTRAINTS
The same calculation appears in two places — the homepage and the prices page. Enquiries arrive as a name and a phone number, typed in many different formats.
THE APPROACH
Keep rates and minimums in one table, turn inputs into numbers in two small functions, and let each interface only format the result. On the server, verify a nonce, sanitise every field, normalise Ukrainian phone numbers and redirect with an explicit state.
THE RESULT
The estimate follows the same rules wherever it appears, and an enquiry is only sent when it contains a usable phone number.
HONEST LIMITS
The two interface functions still repeat the final total rule, and the lead form has no honeypot or rate limiting yet. Both are the next things I’d change.
THE PRICING RULES, WITH SAMPLE NUMBERS
SERVICE
ADD-ONS
  1. Quantity × rate200
  2. Raised to the service minimum300
  3. Add-ons0
  4. Add-ons alone: minimum 150—

ESTIMATE300

Rates, minimums and one total ruleProfiClean theme · assets/js/calculator.js · excerpt of lines 12–46
const EXTRAS_MIN = /* redacted */; // when ordering extras only function calcBase($ctx){  const type = $ctx.find("#type").val();  const qty  = parseFloat($ctx.find("#area").val()) || 0;  if(!SERVICES[type]) return 0;  if(qty <= 0) return 0; // no base if no quantity entered  let {rate, min} = SERVICES[type];  let base = qty * rate;  if (type === 'sofa') base = qty * /* redacted */;  if (base < min) base = min;  return base;}// …function updateInline(){  // …  const base   = calcBase($wrap);  const extras = calcExtras($wrap);  let total = 0;  if (base>0) total = base + extras;  else total = extras>0 ? Math.max(extras, EXTRAS_MIN) : 0;  $wrap.find("#total").text(total ? Math.round(total) : "—");}

WHAT IT SHOWSA quantity is multiplied by the service rate and raised to the service minimum; add-ons are calculated separately; an order of add-ons alone has its own minimum. The interface function only reads inputs and prints the result.

WHAT IT DOESN’T PROVEThe prices page has a second update function that repeats the same total rule — the next refactor is one shared function.

Show implementation detailThe lead handler
A lead is only sent with a usable phone numberProfiClean theme · functions.php · excerpt of lines 92–148
function pc_handle_lead(){  if ( ! isset($_POST['pc_lead_nonce']) || ! wp_verify_nonce($_POST['pc_lead_nonce'], 'pc_lead') ){    wp_die('Invalid request', 'Error', array('response'=>403));  }  $name    = isset($_POST['name'])    ? sanitize_text_field($_POST['name'])        : '';  $phone   = isset($_POST['phone'])   ? pc_normalize_phone($_POST['phone'])       : '';  $email   = isset($_POST['email'])   ? sanitize_email($_POST['email'])            : '';  $service = isset($_POST['service']) ? sanitize_text_field($_POST['service'])     : '';  $message_field = isset($_POST['message']) ? sanitize_textarea_field($_POST['message']) : '';  // …  $digits = preg_replace('/[^0-9]/', '', (string)$phone);  if (strlen($digits) < 9){    $redirect = wp_get_referer() ? wp_get_referer() : home_url('/');    $redirect = add_query_arg(array('sent'=>'0','error'=>'phone'), $redirect);    wp_safe_redirect($redirect);    exit;  }  // …  $mail_ok = wp_mail($to, $subject, $message, $headers);   $redirect = wp_get_referer() ? wp_get_referer() : home_url('/');  if ($mail_ok){    $redirect = add_query_arg('sent', '1', $redirect);  } else {    $redirect = add_query_arg(array('sent'=>'0','error'=>'mail'), $redirect);  }  wp_safe_redirect($redirect);  exit;

WHAT IT SHOWSThe handler verifies a WordPress nonce, sanitises each field by type, rejects an enquiry without a usable phone number, and redirects back with an explicit success or error state depending on whether the email was accepted for sending.

WHAT IT DOESN’T PROVEA nonce is not spam protection, and sanitising input is not a full security review. This version has no honeypot or rate limiting.

View the ProfiClean case study ↗

ALSO

EvaDrives — backend work inside an existing store.

Product options and payment-related logic in an OpenCart store I didn’t design. It’s a different kind of evidence: reading an unfamiliar codebase and changing it carefully.

View the EvaDrives case study ↗
HOW I WORK WITH CODE

Ownership, with room for review.

Have a build that needs this kind of attention?

Start a conversation Working with agencies ↗