@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if (!defined('ABSPATH')) exit; |
|
| 2 | 2 | /** |
| 3 | 3 | * File for installer control class definition |
| 4 | 4 | * |
@@ -25,59 +25,59 @@ discard block |
||
| 25 | 25 | function __construct() { |
| 26 | 26 | |
| 27 | 27 | /** Call administration style definition & scripts */ |
| 28 | - add_action( 'admin_init', array( &$this, 'admin_scripts' ) ); |
|
| 28 | + add_action('admin_init', array(&$this, 'admin_scripts')); |
|
| 29 | 29 | |
| 30 | - $current_step = ( !empty( $_GET['wps-installation-step'] ) ) ? sanitize_title( $_GET['wps-installation-step'] ) : $this->current_installation_step; |
|
| 30 | + $current_step = (!empty($_GET['wps-installation-step'])) ? sanitize_title($_GET['wps-installation-step']) : $this->current_installation_step; |
|
| 31 | 31 | |
| 32 | 32 | /** Instanciate datas saver components */ |
| 33 | 33 | $wps_installer_model = new wps_installer_model(); |
| 34 | 34 | |
| 35 | - $action = !empty( $_POST[ 'action' ] ) ? sanitize_text_field( $_POST[ 'action' ] ) : ''; |
|
| 35 | + $action = !empty($_POST['action']) ? sanitize_text_field($_POST['action']) : ''; |
|
| 36 | 36 | /** Call datas saver */ |
| 37 | - if ( !empty( $current_step ) && !empty( $action ) && ( "wps-installation" == $action ) ) { |
|
| 37 | + if (!empty($current_step) && !empty($action) && ("wps-installation" == $action)) { |
|
| 38 | 38 | $step_to_save = $current_step - 1; |
| 39 | - $wps_installer_model->save_step( $step_to_save ); |
|
| 40 | - if ( WPSINSTALLER_STEPS_COUNT == $current_step ) { |
|
| 41 | - add_action( 'init', array( &$this, 'go_to_wpshop_about' ) ); |
|
| 39 | + $wps_installer_model->save_step($step_to_save); |
|
| 40 | + if (WPSINSTALLER_STEPS_COUNT == $current_step) { |
|
| 41 | + add_action('init', array(&$this, 'go_to_wpshop_about')); |
|
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** Set the current installatino step */ |
| 46 | - $this->current_installation_step = get_option( 'wps-installation-current-step', 1 ); |
|
| 46 | + $this->current_installation_step = get_option('wps-installation-current-step', 1); |
|
| 47 | 47 | |
| 48 | 48 | /** Get current version for wpshop plugin */ |
| 49 | - $wps_current_db_version = get_option( 'wpshop_db_options', 0 ); |
|
| 49 | + $wps_current_db_version = get_option('wpshop_db_options', 0); |
|
| 50 | 50 | |
| 51 | 51 | /** Check the configuration state */ |
| 52 | - $installation_state = !empty( $_GET[ 'installation_state' ] ) ? sanitize_text_field( $_GET[ 'installation_state' ] ) : ''; |
|
| 53 | - if ( isset( $installation_state ) && !empty( $installation_state ) && !empty( $wps_current_db_version ) |
|
| 54 | - && (empty( $wps_current_db_version[ 'installation_state' ] ) || ( $wps_current_db_version[ 'installation_state' ] != 'completed' ) ) ) { |
|
| 55 | - $wps_current_db_version = $wps_installer_model->installer_state_saver( $installation_state, $wps_current_db_version ); |
|
| 52 | + $installation_state = !empty($_GET['installation_state']) ? sanitize_text_field($_GET['installation_state']) : ''; |
|
| 53 | + if (isset($installation_state) && !empty($installation_state) && !empty($wps_current_db_version) |
|
| 54 | + && (empty($wps_current_db_version['installation_state']) || ($wps_current_db_version['installation_state'] != 'completed'))) { |
|
| 55 | + $wps_current_db_version = $wps_installer_model->installer_state_saver($installation_state, $wps_current_db_version); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** Do verification for shop who are configured for being sale shop */ |
| 59 | - $current_page = strstr( $_SERVER[ "REQUEST_URI" ], 'wps-about'); |
|
| 60 | - if ( isset( $wps_current_db_version['installation_state'] ) && ( $wps_current_db_version[ 'installation_state' ] == 'completed' ) && ( WPSHOP_DEFINED_SHOP_TYPE == 'sale' ) && empty( $current_page ) ) { |
|
| 61 | - add_action( 'admin_notices', array( 'wpshop_notices' , 'sale_shop_notice' ) ); |
|
| 59 | + $current_page = strstr($_SERVER["REQUEST_URI"], 'wps-about'); |
|
| 60 | + if (isset($wps_current_db_version['installation_state']) && ($wps_current_db_version['installation_state'] == 'completed') && (WPSHOP_DEFINED_SHOP_TYPE == 'sale') && empty($current_page)) { |
|
| 61 | + add_action('admin_notices', array('wpshop_notices', 'sale_shop_notice')); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /** Create an administration menu */ |
| 65 | - add_action( 'admin_menu', array( $this, 'admin_menu' ), 10 ); |
|
| 65 | + add_action('admin_menu', array($this, 'admin_menu'), 10); |
|
| 66 | 66 | |
| 67 | 67 | /** In case that configuration have not been done and that instalation is not asked to be ignored */ |
| 68 | - if ( empty( $wps_current_db_version ) || empty( $wps_current_db_version[ 'installation_state' ] ) || ( !empty( $wps_current_db_version[ 'installation_state' ] ) && !in_array( $wps_current_db_version[ 'installation_state' ], array( 'completed', 'ignored' ) ) ) ) { |
|
| 68 | + if (empty($wps_current_db_version) || empty($wps_current_db_version['installation_state']) || (!empty($wps_current_db_version['installation_state']) && !in_array($wps_current_db_version['installation_state'], array('completed', 'ignored')))) { |
|
| 69 | 69 | /* Check the db installation state for admin message output */ |
| 70 | - $current_page = strstr( $_SERVER[ "REQUEST_URI" ], 'wps-installer'); |
|
| 71 | - if( ( WPSINSTALLER_STEPS_COUNT > $this->current_installation_step ) && ( empty( $current_page ) ) ) { |
|
| 72 | - add_action( 'admin_notices', array( &$this, 'install_admin_notice' ) ); |
|
| 70 | + $current_page = strstr($_SERVER["REQUEST_URI"], 'wps-installer'); |
|
| 71 | + if ((WPSINSTALLER_STEPS_COUNT > $this->current_installation_step) && (empty($current_page))) { |
|
| 72 | + add_action('admin_notices', array(&$this, 'install_admin_notice')); |
|
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** Hook wpshop dashboard in order to display the notice banner with quick links - wordpress like */ |
| 77 | - add_filter( 'wps_dashboard_notice', array( $this, 'wps_dashboard_notice' ), 10, 1 ); |
|
| 77 | + add_filter('wps_dashboard_notice', array($this, 'wps_dashboard_notice'), 10, 1); |
|
| 78 | 78 | |
| 79 | 79 | /** Hook ajax action when clicking on hide welcome banner on wpshop dashboard */ |
| 80 | - add_action( 'wp_ajax_wps-hide-welcome-panel', array( $this, 'wps_hide_welcome_panel' ) ); |
|
| 80 | + add_action('wp_ajax_wps-hide-welcome-panel', array($this, 'wps_hide_welcome_panel')); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | |
@@ -86,12 +86,12 @@ discard block |
||
| 86 | 86 | * Enqueue scripts definition |
| 87 | 87 | */ |
| 88 | 88 | function admin_scripts($hook_suffix) { |
| 89 | - if ( 'wps-installer.php' !== $hook_suffix ) |
|
| 89 | + if ('wps-installer.php' !== $hook_suffix) |
|
| 90 | 90 | return; |
| 91 | 91 | |
| 92 | - wp_register_style( 'wps_installer_style', WPS_INSTALLER_URL . WPS_INSTALLER_DIR . '/assets/css/backend-styles.css', '', WPS_INSTALLER_VERSION ); |
|
| 93 | - wp_enqueue_style( 'wps_installer_style' ); |
|
| 94 | - wp_enqueue_script( 'wps-installer-admin-scripts', WPS_INSTALLER_URL . WPS_INSTALLER_DIR . '/assets/js/backend-scripts.js', array( 'jquery' ), WPS_INSTALLER_VERSION ); |
|
| 92 | + wp_register_style('wps_installer_style', WPS_INSTALLER_URL . WPS_INSTALLER_DIR . '/assets/css/backend-styles.css', '', WPS_INSTALLER_VERSION); |
|
| 93 | + wp_enqueue_style('wps_installer_style'); |
|
| 94 | + wp_enqueue_script('wps-installer-admin-scripts', WPS_INSTALLER_URL . WPS_INSTALLER_DIR . '/assets/js/backend-scripts.js', array('jquery'), WPS_INSTALLER_VERSION); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** |
@@ -99,26 +99,26 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | function admin_menu() { |
| 101 | 101 | /** Get current version for wpshop plugin */ |
| 102 | - $wps_current_db_version = get_option( 'wpshop_db_options', 0 ); |
|
| 102 | + $wps_current_db_version = get_option('wpshop_db_options', 0); |
|
| 103 | 103 | |
| 104 | - add_menu_page( __( 'Install WPShop', 'wpshop' ), __( 'WPShop - install', 'wpshop' ), 'manage_options', 'wps-installer', array( &$this, 'installer_main_page' ) ); |
|
| 105 | - remove_menu_page( 'wps-installer' ); |
|
| 104 | + add_menu_page(__('Install WPShop', 'wpshop'), __('WPShop - install', 'wpshop'), 'manage_options', 'wps-installer', array(&$this, 'installer_main_page')); |
|
| 105 | + remove_menu_page('wps-installer'); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | /** |
| 109 | 109 | * Display the installer interface |
| 110 | 110 | */ |
| 111 | 111 | function installer_main_page() { |
| 112 | - $current_step = ( !empty( $_GET['wps-installation-step'] ) ) ? wpshop_tools::varSanitizer( $_GET['wps-installation-step'] ) : $this->current_installation_step; |
|
| 113 | - $steps = unserialize( WPSINSTALLER_STEPS ); |
|
| 112 | + $current_step = (!empty($_GET['wps-installation-step'])) ? wpshop_tools::varSanitizer($_GET['wps-installation-step']) : $this->current_installation_step; |
|
| 113 | + $steps = unserialize(WPSINSTALLER_STEPS); |
|
| 114 | 114 | |
| 115 | 115 | /** Get the defined shop type in order to display the different element to */ |
| 116 | - $wps_shop_type = get_option( 'wpshop_shop_type', WPSHOP_DEFAULT_SHOP_TYPE ); |
|
| 116 | + $wps_shop_type = get_option('wpshop_shop_type', WPSHOP_DEFAULT_SHOP_TYPE); |
|
| 117 | 117 | |
| 118 | 118 | /** Check the current step to display */ |
| 119 | 119 | $current_step_output = ''; |
| 120 | 120 | $the_step_file = ''; |
| 121 | - switch( $current_step ) { |
|
| 121 | + switch ($current_step) { |
|
| 122 | 122 | case 2: |
| 123 | 123 | $the_step_file = 'step_two'; |
| 124 | 124 | break; |
@@ -130,25 +130,25 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | /** Create display for current step */ |
| 132 | 132 | ob_start(); |
| 133 | - require_once( wpshop_tools::get_template_part( WPS_INSTALLER_DIR, WPSINSTALLER_TPL_DIR, "backend", $the_step_file ) ); |
|
| 133 | + require_once(wpshop_tools::get_template_part(WPS_INSTALLER_DIR, WPSINSTALLER_TPL_DIR, "backend", $the_step_file)); |
|
| 134 | 134 | $current_step_output = ob_get_contents(); |
| 135 | 135 | ob_end_clean(); |
| 136 | 136 | |
| 137 | - require_once( wpshop_tools::get_template_part( WPS_INSTALLER_DIR, WPSINSTALLER_TPL_DIR, "backend", "installer" ) ); |
|
| 137 | + require_once(wpshop_tools::get_template_part(WPS_INSTALLER_DIR, WPSINSTALLER_TPL_DIR, "backend", "installer")); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | /** |
| 141 | 141 | * Create a notice for admin user when plugin is activated and not yet configured |
| 142 | 142 | */ |
| 143 | 143 | function install_admin_notice() { |
| 144 | - require_once( wpshop_tools::get_template_part( WPS_INSTALLER_DIR, WPSINSTALLER_TPL_DIR, "backend", "notice" ) ); |
|
| 144 | + require_once(wpshop_tools::get_template_part(WPS_INSTALLER_DIR, WPSINSTALLER_TPL_DIR, "backend", "notice")); |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | /** |
| 148 | 148 | * Redirect the user automatically to the wpshop about page |
| 149 | 149 | */ |
| 150 | 150 | function go_to_wpshop_about() { |
| 151 | - wp_redirect( admin_url( 'admin.php?page=wpshop_about' ) ); |
|
| 151 | + wp_redirect(admin_url('admin.php?page=wpshop_about')); |
|
| 152 | 152 | exit(); |
| 153 | 153 | } |
| 154 | 154 | |
@@ -156,26 +156,26 @@ discard block |
||
| 156 | 156 | * DISPLAY - Output the about page for wpshop |
| 157 | 157 | */ |
| 158 | 158 | function wps_about_page() { |
| 159 | - require_once( wpshop_tools::get_template_part( WPS_INSTALLER_DIR, WPSINSTALLER_TPL_DIR, "backend", "about" ) ); |
|
| 159 | + require_once(wpshop_tools::get_template_part(WPS_INSTALLER_DIR, WPSINSTALLER_TPL_DIR, "backend", "about")); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | /** |
| 163 | 163 | * DISPLAY - Display a banner on wpshop dashboard |
| 164 | 164 | */ |
| 165 | 165 | function wps_dashboard_notice() { |
| 166 | - $user_pref = get_user_meta( get_current_user_id(), '_wps_hide_notice_messages_indicator', true ); |
|
| 166 | + $user_pref = get_user_meta(get_current_user_id(), '_wps_hide_notice_messages_indicator', true); |
|
| 167 | 167 | |
| 168 | - if ( empty( $user_pref ) || empty( $user_pref[ 'welcome-banner' ] ) ) { |
|
| 168 | + if (empty($user_pref) || empty($user_pref['welcome-banner'])) { |
|
| 169 | 169 | /** Get current shop type */ |
| 170 | - $shop_type = get_option( 'wpshop_shop_type' ); |
|
| 170 | + $shop_type = get_option('wpshop_shop_type'); |
|
| 171 | 171 | |
| 172 | 172 | /** Get the current number of product created */ |
| 173 | 173 | $nb_products = 0; |
| 174 | - $created_products = wp_count_posts( WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT ); |
|
| 175 | - if ( !empty( $created_products ) ) { |
|
| 176 | - foreach ( $created_products as $created_product_type => $created_product_nb) { |
|
| 174 | + $created_products = wp_count_posts(WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT); |
|
| 175 | + if (!empty($created_products)) { |
|
| 176 | + foreach ($created_products as $created_product_type => $created_product_nb) { |
|
| 177 | 177 | /** Don't count product that are automatically created and not accessible through amin interface */ |
| 178 | - if ( !in_array( $created_product_type, array( 'auto-draft', 'inherit' ) ) ) { |
|
| 178 | + if (!in_array($created_product_type, array('auto-draft', 'inherit'))) { |
|
| 179 | 179 | $nb_products += $created_product_nb; |
| 180 | 180 | } |
| 181 | 181 | } |
@@ -183,18 +183,18 @@ discard block |
||
| 183 | 183 | |
| 184 | 184 | /** Get configuration about payment method */ |
| 185 | 185 | $no_payment_mode_configurated = true; |
| 186 | - if ( !empty($paymentMethod ) && !empty($paymentMethod['mode']) ) { |
|
| 187 | - foreach( $paymentMethod['mode'] as $k => $pm ) { |
|
| 188 | - if ( !empty($pm['active'] ) ) { |
|
| 186 | + if (!empty($paymentMethod) && !empty($paymentMethod['mode'])) { |
|
| 187 | + foreach ($paymentMethod['mode'] as $k => $pm) { |
|
| 188 | + if (!empty($pm['active'])) { |
|
| 189 | 189 | $no_payment_mode_configurated = false; |
| 190 | 190 | } |
| 191 | 191 | } |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | /** Get configuration about emails */ |
| 195 | - $emails = get_option('wpshop_emails', array() ); |
|
| 195 | + $emails = get_option('wpshop_emails', array()); |
|
| 196 | 196 | |
| 197 | - require_once( wpshop_tools::get_template_part( WPS_INSTALLER_DIR, WPSINSTALLER_TPL_DIR, "backend", "welcome" ) ); |
|
| 197 | + require_once(wpshop_tools::get_template_part(WPS_INSTALLER_DIR, WPSINSTALLER_TPL_DIR, "backend", "welcome")); |
|
| 198 | 198 | } |
| 199 | 199 | } |
| 200 | 200 | |
@@ -202,24 +202,24 @@ discard block |
||
| 202 | 202 | * AJAX - Launch ajax action allowing to hide welcome panel for current user |
| 203 | 203 | */ |
| 204 | 204 | function wps_hide_welcome_panel() { |
| 205 | - $wpshop_ajax_nonce = !empty( $_REQUEST['wpshop_ajax_nonce'] ) ? sanitize_text_field( $_REQUEST['wpshop_ajax_nonce'] ) : ''; |
|
| 205 | + $wpshop_ajax_nonce = !empty($_REQUEST['wpshop_ajax_nonce']) ? sanitize_text_field($_REQUEST['wpshop_ajax_nonce']) : ''; |
|
| 206 | 206 | |
| 207 | - if ( !wp_verify_nonce( $_wpnonce, 'wps-installer-welcome-panel-close' ) ) |
|
| 207 | + if (!wp_verify_nonce($_wpnonce, 'wps-installer-welcome-panel-close')) |
|
| 208 | 208 | wp_die(); |
| 209 | 209 | |
| 210 | - $user_pref = get_user_meta( get_current_user_id(), '_wps_hide_notice_messages_indicator', true ); |
|
| 211 | - $user_pref[ 'welcome-banner' ] = true; |
|
| 210 | + $user_pref = get_user_meta(get_current_user_id(), '_wps_hide_notice_messages_indicator', true); |
|
| 211 | + $user_pref['welcome-banner'] = true; |
|
| 212 | 212 | |
| 213 | 213 | $response = array( |
| 214 | 214 | 'status' => false, |
| 215 | 215 | ); |
| 216 | 216 | |
| 217 | - $user_pref = update_user_meta( get_current_user_id(), '_wps_hide_notice_messages_indicator', $user_pref ); |
|
| 218 | - if ( false !== $user_pref ) { |
|
| 219 | - $response[ 'status' ] = true; |
|
| 217 | + $user_pref = update_user_meta(get_current_user_id(), '_wps_hide_notice_messages_indicator', $user_pref); |
|
| 218 | + if (false !== $user_pref) { |
|
| 219 | + $response['status'] = true; |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | - wp_die( json_encode( $response ) ); |
|
| 222 | + wp_die(json_encode($response)); |
|
| 223 | 223 | } |
| 224 | 224 | } |
| 225 | 225 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if (!defined('ABSPATH')) exit; |
|
| 2 | 2 | ?> |
| 3 | 3 | <!-- BOX EXPORTS --> |
| 4 | 4 | <div class="wps-row"> |
@@ -1,4 +1,6 @@ |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
| 2 | + exit; |
|
| 3 | +} |
|
| 2 | 4 | ?> |
| 3 | 5 | <!-- BOX EXPORTS --> |
| 4 | 6 | <div class="wps-row"> |
@@ -1,24 +1,24 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 2 | +if (!defined('ABSPATH')) { |
|
| 3 | 3 | exit; |
| 4 | 4 | } |
| 5 | 5 | ?> |
| 6 | 6 | <div class="wrap wpshopMainWrap" > |
| 7 | 7 | <div id="wpshopLoadingPicture" class="wpshopHide" ><img src="<?php echo WPSHOP_LOADING_ICON; ?>" alt="loading picture" class="wpshopPageMessage_Icon" /></div> |
| 8 | - <div id="wpshopMessage" class="fade below-h2 wpshopPageMessage <?php echo esc_attr( ! empty( $actionInformationMessage ) ? 'wpshopPageMessage_Updated' : '' ); ?>" ><?php ! empty( $actionInformationMessage ) ? _e( $actionInformationMessage, 'wpshop' ) : ''; ?></div> |
|
| 8 | + <div id="wpshopMessage" class="fade below-h2 wpshopPageMessage <?php echo esc_attr(!empty($actionInformationMessage) ? 'wpshopPageMessage_Updated' : ''); ?>" ><?php !empty($actionInformationMessage) ? _e($actionInformationMessage, 'wpshop') : ''; ?></div> |
|
| 9 | 9 | |
| 10 | 10 | <div class="pageTitle" id="pageTitleContainer" > |
| 11 | - <h2 ><?php esc_html_e( 'Shop dashboard', 'wpshop' ); ?></h2> |
|
| 11 | + <h2 ><?php esc_html_e('Shop dashboard', 'wpshop'); ?></h2> |
|
| 12 | 12 | </div> |
| 13 | 13 | <div id="champsCaches" class="wpshop_cls wpshopHide" ></div> |
| 14 | 14 | <div id="wpshop_dashboard"> |
| 15 | 15 | <div class="wpshop_cls wps-gridwrapper2-padded metabox-holder wps-statistics-container" id="dashboard-widgets" > |
| 16 | - <?php apply_filters( 'wps_dashboard_notice', '' ); ?> |
|
| 17 | - <?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', true ); ?> |
|
| 18 | - <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', true ); ?> |
|
| 16 | + <?php apply_filters('wps_dashboard_notice', ''); ?> |
|
| 17 | + <?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', true); ?> |
|
| 18 | + <?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', true); ?> |
|
| 19 | 19 | |
| 20 | - <?php do_meta_boxes( 'wpshop_dashboard', 'left_column', '' ); ?> |
|
| 21 | - <?php do_meta_boxes( 'wpshop_dashboard', 'right_column', '' ); ?> |
|
| 20 | + <?php do_meta_boxes('wpshop_dashboard', 'left_column', ''); ?> |
|
| 21 | + <?php do_meta_boxes('wpshop_dashboard', 'right_column', ''); ?> |
|
| 22 | 22 | |
| 23 | 23 | </div> |
| 24 | 24 | <div class="wpshop_cls wpshopHide" id="ajax-response"></div> |
@@ -2,26 +2,26 @@ |
||
| 2 | 2 | <div class="wps-table-header wps-table-row"> |
| 3 | 3 | <div class="wps-table-cell"><?php _e('Number of users', 'wpshop'); ?></div>
|
| 4 | 4 | <div class="wps-table-cell"><?php $result = count(get_users()); echo $result; ?></div> |
| 5 | - <div class="wps-table-cell"><?php echo ( !empty($result) ) ? '<a href="' . admin_url(). 'admin.php?page=wpshop_dashboard&download_users=users_all" role="button" id="download_all_users_contacts" class="wps-bton-first-rounded">' .__( 'Download the list', 'wpshop' ). '</a>' : ''; ?></div> |
|
| 5 | + <div class="wps-table-cell"><?php echo (!empty($result)) ? '<a href="' . admin_url() . 'admin.php?page=wpshop_dashboard&download_users=users_all" role="button" id="download_all_users_contacts" class="wps-bton-first-rounded">' . __('Download the list', 'wpshop') . '</a>' : ''; ?></div>
|
|
| 6 | 6 | </div> |
| 7 | 7 | |
| 8 | 8 | <div class="wps-table-header wps-table-row"> |
| 9 | 9 | <?php |
| 10 | - $query = $wpdb->prepare( "SELECT COUNT( DISTINCT user_id ) FROM {$wpdb->usermeta} JOIN {$wpdb->posts} ON post_author = user_id AND post_type = %s WHERE meta_key = %s AND ( meta_value LIKE ('%%%s%%') || meta_value LIKE ('%%%s%%') )", WPSHOP_NEWTYPE_IDENTIFIER_ORDER, 'user_preferences', 's:16:"newsletters_site";i:1;', 's:16:"newsletters_site";b:1;' );
|
|
| 10 | + $query = $wpdb->prepare("SELECT COUNT( DISTINCT user_id ) FROM {$wpdb->usermeta} JOIN {$wpdb->posts} ON post_author = user_id AND post_type = %s WHERE meta_key = %s AND ( meta_value LIKE ('%%%s%%') || meta_value LIKE ('%%%s%%') )", WPSHOP_NEWTYPE_IDENTIFIER_ORDER, 'user_preferences', 's:16:"newsletters_site";i:1;', 's:16:"newsletters_site";b:1;');
|
|
| 11 | 11 | $nbcustomers_site = $wpdb->get_var($query); |
| 12 | 12 | ?> |
| 13 | 13 | <div class="wps-table-cell"><?php _e('Number of customers who wants to receive shop newsletters', 'wpshop'); ?></div>
|
| 14 | 14 | <div class="wps-table-cell"><?php echo $nbcustomers_site; ?></div> |
| 15 | - <div class="wps-table-cell"><?php echo ( !empty($nbcustomers_site) ) ? '<a href="' . admin_url(). 'admin.php?page=wpshop_dashboard&download_users=newsletters_site" role="button" id="download_newsletter_contacts" class="wps-bton-first-rounded">' .__( 'Download the list', 'wpshop' ). '</a>' : ''; ?></div> |
|
| 15 | + <div class="wps-table-cell"><?php echo (!empty($nbcustomers_site)) ? '<a href="' . admin_url() . 'admin.php?page=wpshop_dashboard&download_users=newsletters_site" role="button" id="download_newsletter_contacts" class="wps-bton-first-rounded">' . __('Download the list', 'wpshop') . '</a>' : ''; ?></div>
|
|
| 16 | 16 | </div> |
| 17 | 17 | |
| 18 | 18 | <div class="wps-table-header wps-table-row"> |
| 19 | 19 | <?php |
| 20 | - $query = $wpdb->prepare( "SELECT COUNT( DISTINCT user_id ) FROM {$wpdb->usermeta} JOIN {$wpdb->posts} ON post_author = user_id AND post_type = %s WHERE meta_key = %s AND ( meta_value LIKE ('%%%s%%') || meta_value LIKE ('%%%s%%') )", WPSHOP_NEWTYPE_IDENTIFIER_ORDER, 'user_preferences', 's:25:"newsletters_site_partners";i:1;', 's:25:"newsletters_site_partners";b:1;' );
|
|
| 20 | + $query = $wpdb->prepare("SELECT COUNT( DISTINCT user_id ) FROM {$wpdb->usermeta} JOIN {$wpdb->posts} ON post_author = user_id AND post_type = %s WHERE meta_key = %s AND ( meta_value LIKE ('%%%s%%') || meta_value LIKE ('%%%s%%') )", WPSHOP_NEWTYPE_IDENTIFIER_ORDER, 'user_preferences', 's:25:"newsletters_site_partners";i:1;', 's:25:"newsletters_site_partners";b:1;');
|
|
| 21 | 21 | $nbcustomers_site_partners = $wpdb->get_var($query); |
| 22 | 22 | ?> |
| 23 | 23 | <div class="wps-table-cell"><?php _e('Number of customers who wants to receive partners newsletters', 'wpshop'); ?></div>
|
| 24 | 24 | <div class="wps-table-cell"><?php echo $nbcustomers_site_partners; ?></div> |
| 25 | - <div class="wps-table-cell"><?php echo ( !empty($nbcustomers_site_partners) ) ? '<a href="' . admin_url(). 'admin.php?page=wpshop_dashboard&download_users=newsletters_site_partners" role="button" id="download_newsletter_partners_contacts" class="wps-bton-first-rounded">' .__( 'Download the list', 'wpshop' ). '</a>' : ''; ?></div> |
|
| 25 | + <div class="wps-table-cell"><?php echo (!empty($nbcustomers_site_partners)) ? '<a href="' . admin_url() . 'admin.php?page=wpshop_dashboard&download_users=newsletters_site_partners" role="button" id="download_newsletter_partners_contacts" class="wps-bton-first-rounded">' . __('Download the list', 'wpshop') . '</a>' : ''; ?></div>
|
|
| 26 | 26 | </div> |
| 27 | 27 | </div> |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <div class="wps-gridwrapper5-padded wpshop-gridwrapper-quick-link"> |
| 2 | - <div><div class="wps_quick_link_icon"><a href="<?php echo admin_url( 'post-new.php?post_type=wpshop_product' ); ?>"><span class="dashicons dashicons-archive"></span></a></div><center><a href="<?php echo admin_url( 'post-new.php?post_type=wpshop_product' ); ?>"><?php _e( 'Create a new product', 'wpshop'); ?></a></center></div> |
|
| 3 | - <div><div class="wps_quick_link_icon"><a href="<?php echo admin_url( 'post-new.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_ORDER ); ?>"><span class="dashicons dashicons-cart"></span></a></div><center><a href="<?php echo admin_url( 'post-new.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_ORDER ); ?>"><?php _e( 'Create order', 'wpshop'); ?></a></center></div> |
|
| 4 | - <div><div class="wps_quick_link_icon"><a href="<?php echo admin_url( 'post-new.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS ); ?>"><span class="dashicons dashicons-businessman"></span></a></div><center><a href="<?php echo admin_url( 'post-new.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS ); ?>"><?php _e( 'Create a customer', 'wpshop'); ?></a></center></div> |
|
| 5 | - <div><div class="wps_quick_link_icon"><a href="<?php echo admin_url( 'admin.php?page=wpshop_statistics' ); ?>"><span class="dashicons dashicons-chart-line"></span></a></div><center><a href="<?php echo admin_url( 'admin.php?page=wpshop_statistics' ); ?>"><?php _e( 'Statistics', 'wpshop'); ?></a></center></div> |
|
| 6 | - <div><div class="wps_quick_link_icon"><a href="<?php echo admin_url( 'options-general.php?page=wpshop_option#wpshop_display_option' ); ?>"><span class="dashicons dashicons-admin-appearance"></span></a></div><center><a href="<?php echo admin_url( 'options-general.php?page=wpshop_option' ); ?>"><?php _e( 'Customize your shop', 'wpshop'); ?></a></center></div> |
|
| 2 | + <div><div class="wps_quick_link_icon"><a href="<?php echo admin_url('post-new.php?post_type=wpshop_product'); ?>"><span class="dashicons dashicons-archive"></span></a></div><center><a href="<?php echo admin_url('post-new.php?post_type=wpshop_product'); ?>"><?php _e('Create a new product', 'wpshop'); ?></a></center></div>
|
|
| 3 | + <div><div class="wps_quick_link_icon"><a href="<?php echo admin_url('post-new.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_ORDER); ?>"><span class="dashicons dashicons-cart"></span></a></div><center><a href="<?php echo admin_url('post-new.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_ORDER); ?>"><?php _e('Create order', 'wpshop'); ?></a></center></div>
|
|
| 4 | + <div><div class="wps_quick_link_icon"><a href="<?php echo admin_url('post-new.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS); ?>"><span class="dashicons dashicons-businessman"></span></a></div><center><a href="<?php echo admin_url('post-new.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS); ?>"><?php _e('Create a customer', 'wpshop'); ?></a></center></div>
|
|
| 5 | + <div><div class="wps_quick_link_icon"><a href="<?php echo admin_url('admin.php?page=wpshop_statistics'); ?>"><span class="dashicons dashicons-chart-line"></span></a></div><center><a href="<?php echo admin_url('admin.php?page=wpshop_statistics'); ?>"><?php _e('Statistics', 'wpshop'); ?></a></center></div>
|
|
| 6 | + <div><div class="wps_quick_link_icon"><a href="<?php echo admin_url('options-general.php?page=wpshop_option#wpshop_display_option'); ?>"><span class="dashicons dashicons-admin-appearance"></span></a></div><center><a href="<?php echo admin_url('options-general.php?page=wpshop_option'); ?>"><?php _e('Customize your shop', 'wpshop'); ?></a></center></div>
|
|
| 7 | 7 | </div> |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | * @subpackage dashboard |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 9 | +if (!defined('ABSPATH')) { |
|
| 10 | 10 | exit; |
| 11 | 11 | } |
| 12 | 12 | |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) {
|
|
| 2 | +if (!defined('ABSPATH')) {
|
|
| 3 | 3 | exit; |
| 4 | 4 | } |
| 5 | 5 | |
@@ -6,54 +6,54 @@ |
||
| 6 | 6 | * @subpackage dashboard |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 9 | +if (!defined('ABSPATH')) { |
|
| 10 | 10 | exit; |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | ?><div class="wps-table"> |
| 14 | 14 | <div class="wps-table-header wps-table-row"> |
| 15 | 15 | <div class="wps-table-cell"> </div> |
| 16 | - <div class="wps-table-cell"><?php esc_html_e( 'Order total amount', 'wpshop' ); ?></div> |
|
| 17 | - <div class="wps-table-cell"><?php esc_html_e( 'Order count', 'wpshop' ); ?></div> |
|
| 18 | - <div class="wps-table-cell"><?php esc_html_e( 'Customer subscription', 'wpshop' ); ?></div> |
|
| 16 | + <div class="wps-table-cell"><?php esc_html_e('Order total amount', 'wpshop'); ?></div> |
|
| 17 | + <div class="wps-table-cell"><?php esc_html_e('Order count', 'wpshop'); ?></div> |
|
| 18 | + <div class="wps-table-cell"><?php esc_html_e('Customer subscription', 'wpshop'); ?></div> |
|
| 19 | 19 | </div> |
| 20 | 20 | |
| 21 | 21 | <?php |
| 22 | -foreach ( $dates as $label => $date_def ) : |
|
| 23 | - $args = wp_parse_args( array( |
|
| 22 | +foreach ($dates as $label => $date_def) : |
|
| 23 | + $args = wp_parse_args(array( |
|
| 24 | 24 | 'date_query' => $date_def, |
| 25 | - ), $orders_default_args ); |
|
| 26 | - $orders = new WP_Query( $args ); |
|
| 25 | + ), $orders_default_args); |
|
| 26 | + $orders = new WP_Query($args); |
|
| 27 | 27 | |
| 28 | 28 | $orders_total_amount = 0; |
| 29 | - if ( $orders->have_posts() ) { |
|
| 30 | - foreach ( $orders->posts as $order ) { |
|
| 31 | - $order_data = get_post_meta( $order->ID, '_order_postmeta', true ); |
|
| 29 | + if ($orders->have_posts()) { |
|
| 30 | + foreach ($orders->posts as $order) { |
|
| 31 | + $order_data = get_post_meta($order->ID, '_order_postmeta', true); |
|
| 32 | 32 | |
| 33 | - if ( 'denied' === $order_data['order_status'] || 'awaiting_payment' === $order_data['order_status'] ) { |
|
| 33 | + if ('denied' === $order_data['order_status'] || 'awaiting_payment' === $order_data['order_status']) { |
|
| 34 | 34 | continue; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - if ( in_array( $order_data['order_status'], array( 'completed', 'shipped' ), true ) ) { |
|
| 37 | + if (in_array($order_data['order_status'], array('completed', 'shipped'), true)) { |
|
| 38 | 38 | $orders_total_amount += $order_data['order_grand_total']; |
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - $user_subscription_number = new WP_User_Query( array( |
|
| 43 | + $user_subscription_number = new WP_User_Query(array( |
|
| 44 | 44 | 'date_query' => $date_def, |
| 45 | 45 | 'count_total' => true, |
| 46 | - ) ); |
|
| 46 | + )); |
|
| 47 | 47 | ?> |
| 48 | 48 | <div class="wps-table-row"> |
| 49 | - <div class="wps-table-cell"><?php echo esc_html( $label ); ?></div> |
|
| 50 | - <div class="wps-table-cell"><?php echo esc_html( $orders_total_amount ) . ' ' . wpshop_tools::wpshop_get_currency(); ?></div> |
|
| 51 | - <div class="wps-table-cell"><?php echo esc_html( $orders->found_posts ); ?></div> |
|
| 52 | - <div class="wps-table-cell"><?php echo esc_html( $user_subscription_number->get_total() ); ?></div> |
|
| 49 | + <div class="wps-table-cell"><?php echo esc_html($label); ?></div> |
|
| 50 | + <div class="wps-table-cell"><?php echo esc_html($orders_total_amount) . ' ' . wpshop_tools::wpshop_get_currency(); ?></div> |
|
| 51 | + <div class="wps-table-cell"><?php echo esc_html($orders->found_posts); ?></div> |
|
| 52 | + <div class="wps-table-cell"><?php echo esc_html($user_subscription_number->get_total()); ?></div> |
|
| 53 | 53 | </div> |
| 54 | 54 | <?php endforeach; ?> |
| 55 | 55 | </div> |
| 56 | 56 | |
| 57 | -<?php require_once( wpshop_tools::get_template_part( WPS_DASHBOARD_DIR, WPSDASHBOARD_TPL_DIR, 'backend', 'metabox', 'customerStats' ) ); ?> |
|
| 57 | +<?php require_once(wpshop_tools::get_template_part(WPS_DASHBOARD_DIR, WPSDASHBOARD_TPL_DIR, 'backend', 'metabox', 'customerStats')); ?> |
|
| 58 | 58 | |
| 59 | -<center><a class="button button-primary" href="<?php echo admin_url( 'admin.php?page=wpshop_statistics' ); ?>"><span class="dashicons dashicons-chart-line"></span><?php esc_html_e( 'View all statistics', 'wpshop' ); ?></a></center> |
|
| 59 | +<center><a class="button button-primary" href="<?php echo admin_url('admin.php?page=wpshop_statistics'); ?>"><span class="dashicons dashicons-chart-line"></span><?php esc_html_e('View all statistics', 'wpshop'); ?></a></center> |
|
@@ -6,20 +6,20 @@ discard block |
||
| 6 | 6 | * @subpackage string |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -if ( ! defined( 'ABSPATH' ) ) {
|
|
| 9 | +if (!defined('ABSPATH')) {
|
|
| 10 | 10 | exit; |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | ?><div class="wps-boxed"> |
| 14 | - <span class="wps-h5"><?php _e( 'WPShop is also...', 'wpshop' ); ?></span> |
|
| 14 | + <span class="wps-h5"><?php _e('WPShop is also...', 'wpshop'); ?></span>
|
|
| 15 | 15 | <div class="wps-gridwrapper4-padded"> |
| 16 | - <div><a href="https://shop.eoxia.com/ecommerce/assistance-personnalisee-wordpress/" target="_blank" title="<?php echo esc_attr( 'Assistance', 'wpshop' ); ?>"><img src="<?php echo esc_attr( WPSHOP_MEDIAS_IMAGES_URL ); ?>assistance_wpshop.jpg" alt="WPSHOP Assistance" /></a><div class="wps-h5"><center><?php echo esc_html_e( 'Assistance', 'wpshop' ); ?></center></div><center><?php echo esc_html_e( 'To assist you in your WPShop Experience', 'wpshop' ); ?></center></div> |
|
| 17 | - <div><a href="https://shop.eoxia.com/themes/" target="_blank" title="<?php echo esc_attr( 'WPSHOP Themes', 'wpshop' ); ?>"><img src="<?php echo esc_attr( WPSHOP_MEDIAS_IMAGES_URL ); ?>themes_wpshop.jpg" alt="WPSHOP Themes" /></a><div class="wps-h5"><center><?php echo esc_html_e( 'WPSHOP Themes', 'wpshop' ); ?></center></div><center><?php echo esc_html_e( 'To offer to your customer all WPShop\'s powerful experience', 'wpshop' ); ?></center></div> |
|
| 18 | - <div><a href="https://shop.eoxia.com/boutique/wpshop/" target="_blank" title="<?php echo esc_attr( 'WPSHOP\'s add-ons', 'wpshop' ); ?>"><img src="<?php echo esc_attr( WPSHOP_MEDIAS_IMAGES_URL ); ?>modules_wpshop.jpg" alt="WPSHOP Assistance" /></a><div class="wps-h5"><center><?php echo esc_html_e( 'WPSHOP\'s add-ons', 'wpshop' ); ?></center></div><center><?php echo esc_html_e( 'To boost your shop with new functions', 'wpshop' ); ?></center></div> |
|
| 19 | - <div><a href="http://forums.eoxia.com" target="_blank" title="<?php echo esc_attr( 'WPSHOP\'s Forum', 'wpshop' ); ?>"><img src="<?php echo esc_attr( WPSHOP_MEDIAS_IMAGES_URL ); ?>forum_wpshop.jpg" alt="Forum Assistance" /></a><div class="wps-h5"><center><?php echo esc_html_e( 'WPSHOP\'s Forum', 'wpshop' ); ?></center></div><center><?php esc_html_e( 'To respond at your questions', 'wpshop' ); ?></center></div> |
|
| 16 | + <div><a href="https://shop.eoxia.com/ecommerce/assistance-personnalisee-wordpress/" target="_blank" title="<?php echo esc_attr('Assistance', 'wpshop'); ?>"><img src="<?php echo esc_attr(WPSHOP_MEDIAS_IMAGES_URL); ?>assistance_wpshop.jpg" alt="WPSHOP Assistance" /></a><div class="wps-h5"><center><?php echo esc_html_e('Assistance', 'wpshop'); ?></center></div><center><?php echo esc_html_e('To assist you in your WPShop Experience', 'wpshop'); ?></center></div>
|
|
| 17 | + <div><a href="https://shop.eoxia.com/themes/" target="_blank" title="<?php echo esc_attr('WPSHOP Themes', 'wpshop'); ?>"><img src="<?php echo esc_attr(WPSHOP_MEDIAS_IMAGES_URL); ?>themes_wpshop.jpg" alt="WPSHOP Themes" /></a><div class="wps-h5"><center><?php echo esc_html_e('WPSHOP Themes', 'wpshop'); ?></center></div><center><?php echo esc_html_e('To offer to your customer all WPShop\'s powerful experience', 'wpshop'); ?></center></div>
|
|
| 18 | + <div><a href="https://shop.eoxia.com/boutique/wpshop/" target="_blank" title="<?php echo esc_attr('WPSHOP\'s add-ons', 'wpshop'); ?>"><img src="<?php echo esc_attr(WPSHOP_MEDIAS_IMAGES_URL); ?>modules_wpshop.jpg" alt="WPSHOP Assistance" /></a><div class="wps-h5"><center><?php echo esc_html_e('WPSHOP\'s add-ons', 'wpshop'); ?></center></div><center><?php echo esc_html_e('To boost your shop with new functions', 'wpshop'); ?></center></div>
|
|
| 19 | + <div><a href="http://forums.eoxia.com" target="_blank" title="<?php echo esc_attr('WPSHOP\'s Forum', 'wpshop'); ?>"><img src="<?php echo esc_attr(WPSHOP_MEDIAS_IMAGES_URL); ?>forum_wpshop.jpg" alt="Forum Assistance" /></a><div class="wps-h5"><center><?php echo esc_html_e('WPSHOP\'s Forum', 'wpshop'); ?></center></div><center><?php esc_html_e('To respond at your questions', 'wpshop'); ?></center></div>
|
|
| 20 | 20 | </div> |
| 21 | 21 | <br/><br/> |
| 22 | - <span class="wps-h6"><?php esc_html_e( 'Be connected', 'wpshop' ); ?></span> |
|
| 22 | + <span class="wps-h6"><?php esc_html_e('Be connected', 'wpshop'); ?></span>
|
|
| 23 | 23 | <div class="wps-gridwrapper2-padded"> |
| 24 | 24 | <div> |
| 25 | 25 | <div class="fb-like" data-href="https://fr-fr.facebook.com/wpshopplugin" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div> |
@@ -32,6 +32,6 @@ discard block |
||
| 32 | 32 | </div> |
| 33 | 33 | |
| 34 | 34 | <div class="wps-boxed"> |
| 35 | - <span class="wps-h5"><?php esc_html_e( 'WPShop\'s Video Tutorials', 'wpshop' )?></span> |
|
| 35 | + <span class="wps-h5"><?php esc_html_e('WPShop\'s Video Tutorials', 'wpshop')?></span>
|
|
| 36 | 36 | <div><?php $this->wpshop_rss_tutorial_videos(); ?></div> |
| 37 | 37 | </div> |