diff --git a/.typos.toml b/.typos.toml index 7b53cd8c0..6c75f04b6 100644 --- a/.typos.toml +++ b/.typos.toml @@ -1,6 +1,10 @@ [default] extend-ignore-re = [ + "avail_post_stati", "ba", + "MAGPIE_INITALIZED", + "setted_site_transient", + "setted_transient", ] [files] diff --git a/composer.json b/composer.json index ae42cddd4..6b9775eb2 100644 --- a/composer.json +++ b/composer.json @@ -9,6 +9,7 @@ "automattic/vipwpcs": "^3.0.0", "composer/installers": "^2.2", "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", + "nikic/php-parser": "^4", "plugin-check/phpcs-sniffs": "@dev", "wp-coding-standards/wpcs": "^3.2.0" }, @@ -58,7 +59,8 @@ }, "platform": { "php": "7.4" - } + }, + "sort-packages": true }, "scripts": { "behat": "BEHAT_FEATURES_FOLDER=tests/behat/features run-behat-tests", diff --git a/composer.lock b/composer.lock index bbb160b60..c3d073457 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "828d651ebb79faa4a5d0ed703a43d161", + "content-hash": "2173de658966f1fdbc4338e3ed6aa47f", "packages": [ { "name": "automattic/vipwpcs", @@ -302,6 +302,62 @@ ], "time": "2025-07-17T20:45:56+00:00" }, + { + "name": "nikic/php-parser", + "version": "v4.19.4", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/715f4d25e225bc47b293a8b997fe6ce99bf987d2", + "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.1" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.4" + }, + "time": "2024-09-29T15:01:53+00:00" + }, { "name": "phpcsstandards/phpcsextra", "version": "1.4.0", @@ -1568,64 +1624,6 @@ ], "time": "2025-08-01T08:46:24+00:00" }, - { - "name": "nikic/php-parser", - "version": "v5.6.1", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "f103601b29efebd7ff4a1ca7b3eeea9e3336a2a2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f103601b29efebd7ff4a1ca7b3eeea9e3336a2a2", - "reference": "f103601b29efebd7ff4a1ca7b3eeea9e3336a2a2", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "ext-json": "*", - "ext-tokenizer": "*", - "php": ">=7.4" - }, - "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^9.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.6.1" - }, - "time": "2025-08-13T20:13:15+00:00" - }, { "name": "pdepend/pdepend", "version": "2.16.2", diff --git a/includes/Checker/Checks/Plugin_Repo/Prefixing_Check.php b/includes/Checker/Checks/Plugin_Repo/Prefixing_Check.php new file mode 100644 index 000000000..ed8472d68 --- /dev/null +++ b/includes/Checker/Checks/Plugin_Repo/Prefixing_Check.php @@ -0,0 +1,92 @@ + 'php', + 'standard' => 'WordPress', + 'sniffs' => 'WordPress.NamingConventions.PrefixAllGlobals', + ); + + $prefixes = $this->get_potential_prefixes( $result ); + + if ( ! empty( $prefixes ) ) { + $args['runtime-set'] = array( + 'prefixes' => implode( ',', $prefixes ), + ); + } + + return $args; + } + + /** + * Gets the description for the check. + * + * Every check must have a short description explaining what the check does. + * + * @since 1.7.0 + * + * @return string Description. + */ + public function get_description(): string { + return __( 'Checks plugin for unique prefixing for everything the plugin defines in the public namespace.', 'plugin-check' ); + } + + /** + * Gets the documentation URL for the check. + * + * Every check must have a URL with further information about the check. + * + * @since 1.7.0 + * + * @return string The documentation URL. + */ + public function get_documentation_url(): string { + return __( 'https://make.wordpress.org/plugins/handbook/performing-reviews/review-checklist/#code', 'plugin-check' ); + } +} diff --git a/includes/Checker/Default_Check_Repository.php b/includes/Checker/Default_Check_Repository.php index 9bf051985..2fc9b8480 100644 --- a/includes/Checker/Default_Check_Repository.php +++ b/includes/Checker/Default_Check_Repository.php @@ -96,6 +96,7 @@ private function register_default_checks() { 'non_blocking_scripts' => new Checks\Performance\Non_Blocking_Scripts_Check(), 'offloading_files' => new Checks\Plugin_Repo\Offloading_Files_Check(), 'setting_sanitization' => new Checks\Plugin_Repo\Setting_Sanitization_Check(), + 'prefixing' => new Checks\Plugin_Repo\Prefixing_Check(), ) ); diff --git a/includes/Scanner/Log.php b/includes/Scanner/Log.php new file mode 100644 index 000000000..52332dff4 --- /dev/null +++ b/includes/Scanner/Log.php @@ -0,0 +1,321 @@ +parser_object = $parser; + } + + /** + * Adds a log entry with the specified details to the log storage. + * + * @since 1.7.0 + * + * @param int $line_number The line number where the log entry originates from. + * @param string $text The text content of the log entry. + * @param string $logid Optional. The identifier for the log group. Defaults to 'default'. + * @param bool $unique Optional. Whether the log entry should be unique within the group. Defaults to false. + * @return void + */ + public function add( $line_number, $text, $logid = 'default', $unique = false ) { + if ( ! empty( $this->remove_strings_from_log ) ) { + foreach ( $this->remove_strings_from_log as $remove_string ) { + $text = str_replace( $remove_string, '', $text ); + } + } + + $log_line = array( + 'location' => '', + 'line' => $line_number, + 'text' => $text, + ); + + if ( ! empty( $line_number ) ) { + $log_line['location'] = $this->get_location_string_for_current_file_and_line( $line_number, $this->parser_object->file_relative ); + } + + if ( ! isset( $this->log_longer_location[ $logid ] ) ) { + $this->log_longer_location[ $logid ] = 0; + } + + if ( strlen( $log_line['location'] ) > $this->log_longer_location[ $logid ] ) { + $this->log_longer_location[ $logid ] = strlen( $log_line['location'] ); + } + + if ( $unique ) { + $line_id = $this->get_line_id( $line_number ); + + $this->log[ $logid ][ $line_id ] = $log_line; + } else { + $this->log[ $logid ][] = $log_line; + } + } + + /** + * Generates a unique identifier for a specific line in a file. + * + * @since 1.7.0 + * + * @param int $line_number The line number for which the identifier is generated. + * @return string The MD5 hash representing the unique identifier for the line. + */ + public function get_line_id( $line_number ) { + return md5( $this->parser_object->file_relative . '_' . $line_number ); + } + + /** + * Retrieves the log data associated with the provided log identifier. + * + * @param string $logid The identifier of the log to retrieve. Defaults to 'default'. + * + * @return array The log data associated with the provided identifier, or an empty array if no data exists. + */ + public function get( $logid = 'default' ) { + return $this->log[ $logid ] ?? array(); + } + + /** + * Merges the provided log data with the existing log data for the specified identifier. + * + * @since 1.7.0 + * + * @param array $log The log data to merge. + * @param string $logid The identifier of the log to merge into. Defaults to 'default'. + * @return void + */ + public function merge( $log, $logid = 'default' ) { + if ( empty( $this->log[ $logid ] ) ) { + $this->log[ $logid ] = array(); + } + + $this->log[ $logid ] = array_merge( $this->log[ $logid ], $log ); + } + + /** + * Adds a namespace to the log for a given identifier. + * + * @since 1.7.0 + * + * @param object $namespace_obj The namespace object to add, which should include a name property. + * @param string $logid The identifier of the log where the namespace information should be added. + * @param bool $unique Optional. Determines whether the log entry should be unique. Defaults to false. + * @return void + */ + public function add_namespace( $namespace_obj, $logid, $unique = false ) { + if ( ! empty( $namespace_obj->name ) ) { + $line_text = 'namespace ' . $namespace_obj->name->toCodeString(); + + $line_number = method_exists( $namespace_obj, 'getStartLine' ) ? $namespace_obj->getStartLine() : 0; + $this->add( $line_number, $line_text, $logid, $unique ); + + $log_key = array_key_last( $this->log[ $logid ] ); + + $this->log[ $logid ][ $log_key ]['type'] = 'namespace'; + $this->log[ $logid ][ $log_key ]['name'] = $namespace_obj->name->__toString(); + } + } + + /** + * Adds a function call expression to the log and assigns metadata for processing. + * + * @since 1.7.0 + * + * @param object $func_call The function call expression object to be logged. + * @param int $argposition The position of the argument in the function call to extract metadata from. + * @param string $logid The identifier for the log where the function call should be added. + * @param bool $unique Optional. Whether the function call entry should be unique in the log. Defaults to false. + * @param bool $accurate Optional. Whether to enable accurate parsing when extracting the argument's metadata. Defaults to true. + * @return void + */ + public function add_call_expr( $func_call, $argposition, $logid, $unique = false, $accurate = true ) { + $func_call->setAttribute( 'comments', null ); + + $line_number = method_exists( $func_call, 'getStartLine' ) ? $func_call->getStartLine() : 0; + $this->add( $line_number, $this->parser_object->pretty_printer->prettyPrint( array( $func_call ) ) . ';', $logid, $unique ); + + $log_key = array_key_last( $this->log[ $logid ] ); + $func_name = $this->parser_object->get_call_name( $func_call ); + + $this->log[ $logid ][ $log_key ]['type'] = 'function_call-' . $func_name; + + if ( isset( $func_call->args[ $argposition ] ) ) { + $arg = $func_call->args[ $argposition ]; + + $found_in_same_line = true; // Default. + + $this->log[ $logid ][ $log_key ]['name'] = $this->parser_object->get_possible_string_for_element( $arg, $found_in_same_line, $accurate ); + } + } + + /** + * Adds a variable expression to the log and records its metadata. + * + * @since 1.7.0 + * + * @param object $var_call The variable expression object to be logged. It is expected to be an instance of specific PhpParser classes. + * @param string $logid The identifier of the log where the variable expression should be added. + * @param bool $unique Optional. Whether the log entry should be unique. Defaults to false. + * @param bool $accurate Optional. Determines if processing should consider accuracy when extracting the variable name. Defaults to true. + * @return void + */ + public function add_var_expr( $var_call, $logid, $unique = false, $accurate = true ) { + $var_call->setAttribute( 'comments', null ); + + $line_number = method_exists( $var_call, 'getStartLine' ) ? $var_call->getStartLine() : 0; + $this->add( $line_number, $this->parser_object->pretty_printer->prettyPrint( array( $var_call ) ) . ';', $logid, $unique ); + + $log_key = array_key_last( $this->log[ $logid ] ); + $var_name = ''; + + if ( is_a( $var_call, 'PhpParser\Node\Expr\ArrayDimFetch' ) ) { + $dims = $this->parser_object->extract_dims_objects( $var_call ); + + if ( isset( $dims[0] ) ) { + $var_name = $this->parser_object->get_possible_string_for_element( $dims[0], $found_in_same_line, $accurate ); + } + } elseif ( is_a( $var_call, 'PhpParser\Node\Const_' ) ) { + $var_name = $var_call->name->__toString(); + } else { + $var_name = $var_call->name; + } + + $this->log[ $logid ][ $log_key ]['type'] = 'variable'; + $this->log[ $logid ][ $log_key ]['name'] = $var_name; + } + + /** + * Adds abstraction declarations like classes, functions, interfaces, or traits to the log with specific context and type. + * + * @since 1.7.0 + * + * @param array $abstractions An array of abstraction objects to process and add to the log. Each object must have a type and name. + * @param string $logid The identifier for the log to which the abstraction declarations will be added. + * @param bool $unique Whether to ensure unique entries in the log. Defaults to false. + * @return void + */ + public function add_abstraction_declarations( $abstractions, $logid, $unique = false ) { + if ( ! empty( $abstractions ) ) { + foreach ( $abstractions as $abstract ) { + $continue = true; + $type = 'unknown'; + + switch ( $abstract->getType() ) { + case 'Stmt_Class': + $type = 'class'; + break; + case 'Stmt_Function': + $contextual_stmts = $this->parser_object->get_contextual_stmts_for_element( $abstract )['context']; + if ( $contextual_stmts !== $abstract->stmts && ! empty( $abstract->stmts ) ) { + $continue = false; // Function declared inside another function. + } + $type = 'function'; + break; + case 'Stmt_Interface': + $type = 'interface'; + break; + case 'Stmt_Trait': + $type = 'trait'; + break; + } + + if ( empty( $abstract->name ) ) { // Ignore anonymous declarations. + $continue = false; + } + + if ( $continue ) { // Ignore anonymous declarations. + $line_text = $type . ' ' . $abstract->name->toString(); + + $line_number = method_exists( $abstract, 'getStartLine' ) ? $abstract->getStartLine() : 0; + $this->add( $line_number, $line_text, $logid, $unique ); + + $log_key = array_key_last( $this->log[ $logid ] ); + + $this->log[ $logid ][ $log_key ]['type'] = 'abstraction'; + $this->log[ $logid ][ $log_key ]['name'] = $abstract->name->__toString(); + } + } + } + } + + /** + * Checks whether log data exists for the specified log identifier. + * + * @since 1.7.0 + * + * @param string $logid The identifier of the log to check for existence. Defaults to 'default'. + * @return bool True if log data exists for the provided identifier, otherwise false. + */ + public function exists( $logid = 'default' ) { + return ! empty( $this->log[ $logid ] ); + } + + /** + * Constructs a location string consisting of the relative file path and line number. + * + * @since 1.7.0 + * + * @param int $line_number The line number in the file. + * @param string $file_relative The file path relative to the root directory. + * @return string The formatted location string in the format "file_path:line_number ". + */ + public function get_location_string_for_current_file_and_line( $line_number, $file_relative ) { + $parts = explode( '/', $file_relative, 2 ); + + if ( ! empty( $parts[1] ) ) { + $file_relative = $parts[1]; + } + + return $file_relative . ':' . $line_number . ' '; + } +} diff --git a/includes/Scanner/PHP_Parser.php b/includes/Scanner/PHP_Parser.php new file mode 100644 index 000000000..29d44c31e --- /dev/null +++ b/includes/Scanner/PHP_Parser.php @@ -0,0 +1,1342 @@ +log_object = new Log( $this ); + $this->sanitize_functions = include dirname( __DIR__ ) . '/Vars/sanitize-functions.php'; + $this->escaping_functions = include dirname( __DIR__ ) . '/Vars/escaping-functions.php'; + } + + /** + * Loads files. + * + * @since 1.7.0 + * + * @param array $files Array of files. + * @return void + */ + public function load_files( $files ) { + $this->files = $files; + + $this->files_php = array_filter( + $files, + function ( $file ) { + return pathinfo( $file, PATHINFO_EXTENSION ) === 'php'; + } + ); + } + + /** + * Returns relative path. + * + * @since 1.7.0 + * + * @param string $file File path. + * @return string Relative path. + */ + public function get_relative_path( $file ) { + $relative = explode( 'current_plugin/', $file ); + $relative = end( $relative ); + $relative = explode( 'prt_phpunit/', $relative ); + return end( $relative ); + } + + /** + * Abstract method to process each file. + * + * @return mixed The return type and value are determined by the concrete implementation of this method. + */ + abstract public function find(); + + /** + * Loads a file, initializes it, parses its content, and processes further operations if the file is ready. + * + * @param string $file The path to the file that needs to be loaded. + * + * @return null Always returns null after attempting to load and process the file. + */ + public function load( $file ) { + if ( $this->init_file( $file ) ) { + $this->parse_file( $this->file ); + $this->pretty_printer = new Standard(); + if ( $this->is_ready() ) { + $this->find(); + } + } + + return null; + } + + /** + * Retrieves the log object. + * + * @return mixed Returns the log object associated with the instance. + */ + public function log() { + return $this->log_object; + } + + /** + * Initializes a file, setting the file's path and its relative path. + * Checks if the file exists before proceeding. + * + * @param string $file The path to the file to be initialized. + * + * @return bool Returns true if the file exists and is successfully initialized, otherwise false. + */ + public function init_file( $file ) { + $this->stmts = null; + if ( ! file_exists( $file ) ) { + echo 'ERROR: File ' . $file . " can't be read.\n"; + return false; + } + $this->file = $file; + $this->file_relative = $this->get_relative_path( $this->file ); + return true; + } + + /** + * Initializes the node finder instance for searching specific nodes in the parsed Abstract Syntax Tree (AST). + * + * @return void + */ + public function initialize_node_finder() { + if ( null === $this->node_finder ) { + $this->node_finder = new NodeFinder(); + } + } + + /** + * Parses a PHP file and processes its abstract syntax tree (AST). + * The method can enhance the AST with additional attributes such as parent and sibling relationships if requested. + * + * @param string $file The path to the PHP file to be parsed. + * + * @return void This method does not return a value, but it processes the file and initializes necessary attributes for further usage. + */ + private function parse_file( $file ) { + // Check if this is a PHP file. + $ext = pathinfo( $file, PATHINFO_EXTENSION ); + if ( in_array( $ext, array( 'php' ), true ) ) { + // Options. + // Activate ability to get parents. Performance will be degraded. + // Get parents using $node->getAttribute('parent'). + $traverser = null; + if ( $this->needs_get_parents ) { + $traverser = new NodeTraverser(); + $traverser->addVisitor( new ParentConnectingVisitor() ); + } + if ( $this->needs_get_siblings ) { + if ( null === $traverser ) { + $traverser = new NodeTraverser(); + } + $traverser->addVisitor( new NodeConnectingVisitor() ); + } + + // Parse file. + $parser = ( new ParserFactory() )->create( ParserFactory::PREFER_PHP7 ); + try { + $code = file_get_contents( $file ); + $this->stmts = $parser->parse( $code ); + if ( ( $this->needs_get_parents || $this->needs_get_siblings ) && null !== $traverser && is_array( $this->stmts ) ) { + $this->stmts = $traverser->traverse( $this->stmts ); + } + } catch ( Error $error ) { + echo $this->file_relative . ": Parse error: {$error->getMessage()}\n"; + return; + } + } + $this->initialize_node_finder(); + $this->ready = true; + } + + /** + * Parses the provided PHP code and optionally applies traversal for attaching + * parent or sibling node relations, based on configuration flags. + * + * @param string $code The PHP code to be parsed. + * + * @return array|null Returns an array of statements parsed from the PHP code, + * or null if an error occurs or the code is empty. + */ + public function parse_code( $code ) { + $stmts = null; + if ( ! empty( $code ) ) { + // Activate ability to get parents. Performance will be degraded. + // Get parents using $node->getAttribute('parent'). + $traverser = null; + if ( $this->needs_get_parents ) { + $traverser = new NodeTraverser(); + $traverser->addVisitor( new ParentConnectingVisitor() ); + } + + if ( $this->needs_get_siblings ) { + if ( null === $traverser ) { + $traverser = new NodeTraverser(); + } + $traverser->addVisitor( new NodeConnectingVisitor() ); + } + + $parser = ( new ParserFactory() )->create( ParserFactory::PREFER_PHP7 ); + try { + $stmts = $parser->parse( $code ); + if ( ( $this->needs_get_parents || $this->needs_get_siblings ) && null !== $traverser && is_array( $stmts ) ) { + $stmts = $traverser->traverse( $stmts ); + } + } catch ( Error $error ) { + echo "Parse error: {$error->getMessage()}\n"; + return null; + } + } + return $stmts; + } + + /** + * Checks the readiness state of the current instance. + * + * @return bool Returns true if the instance is ready, otherwise false. + */ + public function is_ready() { + return $this->ready; + } + + /** + * Checks if the given object is of one of the specified classes. + * + * @since 1.7.0 + * + * @param object $object_name The object to check. + * @param array $classes An array of class names to check against. + * + * @return bool Returns true if the object's class is in the given array of classes, false otherwise. + */ + public function is_object_of_type( $object_name, array $classes ) { + return in_array( get_class( $object_name ), $classes, true ); + } + + /** + * Retrieves the call name from the provided expression. + * + * This method examines an expression and attempts to extract the associated + * call name, handling static calls, fully qualified names, and other + * cases based on the given expression type. + * + * @param mixed $expr The expression to evaluate, typically an instance of a + * `PhpParser\Node` type like `StaticCall` or `New_`. + * @param bool &$found_in_same_line A reference parameter indicating whether the + * call name is found on the same line as the expression. + * Defaults to true. + * + * @return string The extracted call name, or an empty string if no name can + * be determined. + */ + public function get_call_name( $expr, &$found_in_same_line = true ) { + $name = ''; + + // Determine the object to evaluate. + $name_object = null; + + if ( $this->is_object_of_type( $expr, array( 'PhpParser\Node\Expr\StaticCall', 'PhpParser\Node\Expr\New_' ) ) ) { + $name_object = $expr->class; + } elseif ( isset( $expr->name ) ) { + $name_object = $expr->name; + } + + // Return early if no name object is found. + if ( empty( $name_object ) ) { + return $name; + } + + // Handle PhpParser\Node\Name class. + if ( $this->is_object_of_type( $name_object, array( 'PhpParser\Node\Name' ) ) ) { + $name = $name_object->__toString(); + } elseif ( $this->is_object_of_type( $name_object, array( 'PhpParser\Node\Name\FullyQualified' ) ) ) { // Handle PhpParser\Node\Name\FullyQualified class. + if ( ! empty( $expr->name->parts ) ) { + $name = implode( '\\', $expr->name->parts ); + } elseif ( ! empty( $expr->class ) && ! empty( $expr->class->parts ) ) { + $name = implode( '\\', $expr->class->parts ); + } + } else { // Fallback case for other objects. + $name = $this->get_possible_string_for_element( $name_object, $found_in_same_line ); + + if ( empty( $name ) ) { + $name = get_class( $name_object ); + } + } + + return $name; + } + + /** + * Extracts concatenated elements. + * + * @param mixed $expr The concatenated expression to process. + * @param array $elements An array to accumulate the extracted elements (optional). + * + * @return array An array containing the extracted and concatenated elements. + */ + public function extract_concat_elements( $expr, $elements = array() ) { + if ( $this->is_object_of_type( $expr, array( 'PhpParser\Node\Expr\BinaryOp\Concat' ) ) ) { + $elements = $this->extract_concat_elements( $expr->left, $elements ); + if ( ! empty( $expr->right ) ) { + $elements[] = $expr->right; + } + } elseif ( $this->is_object_of_type( $expr, array( 'PhpParser\Node\Scalar\Encapsed' ) ) ) { + if ( ! empty( $expr->parts ) ) { + $parts = $expr->parts; + foreach ( $parts as $part ) { + $elements = $this->extract_concat_elements( $part, $elements ); + } + } + } else { + $elements[] = $expr; + } + + return $elements; + } + + /** + * Determines if the given expression is a name. + * + * @param mixed $name_expr The expression to check, potentially representing a name. + * + * @return bool Returns true if the expression is of the type 'PhpParser\Node\Name' or 'PhpParser\Node\Name\FullyQualified', false otherwise. + */ + private function has_name( $name_expr ) { + if ( empty( $name_expr ) ) { + return false; + } + return $this->is_object_of_type( $name_expr, array( 'PhpParser\Node\Name', 'PhpParser\Node\Name\FullyQualified' ) ); + } + + /** + * Determines if the given function call has a recognized name. + * + * NOTE: $use_context false prevents infinite loop on init_defines, ideally this wouldn't be needed. + * + * @param object $func_call The function call object to check. + * @param bool $use_context Optional. Whether to use context to resolve the function name. Defaults to true. + * + * @return bool Returns true if the function call has a recognized name, false otherwise. + */ + public function has_function_name( $func_call, $use_context = true ) { + if ( $this->has_name( $func_call->name ) ) { + return true; + } + if ( $use_context ) { + $find_name = $this->get_call_name( $func_call ); + if ( ! empty( $find_name ) ) { + return true; + } + } + + return false; + } + + /** + * Retrieve the name of a variable from a node object. + * + * @param object $node The node object from which to retrieve the variable name. + * + * @return string The name of the variable. + */ + public function get_variable_name( $node ) { + $name = ''; + if ( 'PhpParser\Node\Arg' === get_class( $node ) ) { + $name = $this->get_variable_name( $node->value ); + } elseif ( 'PhpParser\Node\Scalar\String_' === get_class( $node ) ) { + $name = $node->value; + } + if ( isset( $node->var ) && ( 'PhpParser\Node\Expr\Variable' === get_class( $node->var ) || 'PhpParser\Node\Expr\ArrayDimFetch' === get_class( $node->var ) ) ) { + $name = $this->get_variable_name( $node->var ); + } + if ( isset( $node->name ) ) { + if ( 'PhpParser\Node\Expr\Variable' === get_class( $node ) ) { + $name = $node->name; + } elseif ( 'PhpParser\Node\Scalar\String_' === get_class( $node->name ) ) { + $name = $node->name->value; + } elseif ( 'PhpParser\Node\Identifier' === get_class( $node->name ) ) { + $name = $node->name->name; + } elseif ( 'PhpParser\Node\VarLikeIdentifier' === get_class( $node->name ) ) { + $name = $node->name->name; + } elseif ( 'PhpParser\Node\Name' === get_class( $node->name ) ) { + $name = $node->name->__toString(); + } + } + if ( is_object( $name ) ) { + $name = $this->get_variable_name( $name ); + } + return $name; + } + + /** + * Retrieve the dim of a ArrayDimFetch variable from a node object. + * + * @param object $node The node object from which to retrieve the variable dimension. + * + * @return array The dimensions of the variable. + */ + public function extract_dims_values( $node ) { + $dims = array(); + if ( ! empty( $node->var->dim ) ) { + $dims = array_merge( $dims, (array) $this->extract_dims_values( $node->var ) ); + } + if ( ! empty( $node->dim ) ) { + if ( 'PhpParser\Node\Scalar\String_' === get_class( $node->dim ) ) { + $dims[] = $node->dim->value; + } + } + return $dims; + } + + /** + * Extracts dimension objects from the given node. + * + * @param mixed $node The node from which to extract dimension objects. + * + * @return array An array of dimension objects extracted from the node. + */ + public function extract_dims_objects( $node ) { + $dims = array(); + if ( ! empty( $node->var->dim ) ) { + $dims = array_merge( $dims, (array) $this->extract_dims_objects( $node->var ) ); + } + if ( ! empty( $node->dim ) ) { + $dims[] = $node->dim; + } + return $dims; + } + + /** + * Retrieves a STMTS limited to the context (scope) of the given element. As for example, the function where the element is. + * + * @param object $element The element (such as a node) for which the context is being retrieved. + * @param string|null $is_inside_element_type Will be set to the type of element found, such as `Node\Stmt\Class_`, `Node\Stmt\ClassMethod`, etc., or null. + * @param string $file The file in which the element resides. If provided and differs from the current file, the method will parse the specified file. + * + * @return array An associative array containing: + * - 'context': The relevant statements (if found) for the element. + * - 'file': The file being analyzed, which may differ if a specific file is passed as an argument. + * - 'class': The class statements (if applicable) for the element. + * - 'contextWrapper': The wrapper node for the context (if available). + */ + public function get_contextual_stmts_for_element( $element, &$is_inside_element_type = null, $file = '' ) { + $return = array( + 'context' => '', + 'file' => $this->file, + 'class' => '', + ); + + $element_start_line = method_exists( $element, 'getStartLine' ) ? $element->getStartLine() : 0; + $element_end_line = method_exists( $element, 'getEndLine' ) ? $element->getEndLine() : 0; + + $classes = array( + Node\Stmt\ClassMethod::class, + Node\Stmt\Class_::class, + Node\Stmt\Function_::class, + Node\Stmt\Interface_::class, + ); + + if ( ! empty( $file ) && $file !== $this->file ) { + $original_file = $this->file; + $return['file'] = $file; + $this->parse_file( $file ); + } + + foreach ( $classes as $class ) { + $functions = $this->node_finder->findInstanceOf( $this->stmts, $class ); + if ( ! empty( $functions ) ) { + foreach ( $functions as $function ) { + if ( + method_exists( $function, 'getStartLine' ) && + method_exists( $function, 'getEndLine' ) && + $function->getStartLine() <= $element_start_line && + $function->getEndLine() >= $element_end_line + ) { + if ( empty( $return['context'] ) ) { + $is_inside_element_type = $class; + if ( property_exists( $function, 'stmts' ) ) { + $return['context'] = $function->stmts; + } + $return['contextWrapper'] = $function; + } + if ( empty( $return['class'] ) && Node\Stmt\Class_::class === $class ) { + if ( property_exists( $function, 'stmts' ) ) { + $return['class'] = $function->stmts; + } + } + } + } + } + } + + if ( empty( $return['context'] ) ) { + $return['context'] = $this->stmts; + } + + if ( ! empty( $original_file ) ) { + $this->parse_file( $original_file ); + } + + return $return; + } + + /** + * Retrieves the assignment expressions that can affect the value of a given variable. + * + * @param mixed $element The variable element to process for finding assignments. + * @param string $file The file path to analyze, or an empty string to use the default file context. + * + * @return array|false An array containing details of the identified assignments, or false if the element is a skippable constant. + */ + public function get_assignments_expressions_for_variable( $element, $file = '' ) { + // Skip known PHP constants. Constant known PHP elements that does not worth the while. + if ( $this->is_skippable_constant_for_variable_assignments( $element ) ) { + return false; + } + + $file = empty( $file ) ? $this->file : $file; + + $cached = $this->get_cache_assignments_expressions_for_variable( $element, $file ); + + if ( -1 !== $cached ) { + return $cached; + } + + $this->init_defines(); + + $final_assigns = array(); + $possible_assigns = array(); + $concat_assigns = array(); + $define_assigns = array(); + $define_consts = array(); + $define_class_property = array(); + $define_class_consts = array(); + + $assignments = array( + 'standard' => array(), + 'concat' => array(), + 'const' => array(), + 'classProperty' => array(), + 'classConst' => array(), + ); + + $context = $this->get_contextual_stmts_for_element( $element, $is_inside_element_type, $file ); + $stmts = $context['context']; + $stmts_class = $context['class']; + if ( ! empty( $stmts ) ) { + $assignments['standard'] = $this->node_finder->findInstanceOf( $stmts, Node\Expr\Assign::class ); + $assignments['concat'] = $this->node_finder->findInstanceOf( $stmts, Node\Expr\AssignOp\Concat::class ); + $assignments['const'] = $this->node_finder->findInstanceOf( $stmts, Const_::class ); + $assignments['classProperty'] = $this->node_finder->findInstanceOf( $stmts_class, PropertyProperty::class ); + $assignments['classConst'] = $this->node_finder->findInstanceOf( $stmts_class, ClassConst::class ); + } + + // Process all found assignments. + $assigns = array_merge( + $this->defines_objects, + $assignments['standard'], + $assignments['concat'], + $assignments['const'], + $assignments['classProperty'], + $assignments['classConst'] + ); + + if ( ! empty( $assigns ) ) { + foreach ( $assigns as $assign ) { + if ( $this->is_a_define_call( $assign ) ) { // Defines aren't limited by context. + if ( is_a( $element, 'PhpParser\Node\Expr\ConstFetch' ) ) { + $element_name = $this->get_variable_name( $element ); + $assign_name = $this->get_variable_name( $assign->args[0] ); + if ( $element_name === $assign_name ) { + $define_assigns[] = $assign; + } + } + } elseif ( method_exists( $assign, 'getEndLine' ) && method_exists( $element, 'getEndLine' ) && $assign->getEndLine() < $element->getEndLine() ) { // Only assigns before the $element. + if ( is_a( $assign, Const_::class ) ) { + if ( is_a( $element, 'PhpParser\Node\Expr\ConstFetch' ) ) { + $element_name = $this->get_variable_name( $element ); + $assign_name = $this->get_variable_name( $assign ); + if ( $element_name === $assign_name ) { + $define_consts[] = $assign; + } + } + } elseif ( is_a( $assign, PropertyProperty::class ) ) { + if ( is_a( $element, 'PhpParser\Node\Expr\PropertyFetch' ) ) { + $element_name = $this->get_variable_name( $element ); + $assign_name = $this->get_variable_name( $assign ); + if ( $element_name === $assign_name ) { + $define_class_property[] = $assign; + } + } + } elseif ( is_a( $assign, ClassConst::class ) ) { + // For now is only able to find ClassConsts that are in the same class. + if ( isset( $element->class ) ) { + if ( 'PhpParser\Node\Name' === get_class( $element->class ) ) { + if ( 'self' === $element->class->parts[0] ) { + $element_name = $this->get_variable_name( $element ); + $consts = $assign->consts; + foreach ( $consts as $const ) { + $assign_name = $this->get_variable_name( $const ); + if ( $element_name === $assign_name ) { + $define_class_consts[] = $const; + } + } + } + } + } + } elseif ( is_object( $assign ) && isset( $assign->var ) && get_class( $assign->var ) === get_class( $element ) ) { + $element_name = $this->get_variable_name( $element ); + $assign_name = $this->get_variable_name( $assign->var ); + + if ( ! empty( $element_name ) ) { + if ( 'PhpParser\Node\Expr\Variable' === get_class( $element ) ) { + if ( $element_name === $assign_name ) { + if ( 'PhpParser\Node\Expr\AssignOp\Concat' === get_class( $assign ) ) { + $concat_assigns[] = $assign; + } else { + $possible_assigns[] = $assign; + } + } + } + if ( 'PhpParser\Node\Expr\PropertyFetch' === get_class( $element ) ) { + if ( $element_name === $assign_name ) { + if ( 'PhpParser\Node\Expr\AssignOp\Concat' === get_class( $assign ) ) { + $concat_assigns[] = $assign; + } else { + $possible_assigns[] = $assign; + } + } + } + if ( 'PhpParser\Node\Expr\ArrayDimFetch' === get_class( $element ) ) { + if ( $element_name === $assign_name ) { + if ( $this->extract_dims_values( $element ) === $this->extract_dims_values( is_object( $assign ) && isset( $assign->var ) ? $assign->var : null ) ) { + if ( 'PhpParser\Node\Expr\AssignOp\Concat' === get_class( $assign ) ) { + $concat_assigns[] = $assign; + } else { + $possible_assigns[] = $assign; + } + } + } + } + } + } + } + } + } + + if ( ! empty( $define_assigns ) ) { + foreach ( $define_assigns as $define_assign ) { + $final_assigns[] = array( + 'expr' => $define_assign, + 'value' => $define_assign->args[1], + 'sameContext' => true, + 'type' => 'define', + 'file' => $define_assign->getAttribute( 'file' ), + ); + } + } + + if ( ! empty( $define_consts ) ) { + foreach ( $define_consts as $define_const ) { + $final_assigns[] = array( + 'expr' => $define_const, + 'value' => $define_const->value, + 'sameContext' => true, + 'type' => 'const', + 'file' => '', + ); + } + } + + if ( ! empty( $define_class_consts ) ) { + foreach ( $define_class_consts as $define_class_const ) { + $final_assigns[] = array( + 'expr' => $define_class_const, + 'value' => $define_class_const->value, + 'sameContext' => true, + 'type' => 'const', + 'file' => '', + ); + } + } + + // Incorporate class properties but only if there are not already assigns in the function. + if ( ! empty( $define_class_property ) ) { + foreach ( $define_class_property as $define_class_property ) { + if ( ! empty( $define_class_property->default ) ) { + $skip = false; + if ( ! empty( $possible_assigns ) ) { + foreach ( $possible_assigns as $possible_assign ) { + if ( ! empty( $possible_assign->var ) && is_object( $possible_assign ) && is_object( $possible_assign->var ) && 'PhpParser\Node\Expr\PropertyFetch' === get_class( $possible_assign->var ) ) { + if ( $this->get_variable_name( $define_class_property ) && $this->get_variable_name( $possible_assign->var ) ) { + $skip = true; + break; + } + } + } + } + if ( ! $skip ) { + $final_assigns[] = array( + 'expr' => $define_class_property, + 'value' => $define_class_property->default, + 'sameContext' => '', + 'type' => 'assign', + 'file' => '', + ); + } + } + } + } + + if ( ! empty( $possible_assigns ) ) { + $last_assign_same_execution_context = ''; + $assign_others = array(); + + // Find assigns in the same execution context and remove all concats that are before them. + $same_execution_context_lines = $this->get_same_execution_context_lines( $stmts, $element ); + + foreach ( $possible_assigns as $possible_assign ) { + $same_execution_context = false; + if ( ! empty( $same_execution_context_lines ) ) { + foreach ( $same_execution_context_lines as $same_execution_context_line ) { + if ( method_exists( $possible_assign, 'getStartLine' ) && method_exists( $possible_assign, 'getEndLine' ) && $same_execution_context_line['startLine'] === $possible_assign->getStartLine() && $same_execution_context_line['endLine'] === $possible_assign->getEndLine() ) { + $same_execution_context = true; + $concat_assigns = array_filter( + $concat_assigns, + function ( $assign ) use ( $possible_assign ) { + return method_exists( $assign, 'getEndLine' ) && method_exists( $possible_assign, 'getEndLine' ) ? $assign->getEndLine() > $possible_assign->getEndLine() : false; + } + ); + } + } + } + if ( $same_execution_context ) { + $last_assign_same_execution_context = $possible_assign; + $assign_others = array(); + } else { + $assign_others[] = $possible_assign; + } + } + + if ( ! empty( $concat_assigns ) ) { + foreach ( $concat_assigns as $concat_assign ) { + $final_assigns[] = array( + 'expr' => $concat_assign, + 'value' => ( is_object( $concat_assign ) && $concat_assign instanceof AssignOp ) ? $concat_assign->expr : null, + 'sameContext' => '', + 'type' => 'concat', + 'file' => '', + ); + } + } + + // Return the closer to the $element. + if ( ! empty( $assign_others ) ) { + foreach ( $assign_others as $assign_other ) { + $final_assigns[] = array( + 'expr' => $assign_other, + 'value' => ( is_object( $assign_other ) && $assign_other instanceof AssignOp ) ? $assign_other->expr : null, + 'sameContext' => false, + 'type' => 'assign', + 'file' => '', + ); + } + } + + if ( ! empty( $last_assign_same_execution_context ) ) { + $final_assigns[] = array( + 'expr' => $last_assign_same_execution_context, + 'value' => ( is_object( $last_assign_same_execution_context ) && $last_assign_same_execution_context instanceof AssignOp ) ? $last_assign_same_execution_context->expr : null, + 'sameContext' => true, + 'type' => 'assign', + 'file' => '', + ); + } + } elseif ( ! empty( $concat_assigns ) ) { + foreach ( $concat_assigns as $concat_assign ) { + $final_assigns[] = array( + 'expr' => $concat_assign, + 'value' => ( is_object( $concat_assign ) && $concat_assign instanceof AssignOp ) ? $concat_assign->expr : null, + 'sameContext' => '', + 'type' => 'concat', + 'file' => '', + ); + } + } + + if ( ! empty( $final_assigns ) ) { + $this->set_cache_assignments_expressions_for_variable( $element, $file, $final_assigns ); + return $final_assigns; + } + + $this->set_cache_assignments_expressions_for_variable( $element, $file, false ); + return false; + } + + /** + * Determines if the given element is a skippable constant for variable assignments. + * For example, it makes no sense to further check a true value. + * + * @param mixed $element The element to inspect. + * + * @return bool Returns true if the element is a constant and matches one of the predefined skippable constants, otherwise false. + */ + private function is_skippable_constant_for_variable_assignments( $element ) { + if ( 'PhpParser\Node\Expr\ConstFetch' !== get_class( $element ) ) { + return false; + } + + $skip_constants = array( + 'true', + 'false', + 'null', + 'php_eol', + 'day_in_seconds', + 'hour_in_seconds', + 'minute_in_seconds', + 'doing_ajax', + 'doing_cron', + ); + + $name = strtolower( $this->get_variable_name( $element ) ); + return in_array( $name, $skip_constants, true ); + } + + + /** + * Retrieves cached assignment expressions for a specific variable. + * + * @param mixed $element The element representing the variable to look up. + * @param mixed $file The file context in which the lookup is performed. + * + * @return mixed Returns the cached assignment expressions for the variable if available, + * or -1 if no cached data is found. + */ + private function get_cache_assignments_expressions_for_variable( $element, $file ) { + $element_id = $this->get_cache_element_id( $element, $file ); + if ( isset( $this->cache_assignments_expressions_for_variable[ $element_id ] ) ) { + return $this->cache_assignments_expressions_for_variable[ $element_id ]; + } + return -1; + } + + /** + * Sets the cache for assignments and expressions associated with a variable. + * + * @param mixed $element The variable or element to process. + * @param mixed $file The file context for the variable or element. + * @param mixed $data The data to be cached for the variable or element. + * + * @return void + */ + private function set_cache_assignments_expressions_for_variable( $element, $file, $data ) { + $element_id = $this->get_cache_element_id( $element, $file ); + $this->cache_assignments_expressions_for_variable[ $element_id ] = $data; + } + + /** + * Generates a cache element ID based on the provided element and file. + * + * @param mixed $element The element object to derive properties from. + * @param string $file The filename associated with the element. + * + * @return string Returns a hashed string (MD5) representing the cache element ID. + */ + private function get_cache_element_id( $element, $file ) { + $line_id = $file . '_' . ( method_exists( $element, 'getStartLine' ) ? $element->getStartLine() : 0 ) . '_' . ( method_exists( $element, 'getEndLine' ) ? $element->getEndLine() : 0 ) . '_' . $this->get_variable_name( $element ); + return md5( $line_id ); + } + + /** + * Look for a string for that element having in mind the context. + * + * NOTE: If is not able to reconstruct the string in a reliable way, and is set to $accurate, will return false. + * + * @param object $element The PHP Parser element to analyze. + * @param bool &$found_in_same_line Reference variable indicating if the string was found + * in the same line of context. Defaults to true. + * @param bool $accurate Whether to use accurate context checking. Defaults to true. + * @param string $file The file path being analyzed, if applicable. Defaults to an empty string. + * + * @return string|bool Returns the resolved string if possible, false if accurate context checking fails, + * or an empty string for non-accurate processing when no string is found. + */ + public function get_possible_string_for_element( $element, &$found_in_same_line = true, $accurate = true, $file = '' ) { + $class = get_class( $element ); + + switch ( $class ) { + case 'PhpParser\Node\Arg': + if ( isset( $element->value ) ) { + return $this->get_possible_string_for_element( $element->value, $found_in_same_line, $accurate, $file ); + } + break; + + case 'PhpParser\Node\Expr\FuncCall': + if ( $this->has_function_name( $element ) ) { + $function_name = $this->get_call_name( $element ); + // Check inside a escaping function. + $functions = array_merge( array( 'trailingslashit', 'untrailingslashit' ), $this->escaping_functions ); + if ( in_array( $function_name, $functions, true ) ) { + if ( ! empty( $element->args ) && ! empty( $element->args[0] ) && ! empty( $element->args[0]->value ) ) { + return $this->get_possible_string_for_element( $element->args[0], $found_in_same_line, $accurate, $file ); + } + } + } + break; + + case 'PhpParser\Node\Scalar\String_': + case 'PhpParser\Node\Scalar\EncapsedStringPart': + if ( ! empty( $element->value ) ) { + return $element->value; + } + break; + + case 'PhpParser\Node\Identifier': + if ( ! empty( $element->name ) ) { + return $element->name; + } + break; + + case 'PhpParser\Node\Expr\BinaryOp\Concat': + case 'PhpParser\Node\Scalar\Encapsed': + $concat = $this->extract_concat_elements( $element ); + if ( ! empty( $concat ) ) { + $concat_string = ''; + foreach ( $concat as $c ) { + $string = $this->get_possible_string_for_element( $c, $found_in_same_line, $accurate, $file ); + if ( false === $string ) { + return false; + } else { + $concat_string .= $string; + } + } + return $concat_string; + } + break; + case 'PhpParser\Node\Expr\Variable': + case 'PhpParser\Node\Expr\ArrayDimFetch': + case 'PhpParser\Node\Expr\PropertyFetch': + case 'PhpParser\Node\Expr\ConstFetch': + case 'PhpParser\Node\Expr\ClassConstFetch': + $assigns = $this->get_assignments_expressions_for_variable( $element, $file ); + if ( ! empty( $assigns ) ) { + $concat_string = ''; + foreach ( $assigns as $assign ) { + if ( ! $accurate || $assign['sameContext'] ) { + $string = $this->get_possible_string_for_element( $assign['value'], $found_in_same_line, $accurate, $assign['file'] ); + if ( ! empty( $string ) ) { + $found_in_same_line = false; + } + if ( false === $string ) { + return false; + } else { + $concat_string .= $string; + } + } + } + return $concat_string; + } + break; + } + if ( $accurate ) { + return false; + } else { + return ''; + } + } + + /** + * Retrieves the lines of code that share the same execution context as the specified element. + * + * @param mixed $stmts The statements to process. + * @param mixed $element The element to find the matching execution context lines for. + * + * @return array An array of lines sharing the same execution context as the specified element. + */ + private function get_same_execution_context_lines( $stmts, $element ) { + $same_execution_context_lines = array(); + $lines_array = array(); + if ( $this->process_same_execution_context_lines( $stmts, $element, $lines_array ) ) { + $same_execution_context_lines = $lines_array; + } + + return $same_execution_context_lines; + } + + /** + * Processes statements to determine if they share the same execution context + * lines with a given element and populates an array with their line ranges. + * + * @param array $stmts The list of statements to process. + * @param object $element The element to compare the statements against. + * @param array &$lines_array The array to store lines that match within the same execution context. + * + * @return bool Returns true if the element's line range is completely within the range of any processed statement, + * otherwise false. + */ + private function process_same_execution_context_lines( $stmts, $element, &$lines_array ) { + foreach ( $stmts as $stmt ) { + $class = get_class( $stmt ); + + switch ( $class ) : + case 'PhpParser\Node\Stmt\If_': + case 'PhpParser\Node\Stmt\Else_': + case 'PhpParser\Node\Stmt\ElseIf_': + case 'PhpParser\Node\Stmt\Foreach_': + case 'PhpParser\Node\Stmt\For_': + case 'PhpParser\Node\Stmt\While_': + case 'PhpParser\Node\Stmt\Do_': + case 'PhpParser\Node\Stmt\Switch_': + case 'PhpParser\Node\Stmt\TryCatch': + $available_stmts = array(); + if ( ! empty( $stmt->stmts ) ) { + $available_stmts[] = $stmt->stmts; + } + if ( ! empty( $stmt->elseifs ) ) { + $elseifs = $stmt->elseifs; + foreach ( $elseifs as $elseif ) { + if ( ! empty( $elseif->stmts ) ) { + $available_stmts[] = $elseif->stmts; + } + } + } + if ( ! empty( $stmt->else ) ) { + if ( ! empty( $stmt->else->stmts ) ) { + $available_stmts[] = $stmt->else->stmts; + } + } + if ( ! empty( $stmt->cases ) ) { + $cases = $stmt->cases; + foreach ( $cases as $case ) { + if ( ! empty( $case->stmts ) ) { + $available_stmts[] = $case->stmts; + } + } + } + + foreach ( $available_stmts as $check_stmts ) { + $possible_array = array(); + if ( $this->process_same_execution_context_lines( $check_stmts, $element, $possible_array ) ) { + $lines_array = array_merge( $lines_array, $possible_array ); + return true; + } + } + + break; + + default: + if ( method_exists( $stmt, 'getStartLine' ) && method_exists( $element, 'getStartLine' ) && method_exists( $stmt, 'getEndLine' ) && method_exists( $element, 'getEndLine' ) && $stmt->getStartLine() <= $element->getStartLine() && $stmt->getEndLine() >= $element->getEndLine() ) { + return true; + } + $lines_array[] = array( + 'startLine' => method_exists( $stmt, 'getStartLine' ) ? $stmt->getStartLine() : 0, + 'endLine' => method_exists( $stmt, 'getEndLine' ) ? $stmt->getEndLine() : 0, + ); + + endswitch; + } + + return false; + } + + /** + * Determines whether a specific line number is being logged. + * + * @param int $line_number The line number to check. + * + * @return bool + */ + public function is_logged_line( $line_number ) { + // Intended to be extended by the specific class. + return false; + } + + /** + * Initializes the defines by processing PHP files within a specified folder. + * This method ensures that defines are only initialized once per instance. + * + * @return void + */ + private function init_defines() { + if ( $this->defines_objects_loaded ) { + return; + } + $this->defines_objects_loaded = true; + + $files = $this->files_php; + if ( empty( $files ) ) { + return; + } + $this->initialize_node_finder(); + + foreach ( $files as $file ) { + $this->init_defines_for_file( $file ); + } + } + + /** + * Initializes constants defined within a specific file. + * + * @param string $file The file path to analyze for constants. + * + * @return void + */ + private function init_defines_for_file( string $file ) { + $code = file_get_contents( $file ); + $stmts = $this->parse_code( $code ); + + if ( empty( $stmts ) ) { + return; + } + + $function_calls = $this->node_finder->findInstanceOf( $stmts, Node\Expr\FuncCall::class ); + + foreach ( $function_calls as $function_call ) { + $this->init_define_for_function( $function_call, $file ); + } + } + + /** + * Processes a function call and initializes it as a define call if valid. + * + * @param mixed $function_call The function call to be processed. + * @param string $file The file where the function call is located. + * + * @return void + */ + private function init_define_for_function( $function_call, string $file ) { + if ( ! $this->is_a_define_call( $function_call ) || ! $this->init_define_is_valid_define_call( $function_call, $file ) ) { + return; + } + + $function_call->setAttribute( 'file', $file ); + $this->defines_objects[] = $function_call; + } + + /** + * Validates whether a given function call can be initialized as a define call. + * + * @param mixed $function_call The function call to validate. + * @param string $file The file where the function call resides, used for error reporting. + * + * @return bool True if the function call is a valid define call, false otherwise. + */ + private function init_define_is_valid_define_call( $function_call, $file ) { + if ( ! isset( $function_call->args[0], $function_call->args[1] ) ) { + return false; + } + + $define_name = $this->get_define_name( $function_call ); + if ( null === $define_name ) { + return false; + } + + // I know this is weird, but some people define a define using the value of the same define they are defining and that creates an infinite loop when trying to get the value. + $elements = $this->extract_concat_elements( $function_call->args[1]->value ); + if ( ! empty( $elements ) && is_array( $elements ) ) { + foreach ( $elements as $element ) { + if ( get_class( $element ) === 'PhpParser\Node\Expr\ConstFetch' ) { + $included_const_fetch_name = $element->name->__toString(); + if ( $define_name === $included_const_fetch_name ) { + var_dump( 'IS ERROR: Infinite loop detected. Define ' . $define_name . ' at ' . $file . ':' . ( method_exists( $function_call, 'getStartLine' ) ? $function_call->getStartLine() : 0 ) . ' is defined using the value of the same define. Ignoring this define.' ); + return false; + } + } + } + } + + return true; + } + + /** + * Determines if the given element represents a call to the `define` function. + * + * @param mixed $element The element to inspect, expected to be a function call node. + * + * @return bool Returns true if the element is a function call to `define`, otherwise false. + */ + private function is_a_define_call( $element ) { + if ( is_a( $element, 'PhpParser\Node\Expr\FuncCall' ) && $this->has_function_name( $element ) && 'define' === $this->get_call_name( $element ) ) { + return true; + } + return false; + } + + /** + * Retrieves the name defined within a function call, specifically when the argument is a string. + * + * @param object $function_call The function call object, which is expected to contain arguments to be evaluated. + * + * @return string|null Returns the string value of the define name if the argument is a string, otherwise null. + */ + private function get_define_name( $function_call ) { + if ( get_class( $function_call->args[0]->value ) === 'PhpParser\Node\Scalar\String_' ) { + return $function_call->args[0]->value->value; + } + return null; + } +} diff --git a/includes/Scanner/Prefix_Scanner.php b/includes/Scanner/Prefix_Scanner.php new file mode 100644 index 000000000..31be17baf --- /dev/null +++ b/includes/Scanner/Prefix_Scanner.php @@ -0,0 +1,814 @@ +not_valid_prefixes = include dirname( __DIR__ ) . '/Vars/prefix-not-valid.php'; + + $wp_actions = include dirname( __DIR__ ) . '/Vars/wp-actions.php'; + $common_actions = include dirname( __DIR__ ) . '/Vars/common-actions.php'; + $this->wp_actions = array_merge( $wp_actions, $common_actions ); + + $wp_filters = include dirname( __DIR__ ) . '/Vars/wp-filters.php'; + $common_filters = include dirname( __DIR__ ) . '/Vars/common-filters.php'; + $this->wp_filters = array_merge( $wp_filters, $common_filters ); + + $wp_globals = include dirname( __DIR__ ) . '/Vars/wp-globals.php'; + $common_globals = include dirname( __DIR__ ) . '/Vars/common-globals.php'; + $this->wp_globals = array_merge( $wp_globals, $common_globals ); + + $this->wp_constants = include dirname( __DIR__ ) . '/Vars/wp-constants.php'; + $this->wp_options = include dirname( __DIR__ ) . '/Vars/wp-options.php'; + $this->wp_transients = include dirname( __DIR__ ) . '/Vars/wp-transients.php'; + $this->wp_site_transients = include dirname( __DIR__ ) . '/Vars/wp-site-transients.php'; + } + + /** + * Loads files. + * + * @since 1.7.0 + * + * @param array $files Array of file paths. + * @return void + */ + public function load_files( $files ) { + parent::load_files( $files ); + + if ( ! empty( $files ) ) { + foreach ( $files as $file ) { + $this->load( $file ); + } + + $this->check_prefixes( 'prefixes_code' ); + } + } + + /** + * Loads file. + * + * @since 1.7.0 + * + * @param string $file File path. + * @return null + */ + public function load( $file ) { + parent::load( $file ); + + return null; + } + + /** + * Executes a series of logging operations including tracking function calls, method calls, global declarations, and abstraction declarations. + * + * @since 1.7.0 + * + * @return void + */ + public function find() { + $this->add_function_calls_to_log(); + $this->add_method_calls_to_log(); + $this->add_globals_declarations_to_log(); + $this->add_abstractions_declarations_to_log(); + } + + /** + * Detects calls to specific functions (specially a set of WordPress functions) and adds them to the log with the argument that is of interest regarding prefixes. + * + * @since 1.7.0 + * + * @return void + */ + private function add_function_calls_to_log() { + // Find some calls to specific functions. + $function_calls = $this->node_finder->findInstanceOf( $this->stmts, Node\Expr\FuncCall::class ); + if ( ! empty( $function_calls ) ) { + foreach ( $function_calls as $function_call ) { + if ( $this->has_function_name( $function_call ) ) { + switch ( $this->get_call_name( $function_call ) ) { + case 'define': + if ( isset( $function_call->args[0] ) ) { + $this->add_call_expression_to_log( $function_call, $function_call->args[0], $this->wp_constants, 0 ); + } + break; + case 'add_option': + case 'add_site_option': + case 'update_option': + case 'update_site_option': + if ( isset( $function_call->args[0] ) ) { + $this->add_call_expression_to_log( $function_call, $function_call->args[0], $this->wp_options, 0 ); + } + break; + case 'add_network_option': + case 'update_network_option': + case 'register_setting': + if ( isset( $function_call->args[1] ) ) { + $this->add_call_expression_to_log( $function_call, $function_call->args[1], $this->wp_options, 1 ); + } + break; + case 'set_transient': + if ( isset( $function_call->args[0] ) ) { + $this->add_call_expression_to_log( $function_call, $function_call->args[0], $this->wp_transients, 0 ); + } + break; + case 'set_site_transient': + if ( isset( $function_call->args[0] ) ) { + $this->add_call_expression_to_log( $function_call, $function_call->args[0], $this->wp_site_transients, 0 ); + } + break; + case 'add_shortcode': + case 'register_post_type': + case 'register_taxonomy': + if ( isset( $function_call->args[0] ) ) { + $this->add_call_expression_to_log( $function_call, $function_call->args[0], array(), 0 ); + } + break; + case 'do_action': + if ( isset( $function_call->args[0] ) ) { + $this->add_call_expression_to_log( $function_call, $function_call->args[0], $this->wp_actions, 0 ); + } + break; + case 'apply_filters': + if ( isset( $function_call->args[0] ) ) { + $this->add_call_expression_to_log( $function_call, $function_call->args[0], $this->wp_filters, 0 ); + } + break; + case 'wp_schedule_event': + if ( isset( $function_call->args[2] ) ) { + $this->add_call_expression_to_log( $function_call, $function_call->args[2], array(), 2 ); + } + break; + case 'add_menu_page': + case 'add_management_page': + case 'add_options_page': + case 'add_theme_page': + case 'add_plugins_page': + case 'add_users_page': + case 'add_dashboard_page': + case 'add_posts_page': + case 'add_media_page': + case 'add_links_page': + case 'add_pages_page': + case 'add_comments_page': + if ( isset( $function_call->args[3] ) ) { + $possible_string = $this->get_possible_string_for_element( $function_call->args[3] ); + if ( ! empty( $possible_string ) && strlen( $possible_string ) > 8 && preg_match( '/[?\/&]/m', $possible_string ) ) { + break; // Ignore it if this is enough long url-looking string. + } + $this->add_call_expression_to_log( $function_call, $function_call->args[3], array(), 3 ); + } + break; + case 'add_submenu_page': + if ( isset( $function_call->args[4] ) ) { + $possible_string = $this->get_possible_string_for_element( $function_call->args[4] ); + if ( ! empty( $possible_string ) && strlen( $possible_string ) > 8 && preg_match( '/[?\/&]/m', $possible_string ) ) { + break; // Ignore it if this is enough long url-looking string. + } + $this->add_call_expression_to_log( $function_call, $function_call->args[4], array(), 4 ); + } + break; + case 'wp_enqueue_script': + case 'wp_register_script': + case 'wp_enqueue_style': + case 'wp_register_style': + if ( isset( $function_call->args[0] ) ) { + // Check only obvious cases where this is not the name of a library. + $possible_string = $this->get_possible_string_for_element( $function_call->args[0] ); + if ( ! empty( $possible_string ) ) { + $re1 = '/^(my|custom|style|script|css|file)(?!lint|ize)/m'; // Obvious names. + $re2 = '/^(js)(?!lint|on|ize|hint|api|olor|-cookie)[-_]/m'; // Obvious names, but more careful with js. + $re3 = '/^(admin|wp)(?!-components|-categories|-tags|-custom-fields|-custom-header|-comments|-users|-forms|-gallery|-widgets|-mediaelement|-tinymce|-ajax-response|-lists|-codemirror|-color-picker|-api|-embed|-jquery-ui-dialog|-auth-check|-pointer|-embed-template-ie|-admin|-colopicker|-editor-font|-reusable-blocks|-blocks|-block-directory|-format-library|-block-editor-content|-editor-classic-layout-styles|-reset-editor-styles|-patterns|-block-library-theme|-theme-plugin-editor|-i18n|-a11y|-backbone|-sanitize|-date|-util|-hooks|-api-request|-plupload)[-_]?/m'; // Beginning by admin or wp but ignoring core names. + if ( preg_match( $re1, $possible_string ) || preg_match( $re2, $possible_string ) || preg_match( $re3, $possible_string ) ) { + $this->add_call_expression_to_log( $function_call, $function_call->args[0], array(), 0 ); + } + } + } + break; + } + } else { + $this->log()->add_call_expr( $function_call, 0, 'prefixes_code', true ); + } + } + } + } + + /** + * Detects calls to specific methods and adds them to the log. + * + * @since 1.7.0 + * + * @return void + */ + private function add_method_calls_to_log() { + $method_calls = $this->node_finder->findInstanceOf( $this->stmts, Node\Expr\MethodCall::class ); + if ( ! empty( $method_calls ) ) { + foreach ( $method_calls as $method_call ) { + if ( ! empty( $method_call->name ) && ! empty( $method_call->var ) ) { + $methodname = $this->get_possible_string_for_element( $method_call->name ); + $varname = $this->get_variable_name( $method_call->var ); + + // WooCommerce add/update metadata (Heuristic since it checks if the variable is called product). + if ( str_contains( $varname, 'product' ) && in_array( $methodname, array( 'update_meta_data', 'add_meta_data' ), true ) ) { + if ( isset( $method_call->args[0] ) ) { + $this->add_call_expression_to_log( $method_call, $method_call->args[0], array(), 0 ); + } + } + } + } + } + } + + /** + * Detects calls to globals variables and adds them to the log. + * + * @since 1.7.0 + * + * @return void + */ + private function add_globals_declarations_to_log() { + // Find global variables definitions. + + // Eg: global $example variable. + $globals = $this->node_finder->findInstanceOf( $this->stmts, Node\Stmt\Global_::class ); + if ( ! empty( $globals ) ) { + foreach ( $globals as $global ) { + if ( ! empty( $global->vars ) ) { + foreach ( $global->vars as $global_variable ) { + if ( ! empty( $global_variable->name ) && is_string( $global_variable->name ) ) { + if ( ! in_array( $global_variable->name, $this->wp_globals, true ) ) { // Ignore known core global variables. + $this->log()->add_var_expr( $global_variable, 'prefixes_code', true ); + } + } + } + } + } + } + + // Eg: $GLOBALS['example'] variable. + $assigns = $this->node_finder->findInstanceOf( $this->stmts, Node\Expr\Assign::class ); + if ( ! empty( $assigns ) ) { + foreach ( $assigns as $assign ) { + if ( ! empty( $assign->var ) && is_a( $assign->var, 'PhpParser\Node\Expr\ArrayDimFetch' ) ) { + $dimfetch = $assign->var; + if ( 'GLOBALS' === $this->get_variable_name( $dimfetch ) ) { + $dims = $this->extract_dims_objects( $dimfetch ); + // Ignores all cases where we can't find the dim elements. + if ( isset( $dims[0] ) ) { + $this->add_call_expression_to_log( $dimfetch, $dims[0], $this->wp_globals ); + } + } + } + } + } + + // Find all consts: const EXAMPLE = 'example'. + $namespaces = $this->node_finder->findInstanceOf( $this->stmts, Node\Stmt\Namespace_::class ); + if ( empty( $namespaces ) ) { + $consts = $this->node_finder->findInstanceOf( $this->stmts, Const_::class ); + if ( ! empty( $consts ) ) { + foreach ( $consts as $const ) { + $is_inside_element_type = null; + $contextual_stmts = $this->get_contextual_stmts_for_element( $const, $is_inside_element_type )['context']; + if ( ! empty( $contextual_stmts ) && ! in_array( $is_inside_element_type, array( 'PhpParser\Node\Stmt\Class_', 'PhpParser\Node\Stmt\Interface_' ), true ) ) { // Ignore const inside a class. + if ( isset( $const->name ) && method_exists( $const->name, '__toString' ) && ! empty( $const->name->__toString() ) ) { + $this->log()->add_var_expr( $const, 'prefixes_code', true ); + } + } + } + } + } + } + + /** + * Logs abstraction declarations including namespaces, classes, functions (excluding anonymous and nested ones), + * interfaces, and traits found in the provided statements. If a namespace is defined, only namespace declarations + * are logged and the process stops early. Otherwise, all abstraction types are processed and logged accordingly. + * + * @since 1.7.0 + * + * @return void + */ + private function add_abstractions_declarations_to_log() { + // Find namespace (if namespace is defined there is no need to continue). + $namespaces = $this->node_finder->findInstanceOf( $this->stmts, Node\Stmt\Namespace_::class ); + if ( ! empty( $namespaces ) ) { + foreach ( $namespaces as $namespace ) { + $this->log()->add_namespace( $namespace, 'prefixes_code', true ); + } + } else { + // Find all class nodes. + $classes = $this->node_finder->findInstanceOf( $this->stmts, Node\Stmt\Class_::class ); + $this->log()->add_abstraction_declarations( $classes, 'prefixes_code', true ); + + // Find all functions (ignores anonymous, and inside abstractions). + $functions = $this->node_finder->findInstanceOf( $this->stmts, Node\Stmt\Function_::class ); + $this->log()->add_abstraction_declarations( $functions, 'prefixes_code', true ); + + // Find all interfaces. + $interfaces = $this->node_finder->findInstanceOf( $this->stmts, Node\Stmt\Interface_::class ); + $this->log()->add_abstraction_declarations( $interfaces, 'prefixes_code', true ); + + // Find all traits. + $traits = $this->node_finder->findInstanceOf( $this->stmts, Node\Stmt\Trait_::class ); + $this->log()->add_abstraction_declarations( $traits, 'prefixes_code', true ); + } + } + + /** + * Adds a call expression or variable expression to the log based on the given parameters. + * Handles various cases depending on the type of the call and the potential string element provided. + * Also manages additional context logging if the expression is found on a different line. + * + * @since 1.7.0 + * + * @param object $call The call expression node to be logged. + * @param mixed $expr The expression associated with the call. + * @param array $filter An optional array of strings to exclude from logging. + * @param int $arg_position The argument position to be used in logging, default is 0. + * @return void + */ + private function add_call_expression_to_log( $call, $expr, $filter = array(), $arg_position = 0 ) { + if ( ! isset( $expr ) ) { + return; + } + $possible_string_accurate = false; + $found_in_same_line = true; + $possible_string = $this->get_possible_string_for_element( $expr, $found_in_same_line, $possible_string_accurate ); + + if ( empty( $possible_string ) ) { + $this->log()->add_call_expr( $call, 0, 'prefixes_code', true ); + return; + } + + if ( ! in_array( $possible_string, $filter, true ) ) { // Ignore some strings. + $call_class = get_class( $call ); + if ( in_array( $call_class, array( 'PhpParser\Node\Expr\FuncCall', 'PhpParser\Node\Expr\MethodCall' ), true ) ) { + $this->log()->add_call_expr( $call, $arg_position, 'prefixes_code', true, $possible_string_accurate ); + } elseif ( in_array( $call_class, array( 'PhpParser\Node\Expr\ArrayDimFetch' ), true ) ) { + $this->log()->add_var_expr( $call, 'prefixes_code', true, $possible_string_accurate ); + } + } + } + + /** + * Analyzes a log of items to check naming prefixes, identifying and normalizing + * common prefixes, and logging any potential issues or observations regarding + * prefix usage. + * + * @since 1.7.0 + * + * @param string $logid The identifier of the log to analyze. + * @return void + */ + private function check_prefixes( string $logid ) { + $log = $this->log()->get( $logid ); + + // Removes exceptions and logs items whose prefix cannot be read. + $log = $this->check_prefixes_process_exceptions_from_log( $log ); + + // Lowercase all the names. + $log = $this->lowercase_item_names( $log ); + + $this->possible_prefixes = array(); + $this->already_processed_items = array(); + $this->namespaces_count = 0; + + // Check anything having a name. Extract possible prefixes. + foreach ( $log as $key => $log_item ) { + $item_identifier = $log_item['name'] . ':' . $log_item['type']; + if ( isset( $log_item['name'] ) && ! in_array( $item_identifier, $this->already_processed_items, true ) ) { + $this->already_processed_items[] = $item_identifier; + + $should_check_other_prefixes = $this->check_prefixes_add_special_prefixes( $log_item, $key ); + + if ( $should_check_other_prefixes ) { + $this->check_prefixes_add_possible_prefixes( $log_item, $key, '_' ); + $this->check_prefixes_add_possible_prefixes( $log_item, $key, '-' ); + $this->check_prefixes_add_possible_prefixes( $log_item, $key, '\\' ); + } + } + } + + $this->already_processed_items = array_unique( $this->already_processed_items ); + + // Repetitions of each possible prefix. + if ( ! empty( $this->possible_prefixes ) ) { + $logsize = count( $log ) - ( count( $log ) - count( $this->already_processed_items ) ) - $this->namespaces_count; + + $return = $this->normalize_prefixes_array( $this->possible_prefixes, $log ); + $common_prefixes = $return['commonprefixes']; + $minimum_quantity_for_considering_prefix = $this->calculate_minimum_prefix_quantity( $logsize ); + + // Checking for prefixed used commonly. + if ( ! empty( $common_prefixes ) ) { + // In some situations they use similar prefixes like "PRTPR" and "PRT_PR" we process those cases together as they were a similar prefix regarding the prefixes_analysis_prefixed log. + $similar_prefixes = $this->get_too_similar_prefixes_array( $common_prefixes ); + $prefixes_already_processed = array(); + foreach ( $common_prefixes as $prefix => $incidences ) { + $incidences_count = count( $incidences ); + if ( ! empty( $similar_prefixes[ $prefix ] ) ) { + $incidences_count = $similar_prefixes[ $prefix ]['numberincidences']; + } + if ( $incidences_count >= $minimum_quantity_for_considering_prefix || reset( $incidences ) === 'namespace' ) { + if ( ! in_array( $prefix, $prefixes_already_processed, true ) ) { + if ( ! empty( $similar_prefixes[ $prefix ] ) ) { + $this->final_prefixes = array_merge( $this->final_prefixes, $similar_prefixes[ $prefix ]['prefixes'] ); + } else { + $this->final_prefixes[] = $prefix; + } + } + } + if ( ! empty( $similar_prefixes[ $prefix ] ) ) { + $prefixes_already_processed = array_merge( $prefixes_already_processed, $similar_prefixes[ $prefix ]['prefixes'] ); + } else { + $prefixes_already_processed[] = $prefix; + } + } + } + + // Discard prefixes that are less than 4 characters long. + $this->final_prefixes = array_filter( + $this->final_prefixes, + function ( $item ) { + return strlen( $item ) >= 4; + } + ); + + // Discard not valid prefixes. + $this->final_prefixes = array_diff( $this->final_prefixes, $this->not_valid_prefixes ); + } + } + + /** + * Checks if the given log item's name has a specific special prefix and updates the possible prefixes list accordingly. + * + * @since 1.7.0 + * + * @param array $log_item The log item array containing information such as 'name' and 'type'. + * @param mixed $key The key used to associate the log item's type with the special prefix in the internal structure. + * @return bool Returns false if a matching special prefix is found and processed, otherwise true. + */ + private function check_prefixes_add_special_prefixes( array $log_item, $key ) { + $special_prefixes = array( '__', '_', '-' ); + + foreach ( $special_prefixes as $special_prefix ) { + if ( str_starts_with( $log_item['name'], $special_prefix ) && + ( 'abstraction' === $log_item['type'] || $special_prefix === $log_item['name'] ) + ) { + $this->possible_prefixes[ $special_prefix ][ $key ] = $log_item['type']; + return false; + } + } + + return true; + } + + /** + * Processes and filters a log array to detect and handle items without names, + * and exceptions based on specific conditions. Alters the $log array by + * removing items that meet exclusion criteria while maintaining a record + * of unidentified prefix items. + * + * @since 1.7.0 + * + * @param array $log The log array to process, containing items with keys such as 'name', 'type', and 'text'. + * @return array The filtered log array after processing and exclusion of specific items. + */ + private function check_prefixes_process_exceptions_from_log( array $log ) { + $log_without_name = array(); + foreach ( $log as $key => $item ) { + // Log anything that doesn't has name. + // No name or is a function defined by a variable. + if ( ! isset( $item['name'] ) || 'function_call-PhpParser\Node\Expr\Variable' === $item['type'] || false === $item['name'] ) { + $log_without_name[ $key ] = $item; + unset( $log[ $key ] ); + } + + // Exceptions. + if ( ! empty( $item['name'] ) && 'abstraction' === $item['type'] && str_starts_with( $item['text'], 'class ' ) ) { + if ( preg_match( '/^wc_gateway_/i', $item['name'] ) ) { + unset( $log[ $key ] ); // Ignoring classes that begins with WC_Gateway as that's recommended in the WC documentation. + } + } + } + + if ( ! empty( $log_without_name ) ) { + $this->log()->add( '0', '# ██ ⚠ There are some elements we are not able to detect their prefixes.', 'prefixes_analysis_noname' ); + $this->log()->merge( $log_without_name, 'prefixes_analysis_noname' ); + } + + return $log; + } + + /** + * Converts the 'name' value of each item in the provided array to lowercase if it exists. + * + * @since 1.7.0 + * + * @param array $log An array of items, where each item may contain a 'name' key. + * @return array The modified array with the 'name' values converted to lowercase. + */ + private function lowercase_item_names( array $log ) { + foreach ( $log as $key => $item ) { + if ( isset( $item['name'] ) ) { + $log[ $key ]['name'] = strtolower( $item['name'] ); + } + } + return $log; + } + + /** + * Determines the minimum prefix quantity based on the provided log count, + * using varying thresholds and calculations depending on the value of the input. + * + * @since 1.7.0 + * + * @param int $log_count The total number of logs for which the minimum prefix quantity is to be calculated. + * @return int The calculated minimum prefix quantity. + */ + private function calculate_minimum_prefix_quantity( int $log_count ) { + if ( $log_count <= 2 ) { + return 1; + } elseif ( $log_count <= 4 ) { + return 2; + } elseif ( $log_count <= 8 ) { + return 3; + } elseif ( $log_count < 20 ) { + return intval( $log_count / 4 ); + } + return (int) ( log( $log_count ) * 2 ); + } + + /** + * Processes the input item to identify potential prefixes and add them to the list of possible prefixes. + * Handles namespace counting, formats complete names, splits prefixes using a specified separator, + * and checks for multi-part prefixes. + * + * @since 1.7.0 + * + * @param array $item Array containing details, including 'name' and 'type', used to process and identify prefixes. + * @param string $key Key associated with the prefix being processed. + * @param string $separator Optional separator used to split the item name for extracting prefixes. Default is '_'. + * @return void + */ + private function check_prefixes_add_possible_prefixes( $item, $key, $separator = '_' ) { + $complete_name_formatted = str_replace( array( '-', '\\' ), '_', $item['name'] ); + + if ( 'namespace' === $item['type'] ) { + ++$this->namespaces_count; + } + + $this->possible_prefixes[ $complete_name_formatted ][ $key ] = $item['type']; + + $extract_prefixes = explode( $separator, $complete_name_formatted ); + + // Remove special characters at the beginning. + if ( empty( $extract_prefixes[0] ) ) { + array_shift( $extract_prefixes ); + } + + $prefix_parts_count = count( $extract_prefixes ); + + if ( $prefix_parts_count > 1 ) { + $this->check_prefixes_add_possible_prefix( $item, $key, $extract_prefixes[0] ); + if ( $prefix_parts_count > 2 ) { + $this->check_prefixes_add_possible_prefix( $item, $key, $extract_prefixes[0] . '_' . $extract_prefixes[1] ); + } + } + } + + /** + * Updates the possible prefixes by adding the type of the provided item + * under the specified prefix and key. + * + * @since 1.7.0 + * + * @param array $item The item containing data, including its type, to be added. + * @param string $key The key under which the item type is stored for the prefix. + * @param string $prefix The prefix to which the item type is associated. + * @return void + */ + private function check_prefixes_add_possible_prefix( $item, $key, $prefix ) { + $this->possible_prefixes[ $prefix ][ $key ] = $item['type']; + } + + /** + * Normalizes the given array of common prefixes by performing several tasks including: + * filtering invalid or warning prefixes, removing redundant incidences, + * ordering prefixes by length, and removing prefixes that are contained within others. + * + * @since 1.7.0 + * + * @param array $common_prefixes An associative array where keys are prefixes and values are arrays of incidences. + * @param array $log A log array that tracks incidences and messages related to prefixes. + * @return array An associative array containing the updated 'commonprefixes' and 'log' after processing. + */ + private function normalize_prefixes_array( $common_prefixes, $log ) { + if ( ! empty( $common_prefixes ) ) { + + // Remove incidences for just one element, unless it's a namespace, or there is just really one element. + if ( sizeof( $log ) > 1 ) { + foreach ( $common_prefixes as $prefix => $array ) { + if ( sizeof( $array ) <= 1 ) { + if ( reset( $array ) !== 'namespace' ) { + unset( $common_prefixes[ $prefix ] ); + } + } + } + } + + // Order by bigger prefixes. + $keys = array_map( 'strlen', array_keys( $common_prefixes ) ); + array_multisort( $keys, SORT_DESC, $common_prefixes ); + + // Remove prefixes that are inside other prefixes. + foreach ( $common_prefixes as $prefix => $incidences ) { + foreach ( $common_prefixes as $prefix_2 => $incidences_2 ) { + if ( $prefix !== $prefix_2 ) { + if ( str_starts_with( $prefix, $prefix_2 ) ) { // If $prefix starts with $prefix2. + // Remove short prefixes incidences that are within longer prefixes. + $within = ! array_diff_assoc( $incidences_2, $incidences ); + if ( $within ) { + unset( $common_prefixes[ $prefix_2 ] ); + } else { + // Remove longer prefixes incidences that are within shorter prefixes. + $within = ! array_diff_assoc( $incidences, $incidences_2 ); + if ( $within ) { + unset( $common_prefixes[ $prefix ] ); + } + } + } + } + } + } + } + + return array( + 'commonprefixes' => $common_prefixes, + 'log' => $log, + ); + } + + /** + * Identifies and groups prefixes from the provided list that are too similar + * based on normalization criteria. It returns an associative array containing + * the group of similar prefixes along with their total incidences. + * + * @since 1.7.0 + * + * @param array $common_prefixes An associative array where keys are prefixes and values are arrays of incidences for each prefix. + * @return array An associative array where each key is a prefix and the corresponding value is an array containing similar prefixes and the total number of incidences. + */ + private function get_too_similar_prefixes_array( $common_prefixes ) { + $similar_prefixes = array(); + if ( ! empty( $common_prefixes ) ) { + foreach ( $common_prefixes as $prefix => $incidences ) { + foreach ( $common_prefixes as $prefix_search => $incidences_search ) { + if ( $prefix !== $prefix_search && $this->get_prefix_name_normalized( $prefix ) === $this->get_prefix_name_normalized( $prefix_search ) ) { + if ( empty( $similar_prefixes[ $prefix ] ) ) { + $similar_prefixes[ $prefix ] = array( + 'prefixes' => array( $prefix ), + 'numberincidences' => count( $incidences ), + ); + } + $similar_prefixes[ $prefix ]['prefixes'][] = $prefix_search; + $similar_prefixes[ $prefix ]['numberincidences'] += count( $incidences_search ); + } + } + } + } + return $similar_prefixes; + } + + /** + * Normalizes a given prefix by removing underscores and hyphens. + * + * @since 1.7.0 + * + * @param string $prefix The original prefix to be normalized. + * @return string The normalized prefix. + */ + private function get_prefix_name_normalized( $prefix ) { + $normalized = preg_replace( '/[\-_]/', '', $prefix ); + + return empty( $normalized ) ? $prefix : $normalized; + } +} diff --git a/includes/Traits/Prefix_Utils.php b/includes/Traits/Prefix_Utils.php new file mode 100644 index 000000000..10a4d4ade --- /dev/null +++ b/includes/Traits/Prefix_Utils.php @@ -0,0 +1,120 @@ +plugin() ); + + $obj = new Prefix_Scanner(); + + $obj->load_files( $files ); + + $potential_prefixes = $obj->final_prefixes; + + return $potential_prefixes; + } + + /** + * Gets the list of all files that are part of the given plugin. + * + * @since 1.7.0 + * + * @param Check_Context $plugin Context for the plugin to check. + * @return array List of absolute file paths. + * + * @SuppressWarnings(PHPMD.NPathComplexity) + */ + private static function get_files( Check_Context $plugin ) { + $location = wp_normalize_path( $plugin->location() ); + + if ( isset( self::$file_list_cache[ $location ] ) ) { + return self::$file_list_cache[ $location ]; + } + + self::$file_list_cache[ $location ] = array(); + + // If the location is a plugin folder, get all its files. + // Otherwise, it is a single-file plugin. + if ( $plugin->is_single_file_plugin() ) { + self::$file_list_cache[ $location ][] = $location; + } else { + $iterator = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $location ) ); + foreach ( $iterator as $file ) { + if ( ! $file->isFile() ) { + continue; + } + + // Only .php files. + $file_extension = pathinfo( $file->getFilename(), PATHINFO_EXTENSION ); + if ( empty( $file_extension ) || ! in_array( $file_extension, array( 'php', 'phtml' ), true ) ) { + continue; + } + + $file_path = wp_normalize_path( $file->getPathname() ); + + $directories_to_ignore = Plugin_Request_Utility::get_directories_to_ignore(); + + // Flag to check if the file should be included or not. + $include_file = true; + + foreach ( $directories_to_ignore as $directory ) { + // Check if the current file belongs to the directory you want to ignore. + if ( false !== strpos( $file_path, '/' . $directory . '/' ) ) { + $include_file = false; + break; // Skip the file if it matches any ignored directory. + } + } + + $files_to_ignore = Plugin_Request_Utility::get_files_to_ignore(); + + foreach ( $files_to_ignore as $ignore_file ) { + if ( str_ends_with( $file_path, "/$ignore_file" ) ) { + $include_file = false; + break; + } + } + + if ( $include_file ) { + self::$file_list_cache[ $location ][] = $file_path; + } + } + } + + return self::$file_list_cache[ $location ]; + } +} diff --git a/includes/Vars/common-actions.php b/includes/Vars/common-actions.php new file mode 100644 index 000000000..b75f44dae --- /dev/null +++ b/includes/Vars/common-actions.php @@ -0,0 +1,40 @@ + '_admin_menu', + 1 => '_core_updated_successfully', + 2 => '_network_admin_menu', + 3 => '_user_admin_menu', + 4 => '_wp_put_post_revision', + 5 => 'activate_blog', + 6 => 'activate_header', + 7 => 'activate_plugin', + 8 => 'activate_wp_head', + 9 => 'activate_{$plugin}', + 10 => 'activated_plugin', + 11 => 'activity_box_end', + 12 => 'add_admin_bar_menus', + 13 => 'add_attachment', + 14 => 'add_inline_data', + 15 => 'add_link', + 16 => 'add_meta_boxes', + 17 => 'add_meta_boxes_comment', + 18 => 'add_meta_boxes_link', + 19 => 'add_meta_boxes_{$post_type}', + 20 => 'add_meta_boxes_attachment', + 21 => 'add_meta_boxes_page', + 22 => 'add_meta_boxes_post', + 23 => 'add_option', + 24 => 'add_option_{$option}', + 25 => 'add_site_option', + 26 => 'add_site_option_{$option}', + 27 => 'add_tag_form_fields', + 28 => 'add_term_relationship', + 29 => 'add_user_role', + 30 => 'add_user_to_blog', + 31 => 'add_{$meta_type}_meta', + 32 => 'add_comment_meta', + 33 => 'add_post_meta', + 34 => 'add_term_meta', + 35 => 'add_user_meta', + 36 => 'added_existing_user', + 37 => 'added_option', + 38 => 'added_term_relationship', + 39 => 'added_{$meta_type}_meta', + 40 => 'added_comment_meta', + 41 => 'added_post_meta', + 42 => 'added_term_meta', + 43 => 'added_user_meta', + 44 => 'admin_action_{$action}', + 45 => 'admin_bar_init', + 46 => 'admin_bar_menu', + 47 => 'admin_color_scheme_picker', + 48 => 'admin_email_confirm', + 49 => 'admin_email_confirm_form', + 50 => 'admin_enqueue_scripts', + 51 => 'admin_footer', + 52 => 'admin_footer-{$hook_suffix}', + 53 => 'admin_head', + 54 => 'admin_head-media-upload-popup', + 55 => 'admin_head-{$hook_suffix}', + 56 => 'admin_head_{$content_func}', + 57 => 'admin_init', + 58 => 'admin_menu', + 59 => 'admin_notices', + 60 => 'admin_page_access_denied', + 61 => 'admin_post', + 62 => 'admin_post_nopriv', + 63 => 'admin_post_nopriv_{$action}', + 64 => 'admin_post_{$action}', + 65 => 'admin_print_footer_scripts', + 66 => 'admin_print_footer_scripts-{$hook_suffix}', + 67 => 'admin_print_scripts', + 68 => 'admin_print_scripts-media-upload-popup', + 69 => 'admin_print_scripts-{$hook_suffix}', + 70 => 'admin_print_styles', + 71 => 'admin_print_styles-media-upload-popup', + 72 => 'admin_print_styles-{$hook_suffix}', + 73 => 'admin_xml_ns', + 74 => 'adminmenu', + 75 => 'after-{$taxonomy}-table', + 76 => 'after-category-table', + 77 => 'after-post_tag-table', + 78 => 'after_core_auto_updates_settings', + 79 => 'after_db_upgrade', + 80 => 'after_delete_post', + 81 => 'after_menu_locations_table', + 82 => 'after_mu_upgrade', + 83 => 'after_password_reset', + 84 => 'after_plugin_row', + 85 => 'after_plugin_row_{$plugin_file}', + 86 => 'after_setup_theme', + 87 => 'after_signup_form', + 88 => 'after_signup_site', + 89 => 'after_signup_user', + 90 => 'after_switch_theme', + 91 => 'after_theme_row', + 92 => 'after_theme_row_{$stylesheet}', + 93 => 'after_wp_tiny_mce', + 94 => 'all_admin_notices', + 95 => 'application_password_did_authenticate', + 96 => 'application_password_failed_authentication', + 97 => 'archive_blog', + 98 => 'atom_author', + 99 => 'atom_comments_ns', + 100 => 'atom_entry', + 101 => 'atom_head', + 102 => 'atom_ns', + 103 => 'attachment_submitbox_misc_actions', + 104 => 'attachment_updated', + 105 => 'auth_cookie_bad_hash', + 106 => 'auth_cookie_bad_session_token', + 107 => 'auth_cookie_bad_username', + 108 => 'auth_cookie_expired', + 109 => 'auth_cookie_malformed', + 110 => 'auth_cookie_valid', + 111 => 'auth_redirect', + 112 => 'automatic_updates_complete', + 113 => 'before_delete_post', + 114 => 'before_signup_form', + 115 => 'before_signup_header', + 116 => 'before_wp_tiny_mce', + 117 => 'begin_fetch_post_thumbnail_html', + 118 => 'block_editor_meta_box_hidden_fields', + 119 => 'blog_privacy_selector', + 120 => 'bulk_edit_custom_box', + 121 => 'bulk_edit_posts', + 122 => 'change_locale', + 123 => 'check_admin_referer', + 124 => 'check_ajax_referer', + 125 => 'check_comment_flood', + 126 => 'check_passwords', + 127 => 'clean_attachment_cache', + 128 => 'clean_comment_cache', + 129 => 'clean_network_cache', + 130 => 'clean_object_term_cache', + 131 => 'clean_page_cache', + 132 => 'clean_post_cache', + 133 => 'clean_site_cache', + 134 => 'clean_taxonomy_cache', + 135 => 'clean_term_cache', + 136 => 'clean_user_cache', + 137 => 'clear_auth_cookie', + 138 => 'comment_atom_entry', + 139 => 'comment_closed', + 140 => 'comment_duplicate_trigger', + 141 => 'comment_flood_trigger', + 142 => 'comment_form', + 143 => 'comment_form_after', + 144 => 'comment_form_after_fields', + 145 => 'comment_form_before', + 146 => 'comment_form_before_fields', + 147 => 'comment_form_comments_closed', + 148 => 'comment_form_logged_in_after', + 149 => 'comment_form_must_log_in_after', + 150 => 'comment_form_top', + 151 => 'comment_id_not_found', + 152 => 'comment_loop_start', + 153 => 'comment_on_draft', + 154 => 'comment_on_password_protected', + 155 => 'comment_on_trash', + 156 => 'comment_post', + 157 => 'comment_reply_to_unapproved_comment', + 158 => 'comment_{$new_status}_{$comment->comment_type}', + 159 => 'comment_approved_comment', + 160 => 'comment_approved_pingback', + 161 => 'comment_approved_trackback', + 162 => 'comment_spam_comment', + 163 => 'comment_spam_pingback', + 164 => 'comment_spam_trackback', + 165 => 'comment_unapproved_comment', + 166 => 'comment_unapproved_pingback', + 167 => 'comment_unapproved_trackback', + 168 => 'comment_{$old_status}_to_{$new_status}', + 169 => 'comment_approved_to_spam', + 170 => 'comment_approved_to_unapproved', + 171 => 'comment_spam_to_approved', + 172 => 'comment_spam_to_unapproved', + 173 => 'comment_unapproved_to_approved', + 174 => 'comment_unapproved_to_spam', + 175 => 'commentrss2_item', + 176 => 'comments_atom_head', + 177 => 'commentsrss2_head', + 178 => 'core_upgrade_preamble', + 179 => 'create_term', + 180 => 'create_{$taxonomy}', + 181 => 'create_category', + 182 => 'create_post_tag', + 183 => 'created_term', + 184 => 'created_{$taxonomy}', + 185 => 'created_category', + 186 => 'created_post_tag', + 187 => 'cron_reschedule_event_error', + 188 => 'cron_unschedule_event_error', + 189 => 'current_screen', + 190 => 'custom_header_options', + 191 => 'customize_controls_enqueue_scripts', + 192 => 'customize_controls_head', + 193 => 'customize_controls_init', + 194 => 'customize_controls_print_footer_scripts', + 195 => 'customize_controls_print_scripts', + 196 => 'customize_controls_print_styles', + 197 => 'customize_post_value_set', + 198 => 'customize_post_value_set_{$setting_id}', + 199 => 'customize_preview_init', + 200 => 'customize_preview_{$this->id}', + 201 => 'customize_preview_{$this->type}', + 202 => 'customize_register', + 203 => 'customize_render_control', + 204 => 'customize_render_control_{$this->id}', + 205 => 'customize_render_panel', + 206 => 'customize_render_panel_{$this->id}', + 207 => 'customize_render_partials_after', + 208 => 'customize_render_partials_before', + 209 => 'customize_render_section', + 210 => 'customize_render_section_{$this->id}', + 211 => 'customize_save', + 212 => 'customize_save_after', + 213 => 'customize_save_validation_before', + 214 => 'customize_save_{$id_base}', + 215 => 'customize_update_{$this->type}', + 216 => 'dbx_post_sidebar', + 217 => 'deactivate_blog', + 218 => 'deactivate_plugin', + 219 => 'deactivate_{$plugin}', + 220 => 'deactivated_plugin', + 221 => 'delete_attachment', + 222 => 'delete_comment', + 223 => 'delete_link', + 224 => 'delete_option', + 225 => 'delete_option_{$option}', + 226 => 'delete_plugin', + 227 => 'delete_post', + 228 => 'delete_postmeta', + 229 => 'delete_site_option', + 230 => 'delete_site_option_{$option}', + 231 => 'delete_site_transient_{$transient}', + 232 => 'delete_term', + 233 => 'delete_term_relationships', + 234 => 'delete_term_taxonomy', + 235 => 'delete_theme', + 236 => 'delete_transient_{$transient}', + 237 => 'delete_user', + 238 => 'delete_user_form', + 239 => 'delete_widget', + 240 => 'delete_{$meta_type}_meta', + 241 => 'delete_comment_meta', + 242 => 'delete_post_meta', + 243 => 'delete_term_meta', + 244 => 'delete_user_meta', + 245 => 'delete_{$meta_type}meta', + 246 => 'delete_commentmeta', + 247 => 'delete_postmeta', + 248 => 'delete_termmeta', + 249 => 'delete_usermeta', + 250 => 'delete_{$taxonomy}', + 251 => 'delete_category', + 252 => 'delete_post_tag', + 253 => 'deleted_comment', + 254 => 'deleted_link', + 255 => 'deleted_option', + 256 => 'deleted_plugin', + 257 => 'deleted_post', + 258 => 'deleted_postmeta', + 259 => 'deleted_site_transient', + 260 => 'deleted_term_relationships', + 261 => 'deleted_term_taxonomy', + 262 => 'deleted_theme', + 263 => 'deleted_transient', + 264 => 'deleted_user', + 265 => 'deleted_{$meta_type}_meta', + 266 => 'deleted_comment_meta', + 267 => 'deleted_post_meta', + 268 => 'deleted_term_meta', + 269 => 'deleted_user_meta', + 270 => 'deleted_{$meta_type}meta', + 271 => 'deleted_commentmeta', + 272 => 'deleted_postmeta', + 273 => 'deleted_termmeta', + 274 => 'deleted_usermeta', + 275 => 'deprecated_argument_run', + 276 => 'deprecated_class_run', + 277 => 'deprecated_constructor_run', + 278 => 'deprecated_file_included', + 279 => 'deprecated_function_run', + 280 => 'deprecated_hook_run', + 281 => 'do_all_pings', + 282 => 'do_favicon', + 283 => 'do_faviconico', + 284 => 'do_feed_{$feed}', + 285 => 'do_feed_atom', + 286 => 'do_feed_rdf', + 287 => 'do_feed_rss', + 288 => 'do_feed_rss2', + 289 => 'do_meta_boxes', + 290 => 'do_robots', + 291 => 'do_robotstxt', + 292 => 'doing_it_wrong_run', + 293 => 'dynamic_sidebar', + 294 => 'dynamic_sidebar_after', + 295 => 'dynamic_sidebar_before', + 296 => 'edit_attachment', + 297 => 'edit_comment', + 298 => 'edit_form_advanced', + 299 => 'edit_form_after_editor', + 300 => 'edit_form_after_title', + 301 => 'edit_form_before_permalink', + 302 => 'edit_form_top', + 303 => 'edit_link', + 304 => 'edit_page_form', + 305 => 'edit_post', + 306 => 'edit_post_{$post->post_type}', + 307 => 'edit_post_page', + 308 => 'edit_post_post', + 309 => 'edit_term', + 310 => 'edit_term_taxonomies', + 311 => 'edit_term_taxonomy', + 312 => 'edit_terms', + 313 => 'edit_user_created_user', + 314 => 'edit_user_profile', + 315 => 'edit_user_profile_update', + 316 => 'edit_{$taxonomy}', + 317 => 'edit_category', + 318 => 'edit_post_tag', + 319 => 'edited_term', + 320 => 'edited_term_taxonomies', + 321 => 'edited_term_taxonomy', + 322 => 'edited_terms', + 323 => 'edited_{$taxonomy}', + 324 => 'edited_category', + 325 => 'edited_post_tag', + 326 => 'embed_content', + 327 => 'embed_content_meta', + 328 => 'embed_footer', + 329 => 'embed_head', + 330 => 'end_fetch_post_thumbnail_html', + 331 => 'enqueue_block_assets', + 332 => 'enqueue_block_editor_assets', + 333 => 'enqueue_embed_scripts', + 334 => 'export_filters', + 335 => 'export_wp', + 336 => 'generate_recovery_mode_key', + 337 => 'generate_rewrite_rules', + 338 => 'get_footer', + 339 => 'get_header', + 340 => 'get_sidebar', + 341 => 'get_template_part', + 342 => 'get_template_part_{$slug}', + 343 => 'grant_super_admin', + 344 => 'granted_super_admin', + 345 => 'heartbeat_nopriv_tick', + 346 => 'heartbeat_tick', + 347 => 'http_api_curl', + 348 => 'http_api_debug', + 349 => 'in_admin_footer', + 350 => 'in_admin_header', + 351 => 'in_plugin_update_message-{$file}', + 352 => 'in_theme_update_message-{$theme_key}', + 353 => 'in_widget_form', + 354 => 'init', + 355 => 'install_plugins_pre_{$tab}', + 356 => 'install_plugins_pre_beta', + 357 => 'install_plugins_pre_favorites', + 358 => 'install_plugins_pre_featured', + 359 => 'install_plugins_pre_plugin-information', + 360 => 'install_plugins_pre_popular', + 361 => 'install_plugins_pre_recommended', + 362 => 'install_plugins_pre_search', + 363 => 'install_plugins_pre_upload', + 364 => 'install_plugins_table_header', + 365 => 'install_plugins_{$tab}', + 366 => 'install_plugins_beta', + 367 => 'install_plugins_favorites', + 368 => 'install_plugins_featured', + 369 => 'install_plugins_plugin-information', + 370 => 'install_plugins_popular', + 371 => 'install_plugins_recommended', + 372 => 'install_plugins_search', + 373 => 'install_plugins_upload', + 374 => 'install_themes_pre_{$tab}', + 375 => 'install_themes_pre_block-themes', + 376 => 'install_themes_pre_dashboard', + 377 => 'install_themes_pre_featured', + 378 => 'install_themes_pre_new', + 379 => 'install_themes_pre_search', + 380 => 'install_themes_pre_updated', + 381 => 'install_themes_pre_upload', + 382 => 'install_themes_table_header', + 383 => 'install_themes_{$tab}', + 384 => 'install_themes_block-themes', + 385 => 'install_themes_dashboard', + 386 => 'install_themes_featured', + 387 => 'install_themes_new', + 388 => 'install_themes_search', + 389 => 'install_themes_updated', + 390 => 'install_themes_upload', + 391 => 'invite_user', + 392 => 'is_wp_error_instance', + 393 => 'load-importer-{$importer}', + 394 => 'load-importer-blogger', + 395 => 'load-importer-livejournal', + 396 => 'load-importer-mt', + 397 => 'load-importer-rss', + 398 => 'load-importer-tumblr', + 399 => 'load-importer-wordpress', + 400 => 'load-importer-wpcat2tag', + 401 => 'load-widgets.php', + 402 => 'load-{$page_hook}', + 403 => 'load-{$pagenow}', + 404 => 'load-{$plugin_page}', + 405 => 'load_feed_engine', + 406 => 'load_textdomain', + 407 => 'login_enqueue_scripts', + 408 => 'login_footer', + 409 => 'login_form', + 410 => 'login_form_{$action}', + 411 => 'login_form_checkemail', + 412 => 'login_form_confirm_admin_email', + 413 => 'login_form_confirmaction', + 414 => 'login_form_entered_recovery_mode', + 415 => 'login_form_login', + 416 => 'login_form_logout', + 417 => 'login_form_lostpassword', + 418 => 'login_form_postpass', + 419 => 'login_form_register', + 420 => 'login_form_resetpass', + 421 => 'login_form_retrievepassword', + 422 => 'login_form_rp', + 423 => 'login_head', + 424 => 'login_header', + 425 => 'login_init', + 426 => 'loop_end', + 427 => 'loop_no_results', + 428 => 'loop_start', + 429 => 'lost_password', + 430 => 'lostpassword_form', + 431 => 'lostpassword_post', + 432 => 'make_delete_blog', + 433 => 'make_ham_blog', + 434 => 'make_ham_user', + 435 => 'make_spam_blog', + 436 => 'make_spam_user', + 437 => 'make_undelete_blog', + 438 => 'manage_comments_custom_column', + 439 => 'manage_comments_nav', + 440 => 'manage_link_custom_column', + 441 => 'manage_media_custom_column', + 442 => 'manage_pages_custom_column', + 443 => 'manage_plugins_custom_column', + 444 => 'manage_posts_custom_column', + 445 => 'manage_posts_extra_tablenav', + 446 => 'manage_sites_custom_column', + 447 => 'manage_sites_extra_tablenav', + 448 => 'manage_themes_custom_column', + 449 => 'manage_users_extra_tablenav', + 450 => 'manage_{$post->post_type}_posts_custom_column', + 451 => 'manage_page_posts_custom_column', + 452 => 'manage_post_posts_custom_column', + 453 => 'manage_{$this->screen->id}_custom_column', + 454 => 'manage_{$this->screen->id}_custom_column_js_template', + 455 => 'mature_blog', + 456 => 'media_buttons', + 457 => 'media_upload_{$tab}', + 458 => 'media_upload_{$type}', + 459 => 'media_upload_audio', + 460 => 'media_upload_file', + 461 => 'media_upload_image', + 462 => 'media_upload_video', + 463 => 'metadata_lazyloader_queued_objects', + 464 => 'ms_loaded', + 465 => 'ms_network_not_found', + 466 => 'ms_site_not_found', + 467 => 'mu_activity_box_end', + 468 => 'mu_plugin_loaded', + 469 => 'mu_rightnow_end', + 470 => 'muplugins_loaded', + 471 => 'myblogs_allblogs_options', + 472 => 'network_admin_edit_{$action}', + 473 => 'network_admin_menu', + 474 => 'network_admin_notices', + 475 => 'network_plugin_loaded', + 476 => 'network_site_info_form', + 477 => 'network_site_new_created_user', + 478 => 'network_site_new_form', + 479 => 'network_site_users_after_list_table', + 480 => 'network_site_users_created_user', + 481 => 'network_user_new_created_user', + 482 => 'network_user_new_form', + 483 => 'opml_head', + 484 => 'page_attributes_meta_box_template', + 485 => 'page_attributes_misc_attributes', + 486 => 'parse_comment_query', + 487 => 'parse_network_query', + 488 => 'parse_query', + 489 => 'parse_request', + 490 => 'parse_site_query', + 491 => 'parse_tax_query', + 492 => 'parse_term_query', + 493 => 'password_reset', + 494 => 'permalink_structure_changed', + 495 => 'personal_options', + 496 => 'personal_options_update', + 497 => 'phpmailer_init', + 498 => 'pingback_post', + 499 => 'plugin_loaded', + 500 => 'plugins_loaded', + 501 => 'populate_options', + 502 => 'post-html-upload-ui', + 503 => 'post-plupload-upload-ui', + 504 => 'post-upload-ui', + 505 => 'post_action_{$action}', + 506 => 'post_comment_status_meta_box-options', + 507 => 'post_edit_form_tag', + 508 => 'post_lock_lost_dialog', + 509 => 'post_locked_dialog', + 510 => 'post_stuck', + 511 => 'post_submitbox_minor_actions', + 512 => 'post_submitbox_misc_actions', + 513 => 'post_submitbox_start', + 514 => 'post_unstuck', + 515 => 'post_updated', + 516 => 'posts_selection', + 517 => 'pre-html-upload-ui', + 518 => 'pre-plupload-upload-ui', + 519 => 'pre-upload-ui', + 520 => 'pre_auto_update', + 521 => 'pre_comment_on_post', + 522 => 'pre_current_active_plugins', + 523 => 'pre_delete_site_option_{$option}', + 524 => 'pre_delete_term', + 525 => 'pre_get_comments', + 526 => 'pre_get_networks', + 527 => 'pre_get_posts', + 528 => 'pre_get_search_form', + 529 => 'pre_get_sites', + 530 => 'pre_get_terms', + 531 => 'pre_get_users', + 532 => 'pre_network_site_new_created_user', + 533 => 'pre_ping', + 534 => 'pre_post_update', + 535 => 'pre_trackback_post', + 536 => 'pre_uninstall_plugin', + 537 => 'pre_user_query', + 538 => 'preprocess_signup_form', + 539 => 'print_default_editor_scripts', + 540 => 'print_media_templates', + 541 => 'profile_personal_options', + 542 => 'profile_update', + 543 => 'publish_phone', + 544 => 'quick_edit_custom_box', + 545 => 'rdf_header', + 546 => 'rdf_item', + 547 => 'rdf_ns', + 548 => 'register_form', + 549 => 'register_new_user', + 550 => 'register_post', + 551 => 'register_setting', + 552 => 'register_sidebar', + 553 => 'registered_post_type', + 554 => 'registered_post_type_{$post_type}', + 555 => 'registered_post_type_page', + 556 => 'registered_post_type_post', + 557 => 'registered_taxonomy', + 558 => 'registered_taxonomy_for_object_type', + 559 => 'registered_taxonomy_{$taxonomy}', + 560 => 'registered_taxonomy_category', + 561 => 'registered_taxonomy_post_tag', + 562 => 'remove_user_from_blog', + 563 => 'remove_user_role', + 564 => 'render_block_core_template_part_file', + 565 => 'render_block_core_template_part_none', + 566 => 'render_block_core_template_part_post', + 567 => 'requests-{$hook}', + 568 => 'resetpass_form', + 569 => 'rest_after_insert_application_password', + 570 => 'rest_after_insert_attachment', + 571 => 'rest_after_insert_comment', + 572 => 'rest_after_insert_nav_menu_item', + 573 => 'rest_after_insert_user', + 574 => 'rest_after_insert_{$this->post_type}', + 575 => 'rest_after_insert_attachment', + 576 => 'rest_after_insert_page', + 577 => 'rest_after_insert_post', + 578 => 'rest_after_insert_{$this->taxonomy}', + 579 => 'rest_after_insert_category', + 580 => 'rest_after_insert_post_tag', + 581 => 'rest_after_save_widget', + 582 => 'rest_api_init', + 583 => 'rest_delete_comment', + 584 => 'rest_delete_nav_menu_item', + 585 => 'rest_delete_revision', + 586 => 'rest_delete_user', + 587 => 'rest_delete_widget', + 588 => 'rest_delete_{$this->post_type}', + 589 => 'rest_delete_attachment', + 590 => 'rest_delete_page', + 591 => 'rest_delete_post', + 592 => 'rest_delete_{$this->taxonomy}', + 593 => 'rest_delete_category', + 594 => 'rest_delete_post_tag', + 595 => 'rest_insert_attachment', + 596 => 'rest_insert_comment', + 597 => 'rest_insert_nav_menu_item', + 598 => 'rest_insert_user', + 599 => 'rest_insert_{$this->post_type}', + 600 => 'rest_insert_attachment', + 601 => 'rest_insert_page', + 602 => 'rest_insert_post', + 603 => 'rest_insert_{$this->taxonomy}', + 604 => 'rest_insert_category', + 605 => 'rest_insert_post_tag', + 606 => 'rest_save_sidebar', + 607 => 'restore_previous_locale', + 608 => 'restrict_manage_comments', + 609 => 'restrict_manage_posts', + 610 => 'restrict_manage_sites', + 611 => 'restrict_manage_users', + 612 => 'retrieve_password', + 613 => 'retrieve_password_key', + 614 => 'revoke_super_admin', + 615 => 'revoked_super_admin', + 616 => 'rightnow_end', + 617 => 'rss2_comments_ns', + 618 => 'rss2_head', + 619 => 'rss2_item', + 620 => 'rss2_ns', + 621 => 'rss_head', + 622 => 'rss_item', + 623 => 'rss_tag_pre', + 624 => 'sanitize_comment_cookies', + 625 => 'save_post', + 626 => 'save_post_{$post->post_type}', + 627 => 'save_post_page', + 628 => 'save_post_post', + 629 => 'saved_term', + 630 => 'saved_{$taxonomy}', + 631 => 'saved_category', + 632 => 'saved_post_tag', + 633 => 'send_headers', + 634 => 'set_404', + 635 => 'set_auth_cookie', + 636 => 'set_comment_cookies', + 637 => 'set_current_user', + 638 => 'set_logged_in_cookie', + 639 => 'set_object_terms', + 640 => 'set_site_transient_{$transient}', + 641 => 'set_transient_{$transient}', + 642 => 'set_user_role', + 643 => 'setted_site_transient', + 644 => 'setted_transient', + 645 => 'setup_theme', + 646 => 'show_user_profile', + 647 => 'shutdown', + 648 => 'sidebar_admin_page', + 649 => 'sidebar_admin_setup', + 650 => 'signup_blogform', + 651 => 'signup_extra_fields', + 652 => 'signup_finished', + 653 => 'signup_header', + 654 => 'signup_hidden_fields', + 655 => 'site_health_tab_content', + 656 => 'spam_comment', + 657 => 'spammed_comment', + 658 => 'split_shared_term', + 659 => 'start_previewing_theme', + 660 => 'stop_previewing_theme', + 661 => 'submitlink_box', + 662 => 'submitpage_box', + 663 => 'submitpost_box', + 664 => 'switch_blog', + 665 => 'switch_locale', + 666 => 'switch_theme', + 667 => 'template_redirect', + 668 => 'the_post', + 669 => 'the_widget', + 670 => 'tool_box', + 671 => 'trackback_post', + 672 => 'transition_comment_status', + 673 => 'transition_post_status', + 674 => 'trash_comment', + 675 => 'trash_post_comments', + 676 => 'trashed_comment', + 677 => 'trashed_post', + 678 => 'trashed_post_comments', + 679 => 'unarchive_blog', + 680 => 'uninstall_{$file}', + 681 => 'unload_textdomain', + 682 => 'unmature_blog', + 683 => 'unregister_setting', + 684 => 'unregistered_post_type', + 685 => 'unregistered_taxonomy', + 686 => 'unregistered_taxonomy_for_object_type', + 687 => 'unspam_comment', + 688 => 'unspammed_comment', + 689 => 'untrash_comment', + 690 => 'untrash_post', + 691 => 'untrash_post_comments', + 692 => 'untrashed_comment', + 693 => 'untrashed_post', + 694 => 'untrashed_post_comments', + 695 => 'update-core-custom_{$action}', + 696 => 'update-custom_{$action}', + 697 => 'update_blog_public', + 698 => 'update_option', + 699 => 'update_option_{$option}', + 700 => 'update_postmeta', + 701 => 'update_site_option', + 702 => 'update_site_option_{$option}', + 703 => 'update_wpmu_options', + 704 => 'update_{$meta_type}_meta', + 705 => 'update_comment_meta', + 706 => 'update_post_meta', + 707 => 'update_term_meta', + 708 => 'update_user_meta', + 709 => 'updated_option', + 710 => 'updated_postmeta', + 711 => 'updated_{$meta_type}_meta', + 712 => 'updated_comment_meta', + 713 => 'updated_post_meta', + 714 => 'updated_term_meta', + 715 => 'updated_user_meta', + 716 => 'upgrader_overwrote_package', + 717 => 'upgrader_process_complete', + 718 => 'upload_ui_over_quota', + 719 => 'user_admin_menu', + 720 => 'user_admin_notices', + 721 => 'user_edit_form_tag', + 722 => 'user_new_form', + 723 => 'user_new_form_tag', + 724 => 'user_profile_update_errors', + 725 => 'user_register', + 726 => 'user_request_action_confirmed', + 727 => 'validate_password_reset', + 728 => 'welcome_panel', + 729 => 'widgets.php', + 730 => 'widgets_admin_page', + 731 => 'widgets_init', + 732 => 'wp', + 733 => 'wp-mail.php', + 734 => 'wp_add_nav_menu_item', + 735 => 'wp_admin_notice', + 736 => 'wp_after_admin_bar_render', + 737 => 'wp_after_insert_post', + 738 => 'wp_after_load_template', + 739 => 'wp_ajax_crop_image_pre_save', + 740 => 'wp_ajax_nopriv_{$action}', + 741 => 'wp_ajax_{$action}', + 742 => 'wp_authenticate', + 743 => 'wp_authenticate_application_password_errors', + 744 => 'wp_authorize_application_password_form', + 745 => 'wp_authorize_application_password_form_approved_no_js', + 746 => 'wp_authorize_application_password_request_errors', + 747 => 'wp_before_admin_bar_render', + 748 => 'wp_before_load_template', + 749 => 'wp_body_open', + 750 => 'wp_cache_set_last_changed', + 751 => 'wp_check_comment_disallowed_list', + 752 => 'wp_create_application_password', + 753 => 'wp_create_application_password_form', + 754 => 'wp_create_nav_menu', + 755 => 'wp_creating_autosave', + 756 => 'wp_dashboard_setup', + 757 => 'wp_default_scripts', + 758 => 'wp_default_styles', + 759 => 'wp_delete_application_password', + 760 => 'wp_delete_nav_menu', + 761 => 'wp_delete_post_revision', + 762 => 'wp_delete_site', + 763 => 'wp_edit_form_attachment_display', + 764 => 'wp_enqueue_code_editor', + 765 => 'wp_enqueue_editor', + 766 => 'wp_enqueue_media', + 767 => 'wp_enqueue_scripts', + 768 => 'wp_error_added', + 769 => 'wp_feed_options', + 770 => 'wp_footer', + 771 => 'wp_head', + 772 => 'wp_initialize_site', + 773 => 'wp_insert_comment', + 774 => 'wp_insert_post', + 775 => 'wp_insert_site', + 776 => 'wp_install', + 777 => 'wp_loaded', + 778 => 'wp_login', + 779 => 'wp_login_failed', + 780 => 'wp_logout', + 781 => 'wp_mail_failed', + 782 => 'wp_mail_succeeded', + 783 => 'wp_maybe_auto_update', + 784 => 'wp_media_attach_action', + 785 => 'wp_meta', + 786 => 'wp_nav_menu_item_custom_fields', + 787 => 'wp_nav_menu_item_custom_fields_customize_template', + 788 => 'wp_network_dashboard_setup', + 789 => 'wp_playlist_scripts', + 790 => 'wp_print_footer_scripts', + 791 => 'wp_print_scripts', + 792 => 'wp_print_styles', + 793 => 'wp_privacy_personal_data_erased', + 794 => 'wp_privacy_personal_data_export_file', + 795 => 'wp_privacy_personal_data_export_file_created', + 796 => 'wp_register_sidebar_widget', + 797 => 'wp_restore_post_revision', + 798 => 'wp_roles_init', + 799 => 'wp_set_comment_status', + 800 => 'wp_set_password', + 801 => 'wp_sitemaps_init', + 802 => 'wp_tiny_mce_init', + 803 => 'wp_trash_post', + 804 => 'wp_trigger_error_run', + 805 => 'wp_uninitialize_site', + 806 => 'wp_unregister_sidebar_widget', + 807 => 'wp_update_application_password', + 808 => 'wp_update_comment_count', + 809 => 'wp_update_nav_menu', + 810 => 'wp_update_nav_menu_item', + 811 => 'wp_update_site', + 812 => 'wp_update_user', + 813 => 'wp_upgrade', + 814 => 'wp_user_dashboard_setup', + 815 => 'wp_validate_site_data', + 816 => 'wp_validate_site_deletion', + 817 => 'wp_verify_nonce_failed', + 818 => 'wpmu_activate_blog', + 819 => 'wpmu_activate_user', + 820 => 'wpmu_blog_updated', + 821 => 'wpmu_delete_user', + 822 => 'wpmu_new_user', + 823 => 'wpmu_options', + 824 => 'wpmu_update_blog_options', + 825 => 'wpmu_upgrade_page', + 826 => 'wpmu_upgrade_site', + 827 => 'wpmuadminedit', + 828 => 'wpmuadminresult', + 829 => 'wpmublogsaction', + 830 => 'wpmueditblogaction', + 831 => 'xmlrpc_call', + 832 => 'xmlrpc_call_success_blogger_deletePost', + 833 => 'xmlrpc_call_success_blogger_editPost', + 834 => 'xmlrpc_call_success_blogger_newPost', + 835 => 'xmlrpc_call_success_mw_editPost', + 836 => 'xmlrpc_call_success_mw_newMediaObject', + 837 => 'xmlrpc_call_success_mw_newPost', + 838 => 'xmlrpc_call_success_wp_deleteCategory', + 839 => 'xmlrpc_call_success_wp_deleteComment', + 840 => 'xmlrpc_call_success_wp_deletePage', + 841 => 'xmlrpc_call_success_wp_editComment', + 842 => 'xmlrpc_call_success_wp_newCategory', + 843 => 'xmlrpc_call_success_wp_newComment', + 844 => 'xmlrpc_publish_post', + 845 => 'xmlrpc_rsd_apis', + 846 => '{$new_status}_{$post->post_type}', + 847 => 'draft_page', + 848 => 'draft_post', + 849 => 'future_page', + 850 => 'future_post', + 851 => 'pending_page', + 852 => 'pending_post', + 853 => 'private_page', + 854 => 'private_post', + 855 => 'publish_attachment', + 856 => 'publish_page', + 857 => 'publish_post', + 858 => 'trash_attachment', + 859 => 'trash_page', + 860 => 'trash_post', + 861 => '{$old_status}_to_{$new_status}', + 862 => 'draft_to_publish', + 863 => 'pending_to_draft', + 864 => 'publish_to_trash', + 865 => '{$page_hook}', + 866 => '{$taxonomy}_add_form', + 867 => 'category_add_form', + 868 => 'post_tag_add_form', + 869 => '{$taxonomy}_add_form_fields', + 870 => 'category_add_form_fields', + 871 => 'post_tag_add_form_fields', + 872 => '{$taxonomy}_edit_form', + 873 => 'category_edit_form', + 874 => 'post_tag_edit_form', + 875 => '{$taxonomy}_edit_form_fields', + 876 => 'category_edit_form_fields', + 877 => 'post_tag_edit_form_fields', + 878 => '{$taxonomy}_pre_add_form', + 879 => 'category_pre_add_form', + 880 => 'post_tag_pre_add_form', + 881 => '{$taxonomy}_pre_edit_form', + 882 => 'category_pre_edit_form', + 883 => 'post_tag_pre_edit_form', + 884 => '{$taxonomy}_term_edit_form_tag', + 885 => 'category_term_edit_form_tag', + 886 => 'post_tag_term_edit_form_tag', + 887 => '{$taxonomy}_term_edit_form_top', + 888 => 'category_term_edit_form_top', + 889 => 'post_tag_term_edit_form_top', + 890 => '{$taxonomy}_term_new_form_tag', + 891 => 'category_term_new_form_tag', + 892 => 'post_tag_term_new_form_tag', +); diff --git a/includes/Vars/wp-constants.php b/includes/Vars/wp-constants.php new file mode 100644 index 000000000..110bd235b --- /dev/null +++ b/includes/Vars/wp-constants.php @@ -0,0 +1,725 @@ + '_get_page_link', + 1 => '_wp_post_revision_field_{$field}', + 2 => '_wp_post_revision_field_post_content', + 3 => '_wp_post_revision_field_post_excerpt', + 4 => '_wp_post_revision_field_post_title', + 5 => '_wp_post_revision_fields', + 6 => '_wp_relative_upload_path', + 7 => 'add_menu_classes', + 8 => 'add_ping', + 9 => 'add_signup_meta', + 10 => 'add_trashed_suffix_to_trashed_posts', + 11 => 'add_{$meta_type}_metadata', + 12 => 'add_comment_metadata', + 13 => 'add_post_metadata', + 14 => 'add_term_metadata', + 15 => 'add_user_metadata', + 16 => 'additional_capabilities_display', + 17 => 'admin_body_class', + 18 => 'admin_comment_types_dropdown', + 19 => 'admin_email_check_interval', + 20 => 'admin_email_remind_interval', + 21 => 'admin_footer_text', + 22 => 'admin_memory_limit', + 23 => 'admin_post_thumbnail_html', + 24 => 'admin_post_thumbnail_size', + 25 => 'admin_referrer_policy', + 26 => 'admin_title', + 27 => 'admin_url', + 28 => 'admin_viewport_meta', + 29 => 'ajax_query_attachments_args', + 30 => 'ajax_term_search_results', + 31 => 'all_plugins', + 32 => 'all_themes', + 33 => 'alloptions', + 34 => 'allow_dev_auto_core_updates', + 35 => 'allow_empty_comment', + 36 => 'allow_major_auto_core_updates', + 37 => 'allow_minor_auto_core_updates', + 38 => 'allow_password_reset', + 39 => 'allow_subdirectory_install', + 40 => 'allowed_block_types_all', + 41 => 'allowed_http_origin', + 42 => 'allowed_http_origins', + 43 => 'allowed_options', + 44 => 'allowed_redirect_hosts', + 45 => 'allowed_themes', + 46 => 'application_password_is_api_request', + 47 => 'async_update_translation', + 48 => 'async_upload_{$type}', + 49 => 'async_upload_audio', + 50 => 'async_upload_file', + 51 => 'async_upload_image', + 52 => 'async_upload_video', + 53 => 'atom_enclosure', + 54 => 'attach_session_information', + 55 => 'attachment_fields_to_edit', + 56 => 'attachment_fields_to_save', + 57 => 'attachment_link', + 58 => 'attachment_thumbnail_args', + 59 => 'attachment_url_to_postid', + 60 => 'attribute_escape', + 61 => 'audio_submitbox_misc_sections', + 62 => 'auth_cookie', + 63 => 'auth_cookie_expiration', + 64 => 'auth_redirect_scheme', + 65 => 'auth_{$object_type}_meta_{$meta_key}', + 66 => 'auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}', + 67 => 'authenticate', + 68 => 'author_email', + 69 => 'author_feed_link', + 70 => 'author_link', + 71 => 'author_rewrite_rules', + 72 => 'auto_core_update_email', + 73 => 'auto_core_update_send_email', + 74 => 'auto_plugin_theme_update_email', + 75 => 'auto_plugin_update_send_email', + 76 => 'auto_theme_update_send_email', + 77 => 'auto_update_{$type}', + 78 => 'auto_update_core', + 79 => 'auto_update_plugin', + 80 => 'auto_update_theme', + 81 => 'auto_update_translation', + 82 => 'autocomplete_users_for_site_admins', + 83 => 'automatic_updater_disabled', + 84 => 'automatic_updates_debug_email', + 85 => 'automatic_updates_is_vcs_checkout', + 86 => 'automatic_updates_send_debug_email', + 87 => 'available_permalink_structure_tags', + 88 => 'avatar_defaults', + 89 => 'big_image_size_threshold', + 90 => 'block_categories_all', + 91 => 'block_core_navigation_render_fallback', + 92 => 'block_core_navigation_render_inner_blocks', + 93 => 'block_default_classname', + 94 => 'block_editor_no_javascript_message', + 95 => 'block_editor_rest_api_preload_paths', + 96 => 'block_editor_settings_all', + 97 => 'block_local_requests', + 98 => 'block_parser_class', + 99 => 'block_type_metadata', + 100 => 'block_type_metadata_settings', + 101 => 'block_widgets_no_javascript_message', + 102 => 'blog_option_{$option}', + 103 => 'blog_redirect_404', + 104 => 'bloginfo', + 105 => 'bloginfo_rss', + 106 => 'bloginfo_url', + 107 => 'body_class', + 108 => 'browse-happy-notice', + 109 => 'bulk_actions-{$this->screen->id}', + 110 => 'bulk_post_updated_messages', + 111 => 'can_add_user_to_blog', + 112 => 'can_edit_network', + 113 => 'cancel_comment_reply_link', + 114 => 'category_css_class', + 115 => 'category_description', + 116 => 'category_feed_link', + 117 => 'category_link', + 118 => 'category_list_link_attributes', + 119 => 'check_is_user_spammed', + 120 => 'check_password', + 121 => 'clean_url', + 122 => 'close_comments_for_post_types', + 123 => 'comment_author', + 124 => 'comment_author_link_rel', + 125 => 'comment_author_rss', + 126 => 'comment_class', + 127 => 'comment_cookie_lifetime', + 128 => 'comment_duplicate_message', + 129 => 'comment_edit_pre', + 130 => 'comment_edit_redirect', + 131 => 'comment_email', + 132 => 'comment_excerpt', + 133 => 'comment_excerpt_length', + 134 => 'comment_feed_groupby', + 135 => 'comment_feed_join', + 136 => 'comment_feed_limits', + 137 => 'comment_feed_orderby', + 138 => 'comment_feed_where', + 139 => 'comment_flood_filter', + 140 => 'comment_flood_message', + 141 => 'comment_form_default_fields', + 142 => 'comment_form_defaults', + 143 => 'comment_form_field_comment', + 144 => 'comment_form_field_{$name}', + 145 => 'comment_form_field_author', + 146 => 'comment_form_field_comment', + 147 => 'comment_form_field_cookies', + 148 => 'comment_form_field_email', + 149 => 'comment_form_field_url', + 150 => 'comment_form_fields', + 151 => 'comment_form_logged_in', + 152 => 'comment_form_submit_button', + 153 => 'comment_form_submit_field', + 154 => 'comment_id_fields', + 155 => 'comment_link', + 156 => 'comment_max_links_url', + 157 => 'comment_moderation_headers', + 158 => 'comment_moderation_recipients', + 159 => 'comment_moderation_subject', + 160 => 'comment_moderation_text', + 161 => 'comment_notification_headers', + 162 => 'comment_notification_notify_author', + 163 => 'comment_notification_recipients', + 164 => 'comment_notification_subject', + 165 => 'comment_notification_text', + 166 => 'comment_post_redirect', + 167 => 'comment_reply_link', + 168 => 'comment_reply_link_args', + 169 => 'comment_row_actions', + 170 => 'comment_save_pre', + 171 => 'comment_status_links', + 172 => 'comment_text', + 173 => 'comment_text_rss', + 174 => 'comment_url', + 175 => 'comments_array', + 176 => 'comments_clauses', + 177 => 'comments_link_feed', + 178 => 'comments_list_table_query_args', + 179 => 'comments_number', + 180 => 'comments_open', + 181 => 'comments_per_page', + 182 => 'comments_popup_link_attributes', + 183 => 'comments_pre_query', + 184 => 'comments_rewrite_rules', + 185 => 'comments_template', + 186 => 'comments_template_query_args', + 187 => 'comments_template_top_level_query_args', + 188 => 'content_pagination', + 189 => 'content_url', + 190 => 'core_version_check_locale', + 191 => 'core_version_check_query_args', + 192 => 'cron_memory_limit', + 193 => 'cron_request', + 194 => 'cron_schedules', + 195 => 'current_theme_supports-{$feature}', + 196 => 'custom_menu_order', + 197 => 'customize_allowed_urls', + 198 => 'customize_changeset_branching', + 199 => 'customize_changeset_save_data', + 200 => 'customize_control_active', + 201 => 'customize_dynamic_partial_args', + 202 => 'customize_dynamic_partial_class', + 203 => 'customize_dynamic_setting_args', + 204 => 'customize_dynamic_setting_class', + 205 => 'customize_load_themes', + 206 => 'customize_loaded_components', + 207 => 'customize_nav_menu_available_item_types', + 208 => 'customize_nav_menu_available_items', + 209 => 'customize_nav_menu_searched_items', + 210 => 'customize_panel_active', + 211 => 'customize_partial_render', + 212 => 'customize_partial_render_{$partial->id}', + 213 => 'customize_previewable_devices', + 214 => 'customize_refresh_nonces', + 215 => 'customize_render_partials_response', + 216 => 'customize_sanitize_js_{$this->id}', + 217 => 'customize_sanitize_{$this->id}', + 218 => 'customize_save_response', + 219 => 'customize_section_active', + 220 => 'customize_validate_{$this->id}', + 221 => 'customize_value_{$id_base}', + 222 => 'customizer_widgets_section_args', + 223 => 'dashboard_glance_items', + 224 => 'dashboard_primary_feed', + 225 => 'dashboard_primary_link', + 226 => 'dashboard_primary_title', + 227 => 'dashboard_recent_drafts_query_args', + 228 => 'dashboard_recent_posts_query_args', + 229 => 'dashboard_secondary_feed', + 230 => 'dashboard_secondary_items', + 231 => 'dashboard_secondary_link', + 232 => 'dashboard_secondary_title', + 233 => 'date_formats', + 234 => 'date_i18n', + 235 => 'date_query_valid_columns', + 236 => 'date_rewrite_rules', + 237 => 'day_link', + 238 => 'dbdelta_create_queries', + 239 => 'dbdelta_insert_queries', + 240 => 'dbdelta_queries', + 241 => 'debug_information', + 242 => 'default_avatar_select', + 243 => 'default_category_post_types', + 244 => 'default_content', + 245 => 'default_excerpt', + 246 => 'default_feed', + 247 => 'default_hidden_columns', + 248 => 'default_hidden_meta_boxes', + 249 => 'default_option_{$option}', + 250 => 'default_page_template_title', + 251 => 'default_site_option_{$option}', + 252 => 'default_template_types', + 253 => 'default_title', + 254 => 'default_wp_template_part_areas', + 255 => 'default_{$meta_type}_metadata', + 256 => 'delete_site_email_content', + 257 => 'delete_{$meta_type}_metadata', + 258 => 'delete_comment_metadata', + 259 => 'delete_post_metadata', + 260 => 'delete_term_metadata', + 261 => 'delete_user_metadata', + 262 => 'delete_{$meta_type}_metadata_by_mid', + 263 => 'delete_comment_metadata_by_mid', + 264 => 'delete_post_metadata_by_mid', + 265 => 'delete_term_metadata_by_mid', + 266 => 'delete_user_metadata_by_mid', + 267 => 'deprecated_argument_trigger_error', + 268 => 'deprecated_class_trigger_error', + 269 => 'deprecated_constructor_trigger_error', + 270 => 'deprecated_file_trigger_error', + 271 => 'deprecated_function_trigger_error', + 272 => 'deprecated_hook_trigger_error', + 273 => 'determine_current_user', + 274 => 'determine_locale', + 275 => 'disable_captions', + 276 => 'disable_categories_dropdown', + 277 => 'disable_formats_dropdown', + 278 => 'disable_months_dropdown', + 279 => 'display_media_states', + 280 => 'display_post_states', + 281 => 'display_site_states', + 282 => 'do_mu_upgrade', + 283 => 'do_parse_request', + 284 => 'do_redirect_guess_404_permalink', + 285 => 'do_shortcode_tag', + 286 => 'document_title', + 287 => 'document_title_parts', + 288 => 'document_title_separator', + 289 => 'documentation_ignore_functions', + 290 => 'doing_it_wrong_trigger_error', + 291 => 'domain_exists', + 292 => 'download_url_error_max_body_size', + 293 => 'duplicate_comment_id', + 294 => 'dynamic_sidebar_has_widgets', + 295 => 'dynamic_sidebar_params', + 296 => 'edit_bookmark_link', + 297 => 'edit_categories_per_page', + 298 => 'edit_comment_link', + 299 => 'edit_comment_misc_actions', + 300 => 'edit_post_link', + 301 => 'edit_posts_per_page', + 302 => 'edit_profile_url', + 303 => 'edit_tag_link', + 304 => 'edit_tags_per_page', + 305 => 'edit_term_link', + 306 => 'edit_term_{$field}', + 307 => 'edit_user_{$field}', + 308 => 'edit_{$field}', + 309 => 'edit_{$post_type}_per_page', + 310 => 'edit_attachment_per_page', + 311 => 'edit_page_per_page', + 312 => 'edit_post_per_page', + 313 => 'edit_{$taxonomy}_{$field}', + 314 => 'editable_extensions', + 315 => 'editable_roles', + 316 => 'editable_slug', + 317 => 'editor_max_image_size', + 318 => 'editor_stylesheets', + 319 => 'email_change_email', + 320 => 'email_exists', + 321 => 'embed_cache_oembed_types', + 322 => 'embed_defaults', + 323 => 'embed_handler_html', + 324 => 'embed_html', + 325 => 'embed_maybe_make_link', + 326 => 'embed_oembed_discover', + 327 => 'embed_oembed_html', + 328 => 'embed_site_title_html', + 329 => 'embed_thumbnail_id', + 330 => 'embed_thumbnail_image_shape', + 331 => 'embed_thumbnail_image_size', + 332 => 'emoji_ext', + 333 => 'emoji_svg_ext', + 334 => 'emoji_svg_url', + 335 => 'emoji_url', + 336 => 'enable_edit_any_user_configuration', + 337 => 'enable_live_network_counts', + 338 => 'enable_loading_advanced_cache_dropin', + 339 => 'enable_loading_object_cache_dropin', + 340 => 'enable_login_autofocus', + 341 => 'enable_maintenance_mode', + 342 => 'enable_post_by_email_configuration', + 343 => 'enable_update_services_configuration', + 344 => 'enable_wp_debug_mode_checks', + 345 => 'enclosure_links', + 346 => 'enter_title_here', + 347 => 'esc_html', + 348 => 'esc_textarea', + 349 => 'esc_xml', + 350 => 'excerpt_allowed_blocks', + 351 => 'excerpt_allowed_wrapper_blocks', + 352 => 'excerpt_length', + 353 => 'excerpt_more', + 354 => 'exit_on_http_head', + 355 => 'expiration_of_site_transient_{$transient}', + 356 => 'expiration_of_transient_{$transient}', + 357 => 'export_args', + 358 => 'export_wp_filename', + 359 => 'ext2type', + 360 => 'extra_{$context}_headers', + 361 => 'fallback_intermediate_image_sizes', + 362 => 'feed_content_type', + 363 => 'feed_link', + 364 => 'feed_links_extra_show_author_feed', + 365 => 'feed_links_extra_show_category_feed', + 366 => 'feed_links_extra_show_post_comments_feed', + 367 => 'feed_links_extra_show_post_type_archive_feed', + 368 => 'feed_links_extra_show_search_feed', + 369 => 'feed_links_extra_show_tag_feed', + 370 => 'feed_links_extra_show_tax_feed', + 371 => 'feed_links_show_comments_feed', + 372 => 'feed_links_show_posts_feed', + 373 => 'file_is_displayable_image', + 374 => 'file_mod_allowed', + 375 => 'filesystem_method', + 376 => 'filesystem_method_file', + 377 => 'filter_block_editor_meta_boxes', + 378 => 'flush_rewrite_rules_hard', + 379 => 'force_filtered_html_on_import', + 380 => 'format_for_editor', + 381 => 'format_to_edit', + 382 => 'found_comments_query', + 383 => 'found_networks_query', + 384 => 'found_posts', + 385 => 'found_posts_query', + 386 => 'found_sites_query', + 387 => 'found_users_query', + 388 => 'fs_ftp_connection_types', + 389 => 'gallery_style', + 390 => 'get_ancestors', + 391 => 'get_archives_link', + 392 => 'get_attached_file', + 393 => 'get_attached_media', + 394 => 'get_attached_media_args', + 395 => 'get_available_languages', + 396 => 'get_avatar', + 397 => 'get_avatar_comment_types', + 398 => 'get_avatar_data', + 399 => 'get_avatar_url', + 400 => 'get_block_file_template', + 401 => 'get_block_template', + 402 => 'get_block_templates', + 403 => 'get_bloginfo_rss', + 404 => 'get_blogs_of_user', + 405 => 'get_bookmarks', + 406 => 'get_calendar', + 407 => 'get_canonical_url', + 408 => 'get_categories_taxonomy', + 409 => 'get_comment', + 410 => 'get_comment_ID', + 411 => 'get_comment_author', + 412 => 'get_comment_author_IP', + 413 => 'get_comment_author_email', + 414 => 'get_comment_author_link', + 415 => 'get_comment_author_url', + 416 => 'get_comment_author_url_link', + 417 => 'get_comment_date', + 418 => 'get_comment_excerpt', + 419 => 'get_comment_link', + 420 => 'get_comment_text', + 421 => 'get_comment_time', + 422 => 'get_comment_type', + 423 => 'get_comments_link', + 424 => 'get_comments_number', + 425 => 'get_comments_pagenum_link', + 426 => 'get_custom_logo', + 427 => 'get_custom_logo_image_attributes', + 428 => 'get_date_sql', + 429 => 'get_default_comment_status', + 430 => 'get_delete_post_link', + 431 => 'get_edit_bookmark_link', + 432 => 'get_edit_comment_link', + 433 => 'get_edit_post_link', + 434 => 'get_edit_tag_link', + 435 => 'get_edit_term_link', + 436 => 'get_edit_user_link', + 437 => 'get_enclosed', + 438 => 'get_feed_build_date', + 439 => 'get_header_image', + 440 => 'get_header_image_tag', + 441 => 'get_header_image_tag_attributes', + 442 => 'get_header_video_url', + 443 => 'get_image_tag', + 444 => 'get_image_tag_class', + 445 => 'get_lastpostdate', + 446 => 'get_lastpostmodified', + 447 => 'get_main_network_id', + 448 => 'get_media_item_args', + 449 => 'get_meta_sql', + 450 => 'get_network', + 451 => 'get_object_subtype_{$object_type}', + 452 => 'get_object_subtype_comment', + 453 => 'get_object_subtype_post', + 454 => 'get_object_subtype_term', + 455 => 'get_object_subtype_user', + 456 => 'get_object_terms', + 457 => 'get_page_of_comment', + 458 => 'get_page_of_comment_query_args', + 459 => 'get_page_uri', + 460 => 'get_pagenum_link', + 461 => 'get_pages', + 462 => 'get_pages_query_args', + 463 => 'get_post_galleries', + 464 => 'get_post_gallery', + 465 => 'get_post_modified_time', + 466 => 'get_post_status', + 467 => 'get_post_time', + 468 => 'get_pung', + 469 => 'get_role_list', + 470 => 'get_sample_permalink', + 471 => 'get_sample_permalink_html', + 472 => 'get_schedule', + 473 => 'get_search_form', + 474 => 'get_search_query', + 475 => 'get_shortlink', + 476 => 'get_site', + 477 => 'get_site_icon_url', + 478 => 'get_space_allowed', + 479 => 'get_tags', + 480 => 'get_term', + 481 => 'get_terms', + 482 => 'get_terms_args', + 483 => 'get_terms_defaults', + 484 => 'get_terms_fields', + 485 => 'get_terms_orderby', + 486 => 'get_the_archive_description', + 487 => 'get_the_archive_title', + 488 => 'get_the_archive_title_prefix', + 489 => 'get_the_author_{$field}', + 490 => 'get_the_categories', + 491 => 'get_the_date', + 492 => 'get_the_excerpt', + 493 => 'get_the_generator_{$type}', + 494 => 'get_the_generator_atom', + 495 => 'get_the_generator_comment', + 496 => 'get_the_generator_export', + 497 => 'get_the_generator_html', + 498 => 'get_the_generator_rdf', + 499 => 'get_the_generator_rss2', + 500 => 'get_the_generator_xhtml', + 501 => 'get_the_guid', + 502 => 'get_the_modified_date', + 503 => 'get_the_modified_time', + 504 => 'get_the_post_type_description', + 505 => 'get_the_tags', + 506 => 'get_the_terms', + 507 => 'get_the_time', + 508 => 'get_theme_starter_content', + 509 => 'get_to_ping', + 510 => 'get_user_option_{$option}', + 511 => 'get_usernumposts', + 512 => 'get_users_drafts', + 513 => 'get_wp_title_rss', + 514 => 'get_{$adjacent}_post_excluded_terms', + 515 => 'get_next_post_excluded_terms', + 516 => 'get_previous_post_excluded_terms', + 517 => 'get_{$adjacent}_post_join', + 518 => 'get_next_post_join', + 519 => 'get_previous_post_join', + 520 => 'get_{$adjacent}_post_sort', + 521 => 'get_next_post_sort', + 522 => 'get_previous_post_sort', + 523 => 'get_{$adjacent}_post_where', + 524 => 'get_next_post_where', + 525 => 'get_previous_post_where', + 526 => 'get_{$meta_type}_metadata', + 527 => 'get_{$meta_type}_metadata_by_mid', + 528 => 'get_comment_metadata_by_mid', + 529 => 'get_post_metadata_by_mid', + 530 => 'get_term_metadata_by_mid', + 531 => 'get_user_metadata_by_mid', + 532 => 'get_{$taxonomy}', + 533 => 'get_category', + 534 => 'get_post_tag', + 535 => 'getarchives_join', + 536 => 'getarchives_where', + 537 => 'getimagesize_mimes_to_exts', + 538 => 'gettext', + 539 => 'gettext_with_context', + 540 => 'gettext_with_context_{$domain}', + 541 => 'gettext_{$domain}', + 542 => 'got_rewrite', + 543 => 'got_url_rewrite', + 544 => 'handle_bulk_actions-{$screen}', + 545 => 'handle_network_bulk_actions-{$screen}', + 546 => 'has_nav_menu', + 547 => 'has_post_thumbnail', + 548 => 'header_video_settings', + 549 => 'heartbeat_nopriv_received', + 550 => 'heartbeat_nopriv_send', + 551 => 'heartbeat_received', + 552 => 'heartbeat_send', + 553 => 'heartbeat_settings', + 554 => 'hidden_columns', + 555 => 'hidden_meta_boxes', + 556 => 'home_url', + 557 => 'hooked_block_types', + 558 => 'http_allowed_safe_ports', + 559 => 'http_headers_useragent', + 560 => 'http_origin', + 561 => 'http_request_args', + 562 => 'http_request_host_is_external', + 563 => 'http_request_redirection_count', + 564 => 'http_request_reject_unsafe_urls', + 565 => 'http_request_timeout', + 566 => 'http_request_version', + 567 => 'http_response', + 568 => 'https_local_ssl_verify', + 569 => 'https_ssl_verify', + 570 => 'human_time_diff', + 571 => 'icon_dir', + 572 => 'icon_dir_uri', + 573 => 'icon_dirs', + 574 => 'iis7_supports_permalinks', + 575 => 'iis7_url_rewrite_rules', + 576 => 'illegal_user_logins', + 577 => 'image_add_caption_shortcode', + 578 => 'image_add_caption_text', + 579 => 'image_downsize', + 580 => 'image_edit_thumbnails_separately', + 581 => 'image_editor_default_mime_type', + 582 => 'image_editor_output_format', + 583 => 'image_editor_save_pre', + 584 => 'image_get_intermediate_size', + 585 => 'image_make_intermediate_size', + 586 => 'image_memory_limit', + 587 => 'image_resize_dimensions', + 588 => 'image_send_to_editor', + 589 => 'image_send_to_editor_url', + 590 => 'image_sideload_extensions', + 591 => 'image_size_names_choose', + 592 => 'image_strip_meta', + 593 => 'img_caption_shortcode', + 594 => 'img_caption_shortcode_width', + 595 => 'import_upload_size_limit', + 596 => 'includes_url', + 597 => 'incompatible_sql_modes', + 598 => 'insert_custom_user_meta', + 599 => 'insert_user_meta', + 600 => 'insert_with_markers_inline_instructions', + 601 => 'install_plugin_complete_actions', + 602 => 'install_plugin_overwrite_actions', + 603 => 'install_plugin_overwrite_comparison', + 604 => 'install_plugins_nonmenu_tabs', + 605 => 'install_plugins_table_api_args_{$tab}', + 606 => 'install_plugins_table_api_args_beta', + 607 => 'install_plugins_table_api_args_favorites', + 608 => 'install_plugins_table_api_args_featured', + 609 => 'install_plugins_table_api_args_popular', + 610 => 'install_plugins_table_api_args_recommended', + 611 => 'install_plugins_table_api_args_search', + 612 => 'install_plugins_table_api_args_upload', + 613 => 'install_plugins_tabs', + 614 => 'install_theme_complete_actions', + 615 => 'install_theme_overwrite_actions', + 616 => 'install_theme_overwrite_comparison', + 617 => 'install_themes_nonmenu_tabs', + 618 => 'install_themes_table_api_args_{$tab}', + 619 => 'install_themes_table_api_args_dashboard', + 620 => 'install_themes_table_api_args_featured', + 621 => 'install_themes_table_api_args_new', + 622 => 'install_themes_table_api_args_search', + 623 => 'install_themes_table_api_args_updated', + 624 => 'install_themes_table_api_args_upload', + 625 => 'install_themes_tabs', + 626 => 'intermediate_image_sizes', + 627 => 'intermediate_image_sizes_advanced', + 628 => 'invited_user_email', + 629 => 'is_active_sidebar', + 630 => 'is_email', + 631 => 'is_email_address_unsafe', + 632 => 'is_header_video_active', + 633 => 'is_multi_author', + 634 => 'is_post_status_viewable', + 635 => 'is_post_type_viewable', + 636 => 'is_protected_endpoint', + 637 => 'is_protected_meta', + 638 => 'is_sticky', + 639 => 'is_wide_widget_in_customizer', + 640 => 'jpeg_quality', + 641 => 'js_escape', + 642 => 'kses_allowed_protocols', + 643 => 'lang_codes', + 644 => 'language_attributes', + 645 => 'link_category', + 646 => 'link_title', + 647 => 'list_cats', + 648 => 'list_pages', + 649 => 'list_table_primary_column', + 650 => 'list_terms_exclusions', + 651 => 'load_default_embeds', + 652 => 'load_default_widgets', + 653 => 'load_image_to_edit', + 654 => 'load_image_to_edit_attachmenturl', + 655 => 'load_image_to_edit_filesystempath', + 656 => 'load_image_to_edit_path', + 657 => 'load_script_textdomain_relative_path', + 658 => 'load_script_translation_file', + 659 => 'load_script_translations', + 660 => 'load_textdomain_mofile', + 661 => 'locale', + 662 => 'locale_stylesheet_uri', + 663 => 'log_query_custom_data', + 664 => 'login_body_class', + 665 => 'login_display_language_dropdown', + 666 => 'login_errors', + 667 => 'login_form_bottom', + 668 => 'login_form_defaults', + 669 => 'login_form_middle', + 670 => 'login_form_top', + 671 => 'login_headertext', + 672 => 'login_headerurl', + 673 => 'login_language_dropdown_args', + 674 => 'login_link_separator', + 675 => 'login_message', + 676 => 'login_messages', + 677 => 'login_redirect', + 678 => 'login_site_html_link', + 679 => 'login_title', + 680 => 'login_url', + 681 => 'loginout', + 682 => 'logout_redirect', + 683 => 'logout_url', + 684 => 'lost_password_html_link', + 685 => 'lostpassword_errors', + 686 => 'lostpassword_redirect', + 687 => 'lostpassword_url', + 688 => 'lostpassword_user_data', + 689 => 'make_clickable_rel', + 690 => 'manage_media_columns', + 691 => 'manage_pages_columns', + 692 => 'manage_posts_columns', + 693 => 'manage_sites_action_links', + 694 => 'manage_taxonomies_for_attachment_columns', + 695 => 'manage_taxonomies_for_{$post_type}_columns', + 696 => 'manage_taxonomies_for_page_columns', + 697 => 'manage_taxonomies_for_post_columns', + 698 => 'manage_users_custom_column', + 699 => 'manage_{$post_type}_posts_columns', + 700 => 'manage_page_posts_columns', + 701 => 'manage_post_posts_columns', + 702 => 'manage_{$screen->id}_columns', + 703 => 'manage_{$this->screen->id}_sortable_columns', + 704 => 'manage_{$this->screen->taxonomy}_custom_column', + 705 => 'manage_category_custom_column', + 706 => 'manage_post_tag_custom_column', + 707 => 'map_meta_cap', + 708 => 'max_srcset_image_width', + 709 => 'mce_buttons', + 710 => 'mce_buttons_2', + 711 => 'mce_buttons_3', + 712 => 'mce_buttons_4', + 713 => 'mce_css', + 714 => 'mce_external_languages', + 715 => 'mce_external_plugins', + 716 => 'media_date_column_time', + 717 => 'media_embedded_in_content_allowed_types', + 718 => 'media_library_infinite_scrolling', + 719 => 'media_library_months_with_files', + 720 => 'media_library_show_audio_playlist', + 721 => 'media_library_show_video_playlist', + 722 => 'media_meta', + 723 => 'media_row_actions', + 724 => 'media_send_to_editor', + 725 => 'media_submitbox_misc_sections', + 726 => 'media_upload_default_tab', + 727 => 'media_upload_default_type', + 728 => 'media_upload_form_url', + 729 => 'media_upload_mime_type_links', + 730 => 'media_upload_tabs', + 731 => 'media_view_settings', + 732 => 'media_view_strings', + 733 => 'mejs_settings', + 734 => 'menu_order', + 735 => 'meta_query_find_compatible_table_alias', + 736 => 'mime_types', + 737 => 'minimum_site_name_length', + 738 => 'mod_rewrite_rules', + 739 => 'month_link', + 740 => 'months_dropdown_results', + 741 => 'ms_site_check', + 742 => 'ms_sites_list_table_query_args', + 743 => 'ms_user_list_site_actions', + 744 => 'ms_user_list_site_class', + 745 => 'ms_user_row_actions', + 746 => 'mu_dropdown_languages', + 747 => 'mu_menu_items', + 748 => 'myblogs_blog_actions', + 749 => 'myblogs_options', + 750 => 'nav_menu_attr_title', + 751 => 'nav_menu_css_class', + 752 => 'nav_menu_description', + 753 => 'nav_menu_item_args', + 754 => 'nav_menu_item_attributes', + 755 => 'nav_menu_item_id', + 756 => 'nav_menu_item_title', + 757 => 'nav_menu_items_{$post_type_name}', + 758 => 'nav_menu_items_page', + 759 => 'nav_menu_items_post', + 760 => 'nav_menu_items_{$post_type_name}_recent', + 761 => 'nav_menu_items_page_recent', + 762 => 'nav_menu_items_post_recent', + 763 => 'nav_menu_link_attributes', + 764 => 'nav_menu_meta_box_object', + 765 => 'nav_menu_submenu_attributes', + 766 => 'nav_menu_submenu_css_class', + 767 => 'navigation_markup_template', + 768 => 'navigation_widgets_format', + 769 => 'network_admin_email_change_email', + 770 => 'network_admin_plugin_action_links', + 771 => 'network_admin_plugin_action_links_{$plugin_file}', + 772 => 'network_admin_url', + 773 => 'network_allowed_themes', + 774 => 'network_by_path_segments_count', + 775 => 'network_edit_site_nav_links', + 776 => 'network_home_url', + 777 => 'network_site_url', + 778 => 'network_sites_updated_message_{$action}', + 779 => 'networks_clauses', + 780 => 'networks_pre_query', + 781 => 'new_admin_email_content', + 782 => 'new_network_admin_email_content', + 783 => 'new_site_email', + 784 => 'new_user_email_content', + 785 => 'newblog_notify_siteadmin', + 786 => 'newblogname', + 787 => 'newuser_notify_siteadmin', + 788 => 'next_comments_link_attributes', + 789 => 'next_posts_link_attributes', + 790 => 'ngettext', + 791 => 'ngettext_with_context', + 792 => 'ngettext_with_context_{$domain}', + 793 => 'ngettext_{$domain}', + 794 => 'no_texturize_shortcodes', + 795 => 'no_texturize_tags', + 796 => 'nocache_headers', + 797 => 'nonce_life', + 798 => 'nonce_user_logged_out', + 799 => 'notify_moderator', + 800 => 'notify_post_author', + 801 => 'number_format_i18n', + 802 => 'oembed_dataparse', + 803 => 'oembed_default_width', + 804 => 'oembed_discovery_links', + 805 => 'oembed_endpoint_url', + 806 => 'oembed_fetch_url', + 807 => 'oembed_iframe_title_attribute', + 808 => 'oembed_linktypes', + 809 => 'oembed_min_max_width', + 810 => 'oembed_providers', + 811 => 'oembed_remote_get_args', + 812 => 'oembed_request_post_id', + 813 => 'oembed_response_data', + 814 => 'oembed_result', + 815 => 'oembed_ttl', + 816 => 'old_slug_redirect_post_id', + 817 => 'old_slug_redirect_url', + 818 => 'option_page_capability_{$option_page}', + 819 => 'option_{$option}', + 820 => 'override_load_textdomain', + 821 => 'override_post_lock', + 822 => 'override_unload_textdomain', + 823 => 'page_attributes_dropdown_pages_args', + 824 => 'page_css_class', + 825 => 'page_link', + 826 => 'page_menu_link_attributes', + 827 => 'page_rewrite_rules', + 828 => 'page_row_actions', + 829 => 'paginate_links', + 830 => 'paginate_links_output', + 831 => 'parent_file', + 832 => 'parent_theme_file_path', + 833 => 'parent_theme_file_uri', + 834 => 'password_change_email', + 835 => 'password_hint', + 836 => 'password_reset_expiration', + 837 => 'password_reset_key_expired', + 838 => 'phone_content', + 839 => 'pingback_ping_source_uri', + 840 => 'pingback_useragent', + 841 => 'pings_open', + 842 => 'plugin_action_links', + 843 => 'plugin_action_links_{$plugin_file}', + 844 => 'plugin_auto_update_debug_string', + 845 => 'plugin_auto_update_setting_html', + 846 => 'plugin_files_exclusions', + 847 => 'plugin_install_action_links', + 848 => 'plugin_install_description', + 849 => 'plugin_locale', + 850 => 'plugin_row_meta', + 851 => 'plugins_api', + 852 => 'plugins_api_args', + 853 => 'plugins_api_result', + 854 => 'plugins_auto_update_enabled', + 855 => 'plugins_list', + 856 => 'plugins_update_check_locales', + 857 => 'plugins_url', + 858 => 'plupload_default_params', + 859 => 'plupload_default_settings', + 860 => 'plupload_init', + 861 => 'populate_network_meta', + 862 => 'populate_site_meta', + 863 => 'post_class', + 864 => 'post_class_taxonomies', + 865 => 'post_column_taxonomy_links', + 866 => 'post_comments_feed_link', + 867 => 'post_comments_feed_link_html', + 868 => 'post_comments_link', + 869 => 'post_date_column_status', + 870 => 'post_date_column_time', + 871 => 'post_edit_category_parent_dropdown_args', + 872 => 'post_embed_url', + 873 => 'post_format_rewrite_base', + 874 => 'post_gallery', + 875 => 'post_limits', + 876 => 'post_limits_request', + 877 => 'post_link', + 878 => 'post_link_category', + 879 => 'post_mime_types', + 880 => 'post_password_expires', + 881 => 'post_password_required', + 882 => 'post_playlist', + 883 => 'post_rewrite_rules', + 884 => 'post_row_actions', + 885 => 'post_search_columns', + 886 => 'post_thumbnail_html', + 887 => 'post_thumbnail_id', + 888 => 'post_thumbnail_size', + 889 => 'post_thumbnail_url', + 890 => 'post_type_archive_feed_link', + 891 => 'post_type_archive_link', + 892 => 'post_type_archive_title', + 893 => 'post_type_labels_{$post_type}', + 894 => 'post_type_labels_attachment', + 895 => 'post_type_labels_page', + 896 => 'post_type_labels_post', + 897 => 'post_type_link', + 898 => 'post_types_to_delete_with_user', + 899 => 'post_updated_messages', + 900 => 'postbox_classes_{$screen_id}_{$box_id}', + 901 => 'postmeta_form_keys', + 902 => 'postmeta_form_limit', + 903 => 'posts_clauses', + 904 => 'posts_clauses_request', + 905 => 'posts_distinct', + 906 => 'posts_distinct_request', + 907 => 'posts_fields', + 908 => 'posts_fields_request', + 909 => 'posts_groupby', + 910 => 'posts_groupby_request', + 911 => 'posts_join', + 912 => 'posts_join_paged', + 913 => 'posts_join_request', + 914 => 'posts_orderby', + 915 => 'posts_orderby_request', + 916 => 'posts_pre_query', + 917 => 'posts_request', + 918 => 'posts_request_ids', + 919 => 'posts_results', + 920 => 'posts_search', + 921 => 'posts_search_orderby', + 922 => 'posts_where', + 923 => 'posts_where_paged', + 924 => 'posts_where_request', + 925 => 'pre_add_site_option_{$option}', + 926 => 'pre_cache_alloptions', + 927 => 'pre_category_nicename', + 928 => 'pre_clear_scheduled_hook', + 929 => 'pre_comment_approved', + 930 => 'pre_comment_author_email', + 931 => 'pre_comment_author_name', + 932 => 'pre_comment_author_url', + 933 => 'pre_comment_content', + 934 => 'pre_comment_user_agent', + 935 => 'pre_comment_user_ip', + 936 => 'pre_count_users', + 937 => 'pre_delete_attachment', + 938 => 'pre_delete_post', + 939 => 'pre_determine_locale', + 940 => 'pre_do_shortcode_tag', + 941 => 'pre_ent2ncr', + 942 => 'pre_get_available_post_mime_types', + 943 => 'pre_get_avatar', + 944 => 'pre_get_avatar_data', + 945 => 'pre_get_block_file_template', + 946 => 'pre_get_block_template', + 947 => 'pre_get_block_templates', + 948 => 'pre_get_blogs_of_user', + 949 => 'pre_get_col_charset', + 950 => 'pre_get_document_title', + 951 => 'pre_get_lastpostmodified', + 952 => 'pre_get_main_site_id', + 953 => 'pre_get_network_by_path', + 954 => 'pre_get_ready_cron_jobs', + 955 => 'pre_get_scheduled_event', + 956 => 'pre_get_shortlink', + 957 => 'pre_get_site_by_path', + 958 => 'pre_get_space_used', + 959 => 'pre_get_table_charset', + 960 => 'pre_handle_404', + 961 => 'pre_http_request', + 962 => 'pre_http_send_through_proxy', + 963 => 'pre_insert_term', + 964 => 'pre_kses', + 965 => 'pre_load_script_translations', + 966 => 'pre_load_textdomain', + 967 => 'pre_months_dropdown_query', + 968 => 'pre_move_uploaded_file', + 969 => 'pre_oembed_result', + 970 => 'pre_option', + 971 => 'pre_option_{$option}', + 972 => 'pre_post_link', + 973 => 'pre_prepare_themes_for_js', + 974 => 'pre_recurse_dirsize', + 975 => 'pre_redirect_guess_404_permalink', + 976 => 'pre_remote_source', + 977 => 'pre_render_block', + 978 => 'pre_reschedule_event', + 979 => 'pre_schedule_event', + 980 => 'pre_set_site_transient_{$transient}', + 981 => 'pre_set_theme_mod_{$name}', + 982 => 'pre_set_transient_{$transient}', + 983 => 'pre_site_option_{$option}', + 984 => 'pre_site_transient_{$transient}', + 985 => 'pre_term_link', + 986 => 'pre_term_{$field}', + 987 => 'pre_transient_{$transient}', + 988 => 'pre_trash_post', + 989 => 'pre_unschedule_event', + 990 => 'pre_unschedule_hook', + 991 => 'pre_untrash_post', + 992 => 'pre_unzip_file', + 993 => 'pre_update_option', + 994 => 'pre_update_option_{$option}', + 995 => 'pre_update_site_option_{$option}', + 996 => 'pre_upload_error', + 997 => 'pre_user_description', + 998 => 'pre_user_display_name', + 999 => 'pre_user_email', + 1000 => 'pre_user_first_name', + 1001 => 'pre_user_id', + 1002 => 'pre_user_last_name', + 1003 => 'pre_user_login', + 1004 => 'pre_user_nicename', + 1005 => 'pre_user_nickname', + 1006 => 'pre_user_url', + 1007 => 'pre_user_{$field}', + 1008 => 'pre_wp_filesize', + 1009 => 'pre_wp_get_https_detection_errors', + 1010 => 'pre_wp_get_loading_optimization_attributes', + 1011 => 'pre_wp_is_site_initialized', + 1012 => 'pre_wp_list_authors_post_counts_query', + 1013 => 'pre_wp_load_alloptions', + 1014 => 'pre_wp_mail', + 1015 => 'pre_wp_nav_menu', + 1016 => 'pre_wp_setup_nav_menu_item', + 1017 => 'pre_wp_unique_filename_file_list', + 1018 => 'pre_wp_unique_post_slug', + 1019 => 'pre_wp_update_comment_count_now', + 1020 => 'pre_{$field}', + 1021 => 'pre_{$taxonomy}_{$field}', + 1022 => 'prepend_attachment', + 1023 => 'preprocess_comment', + 1024 => 'preview_post_link', + 1025 => 'previous_comments_link_attributes', + 1026 => 'previous_posts_link_attributes', + 1027 => 'print_admin_styles', + 1028 => 'print_footer_scripts', + 1029 => 'print_head_scripts', + 1030 => 'print_late_styles', + 1031 => 'print_scripts_array', + 1032 => 'print_styles_array', + 1033 => 'privacy_on_link_text', + 1034 => 'privacy_on_link_title', + 1035 => 'privacy_policy_url', + 1036 => 'private_title_format', + 1037 => 'process_text_diff_html', + 1038 => 'protected_title_format', + 1039 => 'query', + 1040 => 'query_loop_block_query_vars', + 1041 => 'query_vars', + 1042 => 'quick_edit_dropdown_authors_args', + 1043 => 'quick_edit_dropdown_pages_args', + 1044 => 'quick_edit_enabled_for_post_type', + 1045 => 'quick_edit_enabled_for_taxonomy', + 1046 => 'quick_edit_show_taxonomy', + 1047 => 'quicktags_settings', + 1048 => 'random_password', + 1049 => 'recovery_email_debug_info', + 1050 => 'recovery_email_support_info', + 1051 => 'recovery_mode_begin_url', + 1052 => 'recovery_mode_cookie_length', + 1053 => 'recovery_mode_email', + 1054 => 'recovery_mode_email_link_ttl', + 1055 => 'recovery_mode_email_rate_limit', + 1056 => 'redirect_canonical', + 1057 => 'redirect_network_admin_request', + 1058 => 'redirect_post_location', + 1059 => 'redirect_term_location', + 1060 => 'redirect_user_admin_request', + 1061 => 'register', + 1062 => 'register_block_type_args', + 1063 => 'register_meta_args', + 1064 => 'register_post_type_args', + 1065 => 'register_setting_args', + 1066 => 'register_sidebar_defaults', + 1067 => 'register_taxonomy_args', + 1068 => 'register_url', + 1069 => 'register_{$post_type}_post_type_args', + 1070 => 'register_page_post_type_args', + 1071 => 'register_post_post_type_args', + 1072 => 'register_{$taxonomy}_taxonomy_args', + 1073 => 'register_category_taxonomy_args', + 1074 => 'register_post_tag_taxonomy_args', + 1075 => 'registration_errors', + 1076 => 'registration_redirect', + 1077 => 'removable_query_args', + 1078 => 'render_block', + 1079 => 'render_block_context', + 1080 => 'render_block_data', + 1081 => 'render_block_{$this->name}', + 1082 => 'replace_editor', + 1083 => 'request', + 1084 => 'request_filesystem_credentials', + 1085 => 'respond_link', + 1086 => 'rest_allow_anonymous_comments', + 1087 => 'rest_allowed_cors_headers', + 1088 => 'rest_authentication_errors', + 1089 => 'rest_avatar_sizes', + 1090 => 'rest_block_directory_collection_params', + 1091 => 'rest_comment_collection_params', + 1092 => 'rest_comment_query', + 1093 => 'rest_comment_trashable', + 1094 => 'rest_dispatch_request', + 1095 => 'rest_endpoints', + 1096 => 'rest_endpoints_description', + 1097 => 'rest_envelope_response', + 1098 => 'rest_exposed_cors_headers', + 1099 => 'rest_get_max_batch_size', + 1100 => 'rest_index', + 1101 => 'rest_json_encode_options', + 1102 => 'rest_jsonp_enabled', + 1103 => 'rest_namespace_index', + 1104 => 'rest_oembed_ttl', + 1105 => 'rest_pattern_directory_collection_params', + 1106 => 'rest_post_dispatch', + 1107 => 'rest_post_format_search_query', + 1108 => 'rest_post_search_query', + 1109 => 'rest_pre_dispatch', + 1110 => 'rest_pre_echo_response', + 1111 => 'rest_pre_get_setting', + 1112 => 'rest_pre_insert_application_password', + 1113 => 'rest_pre_insert_comment', + 1114 => 'rest_pre_insert_nav_menu_item', + 1115 => 'rest_pre_insert_user', + 1116 => 'rest_pre_insert_{$this->post_type}', + 1117 => 'rest_pre_insert_attachment', + 1118 => 'rest_pre_insert_page', + 1119 => 'rest_pre_insert_post', + 1120 => 'rest_pre_insert_{$this->taxonomy}', + 1121 => 'rest_pre_insert_category', + 1122 => 'rest_pre_insert_post_tag', + 1123 => 'rest_pre_serve_request', + 1124 => 'rest_pre_update_setting', + 1125 => 'rest_prepare_application_password', + 1126 => 'rest_prepare_attachment', + 1127 => 'rest_prepare_autosave', + 1128 => 'rest_prepare_block_pattern', + 1129 => 'rest_prepare_block_type', + 1130 => 'rest_prepare_comment', + 1131 => 'rest_prepare_menu_location', + 1132 => 'rest_prepare_nav_menu_item', + 1133 => 'rest_prepare_plugin', + 1134 => 'rest_prepare_post_type', + 1135 => 'rest_prepare_revision', + 1136 => 'rest_prepare_sidebar', + 1137 => 'rest_prepare_status', + 1138 => 'rest_prepare_taxonomy', + 1139 => 'rest_prepare_theme', + 1140 => 'rest_prepare_url_details', + 1141 => 'rest_prepare_user', + 1142 => 'rest_prepare_widget', + 1143 => 'rest_prepare_widget_type', + 1144 => 'rest_prepare_{$this->post_type}', + 1145 => 'rest_prepare_attachment', + 1146 => 'rest_prepare_page', + 1147 => 'rest_prepare_post', + 1148 => 'rest_prepare_{$this->taxonomy}', + 1149 => 'rest_prepare_category', + 1150 => 'rest_prepare_post_tag', + 1151 => 'rest_preprocess_comment', + 1152 => 'rest_queried_resource_route', + 1153 => 'rest_query_var-{$key}', + 1154 => 'rest_request_after_callbacks', + 1155 => 'rest_request_before_callbacks', + 1156 => 'rest_request_from_url', + 1157 => 'rest_request_parameter_order', + 1158 => 'rest_response_link_curies', + 1159 => 'rest_route_data', + 1160 => 'rest_route_for_post', + 1161 => 'rest_route_for_post_type_items', + 1162 => 'rest_route_for_taxonomy_items', + 1163 => 'rest_route_for_term', + 1164 => 'rest_send_nocache_headers', + 1165 => 'rest_term_search_query', + 1166 => 'rest_themes_collection_params', + 1167 => 'rest_url', + 1168 => 'rest_url_details_cache_expiration', + 1169 => 'rest_url_details_http_request_args', + 1170 => 'rest_url_prefix', + 1171 => 'rest_user_collection_params', + 1172 => 'rest_user_query', + 1173 => 'rest_{$this->post_type}_collection_params', + 1174 => 'rest_{$this->post_type}_item_schema', + 1175 => 'rest_attachment_item_schema', + 1176 => 'rest_page_item_schema', + 1177 => 'rest_post_item_schema', + 1178 => 'rest_{$this->post_type}_query', + 1179 => 'rest_attachment_query', + 1180 => 'rest_page_query', + 1181 => 'rest_post_query', + 1182 => 'rest_{$this->post_type}_trashable', + 1183 => 'rest_attachment_trashable', + 1184 => 'rest_page_trashable', + 1185 => 'rest_post_trashable', + 1186 => 'rest_{$this->taxonomy}_collection_params', + 1187 => 'rest_{$this->taxonomy}_query', + 1188 => 'rest_category_query', + 1189 => 'rest_post_tag_query', + 1190 => 'retrieve_password_message', + 1191 => 'retrieve_password_notification_email', + 1192 => 'retrieve_password_title', + 1193 => 'revision_text_diff_options', + 1194 => 'rewrite_rules_array', + 1195 => 'robots_txt', + 1196 => 'role_has_cap', + 1197 => 'root_rewrite_rules', + 1198 => 'rss_enclosure', + 1199 => 'rss_update_frequency', + 1200 => 'rss_update_period', + 1201 => 'rss_widget_feed_link', + 1202 => 'run_wptexturize', + 1203 => 'safe_style_css', + 1204 => 'safecss_filter_attr_allow_css', + 1205 => 'salt', + 1206 => 'sanitize_email', + 1207 => 'sanitize_file_name', + 1208 => 'sanitize_file_name_chars', + 1209 => 'sanitize_html_class', + 1210 => 'sanitize_key', + 1211 => 'sanitize_locale_name', + 1212 => 'sanitize_mime_type', + 1213 => 'sanitize_option_{$option}', + 1214 => 'sanitize_text_field', + 1215 => 'sanitize_textarea_field', + 1216 => 'sanitize_title', + 1217 => 'sanitize_trackback_urls', + 1218 => 'sanitize_user', + 1219 => 'sanitize_{$object_type}_meta_{$meta_key}', + 1220 => 'sanitize_{$object_type}_meta_{$meta_key}_for_{$object_subtype}', + 1221 => 'schedule_event', + 1222 => 'screen_layout_columns', + 1223 => 'screen_options_show_screen', + 1224 => 'screen_options_show_submit', + 1225 => 'screen_settings', + 1226 => 'script_loader_src', + 1227 => 'script_loader_tag', + 1228 => 'search_feed_link', + 1229 => 'search_form_args', + 1230 => 'search_form_format', + 1231 => 'search_link', + 1232 => 'search_rewrite_rules', + 1233 => 'secure_auth_cookie', + 1234 => 'secure_auth_redirect', + 1235 => 'secure_logged_in_cookie', + 1236 => 'secure_signon_cookie', + 1237 => 'self_admin_url', + 1238 => 'self_link', + 1239 => 'send_auth_cookies', + 1240 => 'send_core_update_notification_email', + 1241 => 'send_email_change_email', + 1242 => 'send_network_admin_email_change_email', + 1243 => 'send_new_site_email', + 1244 => 'send_password_change_email', + 1245 => 'send_retrieve_password_email', + 1246 => 'send_site_admin_email_change_email', + 1247 => 'session_token_manager', + 1248 => 'set-screen-option', + 1249 => 'set_screen_option_{$option}', + 1250 => 'set_url_scheme', + 1251 => 'shake_error_codes', + 1252 => 'shortcode_atts_{$shortcode}', + 1253 => 'should_load_block_editor_scripts_and_styles', + 1254 => 'should_load_remote_block_patterns', + 1255 => 'should_load_separate_core_block_assets', + 1256 => 'show_admin_bar', + 1257 => 'show_advanced_plugins', + 1258 => 'show_network_active_plugins', + 1259 => 'show_network_site_users_add_existing_form', + 1260 => 'show_network_site_users_add_new_form', + 1261 => 'show_password_fields', + 1262 => 'show_post_locked_dialog', + 1263 => 'show_recent_comments_widget_style', + 1264 => 'sidebars_widgets', + 1265 => 'signup_another_blog_init', + 1266 => 'signup_blog_init', + 1267 => 'signup_get_available_languages', + 1268 => 'signup_site_meta', + 1269 => 'signup_user_init', + 1270 => 'signup_user_meta', + 1271 => 'single_cat_title', + 1272 => 'single_post_title', + 1273 => 'single_tag_title', + 1274 => 'single_term_title', + 1275 => 'site_admin_email_change_email', + 1276 => 'site_allowed_themes', + 1277 => 'site_by_path_segments_count', + 1278 => 'site_details', + 1279 => 'site_editor_no_javascript_message', + 1280 => 'site_health_navigation_tabs', + 1281 => 'site_health_test_rest_capability_{$check}', + 1282 => 'site_icon_attachment_metadata', + 1283 => 'site_icon_image_sizes', + 1284 => 'site_icon_meta_tags', + 1285 => 'site_option_{$option}', + 1286 => 'site_search_columns', + 1287 => 'site_status_available_object_cache_services', + 1288 => 'site_status_good_response_time_threshold', + 1289 => 'site_status_page_cache_supported_cache_headers', + 1290 => 'site_status_persistent_object_cache_notes', + 1291 => 'site_status_persistent_object_cache_thresholds', + 1292 => 'site_status_persistent_object_cache_url', + 1293 => 'site_status_should_suggest_persistent_object_cache', + 1294 => 'site_status_test_php_modules', + 1295 => 'site_status_test_result', + 1296 => 'site_status_tests', + 1297 => 'site_transient_{$transient}', + 1298 => 'site_url', + 1299 => 'sites_clauses', + 1300 => 'sites_pre_query', + 1301 => 'smilies', + 1302 => 'smilies_src', + 1303 => 'split_the_query', + 1304 => 'status_header', + 1305 => 'strict_redirect_guess_404_permalink', + 1306 => 'strip_shortcodes_tagnames', + 1307 => 'style_loader_src', + 1308 => 'style_loader_tag', + 1309 => 'styles_inline_size_limit', + 1310 => 'stylesheet', + 1311 => 'stylesheet_directory', + 1312 => 'stylesheet_directory_uri', + 1313 => 'stylesheet_uri', + 1314 => 'subdirectory_reserved_names', + 1315 => 'submenu_file', + 1316 => 'tables_to_repair', + 1317 => 'tag_cloud_sort', + 1318 => 'tag_escape', + 1319 => 'tag_feed_link', + 1320 => 'tag_link', + 1321 => 'tag_row_actions', + 1322 => 'taxonomy_feed_link', + 1323 => 'taxonomy_labels_{$taxonomy}', + 1324 => 'taxonomy_labels_category', + 1325 => 'taxonomy_labels_post_tag', + 1326 => 'taxonomy_parent_dropdown_args', + 1327 => 'teeny_mce_before_init', + 1328 => 'teeny_mce_buttons', + 1329 => 'teeny_mce_plugins', + 1330 => 'template', + 1331 => 'template_directory', + 1332 => 'template_directory_uri', + 1333 => 'template_include', + 1334 => 'term_exists_default_query_args', + 1335 => 'term_id_filter', + 1336 => 'term_link', + 1337 => 'term_links-{$taxonomy}', + 1338 => 'term_links-category', + 1339 => 'term_links-post_format', + 1340 => 'term_links-post_tag', + 1341 => 'term_name', + 1342 => 'term_search_min_chars', + 1343 => 'term_updated_messages', + 1344 => 'term_{$field}', + 1345 => 'term_{$field}_rss', + 1346 => 'terms_clauses', + 1347 => 'terms_pre_query', + 1348 => 'terms_to_edit', + 1349 => 'the_author', + 1350 => 'the_author_link', + 1351 => 'the_author_posts_link', + 1352 => 'the_author_{$field}', + 1353 => 'the_category', + 1354 => 'the_category_list', + 1355 => 'the_category_rss', + 1356 => 'the_comments', + 1357 => 'the_content', + 1358 => 'the_content_export', + 1359 => 'the_content_feed', + 1360 => 'the_content_more_link', + 1361 => 'the_date', + 1362 => 'the_editor', + 1363 => 'the_editor_content', + 1364 => 'the_excerpt', + 1365 => 'the_excerpt_embed', + 1366 => 'the_excerpt_export', + 1367 => 'the_excerpt_rss', + 1368 => 'the_feed_link', + 1369 => 'the_generator', + 1370 => 'the_guid', + 1371 => 'the_meta_key', + 1372 => 'the_modified_author', + 1373 => 'the_modified_date', + 1374 => 'the_modified_time', + 1375 => 'the_networks', + 1376 => 'the_password_form', + 1377 => 'the_permalink', + 1378 => 'the_permalink_rss', + 1379 => 'the_post_thumbnail_caption', + 1380 => 'the_posts', + 1381 => 'the_posts_pagination_args', + 1382 => 'the_preview', + 1383 => 'the_privacy_policy_link', + 1384 => 'the_search_query', + 1385 => 'the_shortlink', + 1386 => 'the_sites', + 1387 => 'the_tags', + 1388 => 'the_terms', + 1389 => 'the_time', + 1390 => 'the_title', + 1391 => 'the_title_export', + 1392 => 'the_title_rss', + 1393 => 'the_weekday', + 1394 => 'the_weekday_date', + 1395 => 'theme_action_links', + 1396 => 'theme_action_links_{$stylesheet}', + 1397 => 'theme_auto_update_debug_string', + 1398 => 'theme_auto_update_setting_html', + 1399 => 'theme_auto_update_setting_template', + 1400 => 'theme_file_path', + 1401 => 'theme_file_uri', + 1402 => 'theme_install_actions', + 1403 => 'theme_locale', + 1404 => 'theme_mod_{$name}', + 1405 => 'theme_root', + 1406 => 'theme_root_uri', + 1407 => 'theme_row_meta', + 1408 => 'theme_scandir_exclusions', + 1409 => 'theme_templates', + 1410 => 'theme_{$post_type}_templates', + 1411 => 'theme_attachment_templates', + 1412 => 'theme_page_templates', + 1413 => 'theme_post_templates', + 1414 => 'themes_api', + 1415 => 'themes_api_args', + 1416 => 'themes_api_result', + 1417 => 'themes_auto_update_enabled', + 1418 => 'themes_update_check_locales', + 1419 => 'thread_comments_depth_max', + 1420 => 'time_formats', + 1421 => 'tiny_mce_before_init', + 1422 => 'tiny_mce_plugins', + 1423 => 'trackback_url', + 1424 => 'transient_{$transient}', + 1425 => 'translations_api', + 1426 => 'translations_api_result', + 1427 => 'type_url_form_media', + 1428 => 'unzip_file', + 1429 => 'unzip_file_use_ziparchive', + 1430 => 'update_attached_file', + 1431 => 'update_bulk_plugins_complete_actions', + 1432 => 'update_bulk_theme_complete_actions', + 1433 => 'update_custom_css_data', + 1434 => 'update_feedback', + 1435 => 'update_footer', + 1436 => 'update_plugin_complete_actions', + 1437 => 'update_plugins_{$hostname}', + 1438 => 'update_post_term_count_statuses', + 1439 => 'update_right_now_text', + 1440 => 'update_theme_complete_actions', + 1441 => 'update_themes_{$hostname}', + 1442 => 'update_translations_complete_actions', + 1443 => 'update_welcome_email', + 1444 => 'update_welcome_subject', + 1445 => 'update_welcome_user_email', + 1446 => 'update_welcome_user_subject', + 1447 => 'update_{$meta_type}_metadata', + 1448 => 'update_comment_metadata', + 1449 => 'update_post_metadata', + 1450 => 'update_term_metadata', + 1451 => 'update_user_metadata', + 1452 => 'update_{$meta_type}_metadata_by_mid', + 1453 => 'update_comment_metadata_by_mid', + 1454 => 'update_post_metadata_by_mid', + 1455 => 'update_term_metadata_by_mid', + 1456 => 'update_user_metadata_by_mid', + 1457 => 'update_{$meta_type}_metadata_cache', + 1458 => 'update_comment_metadata_cache', + 1459 => 'update_post_metadata_cache', + 1460 => 'update_term_metadata_cache', + 1461 => 'update_user_metadata_cache', + 1462 => 'upgrader_clear_destination', + 1463 => 'upgrader_install_package_result', + 1464 => 'upgrader_package_options', + 1465 => 'upgrader_post_install', + 1466 => 'upgrader_pre_download', + 1467 => 'upgrader_pre_install', + 1468 => 'upgrader_source_selection', + 1469 => 'upload_dir', + 1470 => 'upload_mimes', + 1471 => 'upload_per_page', + 1472 => 'upload_post_params', + 1473 => 'upload_size_limit', + 1474 => 'url_to_postid', + 1475 => 'use_block_editor_for_post', + 1476 => 'use_block_editor_for_post_type', + 1477 => 'use_curl_transport', + 1478 => 'use_default_gallery_style', + 1479 => 'use_google_chrome_frame', + 1480 => 'use_streams_transport', + 1481 => 'use_widgets_block_editor', + 1482 => 'user_admin_url', + 1483 => 'user_can_richedit', + 1484 => 'user_contactmethods', + 1485 => 'user_dashboard_url', + 1486 => 'user_erasure_fulfillment_email_content', + 1487 => 'user_erasure_fulfillment_email_headers', + 1488 => 'user_erasure_fulfillment_email_subject', + 1489 => 'user_erasure_fulfillment_email_to', + 1490 => 'user_has_cap', + 1491 => 'user_profile_picture_description', + 1492 => 'user_registration_email', + 1493 => 'user_request_action_confirmed_message', + 1494 => 'user_request_action_description', + 1495 => 'user_request_action_email_content', + 1496 => 'user_request_action_email_headers', + 1497 => 'user_request_action_email_subject', + 1498 => 'user_request_confirmed_email_content', + 1499 => 'user_request_confirmed_email_headers', + 1500 => 'user_request_confirmed_email_subject', + 1501 => 'user_request_confirmed_email_to', + 1502 => 'user_request_key_expiration', + 1503 => 'user_row_actions', + 1504 => 'user_search_columns', + 1505 => 'user_trailingslashit', + 1506 => 'user_{$field}', + 1507 => 'user_{$name}_label', + 1508 => 'username_exists', + 1509 => 'users_have_additional_content', + 1510 => 'users_list_table_query_args', + 1511 => 'users_pre_query', + 1512 => 'validate_current_theme', + 1513 => 'validate_username', + 1514 => 'view_mode_post_types', + 1515 => 'views_{$this->screen->id}', + 1516 => 'walker_nav_menu_start_el', + 1517 => 'widget_archives_args', + 1518 => 'widget_archives_dropdown_args', + 1519 => 'widget_block_content', + 1520 => 'widget_block_dynamic_classname', + 1521 => 'widget_categories_args', + 1522 => 'widget_categories_dropdown_args', + 1523 => 'widget_comments_args', + 1524 => 'widget_custom_html_content', + 1525 => 'widget_customizer_setting_args', + 1526 => 'widget_display_callback', + 1527 => 'widget_form_callback', + 1528 => 'widget_links_args', + 1529 => 'widget_meta_poweredby', + 1530 => 'widget_nav_menu_args', + 1531 => 'widget_pages_args', + 1532 => 'widget_posts_args', + 1533 => 'widget_tag_cloud_args', + 1534 => 'widget_text', + 1535 => 'widget_text_content', + 1536 => 'widget_title', + 1537 => 'widget_types_to_hide_from_legacy_widget_block', + 1538 => 'widget_update_callback', + 1539 => 'widget_{$this->id_base}_instance', + 1540 => 'widget_{$this->id_base}_instance_schema', + 1541 => 'wp_admin_bar_class', + 1542 => 'wp_admin_bar_show_site_icons', + 1543 => 'wp_admin_css', + 1544 => 'wp_admin_css_uri', + 1545 => 'wp_admin_notice_args', + 1546 => 'wp_admin_notice_markup', + 1547 => 'wp_ajax_cropped_attachment_id', + 1548 => 'wp_ajax_cropped_attachment_metadata', + 1549 => 'wp_allow_query_attachment_by_filename', + 1550 => 'wp_anonymize_comment', + 1551 => 'wp_audio_embed_handler', + 1552 => 'wp_audio_extensions', + 1553 => 'wp_audio_shortcode', + 1554 => 'wp_audio_shortcode_class', + 1555 => 'wp_audio_shortcode_library', + 1556 => 'wp_audio_shortcode_override', + 1557 => 'wp_auth_check_load', + 1558 => 'wp_auth_check_same_domain', + 1559 => 'wp_authenticate_user', + 1560 => 'wp_authorize_application_redirect_url_invalid_protocols', + 1561 => 'wp_cache_themes_persistently', + 1562 => 'wp_calculate_image_sizes', + 1563 => 'wp_calculate_image_srcset', + 1564 => 'wp_calculate_image_srcset_meta', + 1565 => 'wp_check_filetype_and_ext', + 1566 => 'wp_check_post_lock_window', + 1567 => 'wp_checkdate', + 1568 => 'wp_code_editor_settings', + 1569 => 'wp_comment_reply', + 1570 => 'wp_constrain_dimensions', + 1571 => 'wp_content_img_tag', + 1572 => 'wp_count_attachments', + 1573 => 'wp_count_comments', + 1574 => 'wp_count_posts', + 1575 => 'wp_create_file_in_uploads', + 1576 => 'wp_dashboard_widgets', + 1577 => 'wp_date', + 1578 => 'wp_default_editor', + 1579 => 'wp_delete_file', + 1580 => 'wp_die_ajax_handler', + 1581 => 'wp_die_handler', + 1582 => 'wp_die_json_handler', + 1583 => 'wp_die_jsonp_handler', + 1584 => 'wp_die_xml_handler', + 1585 => 'wp_die_xmlrpc_handler', + 1586 => 'wp_direct_php_update_url', + 1587 => 'wp_direct_update_https_url', + 1588 => 'wp_doing_ajax', + 1589 => 'wp_doing_cron', + 1590 => 'wp_dropdown_cats', + 1591 => 'wp_dropdown_pages', + 1592 => 'wp_dropdown_users', + 1593 => 'wp_dropdown_users_args', + 1594 => 'wp_edit_nav_menu_walker', + 1595 => 'wp_edited_image_metadata', + 1596 => 'wp_editor_expand', + 1597 => 'wp_editor_set_quality', + 1598 => 'wp_editor_settings', + 1599 => 'wp_embed_handler_audio', + 1600 => 'wp_embed_handler_video', + 1601 => 'wp_embed_handler_youtube', + 1602 => 'wp_fatal_error_handler_enabled', + 1603 => 'wp_feed_cache_transient_lifetime', + 1604 => 'wp_filesize', + 1605 => 'wp_generate_attachment_metadata', + 1606 => 'wp_generate_tag_cloud', + 1607 => 'wp_generate_tag_cloud_data', + 1608 => 'wp_generator_type', + 1609 => 'wp_get_attachment_caption', + 1610 => 'wp_get_attachment_id3_keys', + 1611 => 'wp_get_attachment_image', + 1612 => 'wp_get_attachment_image_attributes', + 1613 => 'wp_get_attachment_image_context', + 1614 => 'wp_get_attachment_image_src', + 1615 => 'wp_get_attachment_link', + 1616 => 'wp_get_attachment_link_attributes', + 1617 => 'wp_get_attachment_metadata', + 1618 => 'wp_get_attachment_thumb_url', + 1619 => 'wp_get_attachment_url', + 1620 => 'wp_get_comment_fields_max_lengths', + 1621 => 'wp_get_current_commenter', + 1622 => 'wp_get_custom_css', + 1623 => 'wp_get_loading_optimization_attributes', + 1624 => 'wp_get_missing_image_subsizes', + 1625 => 'wp_get_nav_menu_items', + 1626 => 'wp_get_nav_menu_name', + 1627 => 'wp_get_nav_menu_object', + 1628 => 'wp_get_nav_menus', + 1629 => 'wp_get_object_terms', + 1630 => 'wp_get_object_terms_args', + 1631 => 'wp_get_original_image_path', + 1632 => 'wp_get_original_image_url', + 1633 => 'wp_get_revision_ui_diff', + 1634 => 'wp_get_update_data', + 1635 => 'wp_handle_upload', + 1636 => 'wp_header_image_attachment_metadata', + 1637 => 'wp_headers', + 1638 => 'wp_http_accept_encoding', + 1639 => 'wp_http_cookie_value', + 1640 => 'wp_http_ixr_client_headers', + 1641 => 'wp_iframe_tag_add_loading_attr', + 1642 => 'wp_image_editor_before_change', + 1643 => 'wp_image_editors', + 1644 => 'wp_image_file_matches_image_meta', + 1645 => 'wp_image_maybe_exif_rotate', + 1646 => 'wp_image_resize_identical_dimensions', + 1647 => 'wp_image_src_get_dimensions', + 1648 => 'wp_img_tag_add_decoding_attr', + 1649 => 'wp_img_tag_add_loading_attr', + 1650 => 'wp_img_tag_add_srcset_and_sizes_attr', + 1651 => 'wp_img_tag_add_width_and_height_attr', + 1652 => 'wp_initialize_site_args', + 1653 => 'wp_inline_script_attributes', + 1654 => 'wp_insert_attachment_data', + 1655 => 'wp_insert_post_data', + 1656 => 'wp_insert_post_empty_content', + 1657 => 'wp_insert_post_parent', + 1658 => 'wp_insert_term_data', + 1659 => 'wp_insert_term_duplicate_term_check', + 1660 => 'wp_installed_email', + 1661 => 'wp_internal_hosts', + 1662 => 'wp_is_application_passwords_available', + 1663 => 'wp_is_application_passwords_available_for_user', + 1664 => 'wp_is_comment_flood', + 1665 => 'wp_is_large_network', + 1666 => 'wp_is_large_user_count', + 1667 => 'wp_is_mobile', + 1668 => 'wp_is_php_version_acceptable', + 1669 => 'wp_is_site_protected_by_basic_auth', + 1670 => 'wp_kses_allowed_html', + 1671 => 'wp_kses_uri_attributes', + 1672 => 'wp_lazy_loading_enabled', + 1673 => 'wp_link_pages', + 1674 => 'wp_link_pages_args', + 1675 => 'wp_link_pages_link', + 1676 => 'wp_link_query', + 1677 => 'wp_link_query_args', + 1678 => 'wp_list_authors_args', + 1679 => 'wp_list_bookmarks', + 1680 => 'wp_list_categories', + 1681 => 'wp_list_comments_args', + 1682 => 'wp_list_pages', + 1683 => 'wp_list_pages_excludes', + 1684 => 'wp_list_table_class_name', + 1685 => 'wp_list_table_show_post_checkbox', + 1686 => 'wp_list_users_args', + 1687 => 'wp_loading_optimization_force_header_contexts', + 1688 => 'wp_login_errors', + 1689 => 'wp_mail', + 1690 => 'wp_mail_charset', + 1691 => 'wp_mail_content_type', + 1692 => 'wp_mail_from', + 1693 => 'wp_mail_from_name', + 1694 => 'wp_mail_original_content', + 1695 => 'wp_mce_translation', + 1696 => 'wp_mediaelement_fallback', + 1697 => 'wp_mime_type_icon', + 1698 => 'wp_min_priority_img_pixels', + 1699 => 'wp_nav_locations_listed_per_menu', + 1700 => 'wp_nav_menu', + 1701 => 'wp_nav_menu_args', + 1702 => 'wp_nav_menu_container_allowedtags', + 1703 => 'wp_nav_menu_items', + 1704 => 'wp_nav_menu_objects', + 1705 => 'wp_nav_menu_{$menu->slug}_items', + 1706 => 'wp_navigation_should_create_fallback', + 1707 => 'wp_network_dashboard_widgets', + 1708 => 'wp_new_user_notification_email', + 1709 => 'wp_new_user_notification_email_admin', + 1710 => 'wp_normalize_site_data', + 1711 => 'wp_omit_loading_attr_threshold', + 1712 => 'wp_opcache_invalidate_file', + 1713 => 'wp_page_menu', + 1714 => 'wp_page_menu_args', + 1715 => 'wp_parse_str', + 1716 => 'wp_password_change_notification_email', + 1717 => 'wp_php_error_args', + 1718 => 'wp_php_error_message', + 1719 => 'wp_post_revision_meta_keys', + 1720 => 'wp_post_revision_title_expanded', + 1721 => 'wp_pre_insert_user_data', + 1722 => 'wp_preload_resources', + 1723 => 'wp_prepare_attachment_for_js', + 1724 => 'wp_prepare_revision_for_js', + 1725 => 'wp_prepare_themes_for_js', + 1726 => 'wp_privacy_additional_user_profile_data', + 1727 => 'wp_privacy_anonymize_data', + 1728 => 'wp_privacy_export_expiration', + 1729 => 'wp_privacy_exports_dir', + 1730 => 'wp_privacy_exports_url', + 1731 => 'wp_privacy_personal_data_email_content', + 1732 => 'wp_privacy_personal_data_email_headers', + 1733 => 'wp_privacy_personal_data_email_subject', + 1734 => 'wp_privacy_personal_data_email_to', + 1735 => 'wp_privacy_personal_data_erasers', + 1736 => 'wp_privacy_personal_data_erasure_page', + 1737 => 'wp_privacy_personal_data_export_page', + 1738 => 'wp_privacy_personal_data_exporters', + 1739 => 'wp_protected_ajax_actions', + 1740 => 'wp_query_search_exclusion_prefix', + 1741 => 'wp_read_audio_metadata', + 1742 => 'wp_read_image_metadata', + 1743 => 'wp_read_image_metadata_types', + 1744 => 'wp_read_video_metadata', + 1745 => 'wp_redirect', + 1746 => 'wp_redirect_status', + 1747 => 'wp_refresh_nonces', + 1748 => 'wp_required_field_indicator', + 1749 => 'wp_required_field_message', + 1750 => 'wp_resource_hints', + 1751 => 'wp_rest_search_handlers', + 1752 => 'wp_rest_server_class', + 1753 => 'wp_revisions_to_keep', + 1754 => 'wp_robots', + 1755 => 'wp_safe_redirect_fallback', + 1756 => 'wp_save_image_editor_file', + 1757 => 'wp_save_post_revision_check_for_changes', + 1758 => 'wp_save_post_revision_post_has_changed', + 1759 => 'wp_save_post_revision_revisions_before_deletion', + 1760 => 'wp_script_attributes', + 1761 => 'wp_search_stopwords', + 1762 => 'wp_send_new_user_notification_to_admin', + 1763 => 'wp_send_new_user_notification_to_user', + 1764 => 'wp_setup_nav_menu_item', + 1765 => 'wp_should_handle_php_error', + 1766 => 'wp_should_replace_insecure_home_url', + 1767 => 'wp_should_upgrade_global_tables', + 1768 => 'wp_signature_hosts', + 1769 => 'wp_signature_softfail', + 1770 => 'wp_signature_url', + 1771 => 'wp_signup_location', + 1772 => 'wp_sitemaps_add_provider', + 1773 => 'wp_sitemaps_enabled', + 1774 => 'wp_sitemaps_index_entry', + 1775 => 'wp_sitemaps_max_urls', + 1776 => 'wp_sitemaps_post_types', + 1777 => 'wp_sitemaps_posts_entry', + 1778 => 'wp_sitemaps_posts_pre_max_num_pages', + 1779 => 'wp_sitemaps_posts_pre_url_list', + 1780 => 'wp_sitemaps_posts_query_args', + 1781 => 'wp_sitemaps_posts_show_on_front_entry', + 1782 => 'wp_sitemaps_stylesheet_content', + 1783 => 'wp_sitemaps_stylesheet_css', + 1784 => 'wp_sitemaps_stylesheet_index_content', + 1785 => 'wp_sitemaps_stylesheet_index_url', + 1786 => 'wp_sitemaps_stylesheet_url', + 1787 => 'wp_sitemaps_taxonomies', + 1788 => 'wp_sitemaps_taxonomies_entry', + 1789 => 'wp_sitemaps_taxonomies_pre_max_num_pages', + 1790 => 'wp_sitemaps_taxonomies_pre_url_list', + 1791 => 'wp_sitemaps_taxonomies_query_args', + 1792 => 'wp_sitemaps_users_entry', + 1793 => 'wp_sitemaps_users_pre_max_num_pages', + 1794 => 'wp_sitemaps_users_pre_url_list', + 1795 => 'wp_sitemaps_users_query_args', + 1796 => 'wp_spaces_regexp', + 1797 => 'wp_sprintf', + 1798 => 'wp_sprintf_l', + 1799 => 'wp_tag_cloud', + 1800 => 'wp_targeted_link_rel', + 1801 => 'wp_terms_checklist_args', + 1802 => 'wp_theme_editor_filetypes', + 1803 => 'wp_theme_json_data_blocks', + 1804 => 'wp_theme_json_data_default', + 1805 => 'wp_theme_json_data_theme', + 1806 => 'wp_theme_json_data_user', + 1807 => 'wp_theme_json_get_style_nodes', + 1808 => 'wp_title', + 1809 => 'wp_title_parts', + 1810 => 'wp_title_rss', + 1811 => 'wp_trim_excerpt', + 1812 => 'wp_trim_words', + 1813 => 'wp_trusted_keys', + 1814 => 'wp_unique_filename', + 1815 => 'wp_unique_post_slug', + 1816 => 'wp_unique_post_slug_is_bad_attachment_slug', + 1817 => 'wp_unique_post_slug_is_bad_flat_slug', + 1818 => 'wp_unique_post_slug_is_bad_hierarchical_slug', + 1819 => 'wp_unique_term_slug', + 1820 => 'wp_unique_term_slug_is_bad_slug', + 1821 => 'wp_untrash_post_status', + 1822 => 'wp_update_attachment_metadata', + 1823 => 'wp_update_comment_data', + 1824 => 'wp_update_comment_type_batch_size', + 1825 => 'wp_update_https_url', + 1826 => 'wp_update_php_url', + 1827 => 'wp_update_term_data', + 1828 => 'wp_update_term_parent', + 1829 => 'wp_upload_bits', + 1830 => 'wp_user_dashboard_widgets', + 1831 => 'wp_using_themes', + 1832 => 'wp_video_embed_handler', + 1833 => 'wp_video_extensions', + 1834 => 'wp_video_shortcode', + 1835 => 'wp_video_shortcode_class', + 1836 => 'wp_video_shortcode_library', + 1837 => 'wp_video_shortcode_override', + 1838 => 'wp_xmlrpc_server_class', + 1839 => 'wp_{$post->post_type}_revisions_to_keep', + 1840 => 'wp_page_revisions_to_keep', + 1841 => 'wp_post_revisions_to_keep', + 1842 => 'wpmu_active_signup', + 1843 => 'wpmu_blogs_columns', + 1844 => 'wpmu_delete_blog_upload_dir', + 1845 => 'wpmu_drop_tables', + 1846 => 'wpmu_signup_blog_notification', + 1847 => 'wpmu_signup_blog_notification_email', + 1848 => 'wpmu_signup_blog_notification_subject', + 1849 => 'wpmu_signup_user_notification', + 1850 => 'wpmu_signup_user_notification_email', + 1851 => 'wpmu_signup_user_notification_subject', + 1852 => 'wpmu_users_columns', + 1853 => 'wpmu_validate_blog_signup', + 1854 => 'wpmu_validate_user_signup', + 1855 => 'wpmu_welcome_notification', + 1856 => 'wpmu_welcome_user_notification', + 1857 => 'write_your_story', + 1858 => 'wxr_export_skip_commentmeta', + 1859 => 'wxr_export_skip_postmeta', + 1860 => 'wxr_export_skip_termmeta', + 1861 => 'x_redirect_by', + 1862 => 'xmlrpc_allow_anonymous_comments', + 1863 => 'xmlrpc_blog_options', + 1864 => 'xmlrpc_chunk_parsing_size', + 1865 => 'xmlrpc_default_post_fields', + 1866 => 'xmlrpc_default_posttype_fields', + 1867 => 'xmlrpc_default_revision_fields', + 1868 => 'xmlrpc_default_taxonomy_fields', + 1869 => 'xmlrpc_default_user_fields', + 1870 => 'xmlrpc_element_limit', + 1871 => 'xmlrpc_enabled', + 1872 => 'xmlrpc_login_error', + 1873 => 'xmlrpc_methods', + 1874 => 'xmlrpc_pingback_error', + 1875 => 'xmlrpc_prepare_comment', + 1876 => 'xmlrpc_prepare_media_item', + 1877 => 'xmlrpc_prepare_page', + 1878 => 'xmlrpc_prepare_post', + 1879 => 'xmlrpc_prepare_post_type', + 1880 => 'xmlrpc_prepare_taxonomy', + 1881 => 'xmlrpc_prepare_term', + 1882 => 'xmlrpc_prepare_user', + 1883 => 'xmlrpc_text_filters', + 1884 => 'xmlrpc_wp_insert_post_data', + 1885 => 'year_link', + 1886 => '{$action}_overrides', + 1887 => 'wp_handle_sideload_overrides', + 1888 => 'wp_handle_upload_overrides', + 1889 => '{$action}_prefilter', + 1890 => 'wp_handle_sideload_prefilter', + 1891 => 'wp_handle_upload_prefilter', + 1892 => '{$adjacent}_image_link', + 1893 => 'next_image_link', + 1894 => 'previous_image_link', + 1895 => '{$adjacent}_post_link', + 1896 => 'next_post_link', + 1897 => 'previous_post_link', + 1898 => '{$adjacent}_post_rel_link', + 1899 => 'next_post_rel_link', + 1900 => 'previous_post_rel_link', + 1901 => '{$context}_memory_limit', + 1902 => '{$field_no_prefix}_edit_pre', + 1903 => '{$field_no_prefix}_save_pre', + 1904 => '{$field}', + 1905 => '{$field}_pre', + 1906 => '{$option}', + 1907 => '{$permastructname}_rewrite_rules', + 1908 => 'category_rewrite_rules', + 1909 => 'post_format_rewrite_rules', + 1910 => 'post_tag_rewrite_rules', + 1911 => '{$taxonomy}_row_actions', + 1912 => 'category_row_actions', + 1913 => 'post_tag_row_actions', + 1914 => '{$taxonomy}_{$field}', + 1915 => '{$taxonomy}_{$field}_rss', + 1916 => '{$type}_send_to_editor_url', + 1917 => 'audio_send_to_editor_url', + 1918 => 'file_send_to_editor_url', + 1919 => 'video_send_to_editor_url', + 1920 => '{$type}_template', + 1921 => '404_template', + 1922 => 'archive_template', + 1923 => 'attachment_template', + 1924 => 'author_template', + 1925 => 'category_template', + 1926 => 'date_template', + 1927 => 'embed_template', + 1928 => 'frontpage_template', + 1929 => 'home_template', + 1930 => 'index_template', + 1931 => 'page_template', + 1932 => 'paged_template', + 1933 => 'privacypolicy_template', + 1934 => 'search_template', + 1935 => 'single_template', + 1936 => 'singular_template', + 1937 => 'tag_template', + 1938 => 'taxonomy_template', + 1939 => '{$type}_template_hierarchy', + 1940 => '404_template_hierarchy', + 1941 => 'archive_template_hierarchy', + 1942 => 'attachment_template_hierarchy', + 1943 => 'author_template_hierarchy', + 1944 => 'category_template_hierarchy', + 1945 => 'date_template_hierarchy', + 1946 => 'embed_template_hierarchy', + 1947 => 'frontpage_template_hierarchy', + 1948 => 'home_template_hierarchy', + 1949 => 'index_template_hierarchy', + 1950 => 'page_template_hierarchy', + 1951 => 'paged_template_hierarchy', + 1952 => 'privacypolicy_template_hierarchy', + 1953 => 'search_template_hierarchy', + 1954 => 'single_template_hierarchy', + 1955 => 'singular_template_hierarchy', + 1956 => 'tag_template_hierarchy', + 1957 => 'taxonomy_template_hierarchy', + 1958 => '{$type}_upload_iframe_src', + 1959 => 'image_upload_iframe_src', + 1960 => 'media_upload_iframe_src', +); diff --git a/includes/Vars/wp-globals.php b/includes/Vars/wp-globals.php new file mode 100644 index 000000000..bc6b360f6 --- /dev/null +++ b/includes/Vars/wp-globals.php @@ -0,0 +1,253 @@ +*/vendor/* */phpcs-sniffs/PluginCheck/Sniffs/* */includes/Lib/* + */includes/Scanner/* diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 92973ec01..a6885d2fb 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -32,3 +32,21 @@ parameters: - message: '/^Function str_ends_with not found.$/' path: includes/Checker/Checks/Abstract_File_Check.php + - + message: '/^Access to deprecated property \$parts of class PhpParser\\Node\\Name:/' + path: includes/Scanner/PHP_Parser.php + - + message: '/^Call to function is_object\(\) with object will always evaluate to true\.$/' + path: includes/Scanner/PHP_Parser.php + - + message: '/^Call to function is_object\(\) with PhpParser\\Node\\Expr\\AssignOp\\Concat will always evaluate to true\.$/' + path: includes/Scanner/PHP_Parser.php + - + message: '/^Call to function method_exists\(\) with object and .*getEndLine.* will always evaluate to true\.$/' + path: includes/Scanner/PHP_Parser.php + - + message: '/^Call to function method_exists\(\) with PhpParser\\Node\\Expr\\AssignOp\\Concat and .*getEndLine.* will always evaluate to true\.$/' + path: includes/Scanner/PHP_Parser.php + - + message: '/^Instanceof between PhpParser\\Node\\Expr\\AssignOp\\Concat and PhpParser\\Node\\Expr\\AssignOp will always evaluate to true\.$/' + path: includes/Scanner/PHP_Parser.php diff --git a/tests/phpunit/testdata/plugins/test-plugin-prefixing-errors/app.php b/tests/phpunit/testdata/plugins/test-plugin-prefixing-errors/app.php new file mode 100644 index 000000000..afb4a3890 --- /dev/null +++ b/tests/phpunit/testdata/plugins/test-plugin-prefixing-errors/app.php @@ -0,0 +1,8 @@ +run( $check_result ); + + $errors = $check_result->get_errors(); + + $this->assertNotEmpty( $errors ); + $this->assertArrayHasKey( 'load.php', $errors ); + + $this->assertCount( 1, wp_list_filter( $errors['load.php'][18][9], array( 'code' => 'WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedConstantFound' ) ) ); + $this->assertCount( 1, wp_list_filter( $errors['load.php'][20][1], array( 'code' => 'WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound' ) ) ); + $this->assertCount( 1, wp_list_filter( $errors['load.php'][28][1], array( 'code' => 'WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound' ) ) ); + $this->assertCount( 1, wp_list_filter( $errors['load.php'][41][1], array( 'code' => 'WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound' ) ) ); + } +}