GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (1881)

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.

admin/class-gallery-metabox-settings-helper.php (6 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
 * Created by bradvin
4
 * Date: 28/04/2017
5
 *
6
 */
7
if ( ! class_exists( 'FooGallery_Admin_Gallery_MetaBox_Settings_Helper' ) ) {
8
9
	class FooGallery_Admin_Gallery_MetaBox_Settings_Helper {
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
10
11
		/**
12
		 * @var FooGallery
13
		 */
14
		private $gallery;
15
16
		/**
17
		 * @var bool
18
		 */
19
		private $hide_help;
20
21
		/**
22
		 * @var array
23
		 */
24
		public $gallery_templates;
25
26
		/**
27
		 * FooGallery_Admin_Gallery_MetaBox_Settings_Helper constructor.
28
		 * @param $gallery FooGallery
29
		 */
30
		function __construct($gallery) {
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
31
			$this->gallery = $gallery;
32
			$this->hide_help = 'on' == foogallery_get_setting( 'hide_gallery_template_help' );
33
34
			$this->gallery_templates = foogallery_gallery_templates();
35
36
			$this->current_gallery_template = foogallery_default_gallery_template();
0 ignored issues
show
The property current_gallery_template does not seem to exist. Did you mean gallery?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
37
			if ( ! empty($this->gallery->gallery_template) ) {
38
				$this->current_gallery_template = $this->gallery->gallery_template;
0 ignored issues
show
The property current_gallery_template does not seem to exist. Did you mean gallery?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
39
			}
40
		}
41
42
		private function render_gallery_template_settings_tabs( $template, $sections ) {
43
			$tab_active = 'foogallery-tab-active';
44
			foreach ( $sections as $section_slug => $section ) { ?>
45
				<div class="foogallery-vertical-tab <?php echo $tab_active; ?>"
46
					 data-name="<?php echo $template['slug']; ?>-<?php echo $section_slug; ?>">
47
					<span class="dashicons <?php echo $section['icon_class']; ?>"></span>
48
					<span class="foogallery-tab-text"><?php echo $section['name']; ?></span>
49
				</div>
50
				<?php
51
				$tab_active = '';
52
			}
53
		}
54
55
		private function render_gallery_template_settings_tab_contents( $template, $sections ) {
56
			$tab_active = 'foogallery-tab-active';
57
			foreach ( $sections as $section_slug => $section ) { ?>
58
				<div class="foogallery-tab-content <?php echo $tab_active; ?>"
59
					 data-name="<?php echo $template['slug']; ?>-<?php echo $section_slug; ?>">
60
					<?php $this->render_gallery_template_settings_tab_contents_fields( $template, $section ); ?>
61
				</div>
62
				<?php
63
				$tab_active = '';
64
			}
65
		}
66
67
		private function render_gallery_template_settings_tab_contents_fields( $template, $section ) {
68
			?>
69
			<table class="foogallery-metabox-settings">
70
				<tbody>
71
				<?php
72
				foreach ( $section['fields'] as $field ) {
73
					$field_type = isset( $field['type'] ) ? $field['type'] : 'unknown';
74
					$field_class ="foogallery_template_field foogallery_template_field_type-{$field_type} foogallery_template_field_id-{$field['id']} foogallery_template_field_template-{$template['slug']} foogallery_template_field_template_id-{$template['slug']}-{$field['id']}";
75
					$field_row_data_html = '';
76
					if ( isset( $field['row_data'] ) ) {
77
						$field_row_data = array_map( 'esc_attr', $field['row_data'] );
78
						foreach ( $field_row_data as $field_row_data_name => $field_row_data_value ) {
79
							$field_row_data_html .= " $field_row_data_name=" . '"' . $field_row_data_value . '"';
80
						}
81
					}
82
					?>
83
					<tr class="<?php echo $field_class; ?>"<?php echo $field_row_data_html; ?>>
84
						<?php if ( 'help' == $field_type ) { ?>
85
							<td colspan="2">
86
								<div class="foogallery-help">
87
									<?php echo $field['desc']; ?>
88
								</div>
89
							</td>
90
						<?php } else { ?>
91
							<th>
92
								<label for="FooGallerySettings_<?php echo $template['slug'] . '_' . $field['id']; ?>"><?php echo $field['title']; ?></label>
93
								<?php if ( !empty( $field['desc'] ) ) { ?>
94
									<span data-balloon-length="large" data-balloon-pos="right" data-balloon="<?php echo esc_attr($field['desc']); ?>"><i class="dashicons dashicons-editor-help"></i></span>
95
								<?php } ?>
96
							</th>
97
							<td>
98
								<?php do_action( 'foogallery_render_gallery_template_field', $field, $this->gallery, $template ); ?>
99
							</td>
100
						<?php } ?>
101
					</tr>
102
				<?php } ?>
103
				</tbody>
104
			</table>
105
			<?php
106
		}
107
108
		private function render_gallery_template_settings( $template ) {
109
			$sections = $this->build_model_for_template( $template );
110
			?>
111
			<div class="foogallery-settings">
112
				<div class="foogallery-vertical-tabs">
113
					<?php $this->render_gallery_template_settings_tabs( $template, $sections ); ?>
114
				</div>
115
				<div class="foogallery-tab-contents">
116
					<?php $this->render_gallery_template_settings_tab_contents( $template, $sections ); ?>
117
				</div>
118
			</div>
119
			<?php
120
		}
121
122
		public function render_gallery_settings() {
123
			foreach ( $this->gallery_templates as $template ) {
124
				$field_visibility = ($this->current_gallery_template !== $template['slug']) ? 'style="display:none"' : '';
0 ignored issues
show
The property current_gallery_template does not seem to exist. Did you mean gallery?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
125
				?><div
126
				class="foogallery-settings-container foogallery-settings-container-<?php echo $template['slug']; ?>"
127
				<?php echo $field_visibility; ?>>
128
				<?php $this->render_gallery_template_settings( $template ); ?>
129
				</div><?php
130
			}
131
		}
132
133
		/**
134
		 * build up and return a model that we can use to render the gallery settings
135
		 */
136
		private function build_model_for_template($template) {
137
138
		    $fields = foogallery_get_fields_for_template( $template );
139
140
			//create a sections array and fill it with fields
141
			$sections = array();
142
			foreach ( $fields as $field ) {
143
144
				if (isset($field['type']) && 'help' == $field['type'] && $this->hide_help) {
145
					continue; //skip help if the 'hide help' setting is turned on
146
				}
147
148
				$section_name = isset($field['section']) ? $field['section'] : __( 'General', 'foogallery' );
149
150
				$section_slug = apply_filters( 'foogallery_gallery_settings_metabox_section_slug', $section_name );
151
152
				if ( !isset( $sections[ $section_slug ] ) ) {
153
					$sections[ $section_slug ] = array (
154
						'name' => $section_name,
155
						'icon_class' => apply_filters( 'foogallery_gallery_settings_metabox_section_icon', $section_slug ),
156
						'fields' => array()
157
					);
158
				}
159
160
				$sections[ $section_slug ]['fields'][] = $field;
161
			}
162
163
			return $sections;
164
		}
165
166
		public function render_hidden_gallery_template_selector() {
167
			?>
168
			<span class="hidden foogallery-template-selector"> &mdash;
169
				<select id="FooGallerySettings_GalleryTemplate" name="<?php echo FOOGALLERY_META_TEMPLATE; ?>">
170
                    <?php
171
					foreach ( $this->gallery_templates as $template ) {
172
						$selected = ($this->current_gallery_template === $template['slug']) ? 'selected' : '';
0 ignored issues
show
The property current_gallery_template does not seem to exist. Did you mean gallery?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
173
174
						$preview_css = '';
175
						if ( isset( $template['preview_css'] ) ) {
176
							if ( is_array( $template['preview_css'] ) ) {
177
								//dealing with an array of css files to include
178
								$preview_css = implode( ',', $template['preview_css'] );
179
							} else {
180
								$preview_css = $template['preview_css'];
181
							}
182
						}
183
						$preview_css = empty( $preview_css ) ? '' : ' data-preview-css="' . $preview_css . '" ';
184
185
						$mandatory_classes = '';
186
						if ( isset( $template['mandatory_classes'] ) ) {
187
							$mandatory_classes = ' data-mandatory-classes="' . $template['mandatory_classes'] . '" ';
188
						}
189
190
						echo "<option {$selected}{$preview_css}{$mandatory_classes} value=\"{$template['slug']}\">{$template['name']}</option>";
191
					}
192
					?>
193
                </select>
194
            </span>
195
			<?php
196
		}
197
	}
198
}