Issues (55)

Security Analysis    no request data  

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.

Plugin.php (1 issue)

Severity

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 namespace Bedard\Shop;
2
3
use Backend;
4
use System\Classes\PluginBase;
5
6
/**
7
 * Shop Plugin Information File.
8
 */
9
class Plugin extends PluginBase
10
{
11
    /**
12
     * @var array Plugin dependencies
13
     */
14
    public $require = [
15
        'RainLab.User',
16
    ];
17
18
    /**
19
     * Returns information about this plugin.
20
     *
21
     * @return array
22
     */
23
    public function pluginDetails()
24
    {
25
        return [
26
            'name'        => 'bedard.shop::lang.plugin.name',
27
            'description' => 'bedard.shop::lang.plugin.description',
28
            'author'      => 'Bedard',
29
            'icon'        => 'icon-shopping-cart',
30
        ];
31
    }
32
33
    /**
34
     * Boot method, called right before the request route.
35
     *
36
     * @return array
37
     */
38
    public function boot()
39
    {
40
    }
41
42
    /**
43
     * Register method, called when the plugin is first registered.
44
     *
45
     * @return void
46
     */
47
    public function register()
48
    {
49
        $this->registerConsoleCommand('shop.abandon', 'Bedard\Shop\Console\Abandon');
50
    }
51
52
    /**
53
     * Registers any front-end components implemented in this plugin.
54
     *
55
     * @return array
56
     */
57
    public function registerComponents()
58
    {
59
        return []; // Remove this line to activate
60
61
        return [
0 ignored issues
show
// Remove this line to a...ent' => 'myComponent'); 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...
62
            'Bedard\Shop\Components\MyComponent' => 'myComponent',
63
        ];
64
    }
65
66
    /**
67
     * Registers back-end navigation items for this plugin.
68
     *
69
     * @return array
70
     */
71
    public function registerNavigation()
72
    {
73
        return [
74
            'shop' => [
75
                'icon'        => 'icon-shopping-cart',
76
                'label'       => 'bedard.shop::lang.plugin.name',
77
                'order'       => 500,
78
                'permissions' => ['bedard.shop.*'],
79
                'url'         => Backend::url('bedard/shop/carts'),
80
                'sideMenu' => [
81
                    'carts' => [
82
                        'icon'          => 'icon-shopping-cart',
83
                        'label'         => 'bedard.shop::lang.carts.plural',
84
                        'permissions'   => ['bedard.shop.carts.*'],
85
                        'url'           => Backend::url('bedard/shop/carts'),
86
                    ],
87
                    'statuses' => [
88
                        'icon'          => 'icon-tags',
89
                        'label'         => 'bedard.shop::lang.statuses.plural',
90
                        'permissions'   => ['bedard.shop.statuses.*'],
91
                        'url'           => Backend::url('bedard/shop/statuses'),
92
                    ],
93
                    'products' => [
94
                        'icon'          => 'icon-cubes',
95
                        'label'         => 'bedard.shop::lang.products.plural',
96
                        'permissions'   => ['bedard.shop.products.*'],
97
                        'url'           => Backend::url('bedard/shop/products'),
98
                    ],
99
                    'categories' => [
100
                        'icon'          => 'icon-folder-o',
101
                        'label'         => 'bedard.shop::lang.categories.plural',
102
                        'permissions'   => ['bedard.shop.categories.*'],
103
                        'url'           => Backend::url('bedard/shop/categories'),
104
                    ],
105
                    'settings' => [
106
                        'icon'          => 'icon-cog',
107
                        'label'         => 'bedard.shop::lang.settings.plural',
108
                        'permissions'   => ['bedard.shop.settings.*'],
109
                        'url'           => Backend::url('system/settings/update/bedard/shop/general'),
110
                    ],
111
                ],
112
            ],
113
        ];
114
    }
115
116
    /**
117
     * Registers any back-end permissions used by this plugin.
118
     *
119
     * @return array
120
     */
121
    public function registerPermissions()
122
    {
123
        return [
124
            'bedard.shop.carts.manage' => [
125
                'label' => 'bedard.shop::lang.plugin.permissions.carts',
126
                'tab' => 'bedard.shop::lang.plugin.name',
127
            ],
128
            'bedard.shop.categories.manage' => [
129
                'label' => 'bedard.shop::lang.plugin.permissions.categories',
130
                'tab' => 'bedard.shop::lang.plugin.name',
131
            ],
132
            'bedard.shop.products.manage' => [
133
                'label' => 'bedard.shop::lang.plugin.permissions.products',
134
                'tab' => 'bedard.shop::lang.plugin.name',
135
            ],
136
            'bedard.shop.settings.manage' => [
137
                'label' => 'bedard.shop::lang.plugin.permissions.settings',
138
                'tab' => 'bedard.shop::lang.plugin.name',
139
            ],
140
            'bedard.shop.statuses.manage' => [
141
                'label' => 'bedard.shop::lang.plugin.permissions.statuses',
142
                'tab' => 'bedard.shop::lang.plugin.name',
143
            ],
144
        ];
145
    }
146
147
    /**
148
     * Register scheduled tasks.
149
     *
150
     * @param  \Illuminate\Console\Scheduling\Schedule $schedule
151
     * @return void
152
     */
153
    public function registerSchedule($schedule)
154
    {
155
        $schedule->command('shop:abandon')->everyTenMinutes();
156
    }
157
158
    /**
159
     * Register settings models.
160
     *
161
     * @return array
162
     */
163
    public function registerSettings()
164
    {
165
        return [
166
            'general' => [
167
                'category'      => 'bedard.shop::lang.plugin.name',
168
                'class'         => 'Bedard\Shop\Models\Settings',
169
                'description'   => 'bedard.shop::lang.settings.title',
170
                'icon'          => 'icon-cog',
171
                'label'         => 'bedard.shop::lang.settings.label',
172
                'order'         => 100,
173
                'permissions'   => ['bedard.shop.settings.manage'],
174
            ],
175
            'api' => [
176
                'category'      => 'bedard.shop::lang.plugin.name',
177
                'class'         => 'Bedard\Shop\Models\ApiSettings',
178
                'description'   => 'bedard.shop::lang.api.title',
179
                'icon'          => 'icon-code',
180
                'label'         => 'bedard.shop::lang.api.label',
181
                'order'         => 200,
182
                'permissions'   => ['bedard.shop.settings.manage'],
183
            ],
184
            'payment' => [
185
                'category'      => 'bedard.shop::lang.plugin.name',
186
                'class'         => 'Bedard\Shop\Models\PaymentDrivers',
187
                'description'   => 'bedard.shop::lang.payment.title',
188
                'icon'          => 'icon-money',
189
                'label'         => 'bedard.shop::lang.payment.label',
190
                'order'         => 300,
191
                'permissions'   => ['bedard.shop.settings.manage'],
192
            ],
193
        ];
194
    }
195
196
    /**
197
     * Register drivers.
198
     *
199
     * @return array
200
     */
201
    public function registerShopDrivers()
202
    {
203
        return [
204
            'nopayment' => [
205
                'class'     => 'Bedard\Shop\Drivers\NoPayment',
206
                'name'      => 'bedard.shop::lang.drivers.nopayment.name',
207
                'thumbnail' => null,
208
                'type'      => 'payment',
209
            ],
210
        ];
211
    }
212
}
213