Issues (70)

Security Analysis    no request data  

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.

inc/customizer.php (1 issue)

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
 * bitsy Theme Customizer.
4
 *
5
 * @package bitsy
6
 */
7
8
/**
9
 * Add postMessage support for site title and description for the Theme Customizer.
10
 *
11
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
12
 */
13
if ( ! function_exists( 'bitsy_customize_register' ) ) {
14
	/**
15
	 * Register basic customizer support.
16
	 *
17
	 * @param object $wp_customize Customizer reference.
18
	 */
19
	function bitsy_customize_register( $wp_customize ) {
20
		$wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
21
		$wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';
22
		$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
23
	}
24
}
25
add_action( 'customize_register', 'bitsy_customize_register' );
26
27
if ( ! function_exists( 'bitsy_theme_customize_register' ) ) {
28
	/**
29
	 * Register individual settings through customizer's API.
30
	 *
31
	 * @param WP_Customize_Manager $wp_customize Customizer reference.
32
	 */
33
	function bitsy_theme_customize_register( $wp_customize ) {
34
35
		// Theme layout settings.
36
		$wp_customize->add_section( 'bitsy_theme_layout_options', array(
37
			'title'       => __( 'Theme Layout Settings', 'spurs' ),
38
			'capability'  => 'edit_theme_options',
39
			'description' => __( 'Container width and sidebar defaults', 'spurs' ),
40
			'priority'    => 160,
41
		) );
42
43
		//select sanitization function
44
		function bitsy_theme_slug_sanitize_select( $input, $setting ) {
0 ignored issues
show
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
45
46
			//input must be a slug: lowercase alphanumeric characters, dashes and underscores are allowed only
47
			$input = sanitize_key( $input );
48
49
			//get the list of possible select options
50
			$choices = $setting->manager->get_control( $setting->id )->choices;
51
52
			//return input if valid or return default option
53
			return ( array_key_exists( $input, $choices ) ? $input : $setting->default );
54
55
		}
56
57
		$wp_customize->add_setting( 'bitsy_container_type', array(
58
			'default'           => 'container',
59
			'type'              => 'theme_mod',
60
			'sanitize_callback' => 'bitsy_theme_slug_sanitize_select',
61
			'capability'        => 'edit_theme_options',
62
		) );
63
64
		$wp_customize->add_control(
65
			new WP_Customize_Control(
66
				$wp_customize,
67
				'bitsy_container_type', array(
68
					'label'       => __( 'Container Width', 'spurs' ),
69
					'description' => __( 'Use fixed or fluid container?', 'spurs' ),
70
					'section'     => 'bitsy_theme_layout_options',
71
					'settings'    => 'bitsy_container_type',
72
					'type'        => 'select',
73
					'choices'     => array(
74
						'container'       => __( 'Fixed-width container', 'spurs' ),
75
						'container-fluid' => __( 'Full-width container', 'spurs' ),
76
					),
77
					'priority'    => '10',
78
				)
79
			) );
80
81
		$wp_customize->add_setting( 'bitsy_sidebar_position', array(
82
			'default'           => 'right',
83
			'type'              => 'theme_mod',
84
			'sanitize_callback' => 'sanitize_text_field',
85
			'capability'        => 'edit_theme_options',
86
		) );
87
88
		$wp_customize->add_control(
89
			new WP_Customize_Control(
90
				$wp_customize,
91
				'bitsy_sidebar_position', array(
92
					'label'             => __( 'Default Sidebar Position', 'spurs' ),
93
					'description'       => __( '<b>Applies to all pages and posts.</b> <br />
94
												<b>Select:</b> right, left, both, or none. <br />
95
												<b>Note:</b> you can override on individual pages.',
96
						'spurs' ),
97
					'section'           => 'bitsy_theme_layout_options',
98
					'settings'          => 'bitsy_sidebar_position',
99
					'type'              => 'select',
100
					'sanitize_callback' => 'bitsy_theme_slug_sanitize_select',
101
					'choices'           => array(
102
						'right' => __( 'Right sidebar', 'spurs' ),
103
						'left'  => __( 'Left sidebar', 'spurs' ),
104
						'both'  => __( 'Left & Right sidebars', 'spurs' ),
105
						'none'  => __( 'No sidebar', 'spurs' ),
106
					),
107
					'priority'          => '20',
108
				)
109
			) );
110
	}
111
} // endif function_exists( 'bitsy_theme_customize_register' ).
112
add_action( 'customize_register', 'bitsy_theme_customize_register' );
113
114
/**
115
 * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
116
 */
117
if ( ! function_exists( 'bitsy_customize_preview_js' ) ) {
118
	/**
119
	 * Setup JS integration for live previewing.
120
	 */
121
	function bitsy_customize_preview_js() {
122
		wp_enqueue_script( 'bitsy_customizer', get_template_directory_uri() . '/js/customizer.js',
123
			array( 'customize-preview' ), '20130508', true );
124
	}
125
}
126
add_action( 'customize_preview_init', 'bitsy_customize_preview_js' );