Issues (57)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

src/helpers.php (7 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
use Codexshaper\WP\Application;
4
use Illuminate\Container\Container;
5
6
if (!function_exists('csrf_token')) {
7
    function csrf_token($action = 'wbp_nonce')
8
    {
9
        return wp_create_nonce($action);
10
    }
11
}
12
13
if (!function_exists('app')) {
14
    /**
15
     * Get the available container instance.
16
     *
17
     * @param string|null $abstract
18
     * @param array       $parameters
19
     *
20
     * @return mixed|\Illuminate\Contracts\Foundation\Application
21
     */
22
    function app($abstract = null, array $parameters = [])
0 ignored issues
show
The parameter $abstract is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $parameters is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
23
    {
24
        $app = new Application();
25
        var_dump($app->app);
0 ignored issues
show
The property app cannot be accessed from this context as it is declared protected in class CodexShaper\WP\Application.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
Security Debugging Code introduced by
var_dump($app->app); looks like debug code. Are you sure you do not want to remove it? This might expose sensitive data.
Loading history...
26
        die();
27
        if (is_null($abstract) && $container != null) {
0 ignored issues
show
if (is_null($abstract) &... return $container; } does not seem to be reachable.

This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.

Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.

function fx() {
    try {
        doSomething();
        return true;
    }
    catch (\Exception $e) {
        return false;
    }

    return false;
}

In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.

Loading history...
28
            return $container;
29
        }
30
31
        return Container::getInstance()->make($abstract, $parameters);
32
    }
33
}
34
35
if (!function_exists('config')) {
36
    /**
37
     * Get / set the specified configuration value.
38
     *
39
     * If an array is passed as the key, we will assume you want to set an array of values.
40
     *
41
     * @param array|string|null $key
42
     * @param mixed             $default
43
     *
44
     * @return mixed|\Illuminate\Config\Repository
45
     */
46
    function config($key = null, $default = null)
47
    {
48
        if (is_null($key)) {
49
            return app('config');
50
        }
51
52
        if (is_array($key)) {
53
            return app('config')->set($key);
54
        }
55
56
        return app('config')->get($key, $default);
57
    }
58
}
59
60
if (!function_exists('view')) {
61
    function view($view, $data = [], $mergeData = [])
0 ignored issues
show
The parameter $data is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $mergeData is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
62
    {
63
        global $app;
64
65
        if (!class_exists(\CodexShaper\Blade\View::class)) {
66
            throw new \Exception('View not resolved. Please install View');
67
        }
68
69
        return (new \CodexShaper\Blade\View([], '', $app))->make($view, $data = [], $mergeData = []);
70
    }
71
}
72