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.

includes/classes.php (10 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
 * @package Pods\Global\Functions\Classes
4
 */
5
/**
6
 * Include and Init the Pods class
7
 *
8
 * @see   Pods
9
 *
10
 * @param string $type   The pod name
0 ignored issues
show
Should the type for parameter $type not be string|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
11
 * @param mixed  $id     (optional) The ID or slug, to load a single record; Provide array of $params to run 'find'
12
 * @param bool   $strict (optional) If set to true, return false instead of an object if the Pod doesn't exist
0 ignored issues
show
Should the type for parameter $strict not be boolean|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
13
 *
14
 * @return bool|\Pods returns false if $strict, WP_DEBUG, PODS_STRICT or (PODS_DEPRECATED && PODS_STRICT_MODE) are true
0 ignored issues
show
Consider making the return type a bit more specific; maybe use false|Pods.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
15
 * @since 2.0
16
 * @link  https://pods.io/docs/pods/
17
 */
18
function pods( $type = null, $id = null, $strict = null ) {
19
20
	require_once PODS_DIR . 'classes/Pods.php';
21
22
	$pod = new Pods( $type, $id );
23
24
	if ( null === $strict ) {
25
		$strict = pods_strict();
26
	}
27
28
	if ( true === $strict && null !== $type && ! $pod->valid() ) {
29
		return false;
30
	}
31
32
	return $pod;
33
}
34
35
/**
36
 * Easily create content admin screens with in-depth customization. This is the primary interface function that Pods
37
 * runs off of. It's also the only function required to be run in order to have a fully functional Manage interface.
38
 *
39
 * @see   PodsUI
40
 *
41
 * @param array|string|Pods $obj        (optional) Configuration options for the UI
42
 * @param boolean           $deprecated (optional) Whether to enable deprecated options (used by pods_ui_manage)
43
 *
44
 * @return PodsUI
45
 *
46
 * @since 2.0
47
 * @link  https://pods.io/docs/pods-ui/
48
 */
49
function pods_ui( $obj, $deprecated = false ) {
50
51
	require_once PODS_DIR . 'classes/PodsUI.php';
52
53
	return new PodsUI( $obj, $deprecated );
54
}
55
56
/**
57
 * Include and get the PodsAPI object, for use with all calls that Pods makes for add, save, delete, and more.
58
 *
59
 * @see   PodsAPI
60
 *
61
 * @param string $pod    (optional) (deprecated) The Pod name
0 ignored issues
show
Should the type for parameter $pod not be string|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
62
 * @param string $format (optional) (deprecated) Format used in import() and export()
0 ignored issues
show
Should the type for parameter $format not be string|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
63
 *
64
 * @return PodsAPI
65
 *
66
 * @since 2.0
67
 * @link  https://pods.io/docs/pods-api/
68
 */
69
function pods_api( $pod = null, $format = null ) {
70
71
	require_once PODS_DIR . 'classes/PodsAPI.php';
72
73
	return PodsAPI::init( $pod, $format );
74
}
75
76
/**
77
 * Include and Init the PodsData class
78
 *
79
 * @see   PodsData
80
 *
81
 * @param string|\Pod $pod    The pod object to load
0 ignored issues
show
Should the type for parameter $pod not be string|Pod|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
82
 * @param int         $id     (optional) Id of the pod to fetch
0 ignored issues
show
Should the type for parameter $id not be integer|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
83
 * @param bool        $strict (optional) If true throw an error if the pod does not exist
84
 * @param bool        $unique (optional) If true always return a unique class
85
 *
86
 * @return PodsData
87
 *
88
 * @since 2.0
89
 */
90
function pods_data( $pod = null, $id = null, $strict = true, $unique = true ) {
91
92
	require_once PODS_DIR . 'classes/PodsData.php';
93
94
	if ( $unique && false !== $pod ) {
95
		return new PodsData( $pod, $id, $strict );
96
	}
97
98
	return PodsData::init( $pod, $id, $strict );
99
}
100
101
/**
102
 * Include and Init the PodsFormUI class
103
 *
104
 * @see   PodsForm
105
 *
106
 * @return PodsForm
107
 *
108
 * @since 2.0
109
 */
110
function pods_form() {
111
112
	require_once PODS_DIR . 'classes/PodsForm.php';
113
114
	return PodsForm::init();
115
}
116
117
/**
118
 * Include and Init the Pods class
119
 *
120
 * @see   PodsInit
121
 *
122
 * @return PodsInit
123
 *
124
 * @since 2.0
125
 */
126
function pods_init() {
127
128
	require_once PODS_DIR . 'classes/PodsInit.php';
129
130
	return PodsInit::init();
131
}
132
133
/**
134
 * Include and Init the Pods Components class
135
 *
136
 * @see   PodsComponents
137
 *
138
 * @return PodsComponents
139
 *
140
 * @since 2.0
141
 */
142
function pods_components() {
143
144
	require_once PODS_DIR . 'classes/PodsComponents.php';
145
	require_once PODS_DIR . 'classes/PodsComponent.php';
146
147
	return PodsComponents::init();
148
}
149
150
/**
151
 * Include and Init the PodsAdmin class
152
 *
153
 * @see   PodsAdmin
154
 *
155
 * @return PodsAdmin
156
 *
157
 * @since 2.0
158
 */
159
function pods_admin() {
160
161
	require_once PODS_DIR . 'classes/PodsAdmin.php';
162
163
	return PodsAdmin::init();
164
}
165
166
/**
167
 * Include and Init the PodsMeta class
168
 *
169
 * @see   PodsMeta
170
 *
171
 * @return PodsMeta
172
 *
173
 * @since 2.0
174
 */
175
function pods_meta() {
176
177
	require_once PODS_DIR . 'classes/PodsMeta.php';
178
179
	return PodsMeta::init();
180
}
181
182
/**
183
 * Include and Init the PodsArray class
184
 *
185
 * @see   PodsArray
186
 *
187
 * @param mixed $container Object (or existing Array)
188
 *
189
 * @return PodsArray
190
 *
191
 * @since 2.0
192
 */
193
function pods_array( $container ) {
194
195
	require_once PODS_DIR . 'classes/PodsArray.php';
196
197
	return new PodsArray( $container );
198
}
199
200
/**
201
 * @since 2.7
202
 */
203
function pods_i18n() {
204
205
	require_once PODS_DIR . 'classes/PodsI18n.php';
206
207
	return PodsI18n::get_instance();
208
}
209
210
/**
211
 * Include a file that's child/parent theme-aware, and can be cached into object cache or transients
212
 *
213
 * @see   PodsView::view
214
 *
215
 * @param string     $view       Path of the file to be included, this is relative to the current theme
216
 * @param array|null $data       (optional) Data to pass on to the template, using variable => value format
217
 * @param int|bool   $expires    (optional) Time in seconds for the cache to expire, if false caching is disabled.
218
 * @param string     $cache_mode (optional) Specify the caching method to use for the view, available options include
219
 *                               cache, transient, or site-transient
220
 * @param bool       $return     (optional) Whether to return the view or not, defaults to false and will echo it
221
 *
222
 * @return string|bool The view output
223
 *
224
 * @since 2.0
225
 * @link  https://pods.io/docs/pods-view/
226
 */
227
function pods_view( $view, $data = null, $expires = false, $cache_mode = 'cache', $return = false ) {
228
229
	require_once PODS_DIR . 'classes/PodsView.php';
230
231
	$view = PodsView::view( $view, $data, $expires, $cache_mode );
232
233
	if ( $return ) {
234
		return $view;
235
	}
236
237
	echo $view;
238
}
239
240
/**
241
 * Include and Init the PodsMigrate class
242
 *
243
 * @see   PodsMigrate
244
 *
245
 * @param string $type      Export Type (php, json, sv, xml)
0 ignored issues
show
Should the type for parameter $type not be string|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
246
 * @param string $delimiter Delimiter for export type 'sv'
0 ignored issues
show
Should the type for parameter $delimiter not be string|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
247
 * @param array  $data      Array of data
0 ignored issues
show
Should the type for parameter $data not be array|null? Also, consider making the array more specific, something like array<String>, or String[].

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive. In addition it looks for parameters that have the generic type array and suggests a stricter type like array<String>.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
248
 *
249
 * @return PodsMigrate
250
 *
251
 * @since 2.2
252
 */
253
function pods_migrate( $type = null, $delimiter = null, $data = null ) {
254
255
	require_once PODS_DIR . 'classes/PodsMigrate.php';
256
257
	return new PodsMigrate( $type, $delimiter, $data );
258
}
259
260
/**
261
 * Include and Init the PodsUpgrade class
262
 *
263
 * @param string $version Version number of upgrade to get
264
 *
265
 * @see   PodsUpgrade
266
 *
267
 * @return PodsUpgrade
268
 *
269
 * @since 2.1
270
 */
271
function pods_upgrade( $version = '' ) {
272
273
	include_once PODS_DIR . 'sql/upgrade/PodsUpgrade.php';
274
275
	$class_name = str_replace( '.', '_', $version );
276
	$class_name = "PodsUpgrade_{$class_name}";
277
278
	$class_name = trim( $class_name, '_' );
279
280
	if ( ! class_exists( $class_name ) ) {
281
		$file = PODS_DIR . 'sql/upgrade/' . basename( $class_name ) . '.php';
282
283
		if ( file_exists( $file ) ) {
284
			include_once $file;
285
		}
286
	}
287
288
	$class = false;
289
290
	if ( class_exists( $class_name ) ) {
291
		$class = new $class_name();
292
	}
293
294
	return $class;
295
}
296