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/providers/aweber/settings.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
2
/**
3
 * BetterOptin Provider Aweber
4
 *
5
 * @package   BetterOptin/Provider/Aweber/Settings
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_filter( 'wpbo_plugin_settings', 'wpbo_aw_settings' );
18
/**
19
 * Addon settings.
20
 *
21
 * Add new settings to the plugin settings page.
22
 *
23
 * @since  1.0.0
24
 * @param  array $settings Pre-existing settings
25
 * @return array           Updated settings containing MailChimp options
26
 */
27
function wpbo_aw_settings( $settings ) {
28
29
	require( WPBO_PATH . 'includes/providers/aweber/class-titan-aweber.php' );
30
31
	/* Avoid calling the Aweber API when not on its settings page */
32
	if ( ! isset( $_GET['tab'] ) || 'aweber' != $_GET['tab'] ) {
33
		$lists = array();
34
	} else {
35
		$lists = wpbo_aw_get_lists();
36
	}
37
38
	if( !is_array( $lists ) || empty( $lists ) ) {
39
40
		$list_id = array(
41
			'name'    => __( 'List ID', 'wpbo' ),
42
			'id'      => 'aw_list_id',
43
			'type'    => 'text',
44
			'default' => '',
45
			'desc'    => __( 'Input your authorization code and save if you want to see a dropdown of all your lists. If you already entered your authorization code and the dropdown did not appear pleas refresh the page.', 'wpbo' )
46
		);
47
48
	} else {
49
50
		if( is_array( $lists ) ) {
51
52
			$opts[''] = __( 'Please select...', 'wpbo' );
0 ignored issues
show
Coding Style Comprehensibility introduced by
$opts was never initialized. Although not strictly required by PHP, it is generally a good practice to add $opts = array(); before regardless.

Adding an explicit array definition is generally preferable to implicit array definition as it guarantees a stable state of the code.

Let’s take a look at an example:

foreach ($collection as $item) {
    $myArray['foo'] = $item->getFoo();

    if ($item->hasBar()) {
        $myArray['bar'] = $item->getBar();
    }

    // do something with $myArray
}

As you can see in this example, the array $myArray is initialized the first time when the foreach loop is entered. You can also see that the value of the bar key is only written conditionally; thus, its value might result from a previous iteration.

This might or might not be intended. To make your intention clear, your code more readible and to avoid accidental bugs, we recommend to add an explicit initialization $myArray = array() either outside or inside the foreach loop.

Loading history...
53
54
			foreach( $lists as $key => $list ) {
55
				$opts[$list['id']] = $list['name'];
56
			}
57
58
			$list_id = array(
59
				'name'    => __( 'List ID', 'wpbo' ),
60
				'id'      => 'aw_list_id',
61
				'type'    => 'select',
62
				'options' => $opts,
63
				'default' => ''
64
			);
65
66 View Code Duplication
		} else {
0 ignored issues
show
This code seems to be duplicated across 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.

Loading history...
67
68
			$list_id = array(
69
				'name'    => __( 'List ID', 'wpbo' ),
70
				'id'      => 'aw_list_id',
71
				'type'    => 'text',
72
				'default' => '',
73
				'desc'    => __( 'Input your API key and save if you want to see a dropdown of all your lists.', 'wpbo' ),
74
				'default' => ''
75
			);
76
77
		}
78
79
	}
80
81
	$settings['aweber'] = array(
82
		'name'    => __( 'AWeber', 'wpbo' ),
83
		'options' => array(
84
			array(
85
				'name'    => __( 'Authorization Code', 'wpbo' ),
86
				'id'      => 'aw_auth_code',
87
				'type'    => 'aweber',
88
				'desc'    => sprintf( __( 'AWeber requires you to authenticate this plugin with your account for security reasons. If you are not sure how to do it, please <a href="#" target="_blank">watch our video tutorial</a>.', '' ), esc_url( 'http://youtu.be/c448gBbWlkg' ) ),
89
				'default' => ''
90
			),
91
			$list_id
92
		)
93
	);
94
95
	return $settings;
96
97
}