This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
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 $wizard_box = $( '#pods-wizard-box' ), |
||
6 | pods_ajaxurl = $wizard_box.data( 'url' ); |
||
7 | |||
8 | if ( 'undefined' != typeof pods_ajaxurl && '' != pods_ajaxurl ) |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
9 | pods_ajaxurl = pods_ajaxurl.replace( /\?nojs\=1/, '?pods_ajax=1' ); |
||
0 ignored issues
–
show
|
|||
10 | |||
11 | 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
|
|||
12 | pods_ajaxurl = ajaxurl + '?pods_ajax=1'; |
||
0 ignored issues
–
show
|
|||
13 | |||
14 | var $table_pending = $( '#pods-wizard-panel-2 table tbody tr.pods-wizard-table-pending' ); |
||
15 | |||
16 | if ( $table_pending[ 0 ] ) { |
||
17 | var $row = $table_pending.first(); |
||
18 | |||
19 | $row.removeClass( 'pods-wizard-table-pending' ).addClass( 'pods-wizard-table-active' ); |
||
20 | |||
21 | var postdata = { |
||
22 | 'action' : $wizard_box.data( 'action' ), |
||
23 | 'method' : $wizard_box.data( 'method' ), |
||
24 | '_wpnonce' : $wizard_box.data( '_wpnonce' ), |
||
25 | 'migration' : $wizard_box.data( 'migration' ), |
||
26 | 'step' : 'prepare', |
||
27 | 'type' : $row.data( 'migrate' ), |
||
28 | 'object' : '' |
||
29 | }; |
||
30 | |||
31 | if ( 'undefined' != typeof $row.data( 'object' ) ) |
||
0 ignored issues
–
show
|
|||
32 | postdata[ 'object' ] = $row.data( 'object' ); |
||
0 ignored issues
–
show
|
|||
33 | |||
34 | var $step_3 = $( '#pods-wizard-panel-3 table tbody' ), |
||
35 | $table = $row.parent(); |
||
36 | |||
37 | $.ajax( { |
||
38 | type : 'POST', |
||
39 | url : pods_ajaxurl, |
||
40 | cache : false, |
||
41 | data : postdata, |
||
42 | success : function ( d ) { |
||
43 | var message = d.replace( '<e>', '' ).replace( '</e>', '' ); |
||
44 | |||
45 | if ( -1 == d.indexOf( '<e>' ) && -1 != d ) { |
||
0 ignored issues
–
show
|
|||
46 | $row.find( 'td.pods-wizard-count' ).text( d ); |
||
47 | $row.removeClass( 'pods-wizard-table-active' ).addClass( 'pods-wizard-table-complete' ); |
||
48 | |||
49 | if ( 'undefined' != typeof $row.data( 'object' ) ) { |
||
0 ignored issues
–
show
|
|||
50 | $table.find( 'tr[data-migrate="' + $row.data( 'migrate' ) + '"][data-object="' + $row.data( 'object' ) + '"] td.pods-wizard-count' ).text( d ); |
||
51 | $step_3.find( 'tr[data-migrate="' + $row.data( 'migrate' ) + '"][data-object="' + $row.data( 'object' ) + '"] td.pods-wizard-count' ).text( d ); |
||
52 | } |
||
53 | else { |
||
54 | $table.find( 'tr[data-migrate="' + $row.data( 'migrate' ) + '"] td.pods-wizard-count' ).text( d ); |
||
55 | $step_3.find( 'tr[data-migrate="' + $row.data( 'migrate' ) + '"] td.pods-wizard-count' ).text( d ); |
||
56 | } |
||
57 | } |
||
58 | else { |
||
59 | $row.removeClass( 'pods-wizard-table-active' ).addClass( 'pods-wizard-table-warning' ); |
||
60 | $row.find( 'td span.pods-wizard-info' ).html( message ); |
||
61 | |||
62 | if ( window.console ) console.log( message ); |
||
0 ignored issues
–
show
|
|||
63 | } |
||
64 | |||
65 | // Run next |
||
66 | return methods[ 'prepare' ](); |
||
0 ignored issues
–
show
|
|||
67 | }, |
||
68 | error : function () { |
||
69 | $row.removeClass( 'pods-wizard-table-active' ).addClass( 'pods-wizard-table-error' ); |
||
70 | $row.find( 'td span.pods-wizard-info' ).text( PodsI18n.__( 'Unable to process request, please try again.' ) ); |
||
71 | }, |
||
72 | dataType : 'html' |
||
73 | } ); |
||
74 | } |
||
75 | else { |
||
76 | $( '#pods-wizard-next' ).show(); |
||
77 | } |
||
78 | }, |
||
79 | migrate : function ( postdata, $row ) { |
||
80 | var $wizard_box = $( '#pods-wizard-box' ), |
||
81 | pods_ajaxurl = $wizard_box.data( 'url' ); |
||
82 | |||
83 | if ( 'undefined' != typeof pods_ajaxurl ) |
||
0 ignored issues
–
show
|
|||
84 | pods_ajaxurl = pods_ajaxurl.replace( /\?nojs\=1/, '?pods_ajax=1' ); |
||
0 ignored issues
–
show
|
|||
85 | |||
86 | 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
|
|||
87 | pods_ajaxurl = ajaxurl + '?pods_ajax=1'; |
||
0 ignored issues
–
show
|
|||
88 | |||
89 | var $table_pending = $( '#pods-wizard-panel-3 table tbody tr.pods-wizard-table-pending' ); |
||
90 | |||
91 | if ( 'undefined' != typeof postdata || $table_pending[ 0 ] ) { |
||
0 ignored issues
–
show
|
|||
92 | if ( 'undefined' == typeof $row ) |
||
0 ignored issues
–
show
|
|||
93 | $row = $table_pending.first(); |
||
0 ignored issues
–
show
|
|||
94 | |||
95 | if ( 'undefined' == typeof postdata ) { |
||
0 ignored issues
–
show
|
|||
96 | $row.removeClass( 'pods-wizard-table-pending' ).addClass( 'pods-wizard-table-active' ); |
||
97 | |||
98 | postdata = { |
||
99 | 'action' : $wizard_box.data( 'action' ), |
||
100 | 'method' : $wizard_box.data( 'method' ), |
||
101 | '_wpnonce' : $wizard_box.data( '_wpnonce' ), |
||
102 | 'migration' : $wizard_box.data( 'migration' ), |
||
103 | 'step' : 'migrate', |
||
104 | 'type' : $row.data( 'migrate' ), |
||
105 | 'object' : '' |
||
106 | }; |
||
107 | |||
108 | if ( 'undefined' != typeof $row.data( 'object' ) ) |
||
0 ignored issues
–
show
|
|||
109 | postdata[ 'object' ] = $row.data( 'object' ); |
||
0 ignored issues
–
show
|
|||
110 | } |
||
111 | |||
112 | $.ajax( { |
||
113 | type : 'POST', |
||
114 | url : pods_ajaxurl, |
||
115 | cache : false, |
||
116 | data : postdata, |
||
117 | success : function ( d ) { |
||
118 | var message = d.replace( '<e>', '' ).replace( '</e>', '' ); |
||
119 | |||
120 | if ( -1 == d.indexOf( '<e>' ) && '-1' != d ) { |
||
0 ignored issues
–
show
|
|||
121 | if ( '-2' == d ) { |
||
0 ignored issues
–
show
|
|||
122 | // Run next |
||
123 | return methods[ 'migrate' ]( postdata, $row ); |
||
0 ignored issues
–
show
|
|||
124 | } |
||
125 | else if ( '1' == d ) { |
||
0 ignored issues
–
show
|
|||
126 | $row.removeClass( 'pods-wizard-table-active' ).addClass( 'pods-wizard-table-complete' ); |
||
127 | |||
128 | // Run next |
||
129 | return methods[ 'migrate' ](); |
||
0 ignored issues
–
show
|
|||
130 | } |
||
131 | else if ( ( d.length - 2 ) == d.indexOf( '-2' ) ) { |
||
0 ignored issues
–
show
|
|||
132 | $row.removeClass( 'pods-wizard-table-active' ).addClass( 'pods-wizard-table-warning' ); |
||
133 | $row.find( 'td span.pods-wizard-info' ).html( message ); |
||
134 | |||
135 | if ( window.console ) console.log( message ); |
||
0 ignored issues
–
show
|
|||
136 | |||
137 | // Run next |
||
138 | return methods[ 'migrate' ]( postdata, $row ); |
||
0 ignored issues
–
show
|
|||
139 | } |
||
140 | else if ( ( d.length - 1 ) == d.indexOf( '1' ) ) { |
||
0 ignored issues
–
show
|
|||
141 | $row.removeClass( 'pods-wizard-table-active' ).addClass( 'pods-wizard-table-warning' ); |
||
142 | $row.find( 'td span.pods-wizard-info' ).html( message ); |
||
143 | |||
144 | if ( window.console ) console.log( message ); |
||
0 ignored issues
–
show
|
|||
145 | |||
146 | // Run next |
||
147 | return methods[ 'migrate' ](); |
||
0 ignored issues
–
show
|
|||
148 | } |
||
149 | else { |
||
150 | $row.removeClass( 'pods-wizard-table-active' ).addClass( 'pods-wizard-table-error' ); |
||
151 | $row.find( 'td span.pods-wizard-info' ).html( message ); |
||
152 | |||
153 | if ( window.console ) console.log( message ); |
||
0 ignored issues
–
show
|
|||
154 | } |
||
155 | } |
||
156 | else if ( -1 < d.indexOf( 'Database Error;' ) ) { |
||
157 | $row.removeClass( 'pods-wizard-table-active' ).addClass( 'pods-wizard-table-error' ); |
||
158 | $row.find( 'td span.pods-wizard-info' ).html( message ); |
||
159 | |||
160 | if ( window.console ) console.log( message ); |
||
0 ignored issues
–
show
|
|||
161 | } |
||
162 | else { |
||
163 | $row.removeClass( 'pods-wizard-table-active' ).addClass( 'pods-wizard-table-warning' ); |
||
164 | $row.find( 'td span.pods-wizard-info' ).html( message ); |
||
165 | |||
166 | if ( window.console ) console.log( message ); |
||
0 ignored issues
–
show
|
|||
167 | |||
168 | // Run next |
||
169 | return methods[ 'migrate' ](); |
||
0 ignored issues
–
show
There were too many errors found in this file; checking aborted after 86%.
If JSHint finds too many errors in a file, it aborts checking altogether because it suspects a configuration issue. Further Reading: ![]() |
|||
170 | } |
||
171 | |||
172 | return true; |
||
173 | }, |
||
174 | error : function () { |
||
175 | $row.removeClass( 'pods-wizard-table-active' ).addClass( 'pods-wizard-table-error' ); |
||
176 | $row.find( 'td span.pods-wizard-info' ).text( PodsI18n.__( 'Unable to process request, please try again.' ) ); |
||
177 | }, |
||
178 | dataType : 'html' |
||
179 | } ); |
||
180 | } |
||
181 | else { |
||
182 | var $wizard_next = $( '#pods-wizard-next' ); |
||
183 | $wizard_next.click().text( 'Start using Pods' ).addClass( 'finished' ); |
||
184 | $wizard_next.off( 'click' ); |
||
185 | $wizard_next.prop( 'href', 'admin.php?page=pods' ); |
||
186 | $wizard_next.show(); |
||
187 | $( '#pods-wizard-finished' ).show(); |
||
188 | } |
||
189 | } |
||
190 | }; |
||
191 | |||
192 | $.fn.PodsMigrate = function ( method ) { |
||
193 | return methods[ method ](); |
||
194 | // go through tr by tr, run if/else checks |
||
195 | }; |
||
196 | })( jQuery ); |