Issues (72)

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.

assets/js/src/functions.js (11 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
/**
2
 * Asynchronously save all settings in the current settings page to the database.
3
 * Shows an error notification if errors occur. Shows a success notification
4
 * otherwise.
5
 * 
6
 * @param {Function} done
7
 */
8
Amarkal.settings.save = function( done ) 
0 ignored issues
show
The variable Amarkal seems to be never declared. If this is a global, consider adding a /** global: Amarkal */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
9
{
10
    Amarkal.settings._postData('save',function(res){
0 ignored issues
show
The variable Amarkal seems to be never declared. If this is a global, consider adding a /** global: Amarkal */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
11
        
12
        $('#amarkal-settings-form').amarkalUIForm('setData', res.values, res.errors);
13
        Amarkal.settings._clearNotices();
0 ignored issues
show
The variable Amarkal seems to be never declared. If this is a global, consider adding a /** global: Amarkal */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
14
        
15
        if(!$.isEmptyObject(res.errors)) {
16
            for(var name in res.errors) {
0 ignored issues
show
A for in loop automatically includes the property of any prototype object, consider checking the key using hasOwnProperty.

When iterating over the keys of an object, this includes not only the keys of the object, but also keys contained in the prototype of that object. It is generally a best practice to check for these keys specifically:

var someObject;
for (var key in someObject) {
    if ( ! someObject.hasOwnProperty(key)) {
        continue; // Skip keys from the prototype.
    }

    doSomethingWith(key);
}
Loading history...
17
                var $comp = $('[amarkal-component-name="'+name+'"]'),
18
                    props = $comp.amarkalUIComponent('getProps');
19
                
20
                $comp.amarkalUIComponent('makeInvalid');
21
                $comp.parent()
22
                     .children('.amarkal-settings-error')
23
                     .addClass('amarkal-visible')
24
                     .html(res.errors[name]);
25
26
                Amarkal.settings.notifier.error('Some errors have occured, see below for more information.');
27
                Amarkal.settings.sections.flag('error', props.section);
28
                Amarkal.settings.fields.flag('error', props.name);
29
            }
30
            
31
        }
32
        else {
33
            Amarkal.settings.notifier.success('Settings saved', 3000);
34
        }
35
        done();
36
    });
37
};
38
39
/**
40
 * Asynchronously reset all settings in the current settings page to their 
41
 * default values and erase all data from the database. Shows a success 
42
 * notification upon completion.
43
 * 
44
 * @param {Function} done
45
 */
46
Amarkal.settings.resetAll = function( done ) 
47
{
48
    Amarkal.settings._postData('reset_all',function(res){
0 ignored issues
show
The variable Amarkal seems to be never declared. If this is a global, consider adding a /** global: Amarkal */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
49
        
50
        $('#amarkal-settings-form').amarkalUIForm('setData', res.values, res.errors);
51
        Amarkal.settings._clearNotices();
0 ignored issues
show
The variable Amarkal seems to be never declared. If this is a global, consider adding a /** global: Amarkal */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
52
        Amarkal.settings.notifier.success('Default settings applied', 3000);
53
        
54
        done();
55
    });
56
};
57
58
/**
59
 * Asynchronously reset all settings in the current settings section to their 
60
 * default values and erase all section data from the database. Shows a success 
61
 * notification upon completion.
62
 * 
63
 * @param {Function} done
64
 */
65
Amarkal.settings.resetSection = function( done ) 
66
{
67
    Amarkal.settings._postData('reset_section',function(res){
0 ignored issues
show
The variable Amarkal seems to be never declared. If this is a global, consider adding a /** global: Amarkal */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
68
        
69
        $('#amarkal-settings-form').amarkalUIForm('setData', res.values, res.errors);
70
        Amarkal.settings._clearNotices();
0 ignored issues
show
The variable Amarkal seems to be never declared. If this is a global, consider adding a /** global: Amarkal */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
71
        Amarkal.settings.notifier.success('Default settings applied for the section <strong>'+Amarkal.settings.sections.getTitle(Amarkal.settings.sections.activeSection)+'</strong>', 3000);
72
        
73
        done();
74
    });
75
};
76
77
/**
78
 * Reset all components and clear errors
79
 */
80
Amarkal.settings._clearNotices = function()
81
{
82
    // Reset all components
83
    $('.amarkal-ui-component').amarkalUIComponent('reset');
84
    $('.amarkal-settings-error').removeClass('amarkal-visible').html('');
85
    Amarkal.settings.sections.unflagAll();
0 ignored issues
show
The variable Amarkal seems to be never declared. If this is a global, consider adding a /** global: Amarkal */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
86
    Amarkal.settings.fields.unflagAll();
87
};
88
89
/**
90
 * Send serialized form data to be processed in the backend by the function given
91
 * in the 'action' variable.
92
 * 
93
 * @param {string} action
94
 * @param {Function} done
95
 */
96
Amarkal.settings._postData = function( action, done )
97
{
98
    var data = $('#amarkal-settings-form').amarkalUIForm('getData');
99
    $('#amarkal-settings-form').find('input[name^="_amarkal"]').each(function(){
100
        data[$(this).attr('name')] = $(this).val();
101
    });
102
103
    // Set the active section (if applicable)
104
    data._amarkal_settings_section = Amarkal.settings.sections.activeSection;
0 ignored issues
show
The variable Amarkal seems to be never declared. If this is a global, consider adding a /** global: Amarkal */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
105
106
    $.post(ajaxurl, {
0 ignored issues
show
The variable ajaxurl seems to be never declared. If this is a global, consider adding a /** global: ajaxurl */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
107
        action: 'amarkal_settings_'+action,
108
        data: data
109
    }, done);
110
};