This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * A wp-config for testing. |
||
4 | * |
||
5 | * @package automattic/jetpack |
||
6 | */ |
||
7 | |||
8 | /* Path to the WordPress codebase you'd like to test. Add a forward slash in the end. */ |
||
9 | define( 'ABSPATH', '/var/www/html/' ); |
||
10 | |||
11 | /* |
||
12 | * Path to the theme to test with. |
||
13 | * |
||
14 | * The 'default' theme is symlinked from test/phpunit/data/themedir1/default into |
||
15 | * the themes directory of the WordPress installation defined above. |
||
16 | */ |
||
17 | define( 'WP_DEFAULT_THEME', 'default' ); |
||
18 | |||
19 | // Test with multisite enabled. |
||
20 | // Alternatively, use the tests/phpunit/multisite.xml configuration file. |
||
21 | // phpcs:ignore Squiz.Commenting.InlineComment.InvalidEndChar |
||
22 | // define( 'WP_TESTS_MULTISITE', true ); |
||
23 | |||
24 | // Force known bugs to be run. |
||
25 | // Tests with an associated Trac ticket that is still open are normally skipped. |
||
26 | // phpcs:ignore Squiz.Commenting.InlineComment.InvalidEndChar |
||
27 | // define( 'WP_TESTS_FORCE_KNOWN_BUGS', true ); |
||
28 | |||
29 | // Test with WordPress debug mode (default). |
||
30 | define( 'WP_DEBUG', true ); |
||
31 | |||
32 | // Enable error logging for tests. |
||
33 | define( 'WP_DEBUG_LOG', true ); |
||
34 | |||
35 | // Additional constants for better error log. |
||
36 | @error_reporting( E_ALL ); // phpcs:ignore |
||
0 ignored issues
–
show
|
|||
37 | @ini_set( 'log_errors', true ); // phpcs:ignore |
||
0 ignored issues
–
show
It seems like you do not handle an error condition here. This can introduce security issues, and is generally not recommended.
If you suppress an error, we recommend checking for the error condition explicitly: // For example instead of
@mkdir($dir);
// Better use
if (@mkdir($dir) === false) {
throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
![]() |
|||
38 | @ini_set( 'log_errors_max_len', '0' ); // phpcs:ignore |
||
0 ignored issues
–
show
It seems like you do not handle an error condition here. This can introduce security issues, and is generally not recommended.
If you suppress an error, we recommend checking for the error condition explicitly: // For example instead of
@mkdir($dir);
// Better use
if (@mkdir($dir) === false) {
throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
![]() |
|||
39 | |||
40 | define( 'WP_DEBUG_DISPLAY', false ); |
||
41 | define( 'CONCATENATE_SCRIPTS', false ); |
||
42 | define( 'SCRIPT_DEBUG', true ); |
||
43 | define( 'SAVEQUERIES', true ); |
||
44 | |||
45 | // ** MySQL settings ** // |
||
46 | |||
47 | // This configuration file will be used by the copy of WordPress being tested. |
||
48 | // wordpress/wp-config.php will be ignored. |
||
49 | |||
50 | // WARNING WARNING WARNING! |
||
51 | // These tests will DROP ALL TABLES in the database with the prefix named below. |
||
52 | // DO NOT use a production database or one that is shared with something else. |
||
53 | |||
54 | define( 'DB_NAME', getenv( 'MYSQL_DATABASE' ) ); |
||
55 | define( 'DB_USER', getenv( 'MYSQL_USER' ) ); |
||
56 | define( 'DB_PASSWORD', getenv( 'MYSQL_PASSWORD' ) ); |
||
57 | define( 'DB_HOST', getenv( 'MYSQL_HOST' ) ); |
||
58 | define( 'DB_CHARSET', 'utf8' ); |
||
59 | define( 'DB_COLLATE', '' ); |
||
60 | |||
61 | /**#@+ |
||
62 | * Authentication Unique Keys and Salts. |
||
63 | * |
||
64 | * Change these to different unique phrases! |
||
65 | * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service} |
||
66 | */ |
||
67 | define( 'AUTH_KEY', 'put your unique phrase here' ); |
||
68 | define( 'SECURE_AUTH_KEY', 'put your unique phrase here' ); |
||
69 | define( 'LOGGED_IN_KEY', 'put your unique phrase here' ); |
||
70 | define( 'NONCE_KEY', 'put your unique phrase here' ); |
||
71 | define( 'AUTH_SALT', 'put your unique phrase here' ); |
||
72 | define( 'SECURE_AUTH_SALT', 'put your unique phrase here' ); |
||
73 | define( 'LOGGED_IN_SALT', 'put your unique phrase here' ); |
||
74 | define( 'NONCE_SALT', 'put your unique phrase here' ); |
||
75 | |||
76 | // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited, VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
||
77 | $table_prefix = 'wptests_'; // Only numbers, letters, and underscores please! |
||
78 | |||
79 | define( 'WP_TESTS_DOMAIN', 'example.org' ); |
||
80 | define( 'WP_TESTS_EMAIL', '[email protected]' ); |
||
81 | define( 'WP_TESTS_TITLE', 'Test Blog' ); |
||
82 | |||
83 | define( 'WP_PHP_BINARY', 'php' ); |
||
84 | |||
85 | define( 'WPLANG', '' ); |
||
86 |
If you suppress an error, we recommend checking for the error condition explicitly: