Issues (2873)

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.

ui/js/jquery.pods.upgrade.js (43 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
/*@global PodsI18n */
2
(function ( $ ) {
3
    var methods = {
4
        prepare : function () {
5
            var pods_ajaxurl = $( '#pods-wizard-box' ).data( 'url' );
6
7
            if ( 'undefined' != typeof pods_ajaxurl )
0 ignored issues
show
!== was expected, but instead != was given.
Loading history...
8
                pods_ajaxurl = pods_ajaxurl.replace( /\?nojs\=1/, '?pods_ajax=1' );
0 ignored issues
show
{ was expected, but instead pods_ajaxurl was given.
Loading history...
9
10
            if ( 'undefined' != typeof ajaxurl && ('undefined' == typeof pods_ajaxurl || '' == pods_ajaxurl || '?pods_ajax=1' == pods_ajaxurl || document.location.href == pods_ajaxurl || document.location.href.replace( /\?nojs\=1/, '?pods_ajax=1' ) == pods_ajaxurl) )
0 ignored issues
show
!== was expected, but instead != was given.
Loading history...
=== was expected, but instead == was given.
Loading history...
11
                pods_ajaxurl = ajaxurl + '?pods_ajax=1';
0 ignored issues
show
{ was expected, but instead pods_ajaxurl was given.
Loading history...
12
13
            if ( $( '#pods-wizard-panel-2 table tbody tr.pods-wizard-table-pending' )[ 0 ] ) {
14
                var $row = $( '#pods-wizard-panel-2 table tbody tr.pods-wizard-table-pending' ).first();
15
16
                $row.removeClass( 'pods-wizard-table-pending' ).addClass( 'pods-wizard-table-active' );
17
18
                var postdata = {
19
                    'action' : $( '#pods-wizard-box' ).data( 'action' ),
20
                    'method' : $( '#pods-wizard-box' ).data( 'method' ),
21
                    '_wpnonce' : $( '#pods-wizard-box' ).data( '_wpnonce' ),
22
                    'step' : 'prepare',
23
                    'type' : $row.data( 'upgrade' ),
24
                    'pod' : '',
25
                    'version' : $( '#pods-wizard-box' ).data( 'version' )
26
                };
27
28
                if ( 'undefined' != typeof $row.data( 'pod' ) )
0 ignored issues
show
!== was expected, but instead != was given.
Loading history...
29
                    postdata[ 'pod' ] = $row.data( 'pod' );
0 ignored issues
show
{ was expected, but instead postdata was given.
Loading history...
['pod'] could be written in dot notation.

You can rewrite this statement in dot notation:

var obj = { };
obj['foo'] = 'bar'; // Bad
obj.foo = 'bar'; // Good
Loading history...
30
31
                $.ajax( {
32
                    type : 'POST',
33
                    url : pods_ajaxurl,
34
                    cache : false,
35
                    data : postdata,
36
                    success : function ( d ) {
37
                        if ( -1 == d.indexOf( '<e>' ) && -1 != d ) {
0 ignored issues
show
=== was expected, but instead == was given.
Loading history...
!== was expected, but instead != was given.
Loading history...
38
                            $row.find( 'td.pods-wizard-count' ).text( d );
39
                            $row.removeClass( 'pods-wizard-table-active' ).addClass( 'pods-wizard-table-complete' );
40
41
                            if ( 'undefined' == typeof $row.data( 'pod' ) )
0 ignored issues
show
=== was expected, but instead == was given.
Loading history...
42
                                $( '#pods-wizard-panel-3 table tbody tr[data-upgrade="' + $row.data( 'upgrade' ) + '"] td.pods-wizard-count' ).text( d );
0 ignored issues
show
{ was expected, but instead $ was given.
Loading history...
43
                            else
44
                                $( '#pods-wizard-panel-3 table tbody tr[data-pod="' + $row.data( 'pod' ) + '"] td.pods-wizard-count' ).text( d );
0 ignored issues
show
{ was expected, but instead $ was given.
Loading history...
45
46
                            // Run next
47
                            return methods[ 'prepare' ]();
0 ignored issues
show
['prepare'] could be written in dot notation.

You can rewrite this statement in dot notation:

var obj = { };
obj['foo'] = 'bar'; // Bad
obj.foo = 'bar'; // Good
Loading history...
48
                        }
49
                        else {
50
                            $row.removeClass( 'pods-wizard-table-active' ).addClass( 'pods-wizard-table-warning' );
51
                            $row.find( 'td span.pods-wizard-info' ).html( d.replace( '<e>', '' ).replace( '</e>', '' ) );
52
                            if ( window.console ) console.log( d.replace( '<e>', '' ).replace( '</e>', '' ) );
0 ignored issues
show
{ was expected, but instead console was given.
Loading history...
53
54
                            // Run next
55
                            return methods[ 'prepare' ]();
0 ignored issues
show
['prepare'] could be written in dot notation.

You can rewrite this statement in dot notation:

var obj = { };
obj['foo'] = 'bar'; // Bad
obj.foo = 'bar'; // Good
Loading history...
56
                        }
57
                    },
58
                    error : function () {
59
                        $row.removeClass( 'pods-wizard-table-active' ).addClass( 'pods-wizard-table-error' );
60
                        $row.find( 'td span.pods-wizard-info' ).text( PodsI18n.__( 'Unable to process request, please try again.' ) );
61
                    },
62
                    dataType : 'html'
63
                } );
64
            }
65
            else {
66
                $( '#pods-wizard-next' ).show();
67
            }
68
        },
69
        migrate : function ( postdata, $row ) {
70
            var pods_ajaxurl = $( '#pods-wizard-box' ).data( 'url' );
71
72
            if ( 'undefined' != typeof pods_ajaxurl )
0 ignored issues
show
!== was expected, but instead != was given.
Loading history...
73
                pods_ajaxurl = pods_ajaxurl.replace( /\?nojs\=1/, '?pods_ajax=1' );
0 ignored issues
show
{ was expected, but instead pods_ajaxurl was given.
Loading history...
74
75
            if ( 'undefined' != typeof ajaxurl && ('undefined' == typeof pods_ajaxurl || '' == pods_ajaxurl || '?pods_ajax=1' == pods_ajaxurl || document.location.href == pods_ajaxurl || document.location.href.replace( /\?nojs\=1/, '?pods_ajax=1' ) == pods_ajaxurl) )
0 ignored issues
show
!== was expected, but instead != was given.
Loading history...
=== was expected, but instead == was given.
Loading history...
76
                pods_ajaxurl = ajaxurl + '?pods_ajax=1';
0 ignored issues
show
{ was expected, but instead pods_ajaxurl was given.
Loading history...
77
78
            if ( 'undefined' != typeof postdata || $( '#pods-wizard-panel-3 table tbody tr.pods-wizard-table-pending' )[ 0 ] ) {
0 ignored issues
show
!== was expected, but instead != was given.
Loading history...
79
                if ( 'undefined' == typeof $row )
0 ignored issues
show
=== was expected, but instead == was given.
Loading history...
80
                    var $row = $( '#pods-wizard-panel-3 table tbody tr.pods-wizard-table-pending' ).first();
0 ignored issues
show
{ was expected, but instead var was given.
Loading history...
It seems like $row was already defined.
Loading history...
81
82
                if ( 'undefined' == typeof postdata ) {
0 ignored issues
show
=== was expected, but instead == was given.
Loading history...
83
                    $row.removeClass( 'pods-wizard-table-pending' ).addClass( 'pods-wizard-table-active' );
84
85
                    var postdata = {
0 ignored issues
show
It seems like postdata was already defined.
Loading history...
86
                        'action' : $( '#pods-wizard-box' ).data( 'action' ),
87
                        'method' : $( '#pods-wizard-box' ).data( 'method' ),
88
                        '_wpnonce' : $( '#pods-wizard-box' ).data( '_wpnonce' ),
89
                        'step' : 'migrate',
90
                        'type' : $row.data( 'upgrade' ),
91
                        'pod' : '',
92
                        'version' : $( '#pods-wizard-box' ).data( 'version' )
93
                    };
94
95
                    if ( 'undefined' != typeof $row.data( 'pod' ) )
0 ignored issues
show
!== was expected, but instead != was given.
Loading history...
96
                        postdata[ 'pod' ] = $row.data( 'pod' );
0 ignored issues
show
{ was expected, but instead postdata was given.
Loading history...
['pod'] could be written in dot notation.

You can rewrite this statement in dot notation:

var obj = { };
obj['foo'] = 'bar'; // Bad
obj.foo = 'bar'; // Good
Loading history...
97
                }
98
99
                $.ajax( {
100
                    type : 'POST',
101
                    url : pods_ajaxurl,
102
                    cache : false,
103
                    data : postdata,
104
                    success : function ( d ) {
105
                        if ( -1 == d.indexOf( '<e>' ) && '-1' != d ) {
0 ignored issues
show
=== was expected, but instead == was given.
Loading history...
!== was expected, but instead != was given.
Loading history...
106
                            if ( '-2' == d ) {
0 ignored issues
show
=== was expected, but instead == was given.
Loading history...
107
                                // Run next
108
                                return methods[ 'migrate' ]( postdata, $row );
0 ignored issues
show
['migrate'] could be written in dot notation.

You can rewrite this statement in dot notation:

var obj = { };
obj['foo'] = 'bar'; // Bad
obj.foo = 'bar'; // Good
Loading history...
109
                            }
110
                            else if ( '1' == d ) {
0 ignored issues
show
=== was expected, but instead == was given.
Loading history...
111
                                $row.removeClass( 'pods-wizard-table-active' ).addClass( 'pods-wizard-table-complete' );
112
113
                                // Run next
114
                                return methods[ 'migrate' ]();
0 ignored issues
show
['migrate'] could be written in dot notation.

You can rewrite this statement in dot notation:

var obj = { };
obj['foo'] = 'bar'; // Bad
obj.foo = 'bar'; // Good
Loading history...
115
                            }
116
                            else if ( ( d.length - 2 ) == d.indexOf( '-2' ) ) {
0 ignored issues
show
=== was expected, but instead == was given.
Loading history...
117
                                $row.removeClass( 'pods-wizard-table-active' ).addClass( 'pods-wizard-table-warning' );
118
                                $row.find( 'td span.pods-wizard-info' ).html( d.replace( '<e>', '' ).replace( '</e>', '' ) );
119
                                if ( window.console ) console.log( d.replace( '<e>', '' ).replace( '</e>', '' ) );
0 ignored issues
show
{ was expected, but instead console was given.
Loading history...
120
121
                                // Run next
122
                                return methods[ 'migrate' ]( postdata, $row );
0 ignored issues
show
['migrate'] could be written in dot notation.

You can rewrite this statement in dot notation:

var obj = { };
obj['foo'] = 'bar'; // Bad
obj.foo = 'bar'; // Good
Loading history...
123
                            }
124
                            else if ( ( d.length - 1 ) == d.indexOf( '1' ) ) {
0 ignored issues
show
=== was expected, but instead == was given.
Loading history...
125
                                $row.removeClass( 'pods-wizard-table-active' ).addClass( 'pods-wizard-table-warning' );
126
                                $row.find( 'td span.pods-wizard-info' ).html( d.replace( '<e>', '' ).replace( '</e>', '' ) );
127
																if ( window.console ) console.log( d.replace( '<e>', '' ).replace( '</e>', '' ) );
0 ignored issues
show
{ was expected, but instead console was given.
Loading history...
128
129
                                // Run next
130
                                return methods[ 'migrate' ]();
0 ignored issues
show
['migrate'] could be written in dot notation.

You can rewrite this statement in dot notation:

var obj = { };
obj['foo'] = 'bar'; // Bad
obj.foo = 'bar'; // Good
Loading history...
There were too many errors found in this file; checking aborted after 75%.

If JSHint finds too many errors in a file, it aborts checking altogether because it suspects a configuration issue.

Further Reading:

Loading history...
131
                            }
132
                            else {
133
                                $row.removeClass( 'pods-wizard-table-active' ).addClass( 'pods-wizard-table-error' );
134
                                $row.find( 'td span.pods-wizard-info' ).html( d.replace( '<e>', '' ).replace( '</e>', '' ) );
135
																if ( window.console ) console.log( d.replace( '<e>', '' ).replace( '</e>', '' ) );
136
                            }
137
                        }
138
                        else if ( -1 < d.indexOf( 'Database Error;' ) ) {
139
                            $row.removeClass( 'pods-wizard-table-active' ).addClass( 'pods-wizard-table-error' );
140
                            $row.find( 'td span.pods-wizard-info' ).html( d.replace( '<e>', '' ).replace( '</e>', '' ) );
141
														if ( window.console ) console.log( d.replace( '<e>', '' ).replace( '</e>', '' ) );
142
                        }
143
                        else {
144
                            $row.removeClass( 'pods-wizard-table-active' ).addClass( 'pods-wizard-table-warning' );
145
                            $row.find( 'td span.pods-wizard-info' ).html( d.replace( '<e>', '' ).replace( '</e>', '' ) );
146
														if ( window.console ) console.log( d.replace( '<e>', '' ).replace( '</e>', '' ) );
147
148
                            // Run next
149
                            return methods[ 'migrate' ]();
150
                        }
151
                    },
152
                    error : function () {
153
                        $row.removeClass( 'pods-wizard-table-active' ).addClass( 'pods-wizard-table-error' );
154
                        $row.find( 'td span.pods-wizard-info' ).text( PodsI18n.__( 'Unable to process request, please try again.' ) );
155
                    },
156
                    dataType : 'html'
157
                } );
158
            }
159
            else {
160
                $( '#pods-wizard-next' ).click().text( 'Start using Pods' ).addClass( 'finished' );
161
                $( '#pods-wizard-next' ).off( 'click' );
162
                $( '#pods-wizard-next' ).prop( 'href', 'admin.php?page=pods' );
163
                $( '#pods-wizard-next' ).show();
164
                $( '#pods-wizard-finished' ).show();
165
            }
166
        }
167
    };
168
169
    $.fn.PodsUpgrade = function ( method ) {
170
        return methods[ method ]();
171
        // go through tr by tr, run if/else checks
172
    };
173
})( jQuery );