1
|
|
|
<?php if ( ! defined( 'ABSPATH' ) ) { exit; |
2
|
|
|
} |
3
|
|
|
|
4
|
|
|
// End if(). |
|
|
|
|
5
|
|
|
if ( ! defined( 'WPSHOP_VERSION' ) ) { |
6
|
|
|
die( __( 'Access is not allowed by this way', 'wpshop' ) ); |
7
|
|
|
} |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* Plugin librairies include file. |
11
|
|
|
* |
12
|
|
|
* This file will be called in every other file of the plugin and will include every library needed by the plugin to work correctly. If a file is needed in only one script prefer direct inclusion |
13
|
|
|
* |
14
|
|
|
* @author Eoxia <[email protected]> |
15
|
|
|
* @version 1.1 |
16
|
|
|
* @package wpshop |
17
|
|
|
* @subpackage includes |
18
|
|
|
*/ |
19
|
|
|
|
20
|
|
|
// End if(). |
|
|
|
|
21
|
|
|
include_once( WPSHOP_DIR . '/core/module_management/module_management.php' ); |
22
|
|
|
include_once( WPSHOP_INCLUDES_DIR . 'wpshop_ajax.php' ); |
23
|
|
|
include_once( WPSHOP_LIBRAIRIES_DIR . 'install.class.php' ); |
24
|
|
|
include_once( WPSHOP_LIBRAIRIES_DIR . 'permissions.class.php' ); |
25
|
|
|
include_once( WPSHOP_LIBRAIRIES_DIR . 'options/options.class.php' ); |
26
|
|
|
include_once( WPSHOP_LIBRAIRIES_DIR . 'notices.class.php' ); |
27
|
|
|
/* Purchase management */ |
28
|
|
|
include_once( WPSHOP_LIBRAIRIES_DIR . 'purchase/checkout.class.php' ); |
29
|
|
|
include_once( WPSHOP_LIBRAIRIES_DIR . 'purchase/orders.class.php' ); |
30
|
|
|
/* Database management */ |
31
|
|
|
include_once( WPSHOP_LIBRAIRIES_DIR . 'db/db_structure_definition.php' ); |
32
|
|
|
include_once( WPSHOP_LIBRAIRIES_DIR . 'db/db_data_definition.php' ); |
33
|
|
|
include_once( WPSHOP_LIBRAIRIES_DIR . 'db/database.class.php' ); |
34
|
|
|
/* Payments management */ |
35
|
|
|
include_once( WPSHOP_LIBRAIRIES_DIR . 'payments/payment.class.php' ); |
36
|
|
|
include_once( WPSHOP_LIBRAIRIES_DIR . 'payments/paypal.class.php' ); |
37
|
|
|
// If the CIC payment method is active |
38
|
|
|
$wpshop_paymentMethod = get_option( 'wps_payment_mode' ); |
39
|
|
|
if ( WPSHOP_PAYMENT_METHOD_CIC && ! empty( $wpshop_paymentMethod ) && ! empty( $wpshop_paymentMethod['mode'] ) && ! empty( $wpshop_paymentMethod['mode']['cic'] ) ) { |
40
|
|
|
include_once( WPSHOP_LIBRAIRIES_DIR . 'payments/cic.class.php' ); |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
// End if(). |
|
|
|
|
44
|
|
|
if ( ! class_exists( 'WP_List_Table' ) ) { |
45
|
|
|
require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' ); |
46
|
|
|
} |
47
|
|
|
include_once( WPSHOP_LIBRAIRIES_DIR . 'display/display.class.php' ); |
48
|
|
|
include_once( WPSHOP_LIBRAIRIES_DIR . 'display/form.class.php' ); |
49
|
|
|
include_once( WPSHOP_LIBRAIRIES_DIR . 'display/form_management.class.php' ); |
50
|
|
|
include_once( WPSHOP_LIBRAIRIES_DIR . 'display/widgets/categories.widget.php' ); |
51
|
|
|
include_once( WPSHOP_LIBRAIRIES_DIR . 'display/widgets/products.widget.php' ); |
52
|
|
|
// End if(). |
|
|
|
|
53
|
|
|
add_action( 'admin_init', array( 'wpshop_display', 'check_template_file' ) ); |
54
|
|
|
/* Files management */ |
55
|
|
|
include_once( WPSHOP_LIBRAIRIES_DIR . 'documents/documents.class.php' ); |
56
|
|
|
add_action( 'admin_head', array( 'wpshop_documents', 'galery_manager_css' ) ); |
57
|
|
|
add_filter( 'attachment_fields_to_edit', array( 'wpshop_documents', 'attachment_fields' ), 11, 2 ); |
58
|
|
|
add_filter( 'gettext', array( 'wpshop_documents', 'change_picture_translation' ), 11, 2 ); |
59
|
|
|
/* Catalog management */ |
60
|
|
|
include_once( WPSHOP_LIBRAIRIES_DIR . 'catalog/products.class.php' ); |
61
|
|
|
include_once( WPSHOP_LIBRAIRIES_DIR . 'catalog/categories.class.php' ); |
62
|
|
|
add_filter( 'manage_edit-' . WPSHOP_NEWTYPE_IDENTIFIER_CATEGORIES . '_columns', array( 'wpshop_categories', 'category_manage_columns' ) ); |
63
|
|
|
add_filter( 'manage_' . WPSHOP_NEWTYPE_IDENTIFIER_CATEGORIES . '_custom_column', array( 'wpshop_categories', 'category_manage_columns_content' ), 10, 3 ); |
64
|
|
|
add_action( WPSHOP_NEWTYPE_IDENTIFIER_CATEGORIES . '_edit_form_fields', array( 'wpshop_categories', 'category_edit_fields' ) ); |
65
|
|
|
add_action( 'created_' . WPSHOP_NEWTYPE_IDENTIFIER_CATEGORIES, array( 'wpshop_categories', 'category_fields_saver' ), 10, 2 ); |
66
|
|
|
add_action( 'edited_' . WPSHOP_NEWTYPE_IDENTIFIER_CATEGORIES, array( 'wpshop_categories', 'category_fields_saver' ), 10, 2 ); |
67
|
|
|
/* EAV management */ |
68
|
|
|
include( WPSHOP_LIBRAIRIES_DIR . 'eav/wp_list_custom_attributes.class.php' ); |
69
|
|
|
include( WPSHOP_LIBRAIRIES_DIR . 'eav/attributes.class.php' ); |
70
|
|
|
include( WPSHOP_LIBRAIRIES_DIR . 'eav/attributes_unit.class.php' ); |
71
|
|
|
include( WPSHOP_LIBRAIRIES_DIR . 'eav/wp_list_custom_attributes_set.class.php' ); |
72
|
|
|
include( WPSHOP_LIBRAIRIES_DIR . 'eav/attributes_set.class.php' ); |
73
|
|
|
include( WPSHOP_LIBRAIRIES_DIR . 'eav/entities.class.php' ); |
74
|
|
|
/* Modules management */ |
75
|
|
|
eo_module_management::extra_modules(); |
76
|
|
|
|
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.