Issues (103)

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-titan-framework.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
 * BetterOptin Options
4
 *
5
 * @package   BetterOptin/Titan Framework
6
 * @author    ThemeAvenue <[email protected]>
7
 * @license   GPL-2.0+
8
 * @link      http://themeavenue.net
9
 * @copyright 2015 ThemeAvenue
10
 */
11
12
// If this file is called directly, abort.
13
if ( ! defined( 'WPINC' ) ) {
14
	die;
15
}
16
17
add_action( 'setup_theme', array( 'WPBO_Titan', 'get_instance' ), 11 );
18
19
class WPBO_Titan {
20
21
	/**
22
	 * Instance of the Titan Framework.
23
	 *
24
	 * @since  1.0.0
25
	 * @var    object
26
	 */
27
	public static $instance = null;
28
29
	/**
30
	 * Instance of the plugin settings page.
31
	 *
32
	 * @since  1.0.0
33
	 * @var    object
34
	 */
35
	public $settings = null;
36
37
	public $titan;
38
39
	public function __construct() {
40
		$this->load_titan_framework();
41
	}
42
43
	/**
44
	 * Return an instance of this class.
45
	 *
46
	 * @since     1.0.0
47
	 *
48
	 * @return    object    A single instance of this class.
49
	 */
50
	public static function get_instance() {
51
52
		// If the single instance hasn't been set, set it now.
53
		if ( null == self::$instance ) {
54
			self::$instance = new self;
55
		}
56
57
		return self::$instance;
58
59
	}
60
	
61
	/**
62
	 * Loads Titan Framework.
63
	 *
64
	 * Titan Framework is used to handle all plugin options.
65
	 *
66
	 * @since 1.0.0
67
	 */
68
	public function load_titan_framework() {
69
70
		// Don't do anything when we're activating a plugin to prevent errors
71
		// on redeclaring Titan classes
72
		if ( ! empty( $_GET['action'] ) && ! empty( $_GET['plugin'] ) ) {
73
			if ( $_GET['action'] == 'activate' ) {
74
				return;
75
			}
76
		}
77
78
		// Check if the framework plugin is activated
79
		$useEmbeddedFramework = true;
80
		$activePlugins = get_option('active_plugins');
81
		if ( is_array( $activePlugins ) ) {
82
			foreach ( $activePlugins as $plugin ) {
83
				if ( is_string( $plugin ) ) {
84
					if ( stripos( $plugin, '/titan-framework.php' ) !== false ) {
85
						$useEmbeddedFramework = false;
86
						break;
87
					}
88
				}
89
			}
90
		}
91
		// Use the embedded Titan Framework
92
		if ( $useEmbeddedFramework && ! class_exists( 'TitanFramework' ) ) {
93
//			require_once( WPBO_PATH . 'vendor/gambitph/titan-framework/titan-framework.php' );
0 ignored issues
show
Unused Code Comprehensibility introduced by
42% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
94
			require_once( ABSPATH . 'wp-content/Titan-Framework/titan-framework.php' );
95
		}
96
97
		/**
98
		 * wpbo_before_load_titan hook
99
		 */
100
		do_action( 'wpbo_before_load_titan' );
101
102
		$this->titan    = TitanFramework::getInstance( 'wpbo' );
103
		$this->settings = $this->titan->createAdminPage( array(
104
			'name'     => __( 'Settings', 'betteroptin' ),
105
			'title'    => __( 'BetterOptin Settings', 'betteroptin' ),
106
			'parent'   => 'edit.php?post_type=wpbo-popup',
107
			'position' => 999,
108
			'id'       => 'wpbo-settings'
109
		) );
110
111
		/* Get all options */
112
		$options = $this->get_options();
113
114
		/* Iterate */
115
		foreach( $options as $tab => $content ) {
116
117
			/* Add a new tab */
118
			$tab = $this->settings->createTab( array(
119
				'name'  => $content['name'],
120
				'title' => isset( $content['title'] ) ? $content['title'] : $content['name'],
121
				'id'    => $tab
122
				)
123
			);
124
125
			/* Add all options to current tab */
126
			foreach( $content['options'] as $option ) {
127
				$tab->createOption( $option );
128
			}
129
130
			$tab->createOption( array( 'type' => 'save', ) );
131
132
		}
133
134
	}
135
136
	protected function get_options() {
137
		return apply_filters( 'wpbo_plugin_settings', array() );
138
	}
139
140
}