ContentScan final class
Minn\Content\ContentScan · public/minn/src/Minn/Content/ContentScan.php · 196 lines
What a site's stored content asks of the engine: shortcodes, block names, extra tables, extra post types. Preflight lights the findings; the scan itself is pure string and list work so a suite can pin it without a database.
Constants and properties
| const | CORE_TABLES = array ( 0 => 'commentmeta', 1 => 'comments', 2 => 'links', 3 => 'options', 4 => 'postmeta', 5 => 'posts', 6 => 'term_relationships', 7 => 'term_taxonomy', 8 => 'termmeta', 9 => 'terms', 10 => 'usermeta', 11 => 'users', ) | Tables the engine already speaks. Anything else is plugin data. |
| const | CORE_TYPES = array ( 0 => 'post', 1 => 'page', 2 => 'attachment', 3 => 'revision', 4 => 'nav_menu_item', 5 => 'custom_css', 6 => 'customize_changeset', 7 => 'oembed_cache', 8 => 'user_request', 9 => 'wp_block', 10 => 'wp_template', 11 => 'wp_template_part', 12 => 'wp_global_styles', 13 => 'wp_navigation', 14 => 'wp_font_family', 15 => 'wp_font_face', ) | Built-in types the engine stores. Public ones are in data/types.json; the rest are silent core types that still occupy the posts table. |
| const | CONTENT_TYPES = array ( 0 => 'post', 1 => 'page', 2 => 'wp_block', 3 => 'wp_template', 4 => 'wp_template_part', 5 => 'wp_navigation', ) | post_content that a visitor (or a theme template) can actually see. |
Public
| static | shortcodes(string $content): array# | Opening shortcode tags in $content. Escaped [[tag]] is skipped; closers [/tag] never match because a tag name starts with a letter. @return array<string, int> tag => occurrences | |||
| static | blocks(string $content): array# | Block names in $content, namespace included. A delimiter without a namespace is core/, matching the parser. @return array<string, int> name => occurrences | |||
| static | extraTables(array $tables, string $prefix): array# | The tables under the prefix that are not the reference's own.
@return list<string> bare names after stripping the prefix | |||
| static | tableFamilies(array $bare): array# | Group extra tables by the first underscore segment. Wordfence's tables are wfHits and wfls_* with no shared underscore prefix, so those two stems collapse to one family.
@return list<string> | |||
| static | extraTypes(array $types): array# | The post types in use that the reference does not register itself.
@return list<string> | |||
| static | thirdParty(array $named): array# | The block names that are not core/*, with their counts.
@return array<string, int> | |||
| static | listed(array $names, int $cap = 40): string# | Names sorted and comma-separated, cut with a count past the cap.
|
Internals 1
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | walk(array $blocks, array $found): void# |
|
Nothing matches.