Completed
Branch 2.0.0 (814c19)
by Jimmy
03:05
created
modules/my-account/action/class-my-account-action.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
 namespace wpshop;
16 16
 
17
-defined( 'ABSPATH' ) || exit;
17
+defined('ABSPATH') || exit;
18 18
 
19 19
 /**
20 20
  * My Account Action Class.
@@ -27,22 +27,22 @@  discard block
 block discarded – undo
27 27
 	 * @since 2.0.0
28 28
 	 */
29 29
 	public function __construct() {
30
-		add_action( 'init', array( My_Account_Shortcode::g(), 'init_shortcode' ) );
31
-		add_action( 'init', array( My_Account::g(), 'init_endpoint' ) );
30
+		add_action('init', array(My_Account_Shortcode::g(), 'init_shortcode'));
31
+		add_action('init', array(My_Account::g(), 'init_endpoint'));
32 32
 
33
-		add_action( 'wps_before_customer_login_form', array( My_Account::g(), 'before_login_form' ) );
33
+		add_action('wps_before_customer_login_form', array(My_Account::g(), 'before_login_form'));
34 34
 
35
-		add_action( 'wps_before_checkout_form', array( My_Account::g(), 'checkout_form_login' ) );
35
+		add_action('wps_before_checkout_form', array(My_Account::g(), 'checkout_form_login'));
36 36
 
37
-		add_action( 'admin_post_wps_login', array( $this, 'handle_login' ) );
38
-		add_action( 'admin_post_nopriv_wps_login', array( $this, 'handle_login' ) );
37
+		add_action('admin_post_wps_login', array($this, 'handle_login'));
38
+		add_action('admin_post_nopriv_wps_login', array($this, 'handle_login'));
39 39
 
40
-		add_action( 'wps_account_navigation', array( My_Account::g(), 'display_navigation' ) );
41
-		add_action( 'wps_account_orders', array( My_Account::g(), 'display_orders' ) );
42
-		add_action( 'wps_account_proposals', array( My_Account::g(), 'display_proposals' ) );
40
+		add_action('wps_account_navigation', array(My_Account::g(), 'display_navigation'));
41
+		add_action('wps_account_orders', array(My_Account::g(), 'display_orders'));
42
+		add_action('wps_account_proposals', array(My_Account::g(), 'display_proposals'));
43 43
 
44
-		add_action( 'wp_ajax_load_modal_resume_order', array( $this, 'load_modal_resume_order' ) );
45
-		add_action( 'wp_ajax_reorder', array( $this, 'do_reorder' ) );
44
+		add_action('wp_ajax_load_modal_resume_order', array($this, 'load_modal_resume_order'));
45
+		add_action('wp_ajax_reorder', array($this, 'do_reorder'));
46 46
 	}
47 47
 
48 48
 	/**
@@ -57,26 +57,26 @@  discard block
 block discarded – undo
57 57
 	 * @since 2.0.0
58 58
 	 */
59 59
 	public function handle_login() {
60
-		check_admin_referer( 'handle_login' );
60
+		check_admin_referer('handle_login');
61 61
 
62
-		$page = ! empty( $_POST['page'] ) ? sanitize_text_field( $_POST['page'] ) : 'my-account';
62
+		$page = !empty($_POST['page']) ? sanitize_text_field($_POST['page']) : 'my-account';
63 63
 
64
-		if ( empty( $_POST['username'] ) || empty( $_POST['password'] ) ) {
65
-			wp_redirect( site_url( $page ) );
64
+		if (empty($_POST['username']) || empty($_POST['password'])) {
65
+			wp_redirect(site_url($page));
66 66
 			exit;
67 67
 		}
68 68
 
69
-		$user = wp_signon( array(
69
+		$user = wp_signon(array(
70 70
 			'user_login'    => $_POST['username'],
71 71
 			'user_password' => $_POST['password'],
72
-		), is_ssl() );
72
+		), is_ssl());
73 73
 
74
-		if ( is_wp_error( $user ) ) {
75
-			set_transient( 'login_error_' . $_COOKIE['PHPSESSID'], __( 'Your username or password is incorrect.', 'wpshop' ), 30 );
74
+		if (is_wp_error($user)) {
75
+			set_transient('login_error_' . $_COOKIE['PHPSESSID'], __('Your username or password is incorrect.', 'wpshop'), 30);
76 76
 
77
-			wp_redirect( $page );
77
+			wp_redirect($page);
78 78
 		} else {
79
-			wp_redirect( $page );
79
+			wp_redirect($page);
80 80
 			exit;
81 81
 		}
82 82
 	}
@@ -87,31 +87,31 @@  discard block
 block discarded – undo
87 87
 	 * @since 2.0.0
88 88
 	 */
89 89
 	public function load_modal_resume_order() {
90
-		check_ajax_referer( 'load_modal_resume_order' );
90
+		check_ajax_referer('load_modal_resume_order');
91 91
 
92
-		$id = ! empty( $_POST['id'] ) ? (int) $_POST['id'] : 0;
92
+		$id = !empty($_POST['id']) ? (int)$_POST['id'] : 0;
93 93
 
94
-		if ( empty( $id ) ) {
94
+		if (empty($id)) {
95 95
 			wp_send_json_error();
96 96
 		}
97 97
 
98
-		$contact     = Contact::g()->get( array( 'id' => get_current_user_id() ), true );
99
-		$third_party = Third_Party::g()->get( array( 'id' => $contact->data['third_party_id'] ), true );
98
+		$contact     = Contact::g()->get(array('id' => get_current_user_id()), true);
99
+		$third_party = Third_Party::g()->get(array('id' => $contact->data['third_party_id']), true);
100 100
 
101
-		$order = Doli_Order::g()->get( array( 'id' => $id ), true );
101
+		$order = Doli_Order::g()->get(array('id' => $id), true);
102 102
 
103
-		if ( ( isset( $third_party->data ) && $order->data['parent_id'] != $third_party->data['id'] ) && ! current_user_can( 'administrator' ) ) {
103
+		if ((isset($third_party->data) && $order->data['parent_id'] != $third_party->data['id']) && !current_user_can('administrator')) {
104 104
 			exit;
105 105
 		}
106 106
 
107 107
 		ob_start();
108
-		\eoxia\View_Util::exec( 'wpshop', 'my-account', 'frontend/order-modal', array(
108
+		\eoxia\View_Util::exec('wpshop', 'my-account', 'frontend/order-modal', array(
109 109
 			'order' => $order,
110
-		) );
111
-		wp_send_json_success( array(
110
+		));
111
+		wp_send_json_success(array(
112 112
 			'view'         => ob_get_clean(),
113
-			'buttons_view' => '<div class="wpeo-button button-main modal-close"><span>' . __( 'Close', 'wpshop' ) . '</span></div>',
114
-		) );
113
+			'buttons_view' => '<div class="wpeo-button button-main modal-close"><span>' . __('Close', 'wpshop') . '</span></div>',
114
+		));
115 115
 	}
116 116
 
117 117
 	/**
@@ -121,39 +121,39 @@  discard block
 block discarded – undo
121 121
 	 * @since 2.0.0
122 122
 	 */
123 123
 	public function do_reorder() {
124
-		check_ajax_referer( 'do_reorder' );
124
+		check_ajax_referer('do_reorder');
125 125
 
126
-		$id = ! empty( $_POST['id'] ) ? (int) $_POST['id'] : 0;
126
+		$id = !empty($_POST['id']) ? (int)$_POST['id'] : 0;
127 127
 
128
-		if ( empty( $id ) ) {
128
+		if (empty($id)) {
129 129
 			wp_send_json_error();
130 130
 		}
131 131
 
132 132
 		Cart_Session::g()->destroy();
133 133
 
134
-		$order = Doli_Order::g()->get( array( 'id' => $id ), true );
134
+		$order = Doli_Order::g()->get(array('id' => $id), true);
135 135
 
136
-		if ( ! empty( $order->data['lines'] ) ) {
137
-			foreach ( $order->data['lines'] as $element ) {
138
-				$wp_product = Product::g()->get( array(
136
+		if (!empty($order->data['lines'])) {
137
+			foreach ($order->data['lines'] as $element) {
138
+				$wp_product = Product::g()->get(array(
139 139
 					'meta_key'   => '_external_id',
140
-					'meta_value' => (int) $element['fk_product'],
141
-				), true );
140
+					'meta_value' => (int)$element['fk_product'],
141
+				), true);
142 142
 
143
-				if ( ! empty( $wp_product ) ) {
144
-					for ( $i = 0; $i < $element['qty']; ++$i ) {
145
-						Cart::g()->add_to_cart( $wp_product );
143
+				if (!empty($wp_product)) {
144
+					for ($i = 0; $i < $element['qty']; ++$i) {
145
+						Cart::g()->add_to_cart($wp_product);
146 146
 					}
147 147
 				}
148 148
 			}
149 149
 		}
150 150
 
151
-		wp_send_json_success( array(
151
+		wp_send_json_success(array(
152 152
 			'namespace'        => 'wpshopFrontend',
153 153
 			'module'           => 'myAccount',
154 154
 			'callback_success' => 'reorderSuccess',
155 155
 			'redirect_url'     => Pages::g()->get_cart_link(),
156
-		) );
156
+		));
157 157
 	}
158 158
 }
159 159
 
Please login to merge, or discard this patch.
modules/my-account/view/frontend/my-account-orders.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -14,37 +14,37 @@  discard block
 block discarded – undo
14 14
 
15 15
 namespace wpshop;
16 16
 
17
-defined( 'ABSPATH' ) || exit;
17
+defined('ABSPATH') || exit;
18 18
 
19 19
 ?>
20 20
 
21 21
 <table class="wpeo-table">
22 22
 	<thead>
23 23
 		<tr>
24
-			<th data-title="Order"><?php esc_html_e( 'Order', 'wpshop' ); ?></th>
25
-			<th data-title="Date"><?php esc_html_e( 'Date', 'wpshop' ); ?></th>
26
-			<th data-title="Status"><?php esc_html_e( 'Status', 'wpshop' ); ?></th>
27
-			<th data-title="Total"><?php esc_html_e( 'Total HT', 'wpshop' ); ?></th>
28
-			<th data-title="Total"><?php esc_html_e( 'Total TTC', 'wpshop' ); ?></th>
29
-			<th data-title="Total"><?php esc_html_e( 'Actions', 'wpshop' ); ?></th>
24
+			<th data-title="Order"><?php esc_html_e('Order', 'wpshop'); ?></th>
25
+			<th data-title="Date"><?php esc_html_e('Date', 'wpshop'); ?></th>
26
+			<th data-title="Status"><?php esc_html_e('Status', 'wpshop'); ?></th>
27
+			<th data-title="Total"><?php esc_html_e('Total HT', 'wpshop'); ?></th>
28
+			<th data-title="Total"><?php esc_html_e('Total TTC', 'wpshop'); ?></th>
29
+			<th data-title="Total"><?php esc_html_e('Actions', 'wpshop'); ?></th>
30 30
 		</tr>
31 31
 	</thead>
32 32
 	<tbody>
33 33
 		<?php
34
-		if ( ! empty( $orders ) ) :
35
-			foreach ( $orders as $order ) :
34
+		if (!empty($orders)) :
35
+			foreach ($orders as $order) :
36 36
 				?>
37 37
 				<tr>
38
-					<td data-title="<?php echo esc_attr( $order->data['title'] ); ?>"><?php echo esc_html( $order->data['title'] ); ?></td>
39
-					<td data-title="<?php echo esc_attr( $order->data['date_commande']['rendered']['date'] ); ?>"><?php echo esc_html( $order->data['date_commande']['rendered']['date'] ); ?></td>
40
-					<td data-title="N/D"><?php echo Payment::g()->convert_status( $order->data ); ?></td>
41
-					<td data-title="<?php echo esc_attr( number_format( $order->data['total_ht'], 2, ',', '' ) ); ?>€"><?php echo esc_html( number_format( $order->data['total_ttc'], 2, ',', '' ) ); ?>€</td>
42
-					<td data-title="<?php echo esc_attr( number_format( $order->data['total_ttc'], 2, ',', '' ) ); ?>€"><?php echo esc_html( number_format( $order->data['total_ttc'], 2, ',', '' ) ); ?>€</td>
38
+					<td data-title="<?php echo esc_attr($order->data['title']); ?>"><?php echo esc_html($order->data['title']); ?></td>
39
+					<td data-title="<?php echo esc_attr($order->data['date_commande']['rendered']['date']); ?>"><?php echo esc_html($order->data['date_commande']['rendered']['date']); ?></td>
40
+					<td data-title="N/D"><?php echo Payment::g()->convert_status($order->data); ?></td>
41
+					<td data-title="<?php echo esc_attr(number_format($order->data['total_ht'], 2, ',', '')); ?>€"><?php echo esc_html(number_format($order->data['total_ttc'], 2, ',', '')); ?>€</td>
42
+					<td data-title="<?php echo esc_attr(number_format($order->data['total_ttc'], 2, ',', '')); ?>€"><?php echo esc_html(number_format($order->data['total_ttc'], 2, ',', '')); ?>€</td>
43 43
 					<td data-title="View">
44 44
 						<?php
45
-						if ( ! empty( $order->data['invoice'] ) ) :
45
+						if (!empty($order->data['invoice'])) :
46 46
 							?>
47
-							<a target="_blank" href="<?php echo esc_attr( admin_url( 'admin-post.php?action=wps_download_invoice&_wpnonce=' . wp_create_nonce( 'download_invoice' ) . '&order_id=' . $order->data['id'] ) ); ?>" class="wpeo-button button-primary">
47
+							<a target="_blank" href="<?php echo esc_attr(admin_url('admin-post.php?action=wps_download_invoice&_wpnonce=' . wp_create_nonce('download_invoice') . '&order_id=' . $order->data['id'])); ?>" class="wpeo-button button-primary">
48 48
 							<i class="button-icon fas fa-file-download"></i>
49 49
 							</a>
50 50
 							<?php
@@ -52,17 +52,17 @@  discard block
 block discarded – undo
52 52
 						?>
53 53
 
54 54
 						<div data-action="reorder"
55
-							data-nonce="<?php echo esc_attr( wp_create_nonce( 'do_reorder' ) ); ?>"
56
-							data-id="<?php echo esc_attr( $order->data['id'] ); ?>"
55
+							data-nonce="<?php echo esc_attr(wp_create_nonce('do_reorder')); ?>"
56
+							data-id="<?php echo esc_attr($order->data['id']); ?>"
57 57
 							class="action-attribute wpeo-button button-primary">
58
-						<span><?php esc_html_e( 'Reorder', 'wpshop' ); ?></span>
58
+						<span><?php esc_html_e('Reorder', 'wpshop'); ?></span>
59 59
 					</div>
60 60
 
61 61
 					<div class="wpeo-button button-primary wpeo-modal-event"
62
-					data-id="<?php echo esc_attr( $order->data['id'] ); ?>"
63
-					data-title="Commande <?php echo esc_attr( $order->data['title'] ); ?>"
62
+					data-id="<?php echo esc_attr($order->data['id']); ?>"
63
+					data-title="Commande <?php echo esc_attr($order->data['title']); ?>"
64 64
 					data-action="load_modal_resume_order">
65
-						<span><?php esc_html_e( 'Resume', 'wpshop' ); ?></span>
65
+						<span><?php esc_html_e('Resume', 'wpshop'); ?></span>
66 66
 					</div>
67 67
 
68 68
 					</td>
Please login to merge, or discard this patch.
modules/my-account/view/frontend/form-login.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -16,17 +16,17 @@  discard block
 block discarded – undo
16 16
 
17 17
 namespace wpshop;
18 18
 
19
-defined( 'ABSPATH' ) || exit;
19
+defined('ABSPATH') || exit;
20 20
 
21 21
 global $post;
22 22
 
23
-do_action( 'wps_before_customer_login_form' ); ?>
23
+do_action('wps_before_customer_login_form'); ?>
24 24
 
25 25
 <?php
26
-$transient = get_transient( 'login_error_' . $_COOKIE['PHPSESSID'] );
27
-delete_transient( 'login_error_' . $_COOKIE['PHPSESSID'] );
26
+$transient = get_transient('login_error_' . $_COOKIE['PHPSESSID']);
27
+delete_transient('login_error_' . $_COOKIE['PHPSESSID']);
28 28
 
29
-if ( ! empty( $transient ) ) :
29
+if (!empty($transient)) :
30 30
 	?>
31 31
 	<div class="notice notice-error ">
32 32
 		<p><?php echo $transient; ?></p>
@@ -35,32 +35,32 @@  discard block
 block discarded – undo
35 35
 endif;
36 36
 ?>
37 37
 
38
-<form class="wpeo-form" action="<?php echo esc_attr( admin_url( 'admin-post.php' ) ); ?>" method="post">
39
-	<?php wp_nonce_field( 'handle_login' ); ?>
38
+<form class="wpeo-form" action="<?php echo esc_attr(admin_url('admin-post.php')); ?>" method="post">
39
+	<?php wp_nonce_field('handle_login'); ?>
40 40
 	<input type="hidden" name="action" value="wps_login" />
41
-	<input type="hidden" name="page" value="<?php echo Pages::g()->get_slug_link_shop_page( $post->ID ); ?>" />
42
-	<?php do_action( 'wps_login_form_start' ); ?>
41
+	<input type="hidden" name="page" value="<?php echo Pages::g()->get_slug_link_shop_page($post->ID); ?>" />
42
+	<?php do_action('wps_login_form_start'); ?>
43 43
 
44 44
 	<div class="form-element">
45
-		<span class="form-label"><?php esc_html_e( 'Username or email address', 'wpshop' ); ?></span>
45
+		<span class="form-label"><?php esc_html_e('Username or email address', 'wpshop'); ?></span>
46 46
 		<label class="form-field-container">
47 47
 			<input type="text" class="form-field" name="username" />
48 48
 		</label>
49 49
 	</div>
50 50
 
51 51
 	<div class="form-element">
52
-		<span class="form-label"><?php esc_html_e( 'Password', 'wpshop' ); ?></span>
52
+		<span class="form-label"><?php esc_html_e('Password', 'wpshop'); ?></span>
53 53
 		<label class="form-field-container">
54 54
 			<input type="password" class="form-field" name="password" />
55 55
 		</label>
56 56
 	</div>
57 57
 
58
-	<?php do_action( 'wps_login_form' ); ?>
58
+	<?php do_action('wps_login_form'); ?>
59 59
 
60
-	<input class="wpeo-button button-main" type="submit" value="<?php esc_attr_e( 'Log in', 'wphsop' ); ?>" />
61
-	<a class="wpeo-button button-grey" href="<?php echo wp_lostpassword_url(); ?>" title="Lost Password"><?php esc_html_e( 'Lost Password', 'wpshop' ); ?></a>
60
+	<input class="wpeo-button button-main" type="submit" value="<?php esc_attr_e('Log in', 'wphsop'); ?>" />
61
+	<a class="wpeo-button button-grey" href="<?php echo wp_lostpassword_url(); ?>" title="Lost Password"><?php esc_html_e('Lost Password', 'wpshop'); ?></a>
62 62
 
63
-	<?php do_action( 'wps_login_form_end' ); ?>
63
+	<?php do_action('wps_login_form_end'); ?>
64 64
 </form>
65 65
 
66
-<?php do_action( 'wps_after_customer_login_form' ); ?>
66
+<?php do_action('wps_after_customer_login_form'); ?>
Please login to merge, or discard this patch.
modules/doli-synchro/class/class-doli-synchro.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
 namespace wpshop;
16 16
 
17
-defined( 'ABSPATH' ) || exit;
17
+defined('ABSPATH') || exit;
18 18
 
19 19
 /**
20 20
  *  Doli Synchro Class.
@@ -47,37 +47,37 @@  discard block
 block discarded – undo
47 47
 	protected function construct() {
48 48
 		$this->sync_infos = array(
49 49
 			'third-parties' => array(
50
-				'title'    => __( 'Third parties', 'wpshop' ),
50
+				'title'    => __('Third parties', 'wpshop'),
51 51
 				'action'   => 'sync_third_parties',
52 52
 				'nonce'    => 'sync_third_parties',
53 53
 				'endpoint' => 'thirdparties?limit=-1',
54 54
 			),
55 55
 			'contacts'      => array(
56
-				'title'    => __( 'Contacts', 'wpshop' ),
56
+				'title'    => __('Contacts', 'wpshop'),
57 57
 				'action'   => 'sync_contacts',
58 58
 				'nonce'    => 'sync_contacts',
59 59
 				'endpoint' => 'contacts?limit=-1',
60 60
 			),
61 61
 			'products'      => array(
62
-				'title'    => __( 'Products', 'wpshop' ),
62
+				'title'    => __('Products', 'wpshop'),
63 63
 				'action'   => 'sync_products',
64 64
 				'nonce'    => 'sync_products',
65 65
 				'endpoint' => 'products?limit=-1',
66 66
 			),
67 67
 			'proposals'     => array(
68
-				'title'    => __( 'Proposals', 'wpshop' ),
68
+				'title'    => __('Proposals', 'wpshop'),
69 69
 				'action'   => 'sync_proposals',
70 70
 				'nonce'    => 'sync_proposals',
71 71
 				'endpoint' => 'proposals?limit=-1',
72 72
 			),
73 73
 			'orders'        => array(
74
-				'title'    => __( 'Orders', 'wpshop' ),
74
+				'title'    => __('Orders', 'wpshop'),
75 75
 				'action'   => 'sync_orders',
76 76
 				'nonce'    => 'sync_orders',
77 77
 				'endpoint' => 'orders?limit=-1',
78 78
 			),
79 79
 			'invoices'      => array(
80
-				'title'    => __( 'Invoices', 'wpshop' ),
80
+				'title'    => __('Invoices', 'wpshop'),
81 81
 				'action'   => 'sync_invoices',
82 82
 				'nonce'    => 'sync_invoices',
83 83
 				'endpoint' => 'invoices?limit=-1',
Please login to merge, or discard this patch.
modules/doli-synchro/action/class-doli-synchro-action.php 1 patch
Spacing   +158 added lines, -158 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
 namespace wpshop;
16 16
 
17
-defined( 'ABSPATH' ) || exit;
17
+defined('ABSPATH') || exit;
18 18
 
19 19
 /**
20 20
  * Doli Synchro Action Class.
@@ -27,16 +27,16 @@  discard block
 block discarded – undo
27 27
 	 * @since 2.0.0
28 28
 	 */
29 29
 	public function __construct() {
30
-		add_action( 'wp_ajax_load_modal_synchro', array( $this, 'load_modal_synchro' ) );
31
-		add_action( 'wp_ajax_load_synchro_modal_single', array( $this, 'load_modal_synchro_single' ) );
32
-		add_action( 'wp_ajax_associate_and_synchronize', array( $this, 'associate_and_synchronize' ) );
33
-
34
-		add_action( 'wp_ajax_sync_third_parties', array( $this, 'sync_third_parties' ) );
35
-		add_action( 'wp_ajax_sync_contacts', array( $this, 'sync_contacts' ) );
36
-		add_action( 'wp_ajax_sync_products', array( $this, 'sync_products' ) );
37
-		add_action( 'wp_ajax_sync_proposals', array( $this, 'sync_proposals' ) );
38
-		add_action( 'wp_ajax_sync_orders', array( $this, 'sync_orders' ) );
39
-		add_action( 'wp_ajax_sync_invoices', array( $this, 'sync_invoices' ) );
30
+		add_action('wp_ajax_load_modal_synchro', array($this, 'load_modal_synchro'));
31
+		add_action('wp_ajax_load_synchro_modal_single', array($this, 'load_modal_synchro_single'));
32
+		add_action('wp_ajax_associate_and_synchronize', array($this, 'associate_and_synchronize'));
33
+
34
+		add_action('wp_ajax_sync_third_parties', array($this, 'sync_third_parties'));
35
+		add_action('wp_ajax_sync_contacts', array($this, 'sync_contacts'));
36
+		add_action('wp_ajax_sync_products', array($this, 'sync_products'));
37
+		add_action('wp_ajax_sync_proposals', array($this, 'sync_proposals'));
38
+		add_action('wp_ajax_sync_orders', array($this, 'sync_orders'));
39
+		add_action('wp_ajax_sync_invoices', array($this, 'sync_invoices'));
40 40
 	}
41 41
 
42 42
 	/**
@@ -45,30 +45,30 @@  discard block
 block discarded – undo
45 45
 	 * @since 2.0.0
46 46
 	 */
47 47
 	public function load_modal_synchro() {
48
-		check_ajax_referer( 'load_modal_synchro' );
48
+		check_ajax_referer('load_modal_synchro');
49 49
 		$sync_infos = Doli_Synchro::g()->sync_infos;
50 50
 
51
-		if ( ! empty( $sync_infos ) ) {
52
-			foreach ( $sync_infos as &$sync_info ) {
51
+		if (!empty($sync_infos)) {
52
+			foreach ($sync_infos as &$sync_info) {
53 53
 				$sync_info['total_number'] = 0;
54
-				if ( ! empty( $sync_info['endpoint'] ) ) {
55
-					$tmp = Request_Util::get( $sync_info['endpoint'] );
54
+				if (!empty($sync_info['endpoint'])) {
55
+					$tmp = Request_Util::get($sync_info['endpoint']);
56 56
 
57
-					if ( $tmp ) {
58
-						$sync_info['total_number'] = count( $tmp );
57
+					if ($tmp) {
58
+						$sync_info['total_number'] = count($tmp);
59 59
 					}
60 60
 				}
61 61
 			}
62 62
 		}
63 63
 
64 64
 		ob_start();
65
-		\eoxia\View_Util::exec( 'wpshop', 'doli-synchro', 'main', array(
65
+		\eoxia\View_Util::exec('wpshop', 'doli-synchro', 'main', array(
66 66
 			'sync_infos' => $sync_infos,
67
-		) );
67
+		));
68 68
 		$view = ob_get_clean();
69
-		wp_send_json_success( array(
69
+		wp_send_json_success(array(
70 70
 			'view' => $view,
71
-		) );
71
+		));
72 72
 	}
73 73
 
74 74
 	/**
@@ -77,52 +77,52 @@  discard block
 block discarded – undo
77 77
 	 * @since 2.0.0
78 78
 	 */
79 79
 	public function load_modal_synchro_single() {
80
-		check_ajax_referer( 'load_modal_synchro_single' );
80
+		check_ajax_referer('load_modal_synchro_single');
81 81
 
82
-		$wp_id        = ! empty( $_POST['id'] ) ? (int) $_POST['id'] : 0;
83
-		$doli_sync_id = ! empty( $_POST['entry_id'] ) ? (int) $_POST['entry_id'] : get_post_meta( $wp_id, '_external_id', true );
82
+		$wp_id        = !empty($_POST['id']) ? (int)$_POST['id'] : 0;
83
+		$doli_sync_id = !empty($_POST['entry_id']) ? (int)$_POST['entry_id'] : get_post_meta($wp_id, '_external_id', true);
84 84
 		$view         = '';
85 85
 		$buttons_view = '';
86 86
 
87
-		if ( empty( $doli_sync_id ) ) {
88
-			$third_parties = Request_Util::get( 'thirdparties?limit=-1' );
87
+		if (empty($doli_sync_id)) {
88
+			$third_parties = Request_Util::get('thirdparties?limit=-1');
89 89
 
90 90
 			ob_start();
91
-			\eoxia\View_Util::exec( 'wpshop', 'doli-synchro', 'single', array(
91
+			\eoxia\View_Util::exec('wpshop', 'doli-synchro', 'single', array(
92 92
 				'third_parties' => $third_parties,
93 93
 				'wp_id'         => $wp_id,
94
-			) );
94
+			));
95 95
 			$view = ob_get_clean();
96 96
 
97 97
 			ob_start();
98
-			\eoxia\View_Util::exec( 'wpshop', 'doli-synchro', 'single-footer' );
98
+			\eoxia\View_Util::exec('wpshop', 'doli-synchro', 'single-footer');
99 99
 			$buttons_view = ob_get_clean();
100 100
 
101
-			wp_send_json_success( array(
101
+			wp_send_json_success(array(
102 102
 				'view'         => $view,
103 103
 				'buttons_view' => $buttons_view,
104
-			) );
104
+			));
105 105
 		} else {
106
-			$doli_third_party   = Request_Util::get( 'thirdparties/' . $doli_sync_id );
107
-			$wp_third_party     = Third_Party::g()->get( array( 'id' => $wp_id ), true );
108
-			$modified_date_wp   = get_post_modified_time( 'U', false, $wp_id );
109
-			$modified_date_doli = ! empty( $doli_third_party->date_modification ) ? $doli_third_party->date_modification : $doli_third_party->date_creation;
106
+			$doli_third_party   = Request_Util::get('thirdparties/' . $doli_sync_id);
107
+			$wp_third_party     = Third_Party::g()->get(array('id' => $wp_id), true);
108
+			$modified_date_wp   = get_post_modified_time('U', false, $wp_id);
109
+			$modified_date_doli = !empty($doli_third_party->date_modification) ? $doli_third_party->date_modification : $doli_third_party->date_creation;
110 110
 
111 111
 			ob_start();
112
-			\eoxia\View_Util::exec( 'wpshop', 'doli-synchro', 'need-to-confirm', array(
112
+			\eoxia\View_Util::exec('wpshop', 'doli-synchro', 'need-to-confirm', array(
113 113
 				'date_wp'          => $modified_date_wp,
114 114
 				'date_doli'        => $modified_date_doli,
115 115
 				'doli_third_party' => $doli_third_party,
116 116
 				'wp_third_party'   => $wp_third_party,
117
-			) );
117
+			));
118 118
 			$view = ob_get_clean();
119 119
 
120
-			wp_send_json_success( array(
120
+			wp_send_json_success(array(
121 121
 				'namespace'        => 'wpshop',
122 122
 				'module'           => 'doliSynchro',
123 123
 				'callback_success' => 'loadedModalSynchroSingle',
124 124
 				'view'             => $view,
125
-			) );
125
+			));
126 126
 		}
127 127
 	}
128 128
 
@@ -134,53 +134,53 @@  discard block
 block discarded – undo
134 134
 	 * @since 2.0.0
135 135
 	 */
136 136
 	public function associate_and_synchronize() {
137
-		check_ajax_referer( 'associate_and_synchronize' );
138
-		$entry_id = ! empty( $_POST['entry_id'] ) ? (int) $_POST['entry_id'] : 0;
139
-		$wp_id    = ! empty( $_POST['wp_id'] ) ? (int) $_POST['wp_id'] : 0;
140
-		$from     = ! empty( $_POST['from'] ) ? sanitize_text_field( $_POST['from'] ) : '';
137
+		check_ajax_referer('associate_and_synchronize');
138
+		$entry_id = !empty($_POST['entry_id']) ? (int)$_POST['entry_id'] : 0;
139
+		$wp_id    = !empty($_POST['wp_id']) ? (int)$_POST['wp_id'] : 0;
140
+		$from     = !empty($_POST['from']) ? sanitize_text_field($_POST['from']) : '';
141 141
 
142
-		if ( empty( $entry_id ) || empty( $wp_id ) || empty( $from ) ) {
142
+		if (empty($entry_id) || empty($wp_id) || empty($from)) {
143 143
 			wp_send_json_error();
144 144
 		}
145 145
 
146
-		$post_type = get_post_type( $wp_id );
146
+		$post_type = get_post_type($wp_id);
147 147
 
148
-		switch ( $post_type ) {
148
+		switch ($post_type) {
149 149
 			case 'wps-third-party':
150
-				if ( 'dolibarr' === $from ) {
151
-					$doli_third_party = Request_Util::get( 'thirdparties/' . $entry_id );
152
-					$wp_third_party   = Third_Party::g()->get( array( 'id' => $wp_id ), true );
150
+				if ('dolibarr' === $from) {
151
+					$doli_third_party = Request_Util::get('thirdparties/' . $entry_id);
152
+					$wp_third_party   = Third_Party::g()->get(array('id' => $wp_id), true);
153 153
 
154
-					Doli_Third_Parties::g()->doli_to_wp( $doli_third_party, $wp_third_party );
154
+					Doli_Third_Parties::g()->doli_to_wp($doli_third_party, $wp_third_party);
155 155
 				}
156 156
 
157
-				if ( 'wp' === $from ) {
158
-					$wp_third_party   = Third_Party::g()->get( array( 'id' => $wp_id ), true );
159
-					$doli_third_party = Request_Util::get( 'thirdparties/' . $entry_id );
157
+				if ('wp' === $from) {
158
+					$wp_third_party   = Third_Party::g()->get(array('id' => $wp_id), true);
159
+					$doli_third_party = Request_Util::get('thirdparties/' . $entry_id);
160 160
 
161
-					Doli_Third_Parties::g()->wp_to_doli( $wp_third_party, $doli_third_party );
161
+					Doli_Third_Parties::g()->wp_to_doli($wp_third_party, $doli_third_party);
162 162
 				}
163 163
 				break;
164 164
 			case 'wps-product':
165
-				if ( 'dolibarr' === $from ) {
166
-					$doli_product = Request_Util::get( 'products/' . $entry_id );
167
-					$wp_product   = Product::g()->get( array( 'id' => $wp_id ), true );
165
+				if ('dolibarr' === $from) {
166
+					$doli_product = Request_Util::get('products/' . $entry_id);
167
+					$wp_product   = Product::g()->get(array('id' => $wp_id), true);
168 168
 
169
-					Doli_Products::g()->doli_to_wp( $doli_product, $wp_product );
169
+					Doli_Products::g()->doli_to_wp($doli_product, $wp_product);
170 170
 				}
171 171
 				break;
172 172
 			default:
173 173
 				break;
174 174
 		}
175 175
 
176
-		update_post_meta( $wp_id, '_last_sync', current_time( 'mysql' ) );
176
+		update_post_meta($wp_id, '_last_sync', current_time('mysql'));
177 177
 
178
-		wp_send_json_success( array(
178
+		wp_send_json_success(array(
179 179
 			'namespace'        => 'wpshop',
180 180
 			'module'           => 'doliSynchro',
181 181
 			'callback_success' => 'associatedAndSynchronized',
182 182
 			'from'             => $from,
183
-		) );
183
+		));
184 184
 	}
185 185
 
186 186
 	/**
@@ -191,45 +191,45 @@  discard block
 block discarded – undo
191 191
 	 * @since 2.0.0
192 192
 	 */
193 193
 	public function sync_third_parties() {
194
-		check_ajax_referer( 'sync_third_parties' );
194
+		check_ajax_referer('sync_third_parties');
195 195
 
196 196
 		$done         = false;
197
-		$done_number  = ! empty( $_POST['done_number'] ) ? (int) $_POST['done_number'] : 0;
198
-		$total_number = ! empty( $_POST['total_number'] ) ? (int) $_POST['total_number'] : 0;
197
+		$done_number  = !empty($_POST['done_number']) ? (int)$_POST['done_number'] : 0;
198
+		$total_number = !empty($_POST['total_number']) ? (int)$_POST['total_number'] : 0;
199 199
 
200
-		$doli_third_parties = Request_Util::get( 'thirdparties?sortfield=t.rowid&sortorder=ASC&limit=' . Doli_Synchro::g()->limit_entries_by_request . '&page=' . $done_number / Doli_Synchro::g()->limit_entries_by_request );
200
+		$doli_third_parties = Request_Util::get('thirdparties?sortfield=t.rowid&sortorder=ASC&limit=' . Doli_Synchro::g()->limit_entries_by_request . '&page=' . $done_number / Doli_Synchro::g()->limit_entries_by_request);
201 201
 
202
-		if ( ! empty( $doli_third_parties ) ) {
203
-			foreach ( $doli_third_parties as $doli_third_party ) {
204
-				$wp_third_party = Third_Party::g()->get( array(
202
+		if (!empty($doli_third_parties)) {
203
+			foreach ($doli_third_parties as $doli_third_party) {
204
+				$wp_third_party = Third_Party::g()->get(array(
205 205
 					'meta_key'   => '_external_id',
206
-					'meta_value' => (int) $doli_third_party->id,
207
-				), true );
206
+					'meta_value' => (int)$doli_third_party->id,
207
+				), true);
208 208
 
209
-				if ( empty( $wp_third_party ) ) {
210
-					$wp_third_party = Third_Party::g()->get( array( 'schema' => true ), true );
209
+				if (empty($wp_third_party)) {
210
+					$wp_third_party = Third_Party::g()->get(array('schema' => true), true);
211 211
 				}
212 212
 
213
-				Doli_Third_Parties::g()->doli_to_wp( $doli_third_party, $wp_third_party );
213
+				Doli_Third_Parties::g()->doli_to_wp($doli_third_party, $wp_third_party);
214 214
 
215 215
 				$done_number++;
216 216
 			}
217 217
 		}
218 218
 
219
-		if ( $done_number >= $total_number ) {
219
+		if ($done_number >= $total_number) {
220 220
 			$done_number = $total_number;
221 221
 			$done        = true;
222 222
 		}
223 223
 
224
-		wp_send_json_success( array(
224
+		wp_send_json_success(array(
225 225
 			'updateComplete'     => false,
226 226
 			'done'               => $done,
227 227
 			'progression'        => $done_number . '/' . $total_number,
228
-			'progressionPerCent' => 0 !== $total_number ? ( ( $done_number * 100 ) / $total_number ) : 0,
228
+			'progressionPerCent' => 0 !== $total_number ? (($done_number * 100) / $total_number) : 0,
229 229
 			'doneDescription'    => $done_number . '/' . $total_number,
230 230
 			'doneElementNumber'  => $done_number,
231 231
 			'errors'             => null,
232
-		) );
232
+		));
233 233
 	}
234 234
 
235 235
 	/**
@@ -240,45 +240,45 @@  discard block
 block discarded – undo
240 240
 	 * @since 2.0.0
241 241
 	 */
242 242
 	public function sync_contacts() {
243
-		check_ajax_referer( 'sync_contacts' );
243
+		check_ajax_referer('sync_contacts');
244 244
 
245 245
 		$done         = false;
246
-		$done_number  = ! empty( $_POST['done_number'] ) ? (int) $_POST['done_number'] : 0;
247
-		$total_number = ! empty( $_POST['total_number'] ) ? (int) $_POST['total_number'] : 0;
246
+		$done_number  = !empty($_POST['done_number']) ? (int)$_POST['done_number'] : 0;
247
+		$total_number = !empty($_POST['total_number']) ? (int)$_POST['total_number'] : 0;
248 248
 
249
-		$doli_contacts = Request_Util::get( 'contacts?sortfield=t.rowid&sortorder=ASC&limit=' . Doli_Synchro::g()->limit_entries_by_request . '&page=' . $done_number / Doli_Synchro::g()->limit_entries_by_request );
249
+		$doli_contacts = Request_Util::get('contacts?sortfield=t.rowid&sortorder=ASC&limit=' . Doli_Synchro::g()->limit_entries_by_request . '&page=' . $done_number / Doli_Synchro::g()->limit_entries_by_request);
250 250
 
251
-		if ( ! empty( $doli_contacts ) ) {
252
-			foreach ( $doli_contacts as $doli_contact ) {
253
-				$wp_contact = Contact::g()->get( array(
251
+		if (!empty($doli_contacts)) {
252
+			foreach ($doli_contacts as $doli_contact) {
253
+				$wp_contact = Contact::g()->get(array(
254 254
 					'meta_key'   => '_external_id',
255
-					'meta_value' => (int) $doli_contact->id,
256
-				), true );
255
+					'meta_value' => (int)$doli_contact->id,
256
+				), true);
257 257
 
258
-				if ( empty( $wp_contact ) ) {
259
-					$wp_contact = Contact::g()->get( array( 'schema' => true ), true );
258
+				if (empty($wp_contact)) {
259
+					$wp_contact = Contact::g()->get(array('schema' => true), true);
260 260
 				}
261 261
 
262
-				Doli_Contact::g()->doli_to_wp( $doli_contact, $wp_contact );
262
+				Doli_Contact::g()->doli_to_wp($doli_contact, $wp_contact);
263 263
 
264 264
 				$done_number++;
265 265
 			}
266 266
 		}
267 267
 
268
-		if ( $done_number >= $total_number ) {
268
+		if ($done_number >= $total_number) {
269 269
 			$done_number = $total_number;
270 270
 			$done        = true;
271 271
 		}
272 272
 
273
-		wp_send_json_success( array(
273
+		wp_send_json_success(array(
274 274
 			'updateComplete'     => false,
275 275
 			'done'               => $done,
276 276
 			'progression'        => $done_number . '/' . $total_number,
277
-			'progressionPerCent' => 0 !== $total_number ? ( ( $done_number * 100 ) / $total_number ) : 0,
277
+			'progressionPerCent' => 0 !== $total_number ? (($done_number * 100) / $total_number) : 0,
278 278
 			'doneDescription'    => $done_number . '/' . $total_number,
279 279
 			'doneElementNumber'  => $done_number,
280 280
 			'errors'             => null,
281
-		) );
281
+		));
282 282
 	}
283 283
 
284 284
 	/**
@@ -289,45 +289,45 @@  discard block
 block discarded – undo
289 289
 	 * @since 2.0.0
290 290
 	 */
291 291
 	public function sync_products() {
292
-		check_ajax_referer( 'sync_products' );
292
+		check_ajax_referer('sync_products');
293 293
 
294 294
 		$done         = false;
295
-		$done_number  = ! empty( $_POST['done_number'] ) ? (int) $_POST['done_number'] : 0;
296
-		$total_number = ! empty( $_POST['total_number'] ) ? (int) $_POST['total_number'] : 0;
295
+		$done_number  = !empty($_POST['done_number']) ? (int)$_POST['done_number'] : 0;
296
+		$total_number = !empty($_POST['total_number']) ? (int)$_POST['total_number'] : 0;
297 297
 
298
-		$doli_products = Request_Util::get( 'products?sortfield=t.rowid&sortorder=ASC&limit=' . Doli_Synchro::g()->limit_entries_by_request . '&page=' . $done_number / Doli_Synchro::g()->limit_entries_by_request );
298
+		$doli_products = Request_Util::get('products?sortfield=t.rowid&sortorder=ASC&limit=' . Doli_Synchro::g()->limit_entries_by_request . '&page=' . $done_number / Doli_Synchro::g()->limit_entries_by_request);
299 299
 
300
-		if ( ! empty( $doli_products ) ) {
301
-			foreach ( $doli_products as $doli_product ) {
302
-				$wp_product = Product::g()->get( array(
300
+		if (!empty($doli_products)) {
301
+			foreach ($doli_products as $doli_product) {
302
+				$wp_product = Product::g()->get(array(
303 303
 					'meta_key'   => '_external_id',
304
-					'meta_value' => (int) $doli_product->id,
305
-				), true );
304
+					'meta_value' => (int)$doli_product->id,
305
+				), true);
306 306
 
307
-				if ( empty( $wp_product ) ) {
308
-					$wp_product = Product::g()->get( array( 'schema' => true ), true );
307
+				if (empty($wp_product)) {
308
+					$wp_product = Product::g()->get(array('schema' => true), true);
309 309
 				}
310 310
 
311
-				Doli_Products::g()->doli_to_wp( $doli_product, $wp_product );
311
+				Doli_Products::g()->doli_to_wp($doli_product, $wp_product);
312 312
 
313 313
 				$done_number++;
314 314
 			}
315 315
 		}
316 316
 
317
-		if ( $done_number >= $total_number ) {
317
+		if ($done_number >= $total_number) {
318 318
 			$done_number = $total_number;
319 319
 			$done        = true;
320 320
 		}
321 321
 
322
-		wp_send_json_success( array(
322
+		wp_send_json_success(array(
323 323
 			'updateComplete'     => false,
324 324
 			'done'               => $done,
325 325
 			'progression'        => $done_number . '/' . $total_number,
326
-			'progressionPerCent' => 0 !== $total_number ? ( ( $done_number * 100 ) / $total_number ) : 100,
326
+			'progressionPerCent' => 0 !== $total_number ? (($done_number * 100) / $total_number) : 100,
327 327
 			'doneDescription'    => $done_number . '/' . $total_number,
328 328
 			'doneElementNumber'  => $done_number,
329 329
 			'errors'             => null,
330
-		) );
330
+		));
331 331
 	}
332 332
 
333 333
 	/**
@@ -338,45 +338,45 @@  discard block
 block discarded – undo
338 338
 	 * @since 2.0.0
339 339
 	 */
340 340
 	public function sync_proposals() {
341
-		check_ajax_referer( 'sync_proposals' );
341
+		check_ajax_referer('sync_proposals');
342 342
 
343 343
 		$done         = false;
344
-		$done_number  = ! empty( $_POST['done_number'] ) ? (int) $_POST['done_number'] : 0;
345
-		$total_number = ! empty( $_POST['total_number'] ) ? (int) $_POST['total_number'] : 0;
344
+		$done_number  = !empty($_POST['done_number']) ? (int)$_POST['done_number'] : 0;
345
+		$total_number = !empty($_POST['total_number']) ? (int)$_POST['total_number'] : 0;
346 346
 
347
-		$doli_proposals = Request_Util::get( 'proposals?sortfield=t.rowid&sortorder=ASC&limit=' . Doli_Synchro::g()->limit_entries_by_request . '&page=' . $done_number / Doli_Synchro::g()->limit_entries_by_request );
347
+		$doli_proposals = Request_Util::get('proposals?sortfield=t.rowid&sortorder=ASC&limit=' . Doli_Synchro::g()->limit_entries_by_request . '&page=' . $done_number / Doli_Synchro::g()->limit_entries_by_request);
348 348
 
349
-		if ( ! empty( $doli_proposals ) ) {
350
-			foreach ( $doli_proposals as $doli_proposal ) {
351
-				$wp_proposal = Proposals::g()->get( array(
349
+		if (!empty($doli_proposals)) {
350
+			foreach ($doli_proposals as $doli_proposal) {
351
+				$wp_proposal = Proposals::g()->get(array(
352 352
 					'meta_key'   => '_external_id',
353
-					'meta_value' => (int) $doli_proposal->id,
354
-				), true );
353
+					'meta_value' => (int)$doli_proposal->id,
354
+				), true);
355 355
 
356
-				if ( empty( $wp_proposal ) ) {
357
-					$wp_proposal = Proposals::g()->get( array( 'schema' => true ), true );
356
+				if (empty($wp_proposal)) {
357
+					$wp_proposal = Proposals::g()->get(array('schema' => true), true);
358 358
 				}
359 359
 
360
-				Doli_Proposals::g()->doli_to_wp( $doli_proposal, $wp_proposal );
360
+				Doli_Proposals::g()->doli_to_wp($doli_proposal, $wp_proposal);
361 361
 
362 362
 				$done_number++;
363 363
 			}
364 364
 		}
365 365
 
366
-		if ( $done_number >= $total_number ) {
366
+		if ($done_number >= $total_number) {
367 367
 			$done_number = $total_number;
368 368
 			$done        = true;
369 369
 		}
370 370
 
371
-		wp_send_json_success( array(
371
+		wp_send_json_success(array(
372 372
 			'updateComplete'     => false,
373 373
 			'done'               => $done,
374 374
 			'progression'        => $done_number . '/' . $total_number,
375
-			'progressionPerCent' => 0 !== $total_number ? ( ( $done_number * 100 ) / $total_number ) : 100,
375
+			'progressionPerCent' => 0 !== $total_number ? (($done_number * 100) / $total_number) : 100,
376 376
 			'doneDescription'    => $done_number . '/' . $total_number,
377 377
 			'doneElementNumber'  => $done_number,
378 378
 			'errors'             => null,
379
-		) );
379
+		));
380 380
 	}
381 381
 
382 382
 	/**
@@ -387,45 +387,45 @@  discard block
 block discarded – undo
387 387
 	 * @since 2.0.0
388 388
 	 */
389 389
 	public function sync_orders() {
390
-		check_ajax_referer( 'sync_orders' );
390
+		check_ajax_referer('sync_orders');
391 391
 
392 392
 		$done         = false;
393
-		$done_number  = ! empty( $_POST['done_number'] ) ? (int) $_POST['done_number'] : 0;
394
-		$total_number = ! empty( $_POST['total_number'] ) ? (int) $_POST['total_number'] : 0;
393
+		$done_number  = !empty($_POST['done_number']) ? (int)$_POST['done_number'] : 0;
394
+		$total_number = !empty($_POST['total_number']) ? (int)$_POST['total_number'] : 0;
395 395
 
396
-		$doli_orders = Request_Util::get( 'orders?sortfield=t.rowid&sortorder=ASC&limit=' . Doli_Synchro::g()->limit_entries_by_request . '&page=' . $done_number / Doli_Synchro::g()->limit_entries_by_request );
396
+		$doli_orders = Request_Util::get('orders?sortfield=t.rowid&sortorder=ASC&limit=' . Doli_Synchro::g()->limit_entries_by_request . '&page=' . $done_number / Doli_Synchro::g()->limit_entries_by_request);
397 397
 
398
-		if ( ! empty( $doli_orders ) ) {
399
-			foreach ( $doli_orders as $doli_order ) {
400
-				$wp_order = Doli_Order::g()->get( array(
398
+		if (!empty($doli_orders)) {
399
+			foreach ($doli_orders as $doli_order) {
400
+				$wp_order = Doli_Order::g()->get(array(
401 401
 					'meta_key'   => '_external_id',
402
-					'meta_value' => (int) $doli_order->id,
403
-				), true );
402
+					'meta_value' => (int)$doli_order->id,
403
+				), true);
404 404
 
405
-				if ( empty( $wp_order ) ) {
406
-					$wp_order = Doli_Order::g()->get( array( 'schema' => true ), true );
405
+				if (empty($wp_order)) {
406
+					$wp_order = Doli_Order::g()->get(array('schema' => true), true);
407 407
 				}
408 408
 
409
-				Doli_Order::g()->doli_to_wp( $doli_order, $wp_order );
409
+				Doli_Order::g()->doli_to_wp($doli_order, $wp_order);
410 410
 
411 411
 				$done_number++;
412 412
 			}
413 413
 		}
414 414
 
415
-		if ( $done_number >= $total_number ) {
415
+		if ($done_number >= $total_number) {
416 416
 			$done_number = $total_number;
417 417
 			$done        = true;
418 418
 		}
419 419
 
420
-		wp_send_json_success( array(
420
+		wp_send_json_success(array(
421 421
 			'updateComplete'     => false,
422 422
 			'done'               => $done,
423 423
 			'progression'        => $done_number . '/' . $total_number,
424
-			'progressionPerCent' => 0 !== $total_number ? ( ( $done_number * 100 ) / $total_number ) : 100,
424
+			'progressionPerCent' => 0 !== $total_number ? (($done_number * 100) / $total_number) : 100,
425 425
 			'doneDescription'    => $done_number . '/' . $total_number,
426 426
 			'doneElementNumber'  => $done_number,
427 427
 			'errors'             => null,
428
-		) );
428
+		));
429 429
 	}
430 430
 
431 431
 	/**
@@ -436,45 +436,45 @@  discard block
 block discarded – undo
436 436
 	 * @since 2.0.0
437 437
 	 */
438 438
 	public function sync_invoices() {
439
-		check_ajax_referer( 'sync_invoices' );
439
+		check_ajax_referer('sync_invoices');
440 440
 
441 441
 		$done         = false;
442
-		$done_number  = ! empty( $_POST['done_number'] ) ? (int) $_POST['done_number'] : 0;
443
-		$total_number = ! empty( $_POST['total_number'] ) ? (int) $_POST['total_number'] : 0;
442
+		$done_number  = !empty($_POST['done_number']) ? (int)$_POST['done_number'] : 0;
443
+		$total_number = !empty($_POST['total_number']) ? (int)$_POST['total_number'] : 0;
444 444
 
445
-		$doli_invoices = Request_Util::get( 'invoices?sortfield=t.rowid&sortorder=ASC&limit=' . Doli_Synchro::g()->limit_entries_by_request . '&page=' . $done_number / Doli_Synchro::g()->limit_entries_by_request );
445
+		$doli_invoices = Request_Util::get('invoices?sortfield=t.rowid&sortorder=ASC&limit=' . Doli_Synchro::g()->limit_entries_by_request . '&page=' . $done_number / Doli_Synchro::g()->limit_entries_by_request);
446 446
 
447
-		if ( ! empty( $doli_invoices ) ) {
448
-			foreach ( $doli_invoices as $doli_invoice ) {
449
-				$wp_invoice = Doli_Invoice::g()->get( array(
447
+		if (!empty($doli_invoices)) {
448
+			foreach ($doli_invoices as $doli_invoice) {
449
+				$wp_invoice = Doli_Invoice::g()->get(array(
450 450
 					'meta_key'   => '_external_id',
451
-					'meta_value' => (int) $doli_invoice->id,
452
-				), true );
451
+					'meta_value' => (int)$doli_invoice->id,
452
+				), true);
453 453
 
454
-				if ( empty( $wp_invoice ) ) {
455
-					$wp_invoice = Doli_Invoice::g()->get( array( 'schema' => true ), true );
454
+				if (empty($wp_invoice)) {
455
+					$wp_invoice = Doli_Invoice::g()->get(array('schema' => true), true);
456 456
 				}
457 457
 
458
-				Doli_Invoice::g()->doli_to_wp( $doli_invoice, $wp_invoice );
458
+				Doli_Invoice::g()->doli_to_wp($doli_invoice, $wp_invoice);
459 459
 
460 460
 				$done_number++;
461 461
 			}
462 462
 		}
463 463
 
464
-		if ( $done_number >= $total_number ) {
464
+		if ($done_number >= $total_number) {
465 465
 			$done_number = $total_number;
466 466
 			$done        = true;
467 467
 		}
468 468
 
469
-		wp_send_json_success( array(
469
+		wp_send_json_success(array(
470 470
 			'updateComplete'     => false,
471 471
 			'done'               => $done,
472 472
 			'progression'        => $done_number . '/' . $total_number,
473
-			'progressionPerCent' => 0 !== $total_number ? ( ( $done_number * 100 ) / $total_number ) : 100,
473
+			'progressionPerCent' => 0 !== $total_number ? (($done_number * 100) / $total_number) : 100,
474 474
 			'doneDescription'    => $done_number . '/' . $total_number,
475 475
 			'doneElementNumber'  => $done_number,
476 476
 			'errors'             => null,
477
-		) );
477
+		));
478 478
 	}
479 479
 }
480 480
 
Please login to merge, or discard this patch.
modules/doli-synchro/view/main.view.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -14,12 +14,12 @@  discard block
 block discarded – undo
14 14
 
15 15
 namespace wpshop;
16 16
 
17
-defined( 'ABSPATH' ) || exit; ?>
17
+defined('ABSPATH') || exit; ?>
18 18
 
19 19
 <div class="wpeo-gridlayout grid-3">
20 20
 	<?php
21
-	if ( ! empty( $sync_infos ) ) :
22
-		foreach ( $sync_infos as $key => $info ) :
21
+	if (!empty($sync_infos)) :
22
+		foreach ($sync_infos as $key => $info) :
23 23
 			$stats = '0 / ' . $info['total_number'];
24 24
 			?>
25 25
 			<div>
@@ -29,18 +29,18 @@  discard block
 block discarded – undo
29 29
 						<i class="icon dashicons" ></i>
30 30
 					</div>
31 31
 					<div class="item-container">
32
-						<form action="<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>" method="POST">
33
-							<input type="hidden" name="action" value="<?php echo esc_attr( $info['action'] ); ?>" />
34
-							<?php wp_nonce_field( $info['nonce'] ); ?>
32
+						<form action="<?php echo esc_url(admin_url('admin-ajax.php')); ?>" method="POST">
33
+							<input type="hidden" name="action" value="<?php echo esc_attr($info['action']); ?>" />
34
+							<?php wp_nonce_field($info['nonce']); ?>
35 35
 							<div class="item-content" >
36
-								<div class="item-title"><?php echo esc_attr( $info['title'] ); ?></div>
36
+								<div class="item-title"><?php echo esc_attr($info['title']); ?></div>
37 37
 							</div>
38 38
 							<div class="item-result" >
39
-								<input type="hidden" name="total_number" value="<?php echo ( null !== $info['total_number'] ? esc_attr( $info['total_number'] ) : 0 ); ?>" />
39
+								<input type="hidden" name="total_number" value="<?php echo (null !== $info['total_number'] ? esc_attr($info['total_number']) : 0); ?>" />
40 40
 								<input type="hidden" name="done_number" value="0" />
41 41
 								<div class="item-progress" >
42 42
 									<div class="item-progression" >&nbsp;</div>
43
-									<div class="item-stats" ><?php echo esc_html( $stats ); ?></div>
43
+									<div class="item-stats" ><?php echo esc_html($stats); ?></div>
44 44
 								</div>
45 45
 							</div>
46 46
 						</form>
Please login to merge, or discard this patch.
modules/doli-synchro/view/need-to-confirm.view.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 
17 17
 namespace wpshop;
18 18
 
19
-defined( 'ABSPATH' ) || exit; ?>
19
+defined('ABSPATH') || exit; ?>
20 20
 
21 21
 <div class="wpeo-modal need-to-confirm modal-active">
22 22
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 			<div class="content">
27 27
 				<h3>Synchronisation terminée</h3>
28 28
 
29
-				<a href="<?php echo esc_attr( admin_url( 'admin.php?page=wps-third-party&id=' . $wp_third_party->data['id'] ) ); ?>" class="wpeo-button button-main">
29
+				<a href="<?php echo esc_attr(admin_url('admin.php?page=wps-third-party&id=' . $wp_third_party->data['id'])); ?>" class="wpeo-button button-main">
30 30
 					<span>Rafraichir la page</span>
31 31
 				</a>
32 32
 			</div>
@@ -39,47 +39,47 @@  discard block
 block discarded – undo
39 39
 		</div>
40 40
 
41 41
 		<?php
42
-		$date_time_wp   = new \DateTime( date( 'Y-m-d H:i:s', $date_wp ) );
43
-		$date_time_doli = new \DateTime( date( 'Y-m-d H:i:s', $date_doli ) );
42
+		$date_time_wp   = new \DateTime(date('Y-m-d H:i:s', $date_wp));
43
+		$date_time_doli = new \DateTime(date('Y-m-d H:i:s', $date_doli));
44 44
 
45 45
 		?>
46 46
 		<h3>
47 47
 			<?php
48
-			if ( $date_wp > $date_doli ) :
49
-				$interval = $date_time_wp->diff( $date_time_doli );
48
+			if ($date_wp > $date_doli) :
49
+				$interval = $date_time_wp->diff($date_time_doli);
50 50
 				?>
51 51
 				Les données du tier sont plus récentes de<strong style="font-weight: 700">
52 52
 				<span>
53 53
 					<?php
54
-					if ( $interval->format( '%a' ) != 0 ) :
55
-						echo $interval->format( '%a jour(s) et ' );
54
+					if ($interval->format('%a') != 0) :
55
+						echo $interval->format('%a jour(s) et ');
56 56
 					endif;
57 57
 
58
-					if ( $interval->format( '%h' ) != 0 ) :
59
-						echo $interval->format( '%hh' );
58
+					if ($interval->format('%h') != 0) :
59
+						echo $interval->format('%hh');
60 60
 					endif;
61 61
 
62
-					echo $interval->format( '%imin' );
62
+					echo $interval->format('%imin');
63 63
 					?>
64 64
 					</strong> sur
65 65
 					<strong style="font-weight: 700">WordPress</strong>.
66 66
 				</span>
67 67
 				<?php
68
-			elseif ( $date_wp < $date_doli ) :
69
-				$interval = $date_time_doli->diff( $date_time_wp );
68
+			elseif ($date_wp < $date_doli) :
69
+				$interval = $date_time_doli->diff($date_time_wp);
70 70
 				?>
71 71
 				Les données du tier sont plus récentes de<strong style="font-weight: 700">
72 72
 				<span>
73 73
 					<?php
74
-					if ( $interval->format( '%a' ) != 0 ) :
75
-						echo $interval->format( '%a jour(s) et ' );
74
+					if ($interval->format('%a') != 0) :
75
+						echo $interval->format('%a jour(s) et ');
76 76
 					endif;
77 77
 
78
-					if ( $interval->format( '%h' ) != 0 ) :
79
-						echo $interval->format( '%hh' );
78
+					if ($interval->format('%h') != 0) :
79
+						echo $interval->format('%hh');
80 80
 					endif;
81 81
 
82
-					echo $interval->format( '%imin' );
82
+					echo $interval->format('%imin');
83 83
 					?>
84 84
 					</strong> sur <strong style="font-weight: 700">Dolibarr</strong>.
85 85
 				</span>
@@ -99,19 +99,19 @@  discard block
 block discarded – undo
99 99
 				<div class="choose wp">
100 100
 					<h3>WordPress</h3>
101 101
 
102
-					<p>Dernière modification le <?php echo date( 'd/m/Y H:i:s', $date_wp ); ?></p>
102
+					<p>Dernière modification le <?php echo date('d/m/Y H:i:s', $date_wp); ?></p>
103 103
 
104 104
 					<ul>
105
-						<li><strong>Nom</strong>: <?php echo ! empty( $wp_third_party->data['title'] ) ? esc_html( $wp_third_party->data['title'] ) : 'Non définie'; ?></li>
106
-						<li><strong>Adresse</strong>: <?php echo ! empty( $wp_third_party->data['address'] ) ? esc_html( $wp_third_party->data['address'] ) : 'Non définie'; ?></li>
107
-						<li><strong>Code postal</strong>: <?php echo ! empty( $wp_third_party->data['zip'] ) ? esc_html( $wp_third_party->data['zip'] ) : 'Non définie'; ?></li>
108
-						<li><strong>Ville</strong>: <?php echo ! empty( $wp_third_party->data['town'] ) ? esc_html( $wp_third_party->data['town'] ) : 'Non définie'; ?></li>
109
-						<li><strong>Téléphone</strong>: <?php echo ! empty( $wp_third_party->data['phone'] ) ? esc_html( $wp_third_party->data['phone'] ) : 'Non définie'; ?></li>
105
+						<li><strong>Nom</strong>: <?php echo !empty($wp_third_party->data['title']) ? esc_html($wp_third_party->data['title']) : 'Non définie'; ?></li>
106
+						<li><strong>Adresse</strong>: <?php echo !empty($wp_third_party->data['address']) ? esc_html($wp_third_party->data['address']) : 'Non définie'; ?></li>
107
+						<li><strong>Code postal</strong>: <?php echo !empty($wp_third_party->data['zip']) ? esc_html($wp_third_party->data['zip']) : 'Non définie'; ?></li>
108
+						<li><strong>Ville</strong>: <?php echo !empty($wp_third_party->data['town']) ? esc_html($wp_third_party->data['town']) : 'Non définie'; ?></li>
109
+						<li><strong>Téléphone</strong>: <?php echo !empty($wp_third_party->data['phone']) ? esc_html($wp_third_party->data['phone']) : 'Non définie'; ?></li>
110 110
 						<li>
111 111
 							<div class="action-attribute wpeo-button button-main"
112 112
 								style="text-align: center;display: block;margin: auto;width: 50%;"
113 113
 								data-action="associate_and_synchronize"
114
-								data-nonce="<?php echo esc_attr( wp_create_nonce( 'associate_and_synchronize' ) ); ?>"
114
+								data-nonce="<?php echo esc_attr(wp_create_nonce('associate_and_synchronize')); ?>"
115 115
 								data-entry-id="<?php echo $doli_third_party->id; ?>"
116 116
 								data-wp-id="<?php echo $wp_third_party->data['id']; ?>"
117 117
 								data-from="wordpress">
@@ -124,19 +124,19 @@  discard block
 block discarded – undo
124 124
 				<div class="choose dolibarr">
125 125
 					<h3>Dolibarr</h3>
126 126
 
127
-					<p>Dernière modification le <?php echo date( 'd/m/Y H:i:s', $date_doli ); ?></p>
127
+					<p>Dernière modification le <?php echo date('d/m/Y H:i:s', $date_doli); ?></p>
128 128
 
129 129
 					<ul>
130
-						<li><strong>Nom</strong>: <?php echo ! empty( $doli_third_party->name ) ? esc_html( $doli_third_party->name ) : 'Non définie'; ?></li>
131
-						<li><strong>Adresse</strong>: <?php echo ! empty( $doli_third_party->address ) ? esc_html( $doli_third_party->address ) : 'Non définie'; ?></li>
132
-						<li><strong>Code postal</strong>: <?php echo ! empty( $doli_third_party->zip ) ? esc_html( $doli_third_party->zip ) : 'Non définie'; ?></li>
133
-						<li><strong>Ville</strong>: <?php echo ! empty( $doli_third_party->town ) ? esc_html( $doli_third_party->town ) : 'Non définie'; ?></li>
134
-						<li><strong>Téléphone</strong>: <?php echo ! empty( $doli_third_party->phone ) ? esc_html( $doli_third_party->phone ) : 'Non définie'; ?></li>
130
+						<li><strong>Nom</strong>: <?php echo !empty($doli_third_party->name) ? esc_html($doli_third_party->name) : 'Non définie'; ?></li>
131
+						<li><strong>Adresse</strong>: <?php echo !empty($doli_third_party->address) ? esc_html($doli_third_party->address) : 'Non définie'; ?></li>
132
+						<li><strong>Code postal</strong>: <?php echo !empty($doli_third_party->zip) ? esc_html($doli_third_party->zip) : 'Non définie'; ?></li>
133
+						<li><strong>Ville</strong>: <?php echo !empty($doli_third_party->town) ? esc_html($doli_third_party->town) : 'Non définie'; ?></li>
134
+						<li><strong>Téléphone</strong>: <?php echo !empty($doli_third_party->phone) ? esc_html($doli_third_party->phone) : 'Non définie'; ?></li>
135 135
 						<li>
136 136
 							<div class="action-attribute wpeo-button button-main"
137 137
 								style="text-align: center;display: block;margin: auto;width: 50%;"
138 138
 								data-action="associate_and_synchronize"
139
-								data-nonce="<?php echo esc_attr( wp_create_nonce( 'associate_and_synchronize' ) ); ?>"
139
+								data-nonce="<?php echo esc_attr(wp_create_nonce('associate_and_synchronize')); ?>"
140 140
 								data-entry-id="<?php echo $doli_third_party->id; ?>"
141 141
 								data-wp-id="<?php echo $wp_third_party->data['id']; ?>"
142 142
 								data-from="dolibarr"
Please login to merge, or discard this patch.
modules/doli-synchro/view/single-footer.view.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
 namespace wpshop;
16 16
 
17
-defined( 'ABSPATH' ) || exit; ?>
17
+defined('ABSPATH') || exit; ?>
18 18
 
19 19
 
20 20
 <div class="wpeo-button button-light modal-close">
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
 <div class="wpeo-button button-main action-input"
25 25
 	data-action="load_synchro_modal_single"
26
-	data-nonce="<?php echo esc_attr( wp_create_nonce( 'load_modal_synchro_single' ) ); ?>"
26
+	data-nonce="<?php echo esc_attr(wp_create_nonce('load_modal_synchro_single')); ?>"
27 27
 	data-parent="wpeo-modal">
28 28
 	<span>Associer et synchroniser</span>
29 29
 </div>
Please login to merge, or discard this patch.
modules/dashboard/view/metaboxes/metabox-sync.view.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,12 +14,12 @@
 block discarded – undo
14 14
 
15 15
 namespace wpshop;
16 16
 
17
-defined( 'ABSPATH' ) || exit; ?>
17
+defined('ABSPATH') || exit; ?>
18 18
 
19 19
 <div class="wpeo-button button-main wpeo-modal-event"
20 20
 	data-action="load_modal_synchro"
21
-	data-nonce="<?php echo esc_attr( wp_create_nonce( 'load_modal_synchro' ) ); ?>"
21
+	data-nonce="<?php echo esc_attr(wp_create_nonce('load_modal_synchro')); ?>"
22 22
 	data-class="modal-sync"
23
-	data-title="<?php echo esc_attr_e( 'Data synchronization', 'wpshop' ); ?>">
24
-	<span><?php esc_html_e( 'Synchronization', 'wpshop' ); ?></span>
23
+	data-title="<?php echo esc_attr_e('Data synchronization', 'wpshop'); ?>">
24
+	<span><?php esc_html_e('Synchronization', 'wpshop'); ?></span>
25 25
 </div>
Please login to merge, or discard this patch.