Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ node_modules/
*.log
*.sql
*.sqlite
.idea
22 changes: 22 additions & 0 deletions src/MyProblematicClass.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php


class MyProblematicClass
{
protected string $test;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: PHP syntax error: syntax error, unexpected 'string' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) (Generic.PHP.Syntax.PHPSyntax).


public function test(): string
{
foreach ($_POST['menu-locations'] as $menu_id) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Detected usage of a non-sanitized input variable: $_POST['menu-locations'] (WordPress.Security.ValidatedSanitizedInput.InputNotSanitized).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Processing form data without nonce verification (WordPress.Security.NonceVerification.Missing).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Detected usage of a possibly undefined superglobal array index: $_POST['menu-locations']. Use isset() or empty() to check the index exists before using it (WordPress.Security.ValidatedSanitizedInput.InputNotValidated).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Unused variable $menu_id (VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable).

echo 'ADD warning severity 10 - non-sanitized input variable';
}
$functionsCookies = $_COOKIE;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Unused variable $functionsCookies (VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Due to server-side caching, server-side based client related logic might not work. We recommend implementing client side logic in JavaScript instead (WordPressVIPMinimum.Variables.RestrictedVariables.cache_constraints___COOKIE).


$functionsPost = $_POST;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Processing form data without nonce verification (WordPress.Security.NonceVerification.Missing).


var_dump($functionsPost );
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: var_dump() found. Debug code should not normally be used in production (WordPress.PHP.DevelopmentFunctions.error_log_var_dump).


session_write_close();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: The use of PHP session function session_write_close() is prohibited (WordPressVIPMinimum.Functions.RestrictedFunctions.session_session_write_close).

}
}

22 changes: 22 additions & 0 deletions src/MySecondProblematicClass.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php


class MySecondProblematicClass
{
protected string $test;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: PHP syntax error: syntax error, unexpected 'string' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) (Generic.PHP.Syntax.PHPSyntax).


public function test(): string
{
foreach ($_POST['menu-locations'] as $menu_id) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Detected usage of a non-sanitized input variable: $_POST['menu-locations'] (WordPress.Security.ValidatedSanitizedInput.InputNotSanitized).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Processing form data without nonce verification (WordPress.Security.NonceVerification.Missing).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Detected usage of a possibly undefined superglobal array index: $_POST['menu-locations']. Use isset() or empty() to check the index exists before using it (WordPress.Security.ValidatedSanitizedInput.InputNotValidated).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Unused variable $menu_id (VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable).

echo 'ADD warning severity 10 - non-sanitized input variable';
}
$functionsCookies = $_COOKIE;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Unused variable $functionsCookies (VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Due to server-side caching, server-side based client related logic might not work. We recommend implementing client side logic in JavaScript instead (WordPressVIPMinimum.Variables.RestrictedVariables.cache_constraints___COOKIE).


$functionsPost = $_POST;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Processing form data without nonce verification (WordPress.Security.NonceVerification.Missing).


var_dump($functionsPost );
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: var_dump() found. Debug code should not normally be used in production (WordPress.PHP.DevelopmentFunctions.error_log_var_dump).


session_write_close();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: The use of PHP session function session_write_close() is prohibited (WordPressVIPMinimum.Functions.RestrictedFunctions.session_session_write_close).

}
}

13 changes: 13 additions & 0 deletions src/Problem1Class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php


class Problem1Class
{
protected string $test;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: PHP syntax error: syntax error, unexpected 'string' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) (Generic.PHP.Syntax.PHPSyntax).


public function test(): string
{
$functionsCookies = $_COOKIE;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Unused variable $functionsCookies (VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Due to server-side caching, server-side based client related logic might not work. We recommend implementing client side logic in JavaScript instead (WordPressVIPMinimum.Variables.RestrictedVariables.cache_constraints___COOKIE).

}
}

14 changes: 14 additions & 0 deletions src/Problem2Class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php


class Problem2Class
{

public function test(): string
{
foreach ($_POST['menu-locations'] as $menu_id) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Detected usage of a non-sanitized input variable: $_POST['menu-locations'] (WordPress.Security.ValidatedSanitizedInput.InputNotSanitized).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Processing form data without nonce verification (WordPress.Security.NonceVerification.Missing).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Detected usage of a possibly undefined superglobal array index: $_POST['menu-locations']. Use isset() or empty() to check the index exists before using it (WordPress.Security.ValidatedSanitizedInput.InputNotValidated).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Unused variable $menu_id (VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable).

echo 'ADD warning severity 10 - non-sanitized input variable';
}
}
}

Loading