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 | <?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
Coding Style
introduced
by
![]() |
|||
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. ![]() |
|||
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 |