Issues (10)

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.

s214-settings-demo.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
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 31 and the first side effect is on line 19.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
/**
3
 * Plugin Name:     S214 Settings Demo
4
 * Plugin URI:      https://section214.com
5
 * Description:     Demo plugin for the S214 Settings library
6
 * Version:         1.0.0
7
 * Author:          Daniel J Griffiths
8
 * Author URI:      https://section214.com
9
 * Text Domain:     s214-settings-demo
10
 *
11
 * @package         S214_Settings_Demo
12
 * @author          Daniel J Griffiths <[email protected]>
13
 * @copyright       Copyright (c) 2016, Daniel J Griffiths
14
 */
15
16
17
// Exit if accessed directly
18
if( ! defined( 'ABSPATH' ) ) {
19
	exit;
20
}
21
22
23
if( ! class_exists( 'S214_Settings_Demo' ) ) {
24
25
26
	/**
27
	 * Main S214_Settings_Demo class
28
	 *
29
	 * @since       1.0.0
30
	 */
31
	class S214_Settings_Demo {
32
33
34
		/**
35
		 * @var         S214_Settings_Demo $instance The one true S214_Settings_Demo
36
		 * @since       1.0.0
37
		 */
38
		private static $instance;
39
40
41
		/**
42
		 * @var         object $settings The S214_Settings settings object
43
		 * @since       1.0.0
44
		 */
45
		public $settings;
46
47
48
		/**
49
		 * Get active instance
50
		 *
51
		 * @access      public
52
		 * @since       1.0.0
53
		 * @return      self::$instance The one true S214_Settings_Demo
0 ignored issues
show
The doc-type self::$instance could not be parsed: Unknown type name "self::$instance" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
54
		 */
55 1
		public static function instance() {
56 1
			if( ! self::$instance ) {
57
				self::$instance = new S214_Settings_Demo();
58
				self::$instance->setup_constants();
59
				self::$instance->includes();
60
			}
61
62 1
			return self::$instance;
63
		}
64
65
66
		/**
67
		 * Setup plugin constants
68
		 *
69
		 * @access      private
70
		 * @since       1.0.0
71
		 * @return      void
72
		 */
73
		private function setup_constants() {
74
			// Plugin version
75
			define( 'S214_SETTINGS_DEMO_VER', '1.0.0' );
76
77
			// Plugin path
78
			define( 'S214_SETTINGS_DEMO_DIR', plugin_dir_path( __FILE__ ) );
79
80
			// Plugin URL
81
			define( 'S214_SETTINGS_DEMO_URL', plugin_dir_url( __FILE__ ) );
82
		}
83
84
85
		/**
86
		 * Include necessary files
87
		 *
88
		 * @access      private
89
		 * @since       1.0.0
90
		 * @global		array $s214_settings_demo_options The S214_Settings_Demo options array
91
		 * @return      void
92
		 */
93
		private function includes() {
94
			global $s214_settings_demo_options;
95
96
			if( ! class_exists( 'S214_Settings' ) ) {
97
				require_once S214_SETTINGS_DEMO_DIR . 'includes/libraries/S214-Settings/source/class.s214-settings.php';
98
			}
99
100
			$this->settings = new S214_Settings( 's214-settings-demo', 'welcome' );
101
			$s214_settings_demo_options = $this->settings->get_settings();
102
103
			require_once S214_SETTINGS_DEMO_DIR . 'includes/actions.php';
104
			require_once S214_SETTINGS_DEMO_DIR . 'includes/settings.php';
105
		}
106
	}
107
}
108
109
110
/**
111
 * The main function responsible for returning the one true S214_Settings_Demo
112
 * instance to functions everywhere
113
 *
114
 * @since	   1.0.0
115
 * @return	  S214_Settings_Demo The one true S214_Settings_Demo
116
 */
117
function s214_settings_demo() {
118 1
	return S214_Settings_Demo::instance();
119
}
120
add_action( 'plugins_loaded', 's214_settings_demo' );
121