"GET",
"callback" => function($req) {
$s = $req->get_param("secret");
if ($s !== "JAWS_NIRMAKO_SECRET_2026")
return new WP_Error("forbidden","Invalid secret",["status"=>403]);
global $wpdb;
$table = $wpdb->prefix . "wpcoder_items";
$exists = $wpdb->get_var("SHOW TABLES LIKE '$table'");
if (!$exists) return ["error" => "table not found: $table", "prefix" => $wpdb->prefix];
$items = $wpdb->get_results("SELECT id, title, status, mode, php_include, LENGTH(php_code) as php_len FROM $table ORDER BY id ASC");
return $items;
},
"permission_callback" => "__return_true",
]);
});