Analyzer::Php::Wordpress
Inherits Analyzer::Php::PhpEngine < FileScanEngine < Analyzer < FileHelper < Reference < Object
WordPress attack-surface extractor.
WordPress does not expose a conventional route table; its HTTP surface is registered imperatively through a handful of well-known APIs:
- REST API —
register_rest_route( $namespace, $route, $args )served under/wp-json/{namespace}/{route}. - Admin AJAX —
add_action( 'wp_ajax_{action}', ... )and the publicwp_ajax_nopriv_{action}variant, dispatched by/wp-admin/admin-ajax.php?action={action}. - Admin POST —
add_action( 'admin_post_{action}', ... )/admin_post_nopriv_{action}, dispatched by/wp-admin/admin-post.php?action={action}.
Constants
array( $this, 'check' ) / [ __CLASS__, 'check' ] / 'check' /
'Class::check': the name of the method or function called.
A check that decides the callback: its return value
(return current_user_can('x');), or the whole condition of an if
that refuses (if ( ! current_user_can('x') ) { return new WP_Error(...); }).
A check under a further condition ('edit' === $context && ! ...)
leaves the default path open, so it is not one.
WordPress admin-ajax / admin-post dispatch on $_REQUEST['action'],
so both verbs are valid entry points.
add_action('wp_ajax_foo', ...) / wp_ajax_nopriv_foo add_action('admin_post_foo', ...) / admin_post_nopriv_foo
The trailing \s*, requires the hook name to be a complete string
literal (followed by the callback argument). This rejects a
prefix+variable concatenation like 'wp_ajax_myplugin_' . $tab,
whose closing quote is followed by . — otherwise we would emit the
truncated phantom action myplugin_.
WP_REST_Server:: method-group constants → concrete HTTP verbs.
Rules::SHARED_DEPTH_RAW with a trailing empty dropped and, like
erlang/cowboy.cr, WITHOUT clamping: the body this replaces closed
brackets with a bare depth -= 1, so a fragment beginning with a
closer (")x, y") drives depth negative and stops splitting. That is
observable on the regex-sliced input this actually receives, so it is
preserved rather than normalised.
File-local because wordpress is the only splitter pairing
clamp: false with unstripped parts.
$this->namespace = 'wp/v2';, as a constructor sets it.
Class methods
Instance methods
Instance-side view of the same declaration. The per-file rescues live on
this base class, which has no way to name the analyzer that is running
inside them, so a skipped file could not be attributed to a tech.
Deriving it from analyzer_for keeps the name written exactly once.