Issues (1282)

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/admin/class-give-admin.php (2 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
 * This class will handle file loading for the wp-admin interface.
4
 *
5
 * @package     Give
6
 * @subpackage  Admin
7
 * @copyright   Copyright (c) 2018, GiveWP
8
 * @license     https://opensource.org/licenses/gpl-license GNU Public License
9
 * @since       2.4.0
10
 */
11
12
/**
13
 * Class Give_Admin
14
 */
15
class Give_Admin {
0 ignored issues
show
Since you have declared the constructor as private, maybe you should also declare the class as final.
Loading history...
16
	/**
17
	 * Instance.
18
	 *
19
	 * @since  2.4.0
20
	 * @access private
21
	 * @var
22
	 */
23
	static private $instance;
24
25
	/**
26
	 * Singleton pattern.
27
	 *
28
	 * @since  2.4.0
29
	 * @access private
30
	 */
31
	private function __construct() {
32
	}
33
34
35
	/**
36
	 * Get instance.
37
	 *
38
	 * @since  2.4.0
39
	 * @access public
40
	 * @return Give_Admin
41
	 */
42 View Code Duplication
	public static function get_instance() {
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
43
		if ( null === static::$instance ) {
44
			self::$instance = new static();
45
			self::$instance->setup();
46
		}
47
48
		return self::$instance;
49
	}
50
51
	/**
52
	 * Setup Admin
53
	 *
54
	 * @sinve  2.4.0
55
	 * @access private
56
	 */
57
	private function setup() {
58
		$this->admin_loading();
59
		$this->conditional_loading();
60
	}
61
62
	/**
63
	 *  Load core file
64
	 *
65
	 * @since  2.4.0
66
	 * @access private
67
	 */
68
	private function admin_loading() {
69
		require_once GIVE_PLUGIN_DIR . 'includes/admin/misc-functions.php';
70
		require_once GIVE_PLUGIN_DIR . 'includes/admin/setting-page-functions.php';
71
		require_once GIVE_PLUGIN_DIR . 'includes/admin/import-functions.php';
72
		require_once GIVE_PLUGIN_DIR . 'includes/admin/give-metabox-functions.php'; // @todo: [refactor] can be loaded only on the form edit screen. review possibilities
73
74
		require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-footer.php';
75
		require_once GIVE_PLUGIN_DIR . 'includes/admin/class-give-welcome.php';
76
		require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-pages.php';
77
		require_once GIVE_PLUGIN_DIR . 'includes/admin/class-i18n-module.php';
78
		require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-actions.php';
79
		require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-filters.php';
80
		require_once GIVE_PLUGIN_DIR . 'includes/admin/add-ons/add-ons.php';
81
		require_once GIVE_PLUGIN_DIR . 'includes/admin/add-ons/actions.php';
82
		require_once GIVE_PLUGIN_DIR . 'includes/admin/plugins.php';
83
		require_once GIVE_PLUGIN_DIR . 'includes/admin/dashboard-widgets.php';
84
		require_once GIVE_PLUGIN_DIR . 'includes/admin/class-blank-slate.php';
85
86
		require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/actions.php';
87
		require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/payments-history.php';
88
89
		require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donors.php';
90
		require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donor-functions.php';
91
		require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donor-actions.php';
92
93
		require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/metabox.php';
94
		require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/class-give-form-duplicator.php';
95
		require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/class-metabox-form-data.php';
96
		require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/dashboard-columns.php';
97
98
		require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/export-functions.php';
99
		require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/class-export.php';
100
		require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/export-actions.php';
101
		require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/give-export-donations-functions.php';
102
103
		require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/reports.php';
104
		require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/class-give-graph.php';
105
		require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/graphing.php';
106
107
		require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/logs/logs.php';
108
109
		require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/data/tools-actions.php';
110
111
		require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/abstract-shortcode-generator.php';
112
		require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/class-shortcode-button.php';
113
		require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-form.php';
114
		require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-goal.php';
115
		require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-login.php';
116
		require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-register.php';
117
		require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-profile-editor.php';
118
		require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donation-grid.php';
119
		require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donation-history.php';
120
		require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-receipt.php';
121
		require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-totals.php';
122
		require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donor-wall.php';
123
	}
124
125
	/**
126
	 *  Load file conditionally
127
	 *
128
	 * @since  2.4.0
129
	 * @access private
130
	 */
131
	private function conditional_loading() {
132
		if ( $this->is_generate_pdf() ) {
133
			require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/pdf-reports.php';
134
		}
135
	}
136
137
	/**
138
	 * Check if performing action 'generate_pdf'
139
	 *
140
	 * @since  2.4.0
141
	 * @access private
142
	 *
143
	 * @return bool
144
	 */
145
	private function is_generate_pdf() {
146
		return isset( $_GET['give-action'] ) && 'generate_pdf' === give_clean( $_GET['give-action'] );
147
	}
148
}
149
150
Give_Admin::get_instance();
151