Issues (3)

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.

woocommerce-subscription-shortcodes.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
 * Plugin Name: WooCommerce Subscription Shortcodes
4
 * Plugin URI:  https://github.com/seb86/WooCommerce-Subscription-Shortcodes
5
 * Description: Experimental extension providing a few shortcodes that you can use to add details about the subscription product where you want them to be.
6
 * Version:     1.0.0 Beta
7
 * Author:      Sébastien Dumont
8
 * Author URI:  https://sebastiendumont.com
9
 *
10
 * Text Domain: woocommerce-subscription-shortcodes
11
 * Domain Path: /languages/
12
 *
13
 * Requires at least: 4.1
14
 * Tested up to: 4.5.3
15
 *
16
 * Copyright: © 2016 Sébastien Dumont.
17
 * License: GNU General Public License v3.0
18
 * License URI: http://www.gnu.org/licenses/gpl-3.0.html
19
 */
20
if ( ! defined('ABSPATH') ) exit; // Exit if accessed directly.
21
22
if ( ! class_exists( 'WCSS' ) ) {
23
24
	class WCSS {
25
26
		/* Plugin version. */
27
		const VERSION = '1.0.0';
28
29
		/* Required WC version. */
30
		const REQ_WC_VERSION = '2.3.0';
31
32
		/* Text domain. */
33
		const TEXT_DOMAIN = 'woocommerce-subscription-shortcodes';
34
35
		/**
36
		 * @var WCSS - the single instance of the class.
37
		 *
38
		 * @since 1.0.0
39
		 */
40
		protected static $_instance = null;
41
42
		/**
43
		 * Main WCSS Instance.
44
		 *
45
		 * Ensures only one instance of WCSS is loaded or can be loaded.
46
		 *
47
		 * @static
48
		 * @see WCSS()
49
		 * @return WCSS - Main instance
50
		 * @since 1.0.0
51
		 */
52
		public static function instance() {
53
			if ( is_null( self::$_instance ) ) {
54
				self::$_instance = new self();
55
			}
56
			return self::$_instance;
57
		} // END instance()
58
59
		/**
60
		 * Cloning is forbidden.
61
		 *
62
		 * @since 1.0.0
63
		 */
64
		public function __clone() {
65
			_doing_it_wrong( __FUNCTION__, __( 'Foul!' ), '1.0.0' );
66
		}
67
68
		/**
69
		 * Unserializing instances of this class is forbidden.
70
		 *
71
		 * @since 1.0.0
72
		 */
73
		public function __wakeup() {
74
			_doing_it_wrong( __FUNCTION__, __( 'Foul!' ), '1.0.0' );
75
		}
76
77
		/**
78
		 * Do some work.
79
		 */
80
		public function __construct() {
81
			add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ) );
82
			add_action( 'init', array( $this, 'init_textdomain' ) );
83
			add_filter( 'plugin_row_meta', array( $this, 'plugin_meta_links' ), 10, 4 );
84
		}
85
86
		public function plugin_url() {
87
			return plugins_url( basename( plugin_dir_path(__FILE__) ), basename( __FILE__ ) );
88
		} // END plugin_url()
89
90
		public function plugin_path() {
91
			return untrailingslashit( plugin_dir_path( __FILE__ ) );
92
		} // END plugin_path()
93
94
		public function plugins_loaded() {
95
			global $woocommerce;
96
97
			// Subs 2 check
98
			if ( ! function_exists( 'wcs_is_subscription' ) ) {
99
				add_action( 'admin_notices', array( $this, 'wcs_admin_notice' ) );
100
				return false;
101
			}
102
103
			// WC 2 check
104
			if ( version_compare( $woocommerce->version, self::REQ_WC_VERSION ) < 0 ) {
105
				add_action( 'admin_notices', array( $this, 'wc_admin_notice' ) );
106
				return false;
107
			}
108
109
			require_once( 'includes/class-wcs-shortcodes.php' );
110
		} // END plugins_loaded()
111
112
		/**
113
		 * Display a warning message if Subs version check fails.
114
		 *
115
		 * @return void
116
		 */
117
		public function wc_admin_notice() {
118
			echo '<div class="error"><p>' . sprintf( __( 'WooCommerce Subscription Shortcodes requires at least WooCommerce %s in order to function. Please upgrade WooCommerce.', self::TEXT_DOMAIN ), self::REQ_WC_VERSION ) . '</p></div>';
119
		} // END wc_admin_notice()
120
121
		/**
122
		 * Display a warning message if WC version check fails.
123
		 *
124
		 * @return void
125
		 */
126
		public function wcs_admin_notice() {
127
			echo '<div class="error"><p>' . sprintf( __( 'WooCommerce Subscription Shortcodes requires WooCommerce Subscriptions version 2.0+.', self::TEXT_DOMAIN ), self::REQ_WC_VERSION ) . '</p></div>';
128
		} // END wcs_admin_notice()
129
130
		/**
131
		 * Load textdomain.
132
		 *
133
		 * @return void
134
		 */
135
		public function init_textdomain() {
136
			load_plugin_textdomain( 'woocommerce-subscription-shortcodes', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
137
		} // END init_text_domain()
138
139
		/**
140
		 * Show row meta on the plugin screen.
141
		 *
142
		 * @param  mixed $links Plugin Row Meta
143
		 * @param  mixed $file  Plugin Base file
144
		 * @return array
145
		 */
146
		public function plugin_meta_links( $links, $file, $data, $status ) {
0 ignored issues
show
The parameter $status is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
147
			if ( $file == plugin_basename( __FILE__ ) ) {
148
				$author1 = '<a href="' . $data[ 'AuthorURI' ] . '">' . $data[ 'Author' ] . '</a>';
149
				$author2 = '<a href="http://www.subscriptiongroup.co.uk/">Subscription Group Limited</a>';
150
				$links[ 1 ] = sprintf( __( 'By %s', self::TEXT_DOMAIN ), sprintf( __( '%s and %s', self::TEXT_DOMAIN ), $author1, $author2 ) );
151
152
			}
153
154
			return $links;
155
		} // END plugin_meta_links()
156
157
	} // END class
158
159
} // END if class exists
160
161
return WCSS::instance();
162