Some checks are pending
build-gate / build (push) Waiting to run
Driver 2026-09-21: 'a folder called deployment which will store the capacitor
folder, wordpress folder and tauri folder', and 'a folder called documentation
to store the contributing folder so docs are in one place'.
docs/ + contributing/ + CONTRIBUTING.md -> documentation/ (three doc homes into
one). capacitor/ + wordpress/ + src-tauri/ -> deployment/.
The public/ -> dist/ rename the Driver asked about is NOT here: after seeing the
measured blast radius (855 tracked files, 54 source refs, and public/ is the
served web-root four consumers point at) the Driver withdrew it - 'keep the
public folder the same'.
Path references were rewritten mechanically (258 across 87 files), but three
classes needed hand fixes because a prefix regex cannot see them:
- join(ROOT,'docs',...) in 10 internal scripts - a quoted SEGMENT, not a prefix
- tauri frontendDist '../public' -> '../../public', since src-tauri is now one
level deeper; check:tauri caught this exactly as the card predicted
- the WordPress contract test's dirname(__DIR__,2) -> 3, same reason
Also reverted one over-reach: the rewrite renamed a FINDING-CATEGORY label
'docs' in public-hygiene-check.mjs, which is a rule name in its own header, not
a path.
Verified: full build ALL GUARDS PASS, SRI consistent; check:tauri, check:mobile
(cap sync + webDir OK), check:wp-embed, quoted-scripts, capability-citations,
capability-exemplars, library-index, public-hygiene, parse and drop all pass.
35 lines
2.5 KiB
PHP
35 lines
2.5 KiB
PHP
<?php
|
|
/**
|
|
* wp-stubs.php — the ~20 WordPress functions doxa-maps-embed actually calls, stubbed.
|
|
* Deliberately minimal and DUMB: each stub does the least thing that lets the real plugin run,
|
|
* so the test exercises THE PLUGIN rather than a re-implementation of WordPress.
|
|
* Enumerated by grepping the plugin for its wp_, add_, esc_, get_option and shortcode_atts calls.
|
|
*/
|
|
/**
|
|
* Minimal WordPress stub harness — renders the REAL doxa-maps-embed plugin with no WordPress.
|
|
* Proves deploy-method-4's deliverable: that the emitted markup matches the catalog manifest's
|
|
* embed.script contract (bundle src + SRI integrity + the custom element + profile-config).
|
|
*/
|
|
$SCRIPTS = []; $INLINE = []; $SHORTCODES = []; $FILTERS = [];
|
|
function add_action($h,$c,$p=10,$a=1){}
|
|
function add_filter($h,$c,$p=10,$a=1){ global $FILTERS; $FILTERS[$h][]=$c; }
|
|
function apply_filters($h,$v){ global $FILTERS; foreach(($FILTERS[$h]??[]) as $c){ $v=call_user_func_array($c, array_slice(func_get_args(),1)); } return $v; }
|
|
function add_shortcode($t,$c){ global $SHORTCODES; $SHORTCODES[$t]=$c; }
|
|
function do_shortcode_call($t,$a){ global $SHORTCODES; return call_user_func($SHORTCODES[$t],$a); }
|
|
function esc_attr($s){ return htmlspecialchars((string)$s, ENT_QUOTES); }
|
|
function esc_html($s){ return htmlspecialchars((string)$s, ENT_QUOTES); }
|
|
function esc_html__($s,$d=null){ return $s; }
|
|
function esc_url_raw($s){ return $s; }
|
|
function __($s,$d=null){ return $s; }
|
|
function get_option($k,$d=''){ return $d; }
|
|
function wp_json_encode($v,$f=0){ return json_encode($v,$f); }
|
|
function plugin_dir_path($f){ return dirname($f).'/'; }
|
|
function shortcode_atts($pairs,$atts,$sc=''){ $atts=(array)$atts; $out=[]; foreach($pairs as $n=>$d){ $out[$n]= array_key_exists($n,$atts)?$atts[$n]:$d; } return $out; }
|
|
function wp_register_script($h,$src,$deps=[],$ver=null,$args=[]){ global $SCRIPTS; $SCRIPTS[$h]=['src'=>$src]; }
|
|
function wp_enqueue_script($h,$src='',$deps=[],$ver=null,$args=[]){ global $SCRIPTS; if($src) $SCRIPTS[$h]=['src'=>$src]; }
|
|
function wp_script_add_data($h,$k,$v){ global $SCRIPTS; $SCRIPTS[$h][$k]=$v; }
|
|
function wp_add_inline_script($h,$code,$pos='after'){ global $INLINE; $INLINE[]=$code; }
|
|
function add_options_page(...$a){} function add_settings_error(...$a){} function add_settings_field(...$a){}
|
|
function add_settings_section(...$a){} function register_setting(...$a){} function register_block_type(...$a){}
|
|
function sanitize_text_field($s){ return $s; }
|
|
if(!defined('ABSPATH')) define('ABSPATH', __DIR__.'/');
|