Completed
Branch 2.0.0 (fb6d70)
by Jimmy
02:28
created
modules/third-parties/view/metaboxes/metabox-billing-address.view.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -14,24 +14,24 @@
 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="wps-metabox wps-billing-address view gridw-3">
20
-	<h3 class="metabox-title"><?php esc_html_e( 'Address', 'wpshop' ); ?></h3>
20
+	<h3 class="metabox-title"><?php esc_html_e('Address', 'wpshop'); ?></h3>
21 21
 
22 22
 	<!-- <div data-action="third_party_load_address"
23
-		data-nonce="<?php echo esc_attr( wp_create_nonce( 'load_billing_address' ) ); ?>"
24
-		data-third-party_id="<?php echo esc_attr( $third_party->data['id'] ); ?>"
23
+		data-nonce="<?php echo esc_attr(wp_create_nonce('load_billing_address')); ?>"
24
+		data-third-party_id="<?php echo esc_attr($third_party->data['id']); ?>"
25 25
 		class="action-attribute metabox-edit wpeo-button button-grey button-square-30 button-rounded">
26 26
 		<i class="button-icon fas fa-pen"></i>
27 27
 	</div> -->
28 28
 
29 29
 	<ul class="metabox-list wpeo-gridlayout grid-2">
30
-		<li><span><?php esc_html_e( 'Name', 'wpshop' ); ?></span> <?php echo esc_html( $third_party->data['title'] ); ?></li>
31
-		<li><span><?php esc_html_e( 'Address', 'wpshop' ); ?></span> <?php echo $third_party->data['address']; ?></li>
32
-		<li><span><?php esc_html_e( 'ZIP Code', 'wpshop' ); ?></span> <?php echo $third_party->data['zip']; ?></li>
33
-		<li><span><?php esc_html_e( 'City', 'wpshop' ); ?></span> <?php echo $third_party->data['town']; ?></li>
34
-		<li><span><?php esc_html_e( 'Country', 'wpshop' ); ?></span> <?php echo $third_party->data['country']; ?></li>
35
-		<li><span><?php esc_html_e( 'Phone', 'wpshop' ); ?></span> <?php echo $third_party->data['phone']; ?></li>
30
+		<li><span><?php esc_html_e('Name', 'wpshop'); ?></span> <?php echo esc_html($third_party->data['title']); ?></li>
31
+		<li><span><?php esc_html_e('Address', 'wpshop'); ?></span> <?php echo $third_party->data['address']; ?></li>
32
+		<li><span><?php esc_html_e('ZIP Code', 'wpshop'); ?></span> <?php echo $third_party->data['zip']; ?></li>
33
+		<li><span><?php esc_html_e('City', 'wpshop'); ?></span> <?php echo $third_party->data['town']; ?></li>
34
+		<li><span><?php esc_html_e('Country', 'wpshop'); ?></span> <?php echo $third_party->data['country']; ?></li>
35
+		<li><span><?php esc_html_e('Phone', 'wpshop'); ?></span> <?php echo $third_party->data['phone']; ?></li>
36 36
 	</ul>
37 37
 </div>
Please login to merge, or discard this patch.
modules/third-parties/view/metaboxes/metabox-proposals.view.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -14,32 +14,32 @@
 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="wps-metabox wps-billing-address view gridw-2">
20
-	<h3 class="metabox-title"><?php esc_html_e( 'Proposals' ); ?></h3>
20
+	<h3 class="metabox-title"><?php esc_html_e('Proposals'); ?></h3>
21 21
 
22 22
 	<div class="wpeo-table table-flex table-4">
23 23
 		<div class="table-row table-header">
24
-			<div class="table-cell"><?php esc_html_e( 'Proposal', 'wpshop' ); ?></div>
25
-			<div class="table-cell"><?php esc_html_e( 'Date', 'wpshop' ); ?></div>
26
-			<div class="table-cell"><?php esc_html_e( '€ TTC', 'wpshop' ); ?></div>
27
-			<div class="table-cell"><?php esc_html_e( 'Status', 'wpshop' ); ?></div>
24
+			<div class="table-cell"><?php esc_html_e('Proposal', 'wpshop'); ?></div>
25
+			<div class="table-cell"><?php esc_html_e('Date', 'wpshop'); ?></div>
26
+			<div class="table-cell"><?php esc_html_e('€ TTC', 'wpshop'); ?></div>
27
+			<div class="table-cell"><?php esc_html_e('Status', 'wpshop'); ?></div>
28 28
 		</div>
29 29
 
30 30
 		<?php
31
-		if ( ! empty( $proposals ) ) :
32
-			foreach ( $proposals as $proposal ) :
31
+		if (!empty($proposals)) :
32
+			foreach ($proposals as $proposal) :
33 33
 				?>
34 34
 				<div class="table-row">
35 35
 					<div class="table-cell">
36
-						<a href="<?php echo esc_attr( $doli_url . '/comm/propal/card.php?id=' . $proposal->data['external_id'] ); ?>">
37
-							<?php echo esc_html( $proposal->data['title'] ); ?>
36
+						<a href="<?php echo esc_attr($doli_url . '/comm/propal/card.php?id=' . $proposal->data['external_id']); ?>">
37
+							<?php echo esc_html($proposal->data['title']); ?>
38 38
 						</a>
39 39
 					</div>
40
-					<div class="table-cell"><?php echo esc_html( $proposal->data['datec']['rendered']['date'] ); ?></div>
41
-					<div class="table-cell"><?php echo esc_html( number_format( $proposal->data['total_ttc'], 2, ',', '' ) ); ?>€</div>
42
-					<div class="table-cell"><strong><?php echo Doli_Statut::g()->display_status( $proposal ); ?></strong></div>
40
+					<div class="table-cell"><?php echo esc_html($proposal->data['datec']['rendered']['date']); ?></div>
41
+					<div class="table-cell"><?php echo esc_html(number_format($proposal->data['total_ttc'], 2, ',', '')); ?>€</div>
42
+					<div class="table-cell"><strong><?php echo Doli_Statut::g()->display_status($proposal); ?></strong></div>
43 43
 				</div>
44 44
 				<?php
45 45
 			endforeach;
Please login to merge, or discard this patch.
modules/third-parties/view/metaboxes/metabox-orders.view.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -14,32 +14,32 @@
 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="wps-metabox wps-billing-address view gridw-2">
20
-	<h3 class="metabox-title"><?php esc_html_e( 'Orders' ); ?></h3>
20
+	<h3 class="metabox-title"><?php esc_html_e('Orders'); ?></h3>
21 21
 
22 22
 	<div class="wpeo-table table-flex table-4">
23 23
 		<div class="table-row table-header">
24
-			<div class="table-cell"><?php esc_html_e( 'Order', 'wpshop' ); ?></div>
25
-			<div class="table-cell"><?php esc_html_e( 'Date', 'wpshop' ); ?></div>
26
-			<div class="table-cell"><?php esc_html_e( '€ TTC', 'wpshop' ); ?></div>
27
-			<div class="table-cell"><?php esc_html_e( 'Status', 'wpshop' ); ?></div>
24
+			<div class="table-cell"><?php esc_html_e('Order', 'wpshop'); ?></div>
25
+			<div class="table-cell"><?php esc_html_e('Date', 'wpshop'); ?></div>
26
+			<div class="table-cell"><?php esc_html_e('€ TTC', 'wpshop'); ?></div>
27
+			<div class="table-cell"><?php esc_html_e('Status', 'wpshop'); ?></div>
28 28
 		</div>
29 29
 
30 30
 		<?php
31
-		if ( ! empty( $orders ) ) :
32
-			foreach ( $orders as $order ) :
31
+		if (!empty($orders)) :
32
+			foreach ($orders as $order) :
33 33
 				?>
34 34
 				<div class="table-row">
35 35
 					<div class="table-cell">
36
-						<a href="<?php echo admin_url( 'admin.php?page=wps-order&id=' . $order->data['id'] ); ?>">
37
-							<?php echo esc_html( $order->data['title'] ); ?>
36
+						<a href="<?php echo admin_url('admin.php?page=wps-order&id=' . $order->data['id']); ?>">
37
+							<?php echo esc_html($order->data['title']); ?>
38 38
 						</a>
39 39
 					</div>
40
-					<div class="table-cell"><?php echo esc_html( $order->data['datec']['rendered']['date'] ); ?></div>
41
-					<div class="table-cell"><?php echo esc_html( number_format( $order->data['total_ttc'], 2, ',', '' ) ); ?>€</div>
42
-					<div class="table-cell"><strong><?php echo Doli_Statut::g()->display_status( $order ); ?></strong></div>
40
+					<div class="table-cell"><?php echo esc_html($order->data['datec']['rendered']['date']); ?></div>
41
+					<div class="table-cell"><?php echo esc_html(number_format($order->data['total_ttc'], 2, ',', '')); ?>€</div>
42
+					<div class="table-cell"><strong><?php echo Doli_Statut::g()->display_status($order); ?></strong></div>
43 43
 				</div>
44 44
 				<?php
45 45
 			endforeach;
Please login to merge, or discard this patch.
modules/third-parties/view/metaboxes/metabox-indicator.view.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,24 +14,24 @@
 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="wps-metabox wps-billing-address view gridw-6">
20
-	<h3 class="metabox-title"><?php esc_html_e( 'Indicator' ); ?></h3>
20
+	<h3 class="metabox-title"><?php esc_html_e('Indicator'); ?></h3>
21 21
 
22 22
 	<?php
23
-	$currentyear = date( 'Y', strtotime( 'now' ) );
23
+	$currentyear = date('Y', strtotime('now'));
24 24
 
25 25
 	ob_start();
26
-	\eoxia\View_Util::exec( 'task-manager', 'task', 'backend/metabox-head-indicator', array(
26
+	\eoxia\View_Util::exec('task-manager', 'task', 'backend/metabox-head-indicator', array(
27 27
 		'parent_id'   => $post->ID,
28 28
 		'year'        => $currentyear,
29 29
 		'post_id'     => $post->ID,
30 30
 		'post_author' => $post->post_author,
31
-	) );
31
+	));
32 32
 	$button_indicator = ob_get_clean();
33 33
 
34
-	echo apply_filters( 'tm_posts_metabox_buttons', $button_indicator );
35
-	\task_manager\Task_Class::g()->callback_render_indicator( $post, array(), array(), $post->ID );
34
+	echo apply_filters('tm_posts_metabox_buttons', $button_indicator);
35
+	\task_manager\Task_Class::g()->callback_render_indicator($post, array(), array(), $post->ID);
36 36
 	?>
37 37
 </div>
Please login to merge, or discard this patch.
modules/api/view/field-api.view.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,21 +14,21 @@
 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="wpshop-fields">
20
-	<h2><?php esc_html_e( 'WPshop API', 'wpshop' ); ?></h2>
20
+	<h2><?php esc_html_e('WPshop API', 'wpshop'); ?></h2>
21 21
 
22 22
 	<table class="form-table">
23 23
 		<tbody>
24 24
 			<tr class="user-api-wrap">
25
-				<th><label for="api"><?php esc_html_e( 'API Key', 'wpshop' ); ?></label></th>
25
+				<th><label for="api"><?php esc_html_e('API Key', 'wpshop'); ?></label></th>
26 26
 				<td>
27
-					<input type="text" readonly name="api" id="api" aria-describedby="api-description" value="<?php echo esc_attr( $token ); ?>" class="regular-text ltr">
27
+					<input type="text" readonly name="api" id="api" aria-describedby="api-description" value="<?php echo esc_attr($token); ?>" class="regular-text ltr">
28 28
 					<i class="wpeo-button fas fa-redo action-attribute"
29
-						data-action="<?php echo esc_attr( 'generate_api_key' ); ?>"
30
-						data-nonce="<?php echo wp_create_nonce( 'generate_api_key' ); ?>"
31
-						data-id="<?php echo esc_attr( $id ); ?>"></i>
29
+						data-action="<?php echo esc_attr('generate_api_key'); ?>"
30
+						data-nonce="<?php echo wp_create_nonce('generate_api_key'); ?>"
31
+						data-id="<?php echo esc_attr($id); ?>"></i>
32 32
 				</td>
33 33
 			</tr>
34 34
 		</tbody>
Please login to merge, or discard this patch.
modules/api/class/class-api.php 1 patch
Spacing   +11 added lines, -11 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
  * API Class.
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
 	public function generate_token() {
39 39
 		$length            = 20;
40 40
 		$characters        = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_][-&';
41
-		$characters_length = strlen( $characters );
41
+		$characters_length = strlen($characters);
42 42
 
43 43
 		$token = '';
44 44
 
45
-		for ( $i = 0; $i < $length; $i++ ) {
46
-			$token .= $characters[ rand( 0, $characters_length - 1) ];
45
+		for ($i = 0; $i < $length; $i++) {
46
+			$token .= $characters[rand(0, $characters_length - 1)];
47 47
 		}
48 48
 
49 49
 		return $token;
@@ -59,21 +59,21 @@  discard block
 block discarded – undo
59 59
 	 * @return User_Model|null Les données de l'utilisateur ou NULL si aucun
60 60
 	 * utilisateur correspond au token.
61 61
 	 */
62
-	public function get_user_by_token( $token ) {
63
-		$users = get_users( array(
62
+	public function get_user_by_token($token) {
63
+		$users = get_users(array(
64 64
 			'meta_key'   => '_wpshop_api_key',
65 65
 			'meta_value' => $token,
66 66
 			'number'     => 1,
67
-		) );
67
+		));
68 68
 
69
-		if ( empty( $users ) ) {
69
+		if (empty($users)) {
70 70
 			return null;
71 71
 		}
72 72
 
73
-		if ( ! empty( $users ) && 1 === count( $users ) ) {
74
-			$token_base = get_user_meta( $users[0]->ID, '_wpshop_api_key', true );
73
+		if (!empty($users) && 1 === count($users)) {
74
+			$token_base = get_user_meta($users[0]->ID, '_wpshop_api_key', true);
75 75
 
76
-			if ( $token_base !== $token ) {
76
+			if ($token_base !== $token) {
77 77
 				return false;
78 78
 			}
79 79
 
Please login to merge, or discard this patch.
modules/settings/view/payment-method.view.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -14,27 +14,27 @@
 block discarded – undo
14 14
 
15 15
 namespace wpshop;
16 16
 
17
-defined( 'ABSPATH' ) || exit; ?>
17
+defined('ABSPATH') || exit; ?>
18 18
 
19 19
 <table class="wpeo-table">
20 20
 	<thead>
21 21
 		<tr>
22
-			<th><?php esc_html_e( 'Method', 'wpshop' ); ?></th>
23
-			<th><?php esc_html_e( 'Activated', 'wpshop' ); ?></th>
24
-			<th><?php esc_html_e( 'Settings', 'wpshop' ); ?></th>
22
+			<th><?php esc_html_e('Method', 'wpshop'); ?></th>
23
+			<th><?php esc_html_e('Activated', 'wpshop'); ?></th>
24
+			<th><?php esc_html_e('Settings', 'wpshop'); ?></th>
25 25
 		</tr>
26 26
 	</thead>
27 27
 	<tbody>
28 28
 		<?php
29
-		if ( ! empty( $payment_methods ) ) :
30
-			foreach ( $payment_methods as $key => $payment_method ) :
29
+		if (!empty($payment_methods)) :
30
+			foreach ($payment_methods as $key => $payment_method) :
31 31
 				?>
32 32
 				<tr>
33 33
 					<td><?php echo $payment_method['title']; ?></td>
34
-					<td><?php echo $payment_method['active'] ? __( 'Activate', 'wpshop' ) : __( 'Deactivate', 'wpshop' ); ?></td>
34
+					<td><?php echo $payment_method['active'] ? __('Activate', 'wpshop') : __('Deactivate', 'wpshop'); ?></td>
35 35
 					<td>
36
-						<a href="<?php echo admin_url( 'admin-post.php?action=wps_load_settings_tab&_wpnonce=' . wp_create_nonce( 'callback_load_tab' ) . '&page=wps-settings&tab=payment_method&section=' . $key ); ?>" class="wpeo-button button-main">
37
-							<span><?php esc_html_e( 'Configure', 'wpshop' ); ?></span>
36
+						<a href="<?php echo admin_url('admin-post.php?action=wps_load_settings_tab&_wpnonce=' . wp_create_nonce('callback_load_tab') . '&page=wps-settings&tab=payment_method&section=' . $key); ?>" class="wpeo-button button-main">
37
+							<span><?php esc_html_e('Configure', 'wpshop'); ?></span>
38 38
 						</a>
39 39
 					</td>
40 40
 				</tr>
Please login to merge, or discard this patch.
modules/doli-sync/filter/class-doli-sync-filter.php 1 patch
Spacing   +14 added lines, -14 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 Filter Class.
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	 * @since 2.0.0
28 28
 	 */
29 29
 	protected function construct() {
30
-		add_filter( 'wps_countries', array( $this, 'doli_countries' ) );
30
+		add_filter('wps_countries', array($this, 'doli_countries'));
31 31
 	}
32 32
 
33 33
 	/**
@@ -42,29 +42,29 @@  discard block
 block discarded – undo
42 42
 	 * @return array            Les pays modifié de WPshop avec les données de
43 43
 	 * dolibarr.
44 44
 	 */
45
-	public function doli_countries( $countries ) {
46
-		if ( Settings::g()->dolibarr_is_active() ) {
47
-			$countries        = Request_Util::get( 'setup/dictionary/countries?sortfield=code&sortorder=ASC&limit=500' );
45
+	public function doli_countries($countries) {
46
+		if (Settings::g()->dolibarr_is_active()) {
47
+			$countries        = Request_Util::get('setup/dictionary/countries?sortfield=code&sortorder=ASC&limit=500');
48 48
 			$countries_for_wp = array();
49 49
 
50
-			if ( ! empty( $countries ) ) {
51
-				foreach ( $countries as $country ) {
52
-					$country = (array) $country;
50
+			if (!empty($countries)) {
51
+				foreach ($countries as $country) {
52
+					$country = (array)$country;
53 53
 
54
-					if ( '-' === $country['label'] ) {
55
-						$country['label'] = __( 'Country', 'wpshop' );
54
+					if ('-' === $country['label']) {
55
+						$country['label'] = __('Country', 'wpshop');
56 56
 					}
57 57
 
58
-					$countries_for_wp[ $country['id'] ] = $country;
58
+					$countries_for_wp[$country['id']] = $country;
59 59
 				}
60 60
 			}
61 61
 
62
-			usort( $countries_for_wp, function( $a, $b ) {
63
-				if ( $a['label'] === $b['label'] ) {
62
+			usort($countries_for_wp, function($a, $b) {
63
+				if ($a['label'] === $b['label']) {
64 64
 					return 0;
65 65
 				}
66 66
 
67
-				return ( $a['label'] > $b['label'] ) ? 1 : -1;
67
+				return ($a['label'] > $b['label']) ? 1 : -1;
68 68
 			} );
69 69
 
70 70
 			return $countries_for_wp;
Please login to merge, or discard this patch.
modules/doli-sync/view/modal-sync-button.view.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@
 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 modal-close">
20
-	<span><?php esc_html_e( 'Close', 'wpshop' ); ?></span>
20
+	<span><?php esc_html_e('Close', 'wpshop'); ?></span>
21 21
 </div>
Please login to merge, or discard this patch.