Issues (52)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  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.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  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.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  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.
  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.
  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.
  Header Injection
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.

include/Deprecated/class-bd-scheduler-addon.php (2 issues)

1
<?php
2
/**
3
 * Base class for all Scheduler Addons.
4
 *
5
 * @since   5.5
6
 * @deprecated 6.0.0 Use \BulkWP\BulkDelete\Core\Addon\SchedulerAddon instead.
7
 *
8
 * @author  Sudar
9
 *
10
 * @package BulkDelete\Addons\Base
11
 */
12
defined( 'ABSPATH' ) || exit; // Exit if accessed directly
13
14
/**
15
 * Base class for Base Addons.
16
 *
17
 * @abstract
18
 *
19
 * @since 5.5
20
 */
21
abstract class BD_Scheduler_Addon extends BD_Addon {
22
	/**
23
	 * @var No base addon for this scheduler addon.
24
	 */
25
	protected $no_base_addon = false;
26
27
	/**
28
	 * @var Base addon name.
29
	 */
30
	protected $base_addon;
31
32
	/**
33
	 * @var Base addon version.
34
	 */
35
	protected $base_addon_version;
36
37
	/**
38
	 * @var Base addon class name.
39
	 */
40
	protected $base_addon_class_name;
41
42
	/**
43
	 * @var Base addon object.
44
	 */
45
	protected $base_addon_obj;
46
47
	/**
48
	 * @var Cron Hook to run the scheduler on.
0 ignored issues
show
The type Cron was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
49
	 */
50
	protected $cron_hook;
51
52
	/**
53
	 * Use `factory()` method to create instance of this class.
54
	 * Don't create instances directly.
55
	 *
56
	 * @since 5.5
57
	 * @see factory()
58
	 */
59
	public function __construct() {
60
		parent::__construct();
61
	}
62
63
	/**
64
	 * Check if the base addon is available.
65
	 *
66
	 * @access protected
67
	 *
68
	 * @since 5.5
69
	 *
70
	 * @todo check for version as well
71
	 *
72
	 * @param string Base Addon class name. Default null. If not specified then it is auto calculated based on addon name.
73
	 * @param mixed|null $addon_class_name
74
	 *
75
	 * @return bool True if base addon is found, False other wise
76
	 */
77
	protected function check_base_addon( $addon_class_name = null ) {
78
		if ( null == $addon_class_name ) {
79
			$this->base_addon_class_name = bd_get_addon_class_name( $this->base_addon );
0 ignored issues
show
Documentation Bug introduced by
It seems like bd_get_addon_class_name($this->base_addon) of type string is incompatible with the declared type Base of property $base_addon_class_name.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
80
		} else {
81
			$this->base_addon_class_name = $addon_class_name;
82
		}
83
84
		if ( class_exists( $this->base_addon_class_name ) ) {
85
			// Ugly workaround, since we need to support PHP 5.2
86
			$this->base_addon_obj = call_user_func( array( $this->base_addon_class_name, 'factory' ) );
87
88
			return true;
89
		} else {
90
			add_action( 'admin_notices', array( $this, 'addon_missing_notice' ) );
91
92
			return false;
93
		}
94
	}
95
96
	/**
97
	 * Show a notice if the base addon is not available.
98
	 *
99
	 * @since 5.5
100
	 */
101
	public function addon_missing_notice() {
102
		$campaign_args = array(
103
			'utm_source'   => 'wpadmin',
104
			'utm_campaign' => 'BulkDelete',
105
			'utm_medium'   => 'header-notice',
106
			'utm_content'  => $this->addon_code,
107
		);
108
		$addon_url = bd_get_addon_url( $this->base_addon, $campaign_args );
109
110
		printf(
111
			'<div class="error"><p>%s</p></div>',
112
			sprintf( __( '"%s" addon requires "<a href="%s" target="_blank">%s</a>" addon to be installed and activated!', 'bulk-delete' ), $this->addon_name, $addon_url , $this->base_addon )
113
		);
114
	}
115
116
	/**
117
	 * Setup hooks.
118
	 *
119
	 * @since 5.5
120
	 */
121
	protected function setup_hooks() {
122
		add_filter( 'bd_javascript_array', array( $this, 'filter_js_array' ) );
123
124
		$cron_hook = $this->get_cron_hook();
125
		if ( ! empty( $cron_hook ) ) {
126
			add_action( $cron_hook, array( $this, 'do_delete' ), 10, 1 );
127
		}
128
	}
129
130
	/**
131
	 * Filter JS Array and add pro hooks.
132
	 *
133
	 * @since 5.5
134
	 *
135
	 * @param array $js_array JavaScript Array
136
	 *
137
	 * @return array Modified JavaScript Array
138
	 */
139
	public function filter_js_array( $js_array ) {
140
		$js_array['pro_iterators'][] = $this->get_module()->get_field_slug();
141
142
		return $js_array;
143
	}
144
145
	/**
146
	 * Hook handler.
147
	 *
148
	 * @since 5.5
149
	 *
150
	 * @param array $delete_options
151
	 */
152
	public function do_delete( $delete_options ) {
153
		do_action( 'bd_before_scheduler', $this->addon_name );
154
		$count = $this->get_module()->delete( $delete_options );
155
		do_action( 'bd_after_scheduler', $this->addon_name, $count );
156
	}
157
158
	/**
159
	 * Get the cron hook.
160
	 *
161
	 * @access protected
162
	 *
163
	 * @since 5.5
164
	 *
165
	 * @return string Cron hook.
166
	 */
167
	protected function get_cron_hook() {
168
		$cron_hook = '';
169
		if ( null != $this->base_addon_obj ) {
170
			$cron_hook = $this->base_addon_obj->get_cron_hook();
171
		}
172
173
		return $cron_hook;
174
	}
175
176
	/**
177
	 * Get base module.
178
	 *
179
	 * @access protected
180
	 *
181
	 * @since 5.5
182
	 *
183
	 * @return object Base module object
184
	 */
185
	protected function get_module() {
186
		if ( $this->no_base_addon ) {
187
			return $this->base_addon_obj;
188
		} else {
189
			return $this->base_addon_obj->get_module();
190
		}
191
	}
192
}
193