Memory Wiki

Untitled Session

2026-05-24 01:51 UTC · 65 messages · cli

You2026-05-24 01:52 UTC
TA technical audit — read key files, produce detailed Bespoke specs with replacement estimates
Donna2026-05-24 01:52 UTC
I'll start by reading all the key technical files systematically. Let me kick off the analysis.
Tool2026-05-24 01:52 UTC
{"content": " 1|<?php\n 2|/**\n 3| * WordPress database access abstraction class.\n 4| *\n 5| * Original code from {@link http://php.justinvincent.com Justin Vincent (justin@visunet.ie)}\n 6| *\n 7| * @package WordPress\n 8| * @subpackage Database\n 9| * @since 0....
Tool2026-05-24 01:52 UTC
{"content": " 1|<?php\n 2|/**\n 3| * Rewrite API: WP_Rewrite class\n 4| *\n 5| * @package WordPress\n 6| * @subpackage Rewrite\n 7| * @since 1.5.0\n 8| */\n 9|\n 10|/**\n 11| * Core class used to implement a rewrite component API.\n 12| *\n 13| * The W...
Tool2026-05-24 01:52 UTC
{"content": " 1|<?php\n 2|/**\n 3| * REST API functions.\n 4| *\n 5| * @package WordPress\n 6| * @subpackage REST_API\n 7| * @since 4.4.0\n 8| */\n 9|\n 10|/**\n 11| * Version number for our API.\n 12| *\n 13| * @var string\n 14| */\n 15|define( ...
Tool2026-05-24 01:52 UTC
{"content": " 1|<?php\n 2|/**\n 3| * These functions can be replaced via plugins. If plugins do not redefine these\n 4| * functions, then these will be used instead.\n 5| *\n 6| * @package WordPress\n 7| */\n 8|\n 9|if ( ! function_exists( 'wp_set_current_user' ) ...
Tool2026-05-24 01:52 UTC
{"content": " 1|<?php\n 2|/**\n 3| * WordPress scripts and styles default loader.\n 4| *\n 5| * Several constants are used to manage the loading, concatenating and compression of scripts and CSS:\n 6| * define('SCRIPT_DEBUG', true); loads the development (non-minified) versio...
Tool2026-05-24 01:52 UTC
{"content": " 1|<?php\n 2|/**\n 3| * Functions related to registering and parsing blocks.\n 4| *\n 5| * @package WordPress\n 6| * @subpackage Blocks\n 7| * @since 5.0.0\n 8| */\n 9|\n 10|/**\n 11| * Removes the block asset's path prefix if provided.\n 12|...
Tool2026-05-24 01:52 UTC
{"content": " 1|<?php\n 2|/**\n 3| * Deprecated functions from past WordPress versions. You shouldn't use these\n 4| * functions and look for the alternatives instead. The functions will be\n 5| * removed in a later version.\n 6| *\n 7| * @package WordPress\n 8| * @su...
Donna2026-05-24 01:52 UTC
Let me dig deeper into the remaining sections and the REST API endpoints directory.
Tool2026-05-24 01:52 UTC
{"content": " 201|\n 202|\t/**\n 203|\t * Log of queries that were executed, for debugging purposes.\n 204|\t *\n 205|\t * @since 1.5.0\n 206|\t * @since 2.5.0 The third element in each query log was added to record the calling functions.\n 207|\t * @since 5.1.0 The fourth element in e...
Tool2026-05-24 01:52 UTC
{"content": " 401|\t * @since 1.5.0\n 402|\t *\n 403|\t * @var string\n 404|\t */\n 405|\tpublic $posts;\n 406|\n 407|\t/**\n 408|\t * WordPress Terms table.\n 409|\t *\n 410|\t * @since 2.3.0\n 411|\t *\n 412|\t * @var string\n 413|\t */\n 414|\tpublic $terms;\n 415|\n...
Tool2026-05-24 01:52 UTC
{"content": " 601|\t *\n 602|\t * Possible values:\n 603|\t *\n 604|\t * - `mysqli` instance during normal operation\n 605|\t * - `null` if the connection is yet to be made or has been closed\n 606|\t * - `false` if the connection has failed\n 607|\t *\n 608|\t * @since 0.71\n 609|...
Tool2026-05-24 01:52 UTC
{"total_count": 1, "files": ["/var/www/basis-wordpress/wp-core/wp-includes/class-wpdb.php"]}
Donna2026-05-24 01:52 UTC
Let me read the critical methods in wpdb and scan the REST endpoints and pluggable files.
Tool2026-05-24 01:52 UTC
{"content": " 801|\t\t\t'col_meta',\n 802|\t\t\t'table_charset',\n 803|\t\t\t'check_current_query',\n 804|\t\t\t'allow_unsafe_unquoted_parameters',\n 805|\t\t);\n 806|\t\tif ( in_array( $name, $protected_members, true ) ) {\n 807|\t\t\treturn;\n 808|\t\t}\n 809|\t\t$this->$name = $...
Tool2026-05-24 01:52 UTC
{"content": " 1001|\t\t\treturn new WP_Error( 'invalid_db_prefix', 'Invalid database prefix' );\n 1002|\t\t}\n 1003|\n 1004|\t\t$old_prefix = is_multisite() ? '' : $prefix;\n 1005|\n 1006|\t\tif ( isset( $this->base_prefix ) ) {\n 1007|\t\t\t$old_prefix = $this->base_prefix;\n 1008|\t\t}\n ...
Tool2026-05-24 01:52 UTC
{"content": " 1201|\t\t\tif ( ! did_action( 'template_redirect' ) ) {\n 1202|\t\t\t\twp_load_translations_early();\n 1203|\n 1204|\t\t\t\t$message = '<h1>' . __( 'Cannot select database' ) . \"</h1>\\n\";\n 1205|\n 1206|\t\t\t\t$message .= '<p>' . sprintf(\n 1207|\t\t\t\t\t/* translators: %s:...
Tool2026-05-24 01:52 UTC
{"total_count": 45, "files": ["/var/www/basis-wordpress/wp-core/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php", "/var/www/basis-wordpress/wp-core/wp-includes/rest-api/endpoints/class-wp-rest-navigation-fallback-controller.php", "/var/www/basis-wordpress/wp-core/wp-include...
Tool2026-05-24 01:52 UTC
{"content": " 101|\tfunction get_user_by( $field, $value ) {\n 102|\t\t$userdata = WP_User::get_data_by( $field, $value );\n 103|\n 104|\t\tif ( ! $userdata ) {\n 105|\t\t\treturn false;\n 106|\t\t}\n 107|\n 108|\t\t$user = new WP_User();\n 109|\t\t$user->init( $userdata );\n 110...
Donna2026-05-24 01:52 UTC
Now let me read the core wpdb methods (query, prepare, get_results, insert/update/delete) and the rewrite system core:
Tool2026-05-24 01:52 UTC
{"content": " 1401|\t * - `%s` (string)\n 1402|\t * - `%i` (identifier, e.g. table/field names)\n 1403|\t *\n 1404|\t * All placeholders MUST be left unquoted in the query string. A corresponding argument\n 1405|\t * MUST be passed for each placeholder.\n 1406|\t *\n 1407|\t * Note: There is ...
Tool2026-05-24 01:52 UTC
{"content": " 1601|\t\t\t\t\t */\n 1602|\t\t\t\t\tif ( true !== $this->allow_unsafe_unquoted_parameters\n 1603|\t\t\t\t\t\t/*\n 1604|\t\t\t\t\t\t * Note: str_ends_with() is not used here, as this file can be included\n 1605|\t\t\t\t\t\t * directly outside of WordPress core, e.g. by HyperDB, in ...
Tool2026-05-24 01:52 UTC
{"content": " 1801|\n 1802|\t\tif ( ! $str ) {\n 1803|\t\t\t$str = mysqli_error( $this->dbh );\n 1804|\t\t}\n 1805|\n 1806|\t\t$EZSQL_ERROR[] = array(\n 1807|\t\t\t'query' => $this->last_query,\n 1808|\t\t\t'error_str' => $str,\n 1809|\t\t);\n 1810|\n 1811|\t\tif ( $this->suppress_err...
Tool2026-05-24 01:52 UTC
{"content": " 2001|\t\t\t// Load custom DB error template, if present.\n 2002|\t\t\tif ( file_exists( WP_CONTENT_DIR . '/db-error.php' ) ) {\n 2003|\t\t\t\trequire_once WP_CONTENT_DIR . '/db-error.php';\n 2004|\t\t\t\tdie();\n 2005|\t\t\t}\n 2006|\n 2007|\t\t\t$message = '<h1>' . __( 'Error e...
Tool2026-05-24 01:52 UTC
{"content": " 151|\tpublic $front;\n 152|\n 153|\t/**\n 154|\t * The prefix for all permalink structures.\n 155|\t *\n 156|\t * If PATHINFO/index permalinks are in use then the root is the value of\n 157|\t * `WP_Rewrite::$index` with a trailing slash appended. Otherwise the root\n 1...
Donna2026-05-24 01:52 UTC
Let me read the critical wpdb::query method and the insert/update/delete, plus the rest of pluggable and the tail of deprecated.php:
Tool2026-05-24 01:52 UTC
{"content": " 2201|\t *\n 2202|\t * More information can be found on the documentation page.\n 2203|\t *\n 2204|\t * @since 0.71\n 2205|\t *\n 2206|\t * @link https://developer.wordpress.org/reference/classes/wpdb/\n 2207|\t *\n 2208|\t * @param string $query Database query.\n 2209|\t * @re...
Tool2026-05-24 01:52 UTC
{"content": " 2401|\t\t);\n 2402|\t}\n 2403|\n 2404|\t/**\n 2405|\t * Generates and returns a placeholder escape string for use in queries returned by ::prepare().\n 2406|\t *\n 2407|\t * @since 4.8.3\n 2408|\t *\n 2409|\t * @return string String to escape placeholders.\n 2410|\t */\n 241...
Tool2026-05-24 01:52 UTC
{"content": " 2601|\t\t\t\tcontinue;\n 2602|\t\t\t}\n 2603|\n 2604|\t\t\t$formats[] = $value['format'];\n 2605|\t\t\t$values[] = $value['value'];\n 2606|\t\t}\n 2607|\n 2608|\t\t$fields = '`' . implode( '`, `', array_keys( $data ) ) . '`';\n 2609|\t\t$formats = implode( ', ', $formats );\...
Tool2026-05-24 01:52 UTC
{"content": " 301|\t\t\t\t * both string headers and an array of headers.\n 302|\t\t\t\t */\n 303|\t\t\t\t$tempheaders = explode( \"\\n\", str_replace( \"\\r\\n\", \"\\n\", $headers ) );\n 304|\t\t\t} else {\n 305|\t\t\t\t$tempheaders = $headers;\n 306|\t\t\t}\n 307|\t\t\t$headers = ar...
Tool2026-05-24 01:52 UTC
{"content": " 500|\t\t\t\t}\n 501|\t\t\t}\n 502|\t\t}\n 503|\n 504|\t\t// Set to use PHP's mail().\n 505|\t\t$phpmailer->isMail();\n 506|\n 507|\t\t// Set Content-Type and charset.\n 508|\n 509|\t\t// If we don't have a Content-Type from the input headers.\n 510|\t\tif ( ! isse...
Donna2026-05-24 01:52 UTC
Let me read more critical sections: pluggable function list, deprecated.php tail, REST API classes, and block directories:
Tool2026-05-24 01:52 UTC
{"total_count": 38, "counts": {"/var/www/basis-wordpress/wp-core/wp-includes/pluggable.php": 38}}
Tool2026-05-24 01:52 UTC
{"total_count": 0}
Tool2026-05-24 01:52 UTC
{"content": " 6400|function wp_create_block_style_variation_instance_name( $block, $variation ) {\n 6401|\t_deprecated_function( __FUNCTION__, '6.7.0', 'wp_unique_id' );\n 6402|\treturn $variation . '--' . md5( serialize( $block ) );\n 6403|}\n 6404|\n 6405|/**\n 6406| * Returns whether the c...
Tool2026-05-24 01:52 UTC
{"total_count": 242, "counts": {"/var/www/basis-wordpress/wp-core/wp-includes/deprecated.php": 242}}
Tool2026-05-24 01:52 UTC
{"total_count": 50, "files": ["/var/www/basis-wordpress/wp-core/wp-includes/blocks/icon.php", "/var/www/basis-wordpress/wp-core/wp-includes/blocks/widget-group/block.json", "/var/www/basis-wordpress/wp-core/wp-includes/blocks/separator/style-rtl.css", "/var/www/basis-wordpress/wp-core/wp-includes/bl...
Donna2026-05-24 01:52 UTC
Let me get the full list of pluggable functions and remaining key data:
Tool2026-05-24 01:52 UTC
{"total_count": 38, "matches": [{"path": "/var/www/basis-wordpress/wp-core/wp-includes/pluggable.php", "line": 9, "content": "if ( ! function_exists( 'wp_set_current_user' ) ) :"}, {"path": "/var/www/basis-wordpress/wp-core/wp-includes/pluggable.php", "line": 54, "content": "if ( ! function_exists( ...
Tool2026-05-24 01:52 UTC
{"content": " 6500| * @param string|array $gpc String or array of data to slash.\n 6501| * @return string|array Slashed `$gpc`.\n 6502| */\n 6503|function addslashes_gpc( $gpc ) {\n 6504|\t_deprecated_function( __FUNCTION__, '7.0.0', 'wp_slash()' );\n 6505|\treturn wp_slash( $gpc );\n 6506|}\...
Tool2026-05-24 01:52 UTC
{"content": " 2801|\t *\n 2802|\t * @since 4.2.0\n 2803|\t *\n 2804|\t * @param string $table Table name.\n 2805|\t * @param array $data Array of values keyed by their field names.\n 2806|\t * @param string[]|string $format Formats or format to be mapped to the values in ...
Tool2026-05-24 01:52 UTC
{"total_count": 50, "files": ["/var/www/basis-wordpress/wp-core/wp-includes/blocks/site-logo/block.json", "/var/www/basis-wordpress/wp-core/wp-includes/blocks/post-comments-form/block.json", "/var/www/basis-wordpress/wp-core/wp-includes/blocks/accordion-panel/block.json", "/var/www/basis-wordpress/w...
Tool2026-05-24 01:52 UTC
{"content": " 351|\t * @return bool True, if permalinks are enabled.\n 352|\t */\n 353|\tpublic function using_permalinks() {\n 354|\t\treturn ! empty( $this->permalink_structure );\n 355|\t}\n 356|\n 357|\t/**\n 358|\t * Determines whether permalinks are being used and rewrite modul...
Donna2026-05-24 01:52 UTC
Let me get the remaining critical wpdb methods and REST server details:
Tool2026-05-24 01:52 UTC
{"content": " 2951|\t}\n 2952|\n 2953|\t/**\n 2954|\t * For string fields, records the maximum string length that field can safely save.\n 2955|\t *\n 2956|\t * @since 4.2.1\n 2957|\t *\n 2958|\t * @param array $data {\n 2959|\t * Array of values, formats, and charsets keyed by their f...
Tool2026-05-24 01:52 UTC
{"content": " 3151|\t\t} else {\n 3152|\t\t\treturn null;\n 3153|\t\t}\n 3154|\n 3155|\t\t$new_array = array();\n 3156|\t\tif ( OBJECT === $output ) {\n 3157|\t\t\t// Return an integer-keyed array of row objects.\n 3158|\t\t\treturn $this->last_result;\n 3159|\t\t} elseif ( OBJECT_K === $ou...
Tool2026-05-24 01:52 UTC
{"content": " 3351|\t\t}\n 3352|\n 3353|\t\tlist( $charset ) = explode( '_', $this->col_meta[ $tablekey ][ $columnkey ]->Collation );\n 3354|\t\treturn $charset;\n 3355|\t}\n 3356|\n 3357|\t/**\n 3358|\t * Retrieves the maximum string length allowed in a given column.\n 3359|\t *\n 3360|\t...
Tool2026-05-24 01:52 UTC
{"content": " 3551|\t * a WP_Error object is returned.\n 3552|\t */\n 3553|\tprotected function strip_invalid_text( $data ) {\n 3554|\t\t$db_check_string = false;\n 3555|\n 3556|\t\tforeach ( $data as &$value ) {\n 3557|\t\t\t$charset = $value['charset'];\n 3558|\n 35...
Tool2026-05-24 01:52 UTC
{"total_count": 3, "files": ["/var/www/basis-wordpress/wp-core/wp-includes/rest-api.php", "/var/www/basis-wordpress/wp-core/wp-includes/load.php", "/var/www/basis-wordpress/wp-core/wp-includes/rest-api/class-wp-rest-server.php"]}
Donna2026-05-24 01:52 UTC
Let me check the tail of wpdb and the REST server file sizes:
Tool2026-05-24 01:52 UTC
{"content": " 3751|\t */\n 3752|\tpublic function strip_invalid_text_for_column( $table, $column, $value ) {\n 3753|\t\tif ( ! is_string( $value ) ) {\n 3754|\t\t\treturn $value;\n 3755|\t\t}\n 3756|\n 3757|\t\t$charset = $this->get_col_charset( $table, $column );\n 3758|\t\tif ( ! $charset ...
Tool2026-05-24 01:52 UTC
{"content": " 3851|\t\t\t$query,\n 3852|\t\t\t$maybe\n 3853|\t\t) ) {\n 3854|\t\t\treturn str_replace( '`', '', $maybe[1] );\n 3855|\t\t}\n 3856|\n 3857|\t\treturn false;\n 3858|\t}\n 3859|\n 3860|\t/**\n 3861|\t * Loads the column metadata from the last query.\n 3862|\t *\n 3863|\t * @...
Tool2026-05-24 01:52 UTC
{"content": " 3951|\n 3952|\t\t\tif ( $error ) {\n 3953|\t\t\t\t$message = '<p><code>' . $error . \"</code></p>\\n\" . $message;\n 3954|\t\t\t}\n 3955|\n 3956|\t\t\twp_die( $message );\n 3957|\t\t} else {\n 3958|\t\t\tif ( class_exists( 'WP_Error', false ) ) {\n 3959|\t\t\t\t$this->error = ...
Tool2026-05-24 01:52 UTC
{"content": " 401|\t\t */\n 402|\t\t$expose_headers = apply_filters( 'rest_exposed_cors_headers', $expose_headers, $request );\n 403|\n 404|\t\t$this->send_header( 'Access-Control-Expose-Headers', implode( ', ', $expose_headers ) );\n 405|\n 406|\t\t$allow_headers = array(\n 407|\t\t\t...
Tool2026-05-24 01:52 UTC
{"output": "1980 /var/www/basis-wordpress/wp-core/wp-includes/rest-api/class-wp-rest-server.php\n 3500 /var/www/basis-wordpress/wp-core/wp-includes/rest-api.php\n 5480 total\n---\n 30908 total\n---\n109", "exit_code": 0, "error": null}
Donna2026-05-24 01:52 UTC
Let me get the final pieces — rewriting key methods, deprecated function era breakdown, and the script-loader tail:
Tool2026-05-24 01:52 UTC
{"content": " 401|\t * @return string\n 402|\t */\n 403|\tpublic function preg_index( $number ) {\n 404|\t\t$match_prefix = '$';\n 405|\t\t$match_suffix = '';\n 406|\n 407|\t\tif ( ! empty( $this->matches ) ) {\n 408|\t\t\t$match_prefix = '$' . $this->matches . '[';\n 409|\t\t\t$ma...
Tool2026-05-24 01:52 UTC
{"total_count": 50, "matches": [{"path": "/var/www/basis-wordpress/wp-core/wp-includes/deprecated.php", "line": 19, "content": " * @deprecated 1.5.1 Use get_post()"}, {"path": "/var/www/basis-wordpress/wp-core/wp-includes/deprecated.php", "line": 59, "content": " * @deprecated 1.5.0"}, {"path": "/va...
Tool2026-05-24 01:52 UTC
{"content": " 4000|\t\t\t\t */\n 4001|\t\t\t\tif ( ! preg_match( ':^\\s*(/\\*# sourceURL=\\S+? \\*/\\s*)?$:s', $extra_inline_styles ) ) {\n 4002|\t\t\t\t\t$style_processor = new WP_HTML_Tag_Processor( '<style></style>' );\n 4003|\t\t\t\t\t$style_processor->next_tag();\n 4004|\t\t\t\t\t$style_pr...
Donna2026-05-24 01:52 UTC
Let me get the final data on deprecated eras and report the total lines for rest endpoints:
Tool2026-05-24 01:52 UTC
{"total_count": 0}
Tool2026-05-24 01:52 UTC
{"total_count": 0}
Tool2026-05-24 01:52 UTC
{"total_count": 0}
Tool2026-05-24 01:52 UTC
{"output": "3405 /var/www/basis-wordpress/wp-core/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php\n2065 /var/www/basis-wordpress/wp-core/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php\n1859 /var/www/basis-wordpress/wp-core/wp-includes/rest-api/endpoints/class-...