Issues (130)

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/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
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 22 and the first side effect is on line 11.

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
 * Settings
4
 *
5
 * @package     PrintCenter\Admin\Settings
6
 * @since       1.0.0
7
 */
8
9
// Exit if accessed directly
10
if( ! defined( 'ABSPATH' ) ) {
11
	exit;
12
}
13
14
15
/**
16
 * Add the settings menu item
17
 *
18
 * @since       1.0.0
19
 * @param       array $menu The existing menu settings
20
 * @return      array $menu The updated menu settings
21
 */
22
function printcenter_menu( $menu ) {
23
	$menu['page_title'] = __( 'PrintCenter Settings', 'printcenter' );
24
	$menu['menu_title'] = __( 'PrintCenter', 'printcenter' );
25
26
	return $menu;
27
}
28
add_filter( 'printcenter_menu', 'printcenter_menu' );
29
30
31
/**
32
 * Add the settings menu item
33
 *
34
 * @since       1.0.0
35
 * @param       array $tabs The existing settings tabs
36
 * @return      array $tabs The updated settings tabs
37
 */
38
function printcenter_settings_tabs( $tabs ) {
39
	$tabs['ssi']   = __( 'SSI', 'printcenter' );
40
	//$tabs['email'] = __( 'Email', 'printcenter' );
0 ignored issues
show
Unused Code Comprehensibility introduced by
59% 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...
41
42
	return $tabs;
43
}
44
add_filter( 'printcenter_settings_tabs', 'printcenter_settings_tabs' );
45
46
47
/**
48
 * Add the settings
49
 *
50
 * @since       1.0.0
51
 * @param       array $settings The existing settings
52
 * @return      array $settings The updated settings
53
 */
54
function printcenter_settings( $settings ) {
55
	$plugin_settings = array(
56
		'ssi' => apply_filters( 'printcenter_ssi_settings', array(
57
			array(
58
				'id'   => 'ssi_header',
59
				'name' => __( 'SSI Settings', 'printcenter' ),
60
				'desc' => '',
61
				'type' => 'header'
62
			),
63
			array(
64
				'id'      => 'ssi_mode',
65
				'name'    => __( 'Processing Mode', 'printcenter' ),
66
				'desc'    => __( 'Choose the SSI data processing mode', 'printcenter' ),
67
				'type'    => 'select',
68
				'options' => array(
69
					'live'    => __( 'Live', 'printcenter' ),
70
					'test'    => __( 'Test', 'printcenter' ),
71
					'capture' => __( 'Capture', 'printcenter' )
72
				)
73
			),
74
			array(
75
				'id'   => 'ssi_custid',
76
				'name' => __( 'Live Customer ID', 'printcenter' ),
77
				'desc' => __( 'Your SSI customer ID', 'printcenter' ),
78
				'type' => 'text',
79
				'std'  => '1024'
80
			),
81
			array(
82
				'id'   => 'ssi_custzip',
83
				'name' => __( 'Live Customer Zip Code', 'printcenter' ),
84
				'desc' => __( 'Your SSI billing zip code', 'printcenter' ),
85
				'type' => 'text',
86
				'std'  => '80304'
87
			),
88
			array(
89
				'id'   => 'ssi_test_custid',
90
				'name' => __( 'Test Customer ID', 'printcenter' ),
91
				'desc' => __( 'Test ID provided by SSI', 'printcenter' ),
92
				'type' => 'text',
93
				'std'  => '1013'
94
			),
95
			array(
96
				'id'   => 'ssi_test_custzip',
97
				'name' => __( 'Test Zip Code', 'printcenter' ),
98
				'desc' => __( 'Test zip code provided by SSI', 'printcenter' ),
99
				'type' => 'text',
100
				'std'  => '99999'
101
			)
102
		) )
103
	);
104
105
	return array_merge( $settings, $plugin_settings );
106
}
107
add_filter( 'printcenter_registered_settings', 'printcenter_settings' );