Issues (4351)

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/config.php (14 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 if ( ! defined( 'ABSPATH' ) ) { exit;
2
}
3
/**
4
* Plugin configuration file.
5
*
6
*   This file contains the different static configuration for the plugin
7
 *
8
* @author Eoxia <[email protected]>
9
* @version 1.1
10
* @package wpshop
11
* @subpackage includes
12
*/
13
14
// End if().
0 ignored issues
show
Unused Code Comprehensibility introduced by
43% 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...
15
if ( ! defined( 'WPSHOP_VERSION' ) ) {
16
	die( __( 'Access is not allowed by this way', 'wpshop' ) );
17
}
18
19
// End if().
0 ignored issues
show
Unused Code Comprehensibility introduced by
43% 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...
20
global $wpdb;
21
/*	Define the shop type	*/
22
DEFINE( 'WPSHOP_DEFAULT_SHOP_TYPE', 'sale' );
23
$wpshop_shop_type = get_option( 'wpshop_shop_type', WPSHOP_DEFAULT_SHOP_TYPE );
24
DEFINE( 'WPSHOP_DEFINED_SHOP_TYPE', $wpshop_shop_type );
25
26
/*
27
  Define the different path for the plugin    */
28
   /*	Define main plugin directory for our plugin	*/
29
 DEFINE( 'WPSHOP_DIR', WP_PLUGIN_DIR . '/' . WPSHOP_PLUGIN_DIR );
30
   DEFINE( 'WPSHOP_URL', WP_PLUGIN_URL . '/' . WPSHOP_PLUGIN_DIR );
31
32
  /*	Define languages directory for our plugin	*/
33
 DEFINE( 'WPSHOP_LANGUAGES_DIR', WPSHOP_DIR . '/languages/' );
34
  DEFINE( 'WPSHOP_LANGUAGES_URL', WPSHOP_URL . '/languages/' );
35
36
 /*	Define includes directory for our plugin	*/
37
 DEFINE( 'WPSHOP_INCLUDES_DIR', WPSHOP_DIR . '/includes/' );
38
	DEFINE( 'WPSHOP_INCLUDES_URL', WPSHOP_URL . '/includes/' );
39
	DEFINE( 'WPSHOP_MODULES_DIR', WPSHOP_INCLUDES_DIR . 'modules/' );
40
	  /*	Define librairies directory for our plugin	*/
41
	 DEFINE( 'WPSHOP_LIBRAIRIES_DIR', WPSHOP_INCLUDES_DIR . 'librairies/' );
42
		DEFINE( 'WPSHOP_LIBRAIRIES_URL', WPSHOP_INCLUDES_URL . 'librairies/' );
43
44
   /*	Define templates directory for our plugin	*/
45
 DEFINE( 'WPSHOP_TEMPLATES_DIR', WPSHOP_DIR . '/templates/' );
46
  DEFINE( 'WPSHOP_TEMPLATES_URL', WPSHOP_URL . '/templates/' );
47
	  /*	Define medias directory for our plugin	*/
48
	 DEFINE( 'WPSHOP_MEDIAS_DIR', WPSHOP_TEMPLATES_DIR . 'admin/medias/' );
49
	 DEFINE( 'WPSHOP_MEDIAS_URL', WPSHOP_TEMPLATES_URL . 'admin/medias/' );
50
		 /*	Define plugin icon directory	*/
51
		 DEFINE( 'WPSHOP_MEDIAS_ICON_DIR', WPSHOP_MEDIAS_DIR . 'icones/' );
52
		 DEFINE( 'WPSHOP_MEDIAS_ICON_URL', WPSHOP_MEDIAS_URL . 'icones/' );
53
		 /*	Define plugin picture directory	*/
54
		 DEFINE( 'WPSHOP_MEDIAS_IMAGES_DIR', WPSHOP_MEDIAS_DIR . 'images/' );
55
		   DEFINE( 'WPSHOP_MEDIAS_IMAGES_URL', WPSHOP_MEDIAS_URL . 'images/' );
56
	   /*	Define medias directory for our plugin	*/
57
	 DEFINE( 'WPSHOP_JS_DIR', WPSHOP_TEMPLATES_DIR . 'admin/js/' );
58
	 DEFINE( 'WPSHOP_JS_URL', WPSHOP_TEMPLATES_URL . 'admin/js/' );
59
	 /*	Define medias directory for our plugin	*/
60
	 DEFINE( 'WPSHOP_CSS_DIR', WPSHOP_TEMPLATES_DIR . 'admin/css/' );
61
	   DEFINE( 'WPSHOP_CSS_URL', WPSHOP_TEMPLATES_URL . 'admin/css/' );
62
/*	Define upload dir	*/
63
 $wp_upload_dir = wp_upload_dir();
64
  DEFINE( 'WPSHOP_UPLOAD_DIR', $wp_upload_dir['basedir'] . '/' );
65
	DEFINE( 'WPSHOP_UPLOAD_URL', $wp_upload_dir['baseurl'] . '/' );
66
	DEFINE( 'WPSHOP_WP_UPLOAD_DIR', $wp_upload_dir['basedir'] . '/' );
67
 DEFINE( 'WPSHOP_WP_UPLOAD_URL', $wp_upload_dir['baseurl'] . '/' );
68
69
/*
70
  Define external ajax file url   */
71
// DEFINE('WPSHOP_AJAX_FILE_URL', WPSHOP_INCLUDES_URL . 'ajax.php');
72
/*	Define element for new type creation	*/
73
 DEFINE( 'WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES', 'wpshop_entities' );
74
 DEFINE( 'WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS', 'wpshop_customers' );
75
   DEFINE( 'WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT', 'wpshop_product' );
76
   DEFINE( 'WPSHOP_NEWTYPE_IDENTIFIER_ADDRESS', 'wpshop_address' );
77
   DEFINE( 'WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT_VARIATION', 'wps_pdt_variations' );
78
 DEFINE( 'WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS_GROUP', 'wps_customer_group' );
79
   DEFINE( 'WPSHOP_IDENTIFIER_PRODUCT', 'P' );
80
	DEFINE( 'WPSHOP_NEWTYPE_IDENTIFIER_ORDER', 'wpshop_shop_order' );
81
  DEFINE( 'WPSHOP_NEWTYPE_IDENTIFIER_COUPON', 'wpshop_shop_coupon' );
82
	DEFINE( 'WPSHOP_NEWTYPE_IDENTIFIER_MESSAGE', 'wpshop_shop_message' );
83
  DEFINE( 'WPSHOP_NEWTYPE_IDENTIFIER_GROUP', 'wpshop_shop_group' );
84
  DEFINE( 'WPSHOP_NEWTYPE_IDENTIFIER_ADDONS', 'wpshop_shop_addons' );
85
	DEFINE( 'WPSHOP_ATTRIBUTE_SET_ID_META_KEY', '_%s_attribute_set_id' );
86
  DEFINE( 'WPSHOP_PRODUCT_ATTRIBUTE_SET_ID_META_KEY', '_' . WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . '_attribute_set_id' );
87
   DEFINE( 'WPSHOP_ADDRESS_ATTRIBUTE_SET_ID_META_KEY', '_' . WPSHOP_NEWTYPE_IDENTIFIER_ADDRESS . '_attribute_set_id' );
88
   DEFINE( 'WPSHOP_PRODUCT_ATTRIBUTE_META_KEY', '_' . WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . '_metadata' );
89
  DEFINE( 'WPSHOP_NEWTYPE_IDENTIFIER_CATEGORIES', 'wpshop_product_category' );
90
   DEFINE( 'WPSHOP_PRODUCT_RELATED_PRODUCTS', '_' . WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . '_related_products' );
91
	DEFINE( 'WPSHOP_PRODUCT_PROVIDER', '_' . WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . '_provider' );
92
	DEFINE( 'WPSHOP_PRODUCT_VIEW_NB', '_' . WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . '_view_nb' );
93
  DEFINE( 'WPSHOP_PRODUCT_FRONT_DISPLAY_CONF', '_' . WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . '_attributes_frontend_display' );
94
95
  DEFINE( 'WPSHOP_DEFAULT_CUSTOM_TYPES', serialize( array( WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT, WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, WPSHOP_NEWTYPE_IDENTIFIER_ADDRESS ) ) );
96
97
98
	DEFINE( 'WPSHOP_IDENTIFIER_CUSTOMER', 'U' );
99
   $cat_options = get_option( 'wpshop_catalog_categories_option' );
100
   DEFINE( 'WPSHOP_UNCATEGORIZED_PRODUCT_SLUG', ! empty( $cat_options['wpshop_catalog_no_category_slug'] ) ? $cat_options['wpshop_catalog_no_category_slug'] : 'no-category' );
101
   DEFINE( 'WPSHOP_CATALOG_PRODUCT_SLUG', 'catalog' );
102
	DEFINE( 'WPSHOP_CATALOG_CATEGORIES_SLUG', 'catalog' );
103
 DEFINE( 'WPSHOP_CATALOG_PRODUCT_NO_CATEGORY', 'no-categories' );
104
   include_once( WPSHOP_LIBRAIRIES_DIR . 'purchase/list_countries.php' );
105
 DEFINE( 'WPSHOP_COUNTRY_LIST', serialize( $wpshop_tab_countries ) );
106
107
108
 DEFINE( 'WPSHOP_COMMON_ATTRIBUTES_PARENT_VARIATION_PRODUCT', serialize( array( 'tx_tva' ) ) );
109
/*	Define database table names	*/
110
 DEFINE( 'WPSHOP_DBT_ENTITIES', $wpdb->prefix . 'wpshop__entity' );
111
 DEFINE( 'WPSHOP_DBT_ATTRIBUTE_SET', $wpdb->prefix . 'wpshop__attribute_set' );
112
 DEFINE( 'WPSHOP_DBT_ATTRIBUTE_GROUP', $wpdb->prefix . 'wpshop__attribute_set_section' );
113
   DEFINE( 'WPSHOP_DBT_ATTRIBUTE_DETAILS', $wpdb->prefix . 'wpshop__attribute_set_section_details' );
114
115
	DEFINE( 'WPSHOP_DBT_ATTRIBUTE_UNIT', $wpdb->prefix . 'wpshop__attributes_unit' );
116
  DEFINE( 'WPSHOP_DBT_ATTRIBUTE_UNIT_GROUP', $wpdb->prefix . 'wpshop__attributes_unit_groups' );
117
118
	DEFINE( 'WPSHOP_DBT_ATTRIBUTE', $wpdb->prefix . 'wpshop__attribute' );
119
 DEFINE( 'WPSHOP_DBT_ATTRIBUTE_VALUES_PREFIX', $wpdb->prefix . 'wpshop__attribute_value_' );
120
	DEFINE( 'WPSHOP_DBT_ATTRIBUTE_VALUES_VARCHAR', WPSHOP_DBT_ATTRIBUTE_VALUES_PREFIX . 'varchar' );
121
   DEFINE( 'WPSHOP_DBT_ATTRIBUTE_VALUES_DATETIME', WPSHOP_DBT_ATTRIBUTE_VALUES_PREFIX . 'datetime' );
122
 DEFINE( 'WPSHOP_DBT_ATTRIBUTE_VALUES_DECIMAL', WPSHOP_DBT_ATTRIBUTE_VALUES_PREFIX . 'decimal' );
123
   DEFINE( 'WPSHOP_DBT_ATTRIBUTE_VALUES_INTEGER', WPSHOP_DBT_ATTRIBUTE_VALUES_PREFIX . 'integer' );
124
   DEFINE( 'WPSHOP_DBT_ATTRIBUTE_VALUES_TEXT', WPSHOP_DBT_ATTRIBUTE_VALUES_PREFIX . 'text' );
125
 DEFINE( 'WPSHOP_DBT_ATTRIBUTE_VALUES_HISTO', WPSHOP_DBT_ATTRIBUTE_VALUES_PREFIX . '_histo' );
126
  DEFINE( 'WPSHOP_DBT_ATTRIBUTE_VALUES_OPTIONS', WPSHOP_DBT_ATTRIBUTE_VALUES_PREFIX . 'options' );
127
128
  DEFINE( 'WPSHOP_DBT_HISTORIC', $wpdb->prefix . 'wpshop__historique' );
129
 DEFINE( 'WPSHOP_DBT_MESSAGES', $wpdb->prefix . 'wpshop__message' );
130
131
   /*	Delete table at database version 12 for new cart management with session and usermeta database	*/
132
 DEFINE( 'WPSHOP_DBT_CART', $wpdb->prefix . 'wpshop__cart' );
133
   DEFINE( 'WPSHOP_DBT_CART_CONTENTS', $wpdb->prefix . 'wpshop__cart_contents' );
134
/*	Define the different url for the plugin	*/
135
 DEFINE( 'WPSHOP_URL_SLUG_DASHBOARD', 'wpshop_dashboard' );
136
 DEFINE( 'WPSHOP_URL_SLUG_ATTRIBUTE_LISTING', 'wpshop_attribute' );
137
 DEFINE( 'WPSHOP_URL_SLUG_SHORTCODES', 'wpshop_shortcodes' );
138
   DEFINE( 'WPSHOP_URL_SLUG_ABOUT', 'wpshop_about' );
139
 DEFINE( 'WPSHOP_URL_SLUG_ATTRIBUTE_SET_LISTING', 'wpshop_attribute_group' );
140
   DEFINE( 'WPSHOP_URL_SLUG_OPTION', 'wpshop_option' );
141
   DEFINE( 'WPSHOP_URL_SLUG_MESSAGES', 'wpshop_messages' );
142
   DEFINE( 'WPSHOP_URL_SLUG_TOOLS', 'wpshop_tools' );
143
/*	Define the different pictures for the plugin	*/
144
 DEFINE( 'WPSHOP_AUTHORIZED_PICS_EXTENSIONS', 'gif|jp(e)*g|png' );
145
  DEFINE( 'WPSHOP_LOADING_ICON', admin_url( 'images/loading.gif' ) );
146
	DEFINE( 'WPSHOP_ERROR_ICON', WPSHOP_MEDIAS_URL . 'icones/informations/error_s.png' );
147
  DEFINE( 'WPSHOP_SUCCES_ICON', WPSHOP_MEDIAS_URL . 'icones/informations/success_s.png' );
148
   DEFINE( 'WPSHOP_DEFAULT_PRODUCT_PICTURE', WPSHOP_MEDIAS_IMAGES_URL . 'no_picture.png' );
149
   DEFINE( 'WPSHOP_DEFAULT_CATEGORY_PICTURE', WPSHOP_MEDIAS_IMAGES_URL . 'no_picture.png' );
150
  DEFINE( 'WPSHOP_PRODUCT_NOT_EXIST', WPSHOP_MEDIAS_IMAGES_URL . 'not_exist.gif' );
151
152
/*
153
  Define various configuration vars   */
154
   /*	FRONTEND DISPLAY	*/
155
 $wpshop_display_option = get_option( 'wpshop_display_option' );
156
	DEFINE( 'WPSHOP_DISPLAY_GRID_ELEMENT_NUMBER_PER_LINE', (isset( $wpshop_display_option['wpshop_display_grid_element_number'] ) && ($wpshop_display_option['wpshop_display_grid_element_number'] >= 1) ? $wpshop_display_option['wpshop_display_grid_element_number'] : 1) );
157
	DEFINE( 'WPSHOP_DISPLAY_GRID_ELEMENT_NUMBER_PER_LINE_MIN_RANGE', 1 );
158
  DEFINE( 'WPSHOP_DISPLAY_GRID_ELEMENT_NUMBER_PER_LINE_MAX_RANGE', 6 );
159
160
 DEFINE( 'WPSHOP_ELEMENT_NB_PER_PAGE', ! empty( $wpshop_display_option['wpshop_display_element_per_page'] ) ? $wpshop_display_option['wpshop_display_element_per_page'] : 20 );
161
 DEFINE( 'WPSHOP_DISPLAY_GALLERY_ELEMENT_NUMBER_PER_LINE', 3 );
162
 DEFINE( 'WPSHOP_DISPLAY_LIST_TYPE', $wpshop_display_option['wpshop_display_list_type'] );
163
164
 /*	ADMIN DISPLAY	*/
165
 $attribute_page_layout_types = array(
166
	 'tab' => __( 'Tabs', 'wpshop' ),
167
	 'separated_bloc' => __( 'Separated bloc', 'wpshop' ),
168
 );
169
  $wpshop_admin_display_option = get_option( 'wpshop_admin_display_option', array() );
0 ignored issues
show
array() is of type array, but the function expects a integer.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
170
   DEFINE( 'WPSHOP_ATTRIBUTE_SET_EDITION_PAGE_LAYOUT', ( ! empty( $wpshop_admin_display_option['wpshop_admin_attr_set_layout'] )?$wpshop_admin_display_option['wpshop_admin_attr_set_layout']:'separated_bloc') );
171
 DEFINE( 'WPSHOP_ATTRIBUTE_EDITION_PAGE_LAYOUT', ( ! empty( $wpshop_admin_display_option['wpshop_admin_attr_layout'] )?$wpshop_admin_display_option['wpshop_admin_attr_layout']:'tab') );
172
	$product_page_layout_types = array(
173
		'movable-tab' => __( 'Separated box in product page', 'wpshop' ),
174
		'fixed-tab' => __( 'A tab in product data box "Product data"', 'wpshop' ),
175
		'each-box' => __( 'In each attribute group section "Product data"', 'wpshop' ),
176
	);
177
	DEFINE( 'WPSHOP_PRODUCT_SHORTCODE_DISPLAY_TYPE', ( ! empty( $wpshop_admin_display_option['wpshop_admin_product_shortcode_display'] )?$wpshop_admin_display_option['wpshop_admin_product_shortcode_display']:'each-box') );
178
	/*  Define debug vars   */
179
	$extra_options = get_option( 'wpshop_extra_options', array() );
0 ignored issues
show
array() is of type array, but the function expects a integer.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
180
	DEFINE( 'WPSHOP_ADDONS_OPTION_NAME', 'wpshop_addons' );
181
	$wpshop_addons_state = get_option( WPSHOP_ADDONS_OPTION_NAME, array() );
0 ignored issues
show
array() is of type array, but the function expects a integer.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
182
183
	/*	ALLOWED IPS	*/
184
	$default_ip = array( '127.0.0.1', '0.0.0.0' );
185
	DEFINE( 'WPSHOP_DEBUG_MODE_ALLOWED_IP', ( ! empty( $extra_options['WPSHOP_DEBUG_MODE_ALLOWED_IP'] )?serialize( array_merge( $default_ip, array( $extra_options['WPSHOP_DEBUG_MODE_ALLOWED_IP'] ) ) ):serialize( $default_ip )) );
186
	/*	DEBUG MODE	*/
187
	$debug_mode = false;
188
	if ( ! empty( $extra_options['WPSHOP_DEBUG_MODE'] ) && ($extra_options['WPSHOP_DEBUG_MODE'] == 'true') ) {
189
		$debug_mode = true;
190
	}
191
	DEFINE( 'WPSHOP_DEBUG_MODE', $debug_mode );
192
	// End if().
0 ignored issues
show
Unused Code Comprehensibility introduced by
43% 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...
193
	$delete_data = false;
194
	if ( ! empty( $extra_options['WPSHOP_DEBUG_MODE_ALLOW_DATA_DELETION'] ) && ($extra_options['WPSHOP_DEBUG_MODE_ALLOW_DATA_DELETION'] == 'true') ) {
195
		$delete_data = true;
196
	}
197
	DEFINE( 'WPSHOP_DEBUG_MODE_ALLOW_DATA_DELETION', $delete_data );
198
199
	// End if().
0 ignored issues
show
Unused Code Comprehensibility introduced by
43% 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...
200
	$tools_menu_display = false;
201
	if ( ! empty( $extra_options['WPSHOP_DISPLAY_TOOLS_MENU'] ) && ($extra_options['WPSHOP_DISPLAY_TOOLS_MENU'] == 'true') ) {
202
		$tools_menu_display = true;
203
	}
204
	DEFINE( 'WPSHOP_DISPLAY_TOOLS_MENU', $tools_menu_display );
205
206
	// End if().
0 ignored issues
show
Unused Code Comprehensibility introduced by
43% 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...
207
	$attr_value_per_user = false;
208
	if ( ! empty( $extra_options['WPSHOP_ATTRIBUTE_VALUE_PER_USER'] ) && ($extra_options['WPSHOP_ATTRIBUTE_VALUE_PER_USER'] == 'true') ) {
209
		$attr_value_per_user = true;
210
	}
211
	DEFINE( 'WPSHOP_ATTRIBUTE_VALUE_PER_USER', $attr_value_per_user );
212
213
	// End if().
0 ignored issues
show
Unused Code Comprehensibility introduced by
43% 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...
214
	$display_available_keys_for_template = false;
215
	if ( ! empty( $extra_options['WPSHOP_DISPLAY_AVAILABLE_KEYS_FOR_TEMPLATE'] ) && ($extra_options['WPSHOP_DISPLAY_AVAILABLE_KEYS_FOR_TEMPLATE'] == 'true') ) {
216
		 $display_available_keys_for_template = true;
217
	}
218
	DEFINE( 'WPSHOP_DISPLAY_AVAILABLE_KEYS_FOR_TEMPLATE', $display_available_keys_for_template );
219
220
	// End if().
0 ignored issues
show
Unused Code Comprehensibility introduced by
43% 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...
221
	$display_value_attribute_type_select = false;
222
	if ( ! empty( $extra_options['WPSHOP_DISPLAY_VALUE_FOR_ATTRIBUTE_SELECT'] ) && ($extra_options['WPSHOP_DISPLAY_VALUE_FOR_ATTRIBUTE_SELECT'] == 'true') ) {
223
		$display_value_attribute_type_select = true;
224
	}
225
	DEFINE( 'WPSHOP_DISPLAY_VALUE_FOR_ATTRIBUTE_SELECT', $display_value_attribute_type_select );
226
	// End if().
0 ignored issues
show
Unused Code Comprehensibility introduced by
43% 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...
227
	DEFINE( 'WPSHOP_PRODUCT_REFERENCE_PREFIX', 'PDCT' );
228
	DEFINE( 'WPSHOP_PRODUCT_REFERENCE_PREFIX_NB_FILL', 5 );
229
	DEFINE( 'WPSHOP_BILLING_REFERENCE_PREFIX', 'FA' );
230
	DEFINE( 'WPSHOP_CREDIT_SLIP_REFERENCE_PREFIX', 'AV' );
231
	DEFINE( 'WPSHOP_ORDER_REFERENCE_PREFIX', 'OR' );
232
	DEFINE( 'WPSHOP_PREORDER_REFERENCE_PREFIX', 'D' );
233
	/*  Define the different pages to create for basic usage    */
234
	$default_pages = array();
235
	$product_options = get_option( 'wpshop_catalog_product_option' );
236
	$default_pages['presentation'][] = array(
237
		'page_code' => 'wpshop_product_page_id',
238
		'post_title' => __( 'Shop', 'wpshop' ),
239
		'post_name' => ! empty( $product_options['wpshop_catalog_product_slug'] ) ? $product_options['wpshop_catalog_product_slug'] : 'catalog',
240
		'post_content' => '[wpshop_products]',
241
		'menu_order' => 569841,
242
	);
243
	$default_pages['presentation'][] = array(
244
		'page_code' => 'wpshop_cart_page_id',
245
		'post_title' => __( 'Cart', 'wpshop' ),
246
		'post_name' => 'cart',
247
		'post_content' => '[wpshop_cart]',
248
		'menu_order' => 569842,
249
	);
250
	$default_pages['presentation'][] = array(
251
		'page_code' => 'wpshop_checkout_page_id',
252
		'post_title' => __( 'Checkout', 'wpshop' ),
253
		'post_name' => 'checkout',
254
		'post_content' => '[wpshop_checkout]',
255
		'menu_order' => 569843,
256
	);
257
	$default_pages['presentation'][] = array(
258
		'page_code' => 'wpshop_myaccount_page_id',
259
		'post_title' => __( 'My account', 'wpshop' ),
260
		'post_name' => 'myaccount',
261
		'post_content' => '[wpshop_myaccount]',
262
		'menu_order' => 569844,
263
	);
264
	$default_pages['presentation'][] = array(
265
		'page_code' => 'wpshop_signup_page_id',
266
		'post_title' => __( 'Signup', 'wpshop' ),
267
		'post_name' => 'signup',
268
		'post_content' => '[wpshop_signup]',
269
		'menu_order' => 569845,
270
	);
271
	$default_pages['sale'][] = array(
272
		'page_code' => 'wpshop_payment_return_page_id',
273
		'post_title' => __( 'Payment return successfull', 'wpshop' ),
274
		'post_name' => 'return',
275
		'post_content' => '[wpshop_payment_result]',
276
		'menu_order' => 569846,
277
	);
278
	$default_pages['sale'][] = array(
279
		'page_code' => 'wpshop_payment_return_nok_page_id',
280
		'post_title' => __( 'Payment return unsuccessfull', 'wpshop' ),
281
		'post_name' => 'unsuccessfull_payment_return',
282
		'post_content' => '[wpshop_payment_result_unsuccessfull]',
283
		'menu_order' => 569848,
284
	);
285
	$default_pages['presentation'][] = array(
286
		'page_code' => 'wpshop_terms_of_sale_page_id',
287
		'post_title' => __( 'Terms of sale', 'wpshop' ),
288
		'post_name' => 'terms-of-sale',
289
		'post_content' => '[wpshop_terms_of_sale]',
290
		'menu_order' => 569847,
291
	);
292
293
	DEFINE( 'WPSHOP_DEFAULT_PAGES', serialize( $default_pages ) );
294
	/*  Define the different vars used for price calculation    */
295
	$wpshop_shop_price_piloting = get_option( 'wpshop_shop_price_piloting' );
296
	DEFINE( 'WPSHOP_PRODUCT_PRICE_PILOT', ( ! empty( $wpshop_shop_price_piloting ) ? $wpshop_shop_price_piloting : 'TTC') );
297
298
	DEFINE( 'WPSHOP_COST_OF_POSTAGE', 'cost_of_postage' );
299
	DEFINE( 'WPSHOP_PRODUCT_PRICE_HT', 'price_ht' );
300
	DEFINE( 'WPSHOP_PRODUCT_PRICE_TAX', 'tx_tva' );
301
	DEFINE( 'WPSHOP_PRODUCT_PRICE_TTC', 'product_price' );
302
	DEFINE( 'WPSHOP_PRODUCT_PRICE_TAX_AMOUNT', 'tva' );
303
	DEFINE( 'WPSHOP_PRODUCT_WEIGHT', 'product_weight' );
304
	DEFINE( 'WPSHOP_PRODUCT_SPECIAL_PRICE', 'special_price' );
305
	DEFINE( 'WPSHOP_PRODUCT_SPECIAL_PRICE_DATE_FROM', 'special_from' );
306
	DEFINE( 'WPSHOP_PRODUCT_SPECIAL_PRICE_DATE_TO', 'special_to' );
307
	DEFINE( 'WPSHOP_PRODUCT_DISCOUNT_AMOUNT', 'discount_amount' );
308
	DEFINE( 'WPSHOP_VAT_ON_SHIPPING_COST', apply_filters( 'wps_change_shipping_vat', 20 ) );
309
310
	DEFINE( 'WPSHOP_ATTRIBUTE_PRICES', serialize( array( WPSHOP_PRODUCT_PRICE_HT, WPSHOP_PRODUCT_PRICE_TAX, WPSHOP_PRODUCT_PRICE_TTC, WPSHOP_PRODUCT_PRICE_TAX_AMOUNT ) ) );
311
	DEFINE( 'WPSHOP_ATTRIBUTE_WEIGHT', serialize( array( WPSHOP_PRODUCT_WEIGHT ) ) );
312
	/*  Define the different attribute that user won't be able to delete from interface */
313
	DEFINE( 'WPSHOP_ATTRIBUTE_UNDELETABLE', serialize( array_merge( array(), unserialize( WPSHOP_ATTRIBUTE_PRICES ) ) ) );
314
	/*  Define the attribute list to hide or variation creation */
315
	DEFINE( 'WPSHOP_VARIATION_ATTRIBUTE_TO_HIDE', serialize( array_merge( unserialize( WPSHOP_ATTRIBUTE_PRICES ), array( 'product_attribute_set_id', 'product_reference' ) ) ) );
316
	/*  Define the default currency */
317
	DEFINE( 'WPSHOP_SHOP_DEFAULT_CURRENCY', 'EUR' );
318
	DEFINE( 'WPSHOP_SHOP_CURRENCIES', serialize( array(
319
		'EUR' => 'euro',
320
		'USD' => 'dollar',
321
	) ) );
322
323
	/*  Define the shipping default rules   */
324
	DEFINE( 'WPSHOP_SHOP_SHIPPING_RULES', serialize( array(
325
		'min_max' => array(
326
			'min' => 0,
327
			'max' => 30,
328
		),
329
		'free_from' => 4500,
330
	) ) );
331
	$shipping_fees_array = array(
332
		'active' => false,
333
		'fees' => array(
334
			'FR' => array(
335
				'destination' => 'FR',
336
				'rule' => 'weight',
337
				'fees' => array(
338
					100 => 5.6,
339
					250 => 7.2,
340
					500 => 9,
341
				),
342
			),
343
			'OTHERS' => array(
344
				'destination' => 'OTHERS',
345
				'rule' => 'weight',
346
				'fees' => array(
347
					100 => 6.7,
348
					250 => 7.9,
349
					500 => 10.2,
350
				),
351
			),
352
		),
353
	);
354
	DEFINE( 'WPSHOP_SHOP_CUSTOM_SHIPPING', serialize( $shipping_fees_array ) );
355
356
	/*  Define addons modules */
357
	DEFINE( 'WPSHOP_ADDONS_KEY_IS', '48' );
358
	DEFINE( 'WPSHOP_ADDONS_STATES_CLASS', serialize( array(
359
		true => 'wpshop_addons_state wpshop_addons_state_activated',
360
		false => 'wpshop_addons_state wpshop_addons_state_deactivated',
361
	) ) );
362
	DEFINE( 'WPSHOP_ADDONS_LIST', serialize( array(
363
		'WPSHOP_ADDONS_QUOTATION' => array( __( 'Quotation','wpshop' ), '48', 'per_site', 'quotation_allowed', 'WPSHOP_NEW_QUOTATION_ADMIN_MESSAGE' ),
364
		'WPSHOP_ADDONS_PAYMENT_GATEWAY_CB_CIC' => array( __( 'Payment gateway CIC','wpshop' ), '32', 'per_site', '' ),/* , 'WPSHOP_ADDONS_PRICE_PER_GROUP' => array(__('Price per user group','wpshop'), '13', 'free') */
0 ignored issues
show
Unused Code Comprehensibility introduced by
64% 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...
365
	) ) );
366
	DEFINE( 'WPSHOP_ADDONS_QUOTATION', ( ! empty( $wpshop_addons_state['WPSHOP_ADDONS_QUOTATION']['activate'] )?$wpshop_addons_state['WPSHOP_ADDONS_QUOTATION']['activate']:false) );
367
	DEFINE( 'WPSHOP_ADDONS_PRICE_PER_GROUP', ( ! empty( $wpshop_addons_state['WPSHOP_ADDONS_PRICE_PER_GROUP']['activate'] )?$wpshop_addons_state['WPSHOP_ADDONS_PRICE_PER_GROUP']['activate']:false) );
368
	DEFINE( 'WPSHOP_PAYMENT_METHOD_CIC', ( ! empty( $wpshop_addons_state['WPSHOP_ADDONS_PAYMENT_GATEWAY_CB_CIC']['activate'] )?$wpshop_addons_state['WPSHOP_ADDONS_PAYMENT_GATEWAY_CB_CIC']['activate']:false) );
369
	DEFINE( 'WPSHOP_ADDONS_QUOTATION_CODE', 'nfdJK-AsBCO-%AZDZA' );
370
	DEFINE( 'WPSHOP_ADDONS_PRICE_PER_GROUP_CODE', '7GnnQ-5FeqZ-BiKz3' );
371
	DEFINE( 'WPSHOP_ADDONS_PAYMENT_GATEWAY_CB_CIC', 'nZYsM-vQ8qC-VfVfA' );
372
373
	/*  Define payment method params    */
374
	$wpshop_paymentMethod = get_option( 'wps_payment_mode' );
375
	if ( WPSHOP_PAYMENT_METHOD_CIC || ! empty( $wpshop_paymentMethod['mode'] ) && ! empty( $wpshop_paymentMethod['mode']['cic'] ) ) {
376
		$cmcic_params = get_option( 'wpshop_cmcic_params', array() );
0 ignored issues
show
array() is of type array, but the function expects a integer.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
377
		if ( ! empty( $cmcic_params ) ) {
378
			DEFINE( 'CMCIC_CLE', $cmcic_params['cle'] );
379
			 DEFINE( 'CMCIC_TPE', $cmcic_params['tpe'] );
380
			 DEFINE( 'CMCIC_VERSION', $cmcic_params['version'] );
381
			 DEFINE( 'CMCIC_SERVEUR', $cmcic_params['serveur'] );
382
			 DEFINE( 'CMCIC_CODESOCIETE', $cmcic_params['codesociete'] );
383
			 DEFINE( 'CMCIC_URLOK', '' );
384
			 DEFINE( 'CMCIC_URLKO', '' );
385
		}
386
	}
387
388
	/** Civility    */
389
	$civility = array(
390
		1 => __( 'Mr.','wpshop' ),
391
		__( 'Mrs.','wpshop' ),
392
		__( 'Miss','wpshop' ),
393
	);
394
	/** Status  */
395
	$order_status = array(
396
		'' => __( 'Awaiting treatment', 'wpshop' ),
397
		'awaiting_payment' => __( 'Awaiting payment', 'wpshop' ),
398
		'partially_paid' => __( 'Partially paid', 'wpshop' ),
399
		'completed' => __( 'Paid', 'wpshop' ),
400
		'shipped' => __( 'Shipped', 'wpshop' ),
401
		'denied' => __( 'Denied', 'wpshop' ),
402
		'incorrect_amount' => __( 'Incorrect amount', 'wpshop' ),
403
		'canceled' => __( 'Canceled', 'wpshop' ),
404
		'payment_refused' => __( 'Refused payment', 'wpshop' ),
405
		'refunded' => __( 'Refunded', 'wpshop' ),
406
		'pos' => __( 'Taken in store', 'wpshop' ),
407
	);
408
	DEFINE( 'WPSHOP_ORDER_STATUS', serialize( $order_status ) );
409
410
	// End if().
0 ignored issues
show
Unused Code Comprehensibility introduced by
43% 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...
411
	DEFINE( 'WPSHOP_REGISTER_POST_TYPE_SUPPORT', serialize( array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions' ) ) );
412
	$register_post_type_args = array(
413
		'labels' => array( 'name', 'singular_name', 'add_new', 'add_new_item', 'edit', 'edit_item', 'new_item', 'view', 'view_item', 'search_items', 'not_found', 'not_found_in_trash' ),
414
		'description' => 'text',
415
		'public' => 'boolean',
416
		'exclude_from_search' => 'boolean',
417
		'publicly_queryable' => 'boolean',
418
		'show_ui' => 'boolean',
419
		'show_in_nav_menus' => 'boolean',
420
		'show_in_menu' => 'boolean|text',
421
		'capabilities' => array( 'publish_posts', 'edit_posts', 'edit_others_posts', 'delete_posts', 'delete_others_posts', 'read_private_posts', 'edit_post', 'delete_post', 'read_post' ),
422
		'hierarchical' => false,
423
		'rewrite' => false,
424
		'query_var' => true,
425
		'supports' => unserialize( WPSHOP_REGISTER_POST_TYPE_SUPPORT ),
426
	);
427
	DEFINE( 'WPSHOP_REGISTER_POST_TYPE_ARGS', serialize( $register_post_type_args ) );
428
	DEFINE( 'WPSHOP_REGISTER_POST_TYPE_MANDATORY_SUPPORTS', serialize( array( 'title', 'editor', 'thumbnail', 'excerpt' ) ) );
429
	DEFINE( 'WPSHOP_PRODUCT_HIDDEN_METABOX', serialize( array( 'formatdiv', 'pageparentdiv', 'postexcerpt', 'trackbacksdiv', 'postcustom', 'commentstatusdiv', 'commentsdiv', 'slugdiv', 'authordiv', 'revisionsdiv' ) ) );
430
431
	/* Shop type    */
432
	DEFINE( 'WPSHOP_SHOP_TYPES', serialize( array( 'presentation', 'sale' ) ) );
433
434
	/* Attribute select_data_type   */
435
	DEFINE( 'WPSHOP_ATTR_SELECT_TYPE', serialize( array(
436
		'custom' => 'custom_data',
437
		'internal' => 'internal_data',
438
	) ) );
439
	DEFINE( 'WPSHOP_ATTR_SELECT_TYPE_TOGGLED', serialize( array(
440
		'custom' => 'internal_data',
441
		'internal' => 'custom_data',
442
	) ) );
443
444
	/*  Define the types existing into the current WordPress installation   */
445
	$default_to_exclude = array( 'attachment', 'revision', 'nav_menu_item', WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES, WPSHOP_NEWTYPE_IDENTIFIER_MESSAGE );
446
	DEFINE( 'WPSHOP_INTERNAL_TYPES_TO_EXCLUDE', ( ! empty( $extra_options['WPSHOP_INTERNAL_TYPES_TO_EXCLUDE'] )?serialize( array_merge( array( $extra_options['WPSHOP_INTERNAL_TYPES_TO_EXCLUDE'] ),$default_to_exclude ) ):serialize( $default_to_exclude )) );
447
448
	/*
449
     Start form field display config */
450
	/*  Get the list of possible posts status   */
451
	$posts_status = array( 'publish', 'pending', 'draft', 'auto-draft', 'future', 'private', 'inherit', 'trash' );
452
453
	/*  General configuration   */
454
	$comboxOptionToHide = array( 'deleted' );
455
456
	/*  Attributes form */
457
	$attribute_displayed_field = array( 'id', 'status', 'entity_id', 'is_required', 'is_unique', 'is_visible_in_front', 'is_visible_in_front_listing', 'frontend_input', 'backend_input', 'frontend_label', 'default_value', 'is_requiring_unit', '_unit_group_id', '_default_unit', 'is_historisable', 'is_intrinsic', 'is_filterable', 'code', 'is_used_for_sort_by', 'is_visible_in_advanced_search', 'is_used_in_admin_listing_column', 'is_used_in_quick_add_form', 'frontend_verification', 'is_user_defined', 'is_used_in_variation', 'is_used_for_variation', '_need_verification', '_display_informations_about_value', 'frontend_css_class', 'backend_css_class', 'frontend_help_message', 'is_searchable' );
458
	$attribute_options_group = array(
459
		__( 'Attribute unit', 'wpshop' ) => array( 'is_requiring_unit', '_unit_group_id', '_default_unit' ),
460
		__( 'Frontend option', 'wpshop' ) => array( 'is_visible_in_front', 'is_visible_in_front_listing', 'is_used_for_sort_by', 'is_visible_in_advanced_search', 'is_searchable', '_display_informations_about_value' ),
461
		__( 'Variations', 'wpshop' ) => array( 'is_user_defined', 'is_used_in_variation', 'is_used_for_variation', 'frontend_input' ),
462
	);
463
	DEFINE( 'WPSHOP_ATTRIBUTE_DEF_COLUMN_INTO_OPTIONS', serialize( array( '_need_verification', 'frontend_verification', 'frontend_css_class', 'backend_css_class', 'frontend_help_message', 'frontend_help_message' ) ) );
464
465
	/*  General form    */
466
	$attribute_hidden_field = array( 'position' );
467
468
	/*  Definition des differents champs pour les formulaires   */
469
	$customer_adress_information_field = array(
470
		'civility' => __( 'Civility', 'wpshop' ),
471
		'first_name' => __( 'First name', 'wpshop' ),
472
		'last_name' => __( 'Last name', 'wpshop' ),
473
		'email' => __( 'Email adress', 'wpshop' ),
474
		'phone' => __( 'Phone number', 'wpshop' ),
475
		'company' => __( 'Company', 'wpshop' ),
476
		'address' => __( 'Adresse', 'wpshop' ),
477
		'postcode' => __( 'Postcode', 'wpshop' ),
478
		'city' => __( 'City', 'wpshop' ),
479
		'country' => __( 'Country', 'wpshop' ),
480
	);
481
	/*  End form field display config       */
482