Passed
Push — master ( 968588...618fc1 )
by Brian
11:17
created
templates/payment-forms-admin/edit/website.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -7,54 +7,54 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 ?>
13 13
 
14 14
 <div class='form-group'>
15 15
     <label class="d-block">
16
-        <span><?php esc_html_e( 'Field Label', 'invoicing' ); ?></span>
16
+        <span><?php esc_html_e('Field Label', 'invoicing'); ?></span>
17 17
         <input v-model='active_form_element.label' class='form-control' type="text"/>
18 18
     </label>
19 19
 </div>
20 20
 
21 21
 <div class='form-group'>
22 22
     <label class="d-block">
23
-        <span><?php esc_html_e( 'Placeholder text', 'invoicing' ); ?></span>
23
+        <span><?php esc_html_e('Placeholder text', 'invoicing'); ?></span>
24 24
         <input v-model='active_form_element.placeholder' class='form-control' type="text"/>
25 25
     </label>
26 26
 </div>
27 27
 
28 28
 <div class='form-group'>
29 29
     <label class="d-block">
30
-        <span><?php esc_html_e( 'Help Text', 'invoicing' ); ?></span>
31
-        <textarea placeholder='<?php esc_attr_e( 'Add some help text for this field', 'invoicing' ); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea>
32
-        <small class="form-text text-muted"><?php _e( 'HTML is allowed', 'invoicing' ); ?></small>
30
+        <span><?php esc_html_e('Help Text', 'invoicing'); ?></span>
31
+        <textarea placeholder='<?php esc_attr_e('Add some help text for this field', 'invoicing'); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea>
32
+        <small class="form-text text-muted"><?php _e('HTML is allowed', 'invoicing'); ?></small>
33 33
     </label>
34 34
 </div>
35 35
 
36 36
 <div class='form-group form-check'>
37 37
     <input :id="active_form_element.id + '_edit'" v-model='active_form_element.required' type='checkbox' class='form-check-input' />
38
-    <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e( 'Is this field required?', 'invoicing' ); ?></label>
38
+    <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e('Is this field required?', 'invoicing'); ?></label>
39 39
 </div>
40 40
 
41 41
 <div class='form-group form-check'>
42 42
     <input :id="active_form_element.id + '_add_meta'" v-model='active_form_element.add_meta' type='checkbox' class='form-check-input' />
43
-    <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e( 'Show this field in receipts and emails?', 'invoicing' ); ?></label>
43
+    <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e('Show this field in receipts and emails?', 'invoicing'); ?></label>
44 44
 </div>
45 45
 
46 46
 <div class='form-group form-check'>
47 47
     <input :id="active_form_element.id + '_edit_default_current'" v-model='active_form_element.default_current_post' type='checkbox' class='form-check-input' />
48
-    <label class='form-check-label' :for="active_form_element.id + '_edit_default_current'"><?php esc_html_e( 'Default to the current page\'s URL?', 'invoicing' ); ?></label>
48
+    <label class='form-check-label' :for="active_form_element.id + '_edit_default_current'"><?php esc_html_e('Default to the current page\'s URL?', 'invoicing'); ?></label>
49 49
 </div>
50 50
 
51 51
 <hr class='featurette-divider mt-4'>
52 52
 
53 53
 <div class='form-group'>
54 54
     <label class="d-block">
55
-        <span><?php esc_html_e( 'Email Merge Tag', 'invoicing' ); ?></span>
55
+        <span><?php esc_html_e('Email Merge Tag', 'invoicing'); ?></span>
56 56
         <input :value='active_form_element.label | formatMergeTag' class='form-control bg-white' type="text" readonly onclick="this.select()" />
57
-        <span class="form-text text-muted"><?php esc_html_e( 'You can use this merge tag in notification emails', 'invoicing' ); ?></span>
57
+        <span class="form-text text-muted"><?php esc_html_e('You can use this merge tag in notification emails', 'invoicing'); ?></span>
58 58
     </label>
59 59
 </div>
60 60
 
Please login to merge, or discard this patch.
templates/payment-forms-admin/edit/radio.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -7,48 +7,48 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 ?>
13 13
 
14 14
 <div class='form-group'>
15 15
     <label class="d-block">
16
-        <span><?php esc_html_e( 'Field Label', 'invoicing' ); ?></span>
16
+        <span><?php esc_html_e('Field Label', 'invoicing'); ?></span>
17 17
         <input v-model='active_form_element.label' class='form-control' type="text"/>
18 18
     </label>
19 19
 </div>
20 20
 
21 21
 <div class='form-group'>
22 22
     <label class="d-block">
23
-        <span><?php esc_html_e( 'Help Text', 'invoicing' ); ?></span>
24
-        <textarea placeholder='<?php esc_attr_e( 'Add some help text for this field', 'invoicing' ); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea>
25
-        <small class="form-text text-muted"><?php _e( 'HTML is allowed', 'invoicing' ); ?></small>
23
+        <span><?php esc_html_e('Help Text', 'invoicing'); ?></span>
24
+        <textarea placeholder='<?php esc_attr_e('Add some help text for this field', 'invoicing'); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea>
25
+        <small class="form-text text-muted"><?php _e('HTML is allowed', 'invoicing'); ?></small>
26 26
     </label>
27 27
 </div>
28 28
 
29 29
 <div class='form-group form-check'>
30 30
     <input :id="active_form_element.id + '_edit'" v-model='active_form_element.required' type='checkbox' class='form-check-input' />
31
-    <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e( 'Is this field required?', 'invoicing' ); ?></label>
31
+    <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e('Is this field required?', 'invoicing'); ?></label>
32 32
 </div>
33 33
 
34 34
 <div class='form-group form-check'>
35 35
     <input :id="active_form_element.id + '_add_meta'" v-model='active_form_element.add_meta' type='checkbox' class='form-check-input' />
36
-    <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e( 'Show this field in receipts and emails?', 'invoicing' ); ?></label>
36
+    <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e('Show this field in receipts and emails?', 'invoicing'); ?></label>
37 37
 </div>
38 38
 
39 39
 <hr class='featurette-divider mt-4'>
40 40
 
41 41
 <div class='form-group'>
42 42
     <label class="d-block">
43
-        <span><?php esc_html_e( 'Email Merge Tag', 'invoicing' ); ?></span>
43
+        <span><?php esc_html_e('Email Merge Tag', 'invoicing'); ?></span>
44 44
         <input :value='active_form_element.label | formatMergeTag' class='form-control bg-white' type="text" readonly onclick="this.select()" />
45
-        <span class="form-text text-muted"><?php esc_html_e( 'You can use this merge tag in notification emails', 'invoicing' ); ?></span>
45
+        <span class="form-text text-muted"><?php esc_html_e('You can use this merge tag in notification emails', 'invoicing'); ?></span>
46 46
     </label>
47 47
 </div>
48 48
 
49 49
 <hr class='featurette-divider mt-4'>
50 50
 
51
-<h5><?php esc_html_e( 'Available Options', 'invoicing' ); ?></h5>
51
+<h5><?php esc_html_e('Available Options', 'invoicing'); ?></h5>
52 52
 
53 53
 <div class='form-group input-group' v-for='(option, index) in active_form_element.options'>
54 54
     <input type='text' class='form-control' v-model='active_form_element.options[index]'>
@@ -58,5 +58,5 @@  discard block
 block discarded – undo
58 58
 </div>
59 59
 
60 60
 <div class='form-group'>
61
-    <button class='button button-secondary' type='button' @click.prevent='active_form_element.options.push("")'><?php esc_html_e( 'Add Option', 'invoicing' ); ?></button>
61
+    <button class='button button-secondary' type='button' @click.prevent='active_form_element.options.push("")'><?php esc_html_e('Add Option', 'invoicing'); ?></button>
62 62
 </div>
Please login to merge, or discard this patch.
templates/payment-forms-admin/edit/select.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -7,55 +7,55 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 ?>
13 13
 
14 14
 <div class='form-group'>
15 15
     <label class="d-block">
16
-        <span><?php esc_html_e( 'Field Label', 'invoicing' ); ?></span>
16
+        <span><?php esc_html_e('Field Label', 'invoicing'); ?></span>
17 17
         <input v-model='active_form_element.label' class='form-control' type="text"/>
18 18
     </label>
19 19
 </div>
20 20
 
21 21
 <div class='form-group'>
22 22
     <label class="d-block">
23
-        <span><?php esc_html_e( 'Placeholder text', 'invoicing' ); ?></span>
23
+        <span><?php esc_html_e('Placeholder text', 'invoicing'); ?></span>
24 24
         <input v-model='active_form_element.placeholder' class='form-control' type="text"/>
25 25
     </label>
26 26
 </div>
27 27
 
28 28
 <div class='form-group'>
29 29
     <label class="d-block">
30
-        <span><?php esc_html_e( 'Help Text', 'invoicing' ); ?></span>
31
-        <textarea placeholder='<?php esc_attr_e( 'Add some help text for this field', 'invoicing' ); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea>
32
-        <small class="form-text text-muted"><?php _e( 'HTML is allowed', 'invoicing' ); ?></small>
30
+        <span><?php esc_html_e('Help Text', 'invoicing'); ?></span>
31
+        <textarea placeholder='<?php esc_attr_e('Add some help text for this field', 'invoicing'); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea>
32
+        <small class="form-text text-muted"><?php _e('HTML is allowed', 'invoicing'); ?></small>
33 33
     </label>
34 34
 </div>
35 35
 
36 36
 <div class='form-group form-check'>
37 37
     <input :id="active_form_element.id + '_edit'" v-model='active_form_element.required' type='checkbox' class='form-check-input' />
38
-    <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e( 'Is this field required?', 'invoicing' ); ?></label>
38
+    <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e('Is this field required?', 'invoicing'); ?></label>
39 39
 </div>
40 40
 
41 41
 <div class='form-group form-check'>
42 42
     <input :id="active_form_element.id + '_add_meta'" v-model='active_form_element.add_meta' type='checkbox' class='form-check-input' />
43
-    <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e( 'Show this field in receipts and emails?', 'invoicing' ); ?></label>
43
+    <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e('Show this field in receipts and emails?', 'invoicing'); ?></label>
44 44
 </div>
45 45
 
46 46
 <hr class='featurette-divider mt-4'>
47 47
 
48 48
 <div class='form-group'>
49 49
     <label class="d-block">
50
-        <span><?php esc_html_e( 'Email Merge Tag', 'invoicing' ); ?></span>
50
+        <span><?php esc_html_e('Email Merge Tag', 'invoicing'); ?></span>
51 51
         <input :value='active_form_element.label | formatMergeTag' class='form-control bg-white' type="text" readonly onclick="this.select()" />
52
-        <span class="form-text text-muted"><?php esc_html_e( 'You can use this merge tag in notification emails', 'invoicing' ); ?></span>
52
+        <span class="form-text text-muted"><?php esc_html_e('You can use this merge tag in notification emails', 'invoicing'); ?></span>
53 53
     </label>
54 54
 </div>
55 55
 
56 56
 <hr class='featurette-divider mt-4'>
57 57
 
58
-<h5><?php esc_html_e( 'Available Options', 'invoicing' ); ?></h5>
58
+<h5><?php esc_html_e('Available Options', 'invoicing'); ?></h5>
59 59
 
60 60
 <div class='form-group input-group' v-for='(option, index) in active_form_element.options'>
61 61
     <input type='text' class='form-control' v-model='active_form_element.options[index]'>
@@ -65,5 +65,5 @@  discard block
 block discarded – undo
65 65
 </div>
66 66
 
67 67
 <div class='form-group'>
68
-    <button class='button button-secondary' type='button' @click.prevent='active_form_element.options.push("")'><?php esc_html_e( 'Add Option', 'invoicing' ); ?></button>
68
+    <button class='button button-secondary' type='button' @click.prevent='active_form_element.options.push("")'><?php esc_html_e('Add Option', 'invoicing'); ?></button>
69 69
 </div>
Please login to merge, or discard this patch.
templates/payment-forms-admin/edit/time.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -7,42 +7,42 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 ?>
13 13
 
14 14
 <div class='form-group'>
15 15
     <label class="d-block">
16
-        <span><?php esc_html_e( 'Field Label', 'invoicing' ); ?></span>
16
+        <span><?php esc_html_e('Field Label', 'invoicing'); ?></span>
17 17
         <input v-model='active_form_element.label' class='form-control' type="text"/>
18 18
     </label>
19 19
 </div>
20 20
 
21 21
 <div class='form-group'>
22 22
     <label class="d-block">
23
-        <span><?php esc_html_e( 'Help Text', 'invoicing' ); ?></span>
24
-        <textarea placeholder='<?php esc_attr_e( 'Add some help text for this field', 'invoicing' ); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea>
25
-        <small class="form-text text-muted"><?php _e( 'HTML is allowed', 'invoicing' ); ?></small>
23
+        <span><?php esc_html_e('Help Text', 'invoicing'); ?></span>
24
+        <textarea placeholder='<?php esc_attr_e('Add some help text for this field', 'invoicing'); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea>
25
+        <small class="form-text text-muted"><?php _e('HTML is allowed', 'invoicing'); ?></small>
26 26
     </label>
27 27
 </div>
28 28
 
29 29
 <div class='form-group form-check'>
30 30
     <input :id="active_form_element.id + '_edit'" v-model='active_form_element.required' type='checkbox' class='form-check-input' />
31
-    <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e( 'Is this field required?', 'invoicing' ); ?></label>
31
+    <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e('Is this field required?', 'invoicing'); ?></label>
32 32
 </div>
33 33
 
34 34
 <div class='form-group form-check'>
35 35
     <input :id="active_form_element.id + '_add_meta'" v-model='active_form_element.add_meta' type='checkbox' class='form-check-input' />
36
-    <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e( 'Show this field in receipts and emails?', 'invoicing' ); ?></label>
36
+    <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e('Show this field in receipts and emails?', 'invoicing'); ?></label>
37 37
 </div>
38 38
 
39 39
 <hr class='featurette-divider mt-4'>
40 40
 
41 41
 <div class='form-group'>
42 42
     <label class="d-block">
43
-        <span><?php esc_html_e( 'Email Merge Tag', 'invoicing' ); ?></span>
43
+        <span><?php esc_html_e('Email Merge Tag', 'invoicing'); ?></span>
44 44
         <input :value='active_form_element.label | formatMergeTag' class='form-control bg-white' type="text" readonly onclick="this.select()" />
45
-        <span class="form-text text-muted"><?php esc_html_e( 'You can use this merge tag in notification emails', 'invoicing' ); ?></span>
45
+        <span class="form-text text-muted"><?php esc_html_e('You can use this merge tag in notification emails', 'invoicing'); ?></span>
46 46
     </label>
47 47
 </div>
48 48
 
Please login to merge, or discard this patch.
templates/payment-forms-admin/edit/number.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -7,49 +7,49 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 ?>
13 13
 
14 14
 <div class='form-group'>
15 15
     <label class="d-block">
16
-        <span><?php esc_html_e( 'Field Label', 'invoicing' ); ?></span>
16
+        <span><?php esc_html_e('Field Label', 'invoicing'); ?></span>
17 17
         <input v-model='active_form_element.label' class='form-control' type="text"/>
18 18
     </label>
19 19
 </div>
20 20
 
21 21
 <div class='form-group'>
22 22
     <label class="d-block">
23
-        <span><?php esc_html_e( 'Placeholder text', 'invoicing' ); ?></span>
23
+        <span><?php esc_html_e('Placeholder text', 'invoicing'); ?></span>
24 24
         <input v-model='active_form_element.placeholder' class='form-control' type="text"/>
25 25
     </label>
26 26
 </div>
27 27
 
28 28
 <div class='form-group'>
29 29
     <label class="d-block">
30
-        <span><?php esc_html_e( 'Help Text', 'invoicing' ); ?></span>
31
-        <textarea placeholder='<?php esc_attr_e( 'Add some help text for this field', 'invoicing' ); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea>
32
-        <small class="form-text text-muted"><?php _e( 'HTML is allowed', 'invoicing' ); ?></small>
30
+        <span><?php esc_html_e('Help Text', 'invoicing'); ?></span>
31
+        <textarea placeholder='<?php esc_attr_e('Add some help text for this field', 'invoicing'); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea>
32
+        <small class="form-text text-muted"><?php _e('HTML is allowed', 'invoicing'); ?></small>
33 33
     </label>
34 34
 </div>
35 35
 
36 36
 <div class='form-group form-check'>
37 37
     <input :id="active_form_element.id + '_edit'" v-model='active_form_element.required' type='checkbox' class='form-check-input' />
38
-    <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e( 'Is this field required?', 'invoicing' ); ?></label>
38
+    <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e('Is this field required?', 'invoicing'); ?></label>
39 39
 </div>
40 40
 
41 41
 <div class='form-group form-check'>
42 42
     <input :id="active_form_element.id + '_add_meta'" v-model='active_form_element.add_meta' type='checkbox' class='form-check-input' />
43
-    <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e( 'Show this field in receipts and emails?', 'invoicing' ); ?></label>
43
+    <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e('Show this field in receipts and emails?', 'invoicing'); ?></label>
44 44
 </div>
45 45
 
46 46
 <hr class='featurette-divider mt-4'>
47 47
 
48 48
 <div class='form-group'>
49 49
     <label class="d-block">
50
-        <span><?php esc_html_e( 'Email Merge Tag', 'invoicing' ); ?></span>
50
+        <span><?php esc_html_e('Email Merge Tag', 'invoicing'); ?></span>
51 51
         <input :value='active_form_element.label | formatMergeTag' class='form-control bg-white' type="text" readonly onclick="this.select()" />
52
-        <span class="form-text text-muted"><?php esc_html_e( 'You can use this merge tag in notification emails', 'invoicing' ); ?></span>
52
+        <span class="form-text text-muted"><?php esc_html_e('You can use this merge tag in notification emails', 'invoicing'); ?></span>
53 53
     </label>
54 54
 </div>
55 55
 
Please login to merge, or discard this patch.
templates/payment-forms-admin/edit/textarea.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -7,49 +7,49 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 ?>
13 13
 
14 14
 <div class='form-group'>
15 15
     <label class="d-block">
16
-        <span><?php esc_html_e( 'Field Label', 'invoicing' ); ?></span>
16
+        <span><?php esc_html_e('Field Label', 'invoicing'); ?></span>
17 17
         <input v-model='active_form_element.label' class='form-control' type="text"/>
18 18
     </label>
19 19
 </div>
20 20
 
21 21
 <div class='form-group'>
22 22
     <label class="d-block">
23
-        <span><?php esc_html_e( 'Placeholder text', 'invoicing' ); ?></span>
23
+        <span><?php esc_html_e('Placeholder text', 'invoicing'); ?></span>
24 24
         <input v-model='active_form_element.placeholder' class='form-control' type="text"/>
25 25
     </label>
26 26
 </div>
27 27
 
28 28
 <div class='form-group'>
29 29
     <label class="d-block">
30
-        <span><?php esc_html_e( 'Help Text', 'invoicing' ); ?></span>
31
-        <textarea placeholder='<?php esc_attr_e( 'Add some help text for this field', 'invoicing' ); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea>
32
-        <small class="form-text text-muted"><?php _e( 'HTML is allowed', 'invoicing' ); ?></small>
30
+        <span><?php esc_html_e('Help Text', 'invoicing'); ?></span>
31
+        <textarea placeholder='<?php esc_attr_e('Add some help text for this field', 'invoicing'); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea>
32
+        <small class="form-text text-muted"><?php _e('HTML is allowed', 'invoicing'); ?></small>
33 33
     </label>
34 34
 </div>
35 35
 
36 36
 <div class='form-group form-check'>
37 37
     <input :id="active_form_element.id + '_edit'" v-model='active_form_element.required' type='checkbox' class='form-check-input' />
38
-    <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e( 'Is this field required?', 'invoicing' ); ?></label>
38
+    <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e('Is this field required?', 'invoicing'); ?></label>
39 39
 </div>
40 40
 
41 41
 <div class='form-group form-check'>
42 42
     <input :id="active_form_element.id + '_add_meta'" v-model='active_form_element.add_meta' type='checkbox' class='form-check-input' />
43
-    <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e( 'Show this field in receipts and emails?', 'invoicing' ); ?></label>
43
+    <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e('Show this field in receipts and emails?', 'invoicing'); ?></label>
44 44
 </div>
45 45
 
46 46
 <hr class='featurette-divider mt-4'>
47 47
 
48 48
 <div class='form-group'>
49 49
     <label class="d-block">
50
-        <span><?php esc_html_e( 'Email Merge Tag', 'invoicing' ); ?></span>
50
+        <span><?php esc_html_e('Email Merge Tag', 'invoicing'); ?></span>
51 51
         <input :value='active_form_element.label | formatMergeTag' class='form-control bg-white' type="text" readonly onclick="this.select()" />
52
-        <span class="form-text text-muted"><?php esc_html_e( 'You can use this merge tag in notification emails', 'invoicing' ); ?></span>
52
+        <span class="form-text text-muted"><?php esc_html_e('You can use this merge tag in notification emails', 'invoicing'); ?></span>
53 53
     </label>
54 54
 </div>
55 55
 
Please login to merge, or discard this patch.
templates/payment-forms-admin/edit/text.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -7,49 +7,49 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 ?>
13 13
 
14 14
 <div class='form-group'>
15 15
     <label class="d-block">
16
-        <span><?php esc_html_e( 'Field Label', 'invoicing' ); ?></span>
16
+        <span><?php esc_html_e('Field Label', 'invoicing'); ?></span>
17 17
         <input v-model='active_form_element.label' class='form-control' type="text"/>
18 18
     </label>
19 19
 </div>
20 20
 
21 21
 <div class='form-group'>
22 22
     <label class="d-block">
23
-        <span><?php esc_html_e( 'Placeholder text', 'invoicing' ); ?></span>
23
+        <span><?php esc_html_e('Placeholder text', 'invoicing'); ?></span>
24 24
         <input v-model='active_form_element.placeholder' class='form-control' type="text"/>
25 25
     </label>
26 26
 </div>
27 27
 
28 28
 <div class='form-group'>
29 29
     <label class="d-block">
30
-        <span><?php esc_html_e( 'Help Text', 'invoicing' ); ?></span>
31
-        <textarea placeholder='<?php esc_attr_e( 'Add some help text for this field', 'invoicing' ); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea>
32
-        <small class="form-text text-muted"><?php _e( 'HTML is allowed', 'invoicing' ); ?></small>
30
+        <span><?php esc_html_e('Help Text', 'invoicing'); ?></span>
31
+        <textarea placeholder='<?php esc_attr_e('Add some help text for this field', 'invoicing'); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea>
32
+        <small class="form-text text-muted"><?php _e('HTML is allowed', 'invoicing'); ?></small>
33 33
     </label>
34 34
 </div>
35 35
 
36 36
 <div class='form-group form-check'>
37 37
     <input :id="active_form_element.id + '_edit'" v-model='active_form_element.required' type='checkbox' class='form-check-input' />
38
-    <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e( 'Is this field required?', 'invoicing' ); ?></label>
38
+    <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e('Is this field required?', 'invoicing'); ?></label>
39 39
 </div>
40 40
 
41 41
 <div class='form-group form-check'>
42 42
     <input :id="active_form_element.id + '_add_meta'" v-model='active_form_element.add_meta' type='checkbox' class='form-check-input' />
43
-    <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e( 'Show this field in receipts and emails?', 'invoicing' ); ?></label>
43
+    <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e('Show this field in receipts and emails?', 'invoicing'); ?></label>
44 44
 </div>
45 45
 
46 46
 <hr class='featurette-divider mt-4'>
47 47
 
48 48
 <div class='form-group'>
49 49
     <label class="d-block">
50
-        <span><?php esc_html_e( 'Email Merge Tag', 'invoicing' ); ?></span>
50
+        <span><?php esc_html_e('Email Merge Tag', 'invoicing'); ?></span>
51 51
         <input :value='active_form_element.label | formatMergeTag' class='form-control bg-white' type="text" readonly onclick="this.select()" />
52
-        <span class="form-text text-muted"><?php esc_html_e( 'You can use this merge tag in notification emails', 'invoicing' ); ?></span>
52
+        <span class="form-text text-muted"><?php esc_html_e('You can use this merge tag in notification emails', 'invoicing'); ?></span>
53 53
     </label>
54 54
 </div>
55 55
 
Please login to merge, or discard this patch.
includes/payments/class-getpaid-payment-form-submission-fees.php 2 patches
Indentation   +107 added lines, -107 removed lines patch added patch discarded remove patch
@@ -12,114 +12,114 @@
 block discarded – undo
12 12
  */
13 13
 class GetPaid_Payment_Form_Submission_Fees {
14 14
 
15
-	/**
16
-	 * The fee validation error.
17
-	 * @var string
18
-	 */
19
-	public $fee_error;
20
-
21
-	/**
22
-	 * Submission fees.
23
-	 * @var array
24
-	 */
25
-	public $fees = array();
15
+    /**
16
+     * The fee validation error.
17
+     * @var string
18
+     */
19
+    public $fee_error;
20
+
21
+    /**
22
+     * Submission fees.
23
+     * @var array
24
+     */
25
+    public $fees = array();
26
+
27
+    /**
28
+     * Class constructor
29
+     *
30
+     * @param GetPaid_Payment_Form_Submission $submission
31
+     */
32
+    public function __construct( $submission ) {
33
+
34
+        // Process any existing invoice fees.
35
+        if ( $submission->has_invoice() ) {
36
+            $this->fees = $submission->get_invoice()->get_fees();
37
+        }
38
+
39
+        // Process price fields.
40
+        $data         = $submission->get_data();
41
+        $payment_form = $submission->get_payment_form();
42
+
43
+        foreach ( $payment_form->get_elements() as $element ) {
44
+
45
+            if ( 'price_input' == $element['type'] ) {
46
+                $this->process_price_input( $element, $data, $submission );
47
+            }
48
+
49
+            if ( 'price_select' == $element['type'] ) {
50
+                $this->process_price_select( $element, $data );
51
+            }
52
+
53
+        }
54
+
55
+    }
56
+
57
+    /**
58
+     * Process a price input field.
59
+     *
60
+     * @param array $element
61
+     * @param array $data
62
+     * @param GetPaid_Payment_Form_Submission $submission
63
+     */
64
+    public function process_price_input( $element, $data, $submission ) {
65
+
66
+        // Abort if not passed.
67
+        if ( empty( $data[ $element['id'] ] ) ) {
68
+            return;
69
+        }
70
+
71
+        $amount  = (float) wpinv_sanitize_amount( $data[ $element['id'] ] );
72
+        $minimum = empty( $element['minimum'] ) ? 0 : (float) wpinv_sanitize_amount( $element['minimum'] );
73
+
74
+        if ( $amount < $minimum ) {
75
+            throw new Exception( sprintf( __( 'The minimum allowed amount is %s', 'invoicing' ), getpaid_unstandardize_amount( $minimum, $submission->get_currency() ) ) );
76
+        }
77
+
78
+        $this->fees[ $element['label'] ] = array(
79
+            'name'          => $element['label'],
80
+            'initial_fee'   => $amount,
81
+            'recurring_fee' => 0,
82
+        );
83
+
84
+    }
26 85
 
27 86
     /**
28
-	 * Class constructor
29
-	 *
30
-	 * @param GetPaid_Payment_Form_Submission $submission
31
-	 */
32
-	public function __construct( $submission ) {
33
-
34
-		// Process any existing invoice fees.
35
-		if ( $submission->has_invoice() ) {
36
-			$this->fees = $submission->get_invoice()->get_fees();
37
-		}
38
-
39
-		// Process price fields.
40
-		$data         = $submission->get_data();
41
-		$payment_form = $submission->get_payment_form();
42
-
43
-		foreach ( $payment_form->get_elements() as $element ) {
44
-
45
-			if ( 'price_input' == $element['type'] ) {
46
-				$this->process_price_input( $element, $data, $submission );
47
-			}
48
-
49
-			if ( 'price_select' == $element['type'] ) {
50
-				$this->process_price_select( $element, $data );
51
-			}
52
-
53
-		}
54
-
55
-	}
56
-
57
-	/**
58
-	 * Process a price input field.
59
-	 *
60
-	 * @param array $element
61
-	 * @param array $data
62
-	 * @param GetPaid_Payment_Form_Submission $submission
63
-	 */
64
-	public function process_price_input( $element, $data, $submission ) {
65
-
66
-		// Abort if not passed.
67
-		if ( empty( $data[ $element['id'] ] ) ) {
68
-			return;
69
-		}
70
-
71
-		$amount  = (float) wpinv_sanitize_amount( $data[ $element['id'] ] );
72
-		$minimum = empty( $element['minimum'] ) ? 0 : (float) wpinv_sanitize_amount( $element['minimum'] );
73
-
74
-		if ( $amount < $minimum ) {
75
-			throw new Exception( sprintf( __( 'The minimum allowed amount is %s', 'invoicing' ), getpaid_unstandardize_amount( $minimum, $submission->get_currency() ) ) );
76
-		}
77
-
78
-		$this->fees[ $element['label'] ] = array(
79
-			'name'          => $element['label'],
80
-			'initial_fee'   => $amount,
81
-			'recurring_fee' => 0,
82
-		);
83
-
84
-	}
85
-
86
-	/**
87
-	 * Process a price select field.
88
-	 *
89
-	 * @param array $element
90
-	 * @param array $data
91
-	 */
92
-	public function process_price_select( $element, $data ) {
93
-
94
-		// Abort if not passed.
95
-		if ( empty( $data[ $element['id'] ] ) ) {
96
-			return;
97
-		}
98
-
99
-		$options    = getpaid_convert_price_string_to_options( $element['options'] );
100
-		$selected   = array_filter( array_map( 'trim', explode( ',', $data[ $element['id'] ] ) ) );
101
-		$total      = 0;
102
-		$sub_labels = array();
103
-
104
-		foreach ( $selected as $price ) {
105
-
106
-			if ( ! isset( $options[ $price ] ) ) {
107
-				throw new Exception( __( 'You have selected an invalid amount', 'invoicing' ) );
108
-			}
109
-
110
-			$price = explode( '|', $price );
111
-
112
-			$sub_labels[] = $price[0];
113
-			$total += (float) wpinv_sanitize_amount( $price[1] );
114
-		}
115
-
116
-		$this->fees[ $element['label'] ] = array(
117
-			'name'          => $element['label'],
118
-			'initial_fee'   => $total,
119
-			'recurring_fee' => 0,
120
-			'description'   => implode( ', ', $sub_labels ),
121
-		);
122
-
123
-	}
87
+     * Process a price select field.
88
+     *
89
+     * @param array $element
90
+     * @param array $data
91
+     */
92
+    public function process_price_select( $element, $data ) {
93
+
94
+        // Abort if not passed.
95
+        if ( empty( $data[ $element['id'] ] ) ) {
96
+            return;
97
+        }
98
+
99
+        $options    = getpaid_convert_price_string_to_options( $element['options'] );
100
+        $selected   = array_filter( array_map( 'trim', explode( ',', $data[ $element['id'] ] ) ) );
101
+        $total      = 0;
102
+        $sub_labels = array();
103
+
104
+        foreach ( $selected as $price ) {
105
+
106
+            if ( ! isset( $options[ $price ] ) ) {
107
+                throw new Exception( __( 'You have selected an invalid amount', 'invoicing' ) );
108
+            }
109
+
110
+            $price = explode( '|', $price );
111
+
112
+            $sub_labels[] = $price[0];
113
+            $total += (float) wpinv_sanitize_amount( $price[1] );
114
+        }
115
+
116
+        $this->fees[ $element['label'] ] = array(
117
+            'name'          => $element['label'],
118
+            'initial_fee'   => $total,
119
+            'recurring_fee' => 0,
120
+            'description'   => implode( ', ', $sub_labels ),
121
+        );
122
+
123
+    }
124 124
 
125 125
 }
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
  *
5 5
  */
6 6
 
7
-defined( 'ABSPATH' ) || exit;
7
+defined('ABSPATH') || exit;
8 8
 
9 9
 /**
10 10
  * Payment form submission fees class
@@ -29,10 +29,10 @@  discard block
 block discarded – undo
29 29
 	 *
30 30
 	 * @param GetPaid_Payment_Form_Submission $submission
31 31
 	 */
32
-	public function __construct( $submission ) {
32
+	public function __construct($submission) {
33 33
 
34 34
 		// Process any existing invoice fees.
35
-		if ( $submission->has_invoice() ) {
35
+		if ($submission->has_invoice()) {
36 36
 			$this->fees = $submission->get_invoice()->get_fees();
37 37
 		}
38 38
 
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
 		$data         = $submission->get_data();
41 41
 		$payment_form = $submission->get_payment_form();
42 42
 
43
-		foreach ( $payment_form->get_elements() as $element ) {
43
+		foreach ($payment_form->get_elements() as $element) {
44 44
 
45
-			if ( 'price_input' == $element['type'] ) {
46
-				$this->process_price_input( $element, $data, $submission );
45
+			if ('price_input' == $element['type']) {
46
+				$this->process_price_input($element, $data, $submission);
47 47
 			}
48 48
 
49
-			if ( 'price_select' == $element['type'] ) {
50
-				$this->process_price_select( $element, $data );
49
+			if ('price_select' == $element['type']) {
50
+				$this->process_price_select($element, $data);
51 51
 			}
52 52
 
53 53
 		}
@@ -61,21 +61,21 @@  discard block
 block discarded – undo
61 61
 	 * @param array $data
62 62
 	 * @param GetPaid_Payment_Form_Submission $submission
63 63
 	 */
64
-	public function process_price_input( $element, $data, $submission ) {
64
+	public function process_price_input($element, $data, $submission) {
65 65
 
66 66
 		// Abort if not passed.
67
-		if ( empty( $data[ $element['id'] ] ) ) {
67
+		if (empty($data[$element['id']])) {
68 68
 			return;
69 69
 		}
70 70
 
71
-		$amount  = (float) wpinv_sanitize_amount( $data[ $element['id'] ] );
72
-		$minimum = empty( $element['minimum'] ) ? 0 : (float) wpinv_sanitize_amount( $element['minimum'] );
71
+		$amount  = (float) wpinv_sanitize_amount($data[$element['id']]);
72
+		$minimum = empty($element['minimum']) ? 0 : (float) wpinv_sanitize_amount($element['minimum']);
73 73
 
74
-		if ( $amount < $minimum ) {
75
-			throw new Exception( sprintf( __( 'The minimum allowed amount is %s', 'invoicing' ), getpaid_unstandardize_amount( $minimum, $submission->get_currency() ) ) );
74
+		if ($amount < $minimum) {
75
+			throw new Exception(sprintf(__('The minimum allowed amount is %s', 'invoicing'), getpaid_unstandardize_amount($minimum, $submission->get_currency())));
76 76
 		}
77 77
 
78
-		$this->fees[ $element['label'] ] = array(
78
+		$this->fees[$element['label']] = array(
79 79
 			'name'          => $element['label'],
80 80
 			'initial_fee'   => $amount,
81 81
 			'recurring_fee' => 0,
@@ -89,35 +89,35 @@  discard block
 block discarded – undo
89 89
 	 * @param array $element
90 90
 	 * @param array $data
91 91
 	 */
92
-	public function process_price_select( $element, $data ) {
92
+	public function process_price_select($element, $data) {
93 93
 
94 94
 		// Abort if not passed.
95
-		if ( empty( $data[ $element['id'] ] ) ) {
95
+		if (empty($data[$element['id']])) {
96 96
 			return;
97 97
 		}
98 98
 
99
-		$options    = getpaid_convert_price_string_to_options( $element['options'] );
100
-		$selected   = array_filter( array_map( 'trim', explode( ',', $data[ $element['id'] ] ) ) );
99
+		$options    = getpaid_convert_price_string_to_options($element['options']);
100
+		$selected   = array_filter(array_map('trim', explode(',', $data[$element['id']])));
101 101
 		$total      = 0;
102 102
 		$sub_labels = array();
103 103
 
104
-		foreach ( $selected as $price ) {
104
+		foreach ($selected as $price) {
105 105
 
106
-			if ( ! isset( $options[ $price ] ) ) {
107
-				throw new Exception( __( 'You have selected an invalid amount', 'invoicing' ) );
106
+			if (!isset($options[$price])) {
107
+				throw new Exception(__('You have selected an invalid amount', 'invoicing'));
108 108
 			}
109 109
 
110
-			$price = explode( '|', $price );
110
+			$price = explode('|', $price);
111 111
 
112 112
 			$sub_labels[] = $price[0];
113
-			$total += (float) wpinv_sanitize_amount( $price[1] );
113
+			$total += (float) wpinv_sanitize_amount($price[1]);
114 114
 		}
115 115
 
116
-		$this->fees[ $element['label'] ] = array(
116
+		$this->fees[$element['label']] = array(
117 117
 			'name'          => $element['label'],
118 118
 			'initial_fee'   => $total,
119 119
 			'recurring_fee' => 0,
120
-			'description'   => implode( ', ', $sub_labels ),
120
+			'description'   => implode(', ', $sub_labels),
121 121
 		);
122 122
 
123 123
 	}
Please login to merge, or discard this patch.
includes/admin/class-getpaid-admin-setup-wizard.php 2 patches
Indentation   +385 added lines, -385 removed lines patch added patch discarded remove patch
@@ -17,397 +17,397 @@
 block discarded – undo
17 17
  */
18 18
 class GetPaid_Admin_Setup_Wizard {
19 19
 
20
-	/**
21
-	 * @var string Current Step
22
-	 */
23
-	protected $step = '';
24
-
25
-	/**
26
-	 * @var string|false Previous Step
27
-	 */
28
-	protected $previous_step = '';
29
-
30
-	/**
31
-	 * @var string|false Next Step
32
-	 */
33
-	protected $next_step = '';
34
-
35
-	/**
36
-	 * @var array All available steps for the setup wizard
37
-	 */
38
-	protected $steps = array();
39
-
40
-	/**
41
-	 * Class constructor.
42
-	 *
43
-	 * @since 2.4.0
44
-	 */
45
-	public function __construct() {
46
-
47
-		if ( apply_filters( 'getpaid_enable_setup_wizard', true ) && wpinv_current_user_can_manage_invoicing() ) {
48
-			add_action( 'admin_menu', array( $this, 'add_menu' ) );
49
-			add_action( 'current_screen', array( $this, 'setup_wizard' ) );
50
-		}
51
-
52
-	}
53
-
54
-	/**
55
-	 * Add admin menus/screens.
56
-	 *
57
-	 * @since 2.4.0
58
-	 */
59
-	public function add_menu() {
60
-		add_dashboard_page( '', '', wpinv_get_capability(), 'gp-setup', '' );
61
-	}
62
-
63
-	/**
64
-	 * Sets up the setup wizard.
65
-	 *
66
-	 * @since 2.4.0
67
-	 */
68
-	public function setup_wizard() {
69
-
70
-		if ( isset( $_GET['page'] ) && 'gp-setup' === $_GET['page'] ) {
71
-			$this->setup_globals();
72
-			$this->maybe_save_current_step();
73
-			$this->display_wizard();
74
-			exit;
75
-		}
76
-
77
-	}
78
-
79
-	/**
80
-	 * Sets up class variables.
81
-	 *
82
-	 * @since 2.4.0
83
-	 */
84
-	protected function setup_globals() {
85
-		$this->steps         = $this->get_setup_steps();
86
-		$this->step          = $this->get_current_step();
87
-		$this->previous_step = $this->get_previous_step();
88
-		$this->next_step     = $this->get_next_step();
89
-	}
90
-
91
-	/**
92
-	 * Saves the current step.
93
-	 *
94
-	 * @since 2.4.0
95
-	 */
96
-	protected function maybe_save_current_step() {
97
-		if ( ! empty( $_POST['save_step'] ) && is_callable( $this->steps[ $this->step ]['handler'] ) ) {
98
-			call_user_func( $this->steps[ $this->step ]['handler'], $this );
99
-		}
100
-	}
101
-
102
-	/**
103
-	 * Returns the setup steps.
104
-	 *
105
-	 * @since 2.4.0
106
-	 * @return array
107
-	 */
108
-	protected function get_setup_steps() {
109
-
110
-		$steps = array(
111
-
112
-			'introduction'     => array(
113
-				'name'    => __( 'Introduction', 'invoicing' ),
114
-				'view'    => array( $this, 'setup_introduction' ),
115
-				'handler' => '',
116
-			),
117
-
118
-			'business_details'             => array(
119
-				'name'    => __( "Business Details", 'invoicing' ),
120
-				'view'    => array( $this, 'setup_business' ),
121
-				'handler' => '',
122
-			),
123
-
124
-			'currency' => array(
125
-				'name'    => __( 'Currency', 'invoicing' ),
126
-				'view'    => array( $this, 'setup_currency' ),
127
-				'handler' => '',
128
-			),
129
-
130
-			'payments'        => array(
131
-				'name'    => __( 'Payment Gateways', 'invoicing' ),
132
-				'view'    => array( $this, 'setup_payments' ),
133
-				'handler' => array( $this, 'setup_payments_save' ),
134
-			),
135
-
136
-			'recommend'          => array(
137
-				'name'    => __( 'Recommend', 'invoicing' ),
138
-				'view'    => array( $this, 'setup_recommend' ),
139
-				'handler' => '',
140
-			),
141
-
142
-			'next_steps'       => array(
143
-				'name'    => __( 'Get Paid', 'invoicing' ),
144
-				'view'    => array( $this, 'setup_ready' ),
145
-				'handler' => '',
146
-			),
147
-
148
-		);
149
-
150
-		return apply_filters( 'getpaid_setup_wizard_steps', $steps );
151
-
152
-	}
153
-
154
-	/**
155
-	 * Returns the current step.
156
-	 *
157
-	 * @since 2.4.0
158
-	 * @return string
159
-	 */
160
-	protected function get_current_step() {
161
-		$step = isset( $_GET['step'] ) ? sanitize_key( $_GET['step'] ) : '';
162
-		return ! empty( $step ) && in_array( $step, array_keys( $this->steps ) ) ? $step : current( array_keys( $this->steps ) );
163
-	}
164
-
165
-	/**
166
-	 * Returns the previous step.
167
-	 *
168
-	 * @since 2.4.0
169
-	 * @return string|false
170
-	 */
171
-	protected function get_previous_step() {
172
-
173
-		$previous = false;
174
-		$current  = $this->step;
175
-		foreach ( array_keys( $this->steps ) as $step ) {
176
-			if ( $current === $step ) {
177
-				return $previous;
178
-			}
179
-
180
-			$previous = $step;
181
-		}
182
-
183
-		return false;
184
-	}
185
-
186
-	/**
187
-	 * Returns the next step.
188
-	 *
189
-	 * @since 2.4.0
190
-	 * @return string|false
191
-	 */
192
-	protected function get_next_step() {
193
-
194
-		$on_current = false;
195
-		$current    = $this->step;
196
-		foreach ( array_keys( $this->steps ) as $step ) {
197
-
198
-			if ( $on_current ) {
199
-				return $step;
200
-			}
201
-
202
-			if ( $current === $step ) {
203
-				return $on_current = true;
204
-			}
205
-
206
-		}
207
-
208
-		return false;
209
-	}
210
-
211
-	/**
212
-	 * Displays the setup wizard.
213
-	 *
214
-	 * @since 2.4.0
215
-	 */
216
-	public function display_wizard() {
217
-		$this->display_header();
218
-		$this->display_current_step();
219
-		$this->display_footer();
220
-	}
221
-
222
-	/**
223
-	 * Displays the Wizard Header.
224
-	 *
225
-	 * @since 2.0.0
226
-	 */
227
-	public function display_header() {
228
-		$steps     = $this->steps;
229
-		$current   = $this->step;
230
-		$next_step = $this->next_step;
231
-		array_shift( $steps );
232
-		include plugin_dir_path( __FILE__ ) . 'views/wizard-header.php';
233
-	}
234
-
235
-	/**
236
-	 * Displays the content for the current step.
237
-	 *
238
-	 * @since 2.4.0
239
-	 */
240
-	public function display_current_step() {
241
-		?>
20
+    /**
21
+     * @var string Current Step
22
+     */
23
+    protected $step = '';
24
+
25
+    /**
26
+     * @var string|false Previous Step
27
+     */
28
+    protected $previous_step = '';
29
+
30
+    /**
31
+     * @var string|false Next Step
32
+     */
33
+    protected $next_step = '';
34
+
35
+    /**
36
+     * @var array All available steps for the setup wizard
37
+     */
38
+    protected $steps = array();
39
+
40
+    /**
41
+     * Class constructor.
42
+     *
43
+     * @since 2.4.0
44
+     */
45
+    public function __construct() {
46
+
47
+        if ( apply_filters( 'getpaid_enable_setup_wizard', true ) && wpinv_current_user_can_manage_invoicing() ) {
48
+            add_action( 'admin_menu', array( $this, 'add_menu' ) );
49
+            add_action( 'current_screen', array( $this, 'setup_wizard' ) );
50
+        }
51
+
52
+    }
53
+
54
+    /**
55
+     * Add admin menus/screens.
56
+     *
57
+     * @since 2.4.0
58
+     */
59
+    public function add_menu() {
60
+        add_dashboard_page( '', '', wpinv_get_capability(), 'gp-setup', '' );
61
+    }
62
+
63
+    /**
64
+     * Sets up the setup wizard.
65
+     *
66
+     * @since 2.4.0
67
+     */
68
+    public function setup_wizard() {
69
+
70
+        if ( isset( $_GET['page'] ) && 'gp-setup' === $_GET['page'] ) {
71
+            $this->setup_globals();
72
+            $this->maybe_save_current_step();
73
+            $this->display_wizard();
74
+            exit;
75
+        }
76
+
77
+    }
78
+
79
+    /**
80
+     * Sets up class variables.
81
+     *
82
+     * @since 2.4.0
83
+     */
84
+    protected function setup_globals() {
85
+        $this->steps         = $this->get_setup_steps();
86
+        $this->step          = $this->get_current_step();
87
+        $this->previous_step = $this->get_previous_step();
88
+        $this->next_step     = $this->get_next_step();
89
+    }
90
+
91
+    /**
92
+     * Saves the current step.
93
+     *
94
+     * @since 2.4.0
95
+     */
96
+    protected function maybe_save_current_step() {
97
+        if ( ! empty( $_POST['save_step'] ) && is_callable( $this->steps[ $this->step ]['handler'] ) ) {
98
+            call_user_func( $this->steps[ $this->step ]['handler'], $this );
99
+        }
100
+    }
101
+
102
+    /**
103
+     * Returns the setup steps.
104
+     *
105
+     * @since 2.4.0
106
+     * @return array
107
+     */
108
+    protected function get_setup_steps() {
109
+
110
+        $steps = array(
111
+
112
+            'introduction'     => array(
113
+                'name'    => __( 'Introduction', 'invoicing' ),
114
+                'view'    => array( $this, 'setup_introduction' ),
115
+                'handler' => '',
116
+            ),
117
+
118
+            'business_details'             => array(
119
+                'name'    => __( "Business Details", 'invoicing' ),
120
+                'view'    => array( $this, 'setup_business' ),
121
+                'handler' => '',
122
+            ),
123
+
124
+            'currency' => array(
125
+                'name'    => __( 'Currency', 'invoicing' ),
126
+                'view'    => array( $this, 'setup_currency' ),
127
+                'handler' => '',
128
+            ),
129
+
130
+            'payments'        => array(
131
+                'name'    => __( 'Payment Gateways', 'invoicing' ),
132
+                'view'    => array( $this, 'setup_payments' ),
133
+                'handler' => array( $this, 'setup_payments_save' ),
134
+            ),
135
+
136
+            'recommend'          => array(
137
+                'name'    => __( 'Recommend', 'invoicing' ),
138
+                'view'    => array( $this, 'setup_recommend' ),
139
+                'handler' => '',
140
+            ),
141
+
142
+            'next_steps'       => array(
143
+                'name'    => __( 'Get Paid', 'invoicing' ),
144
+                'view'    => array( $this, 'setup_ready' ),
145
+                'handler' => '',
146
+            ),
147
+
148
+        );
149
+
150
+        return apply_filters( 'getpaid_setup_wizard_steps', $steps );
151
+
152
+    }
153
+
154
+    /**
155
+     * Returns the current step.
156
+     *
157
+     * @since 2.4.0
158
+     * @return string
159
+     */
160
+    protected function get_current_step() {
161
+        $step = isset( $_GET['step'] ) ? sanitize_key( $_GET['step'] ) : '';
162
+        return ! empty( $step ) && in_array( $step, array_keys( $this->steps ) ) ? $step : current( array_keys( $this->steps ) );
163
+    }
164
+
165
+    /**
166
+     * Returns the previous step.
167
+     *
168
+     * @since 2.4.0
169
+     * @return string|false
170
+     */
171
+    protected function get_previous_step() {
172
+
173
+        $previous = false;
174
+        $current  = $this->step;
175
+        foreach ( array_keys( $this->steps ) as $step ) {
176
+            if ( $current === $step ) {
177
+                return $previous;
178
+            }
179
+
180
+            $previous = $step;
181
+        }
182
+
183
+        return false;
184
+    }
185
+
186
+    /**
187
+     * Returns the next step.
188
+     *
189
+     * @since 2.4.0
190
+     * @return string|false
191
+     */
192
+    protected function get_next_step() {
193
+
194
+        $on_current = false;
195
+        $current    = $this->step;
196
+        foreach ( array_keys( $this->steps ) as $step ) {
197
+
198
+            if ( $on_current ) {
199
+                return $step;
200
+            }
201
+
202
+            if ( $current === $step ) {
203
+                return $on_current = true;
204
+            }
205
+
206
+        }
207
+
208
+        return false;
209
+    }
210
+
211
+    /**
212
+     * Displays the setup wizard.
213
+     *
214
+     * @since 2.4.0
215
+     */
216
+    public function display_wizard() {
217
+        $this->display_header();
218
+        $this->display_current_step();
219
+        $this->display_footer();
220
+    }
221
+
222
+    /**
223
+     * Displays the Wizard Header.
224
+     *
225
+     * @since 2.0.0
226
+     */
227
+    public function display_header() {
228
+        $steps     = $this->steps;
229
+        $current   = $this->step;
230
+        $next_step = $this->next_step;
231
+        array_shift( $steps );
232
+        include plugin_dir_path( __FILE__ ) . 'views/wizard-header.php';
233
+    }
234
+
235
+    /**
236
+     * Displays the content for the current step.
237
+     *
238
+     * @since 2.4.0
239
+     */
240
+    public function display_current_step() {
241
+        ?>
242 242
 			<div class="gp-setup-content rowx mw-100 text-center mb-3">
243 243
 				<div class="col-12 col-md-5 m-auto">
244 244
 					<?php call_user_func( $this->steps[ $this->step ]['view'], $this ); ?>
245 245
 				</div>
246 246
 			</div>
247 247
 		<?php
248
-	}
249
-
250
-	/**
251
-	 * Setup Wizard Footer.
252
-	 *
253
-	 * @since 2.4.0
254
-	 */
255
-	public function display_footer() {
256
-
257
-		if ( isset( $_GET['step'] ) ) {
258
-			$next_url = esc_url( $this->get_next_step_link() );
259
-			$label    = $this->step == 'next_steps' ? __( 'Return to the WordPress Dashboard', 'invoicing' ) : __( 'Skip this step', 'invoicing' );
260
-
261
-			echo '<p class="gd-return-to-dashboard-wrap"> <a href="' . $next_url . '" class="gd-return-to-dashboard btn btn-link d-block text-muted">' . $label . '</a></p>';
262
-		}
263
-
264
-		echo '</body></html>';
265
-	}
266
-
267
-	/**
268
-	 * Introduction step.
269
-	 *
270
-	 * @since 2.0.0
271
-	 */
272
-	public function setup_introduction() {
273
-		$next_url = $this->get_next_step_link();
274
-		include plugin_dir_path( __FILE__ ) . 'views/wizard-introduction.php';
275
-	}
276
-
277
-	/**
278
-	 * Get the URL for the next step's screen.
279
-	 *
280
-	 * @param string step   slug (default: current step)
281
-	 *
282
-	 * @return string       URL for next step if a next step exists.
283
-	 *                      Admin URL if it's the last step.
284
-	 *                      Empty string on failure.
285
-	 * @since 3.0.0
286
-	 */
287
-	public function get_next_step_link( $step = '' ) {
288
-		if ( ! $step ) {
289
-			$step = $this->step;
290
-		}
291
-
292
-		$keys = array_keys( $this->steps );
293
-		if ( end( $keys ) === $step ) {
294
-			return admin_url();
295
-		}
296
-
297
-		$step_index = array_search( $step, $keys );
298
-		if ( false === $step_index ) {
299
-			return '';
300
-		}
301
-
302
-		return remove_query_arg('settings-updated', add_query_arg( 'step', $keys[ $step_index + 1 ] ));
303
-	}
304
-
305
-	/**
306
-	 * Setup maps api.
307
-	 *
308
-	 * @since 2.0.0
309
-	 */
310
-	public function setup_business() {
311
-		$next_url = $this->get_next_step_link();
312
-		$wizard   = $this;
313
-		$page     = 'wpinv_settings_general_main';
314
-		$section  = 'wpinv_settings_general_main';
315
-		include plugin_dir_path( __FILE__ ) . 'views/wizard-settings.php';
316
-	}
317
-
318
-	/**
319
-	 * Default Location settings.
320
-	 *
321
-	 * @since 2.0.0
322
-	 */
323
-	public function setup_currency() {
324
-		$next_url = $this->get_next_step_link();
325
-		$wizard   = $this;
326
-		$page     = 'wpinv_settings_general_currency_section';
327
-		$section  = 'wpinv_settings_general_currency_section';
328
-		include plugin_dir_path( __FILE__ ) . 'views/wizard-settings.php';
329
-	}
330
-
331
-	/**
332
-	 * Installation of recommended plugins.
333
-	 *
334
-	 * @since 1.0.0
335
-	 */
336
-	public function setup_recommend() {
337
-		$next_url            = $this->get_next_step_link();
338
-		$recommended_plugins = self::get_recommend_wp_plugins();
339
-		include plugin_dir_path( __FILE__ ) . 'views/wizard-plugins.php';
340
-	}
341
-
342
-	/**
343
-	 * A list of recommended wp.org plugins.
344
-	 * @return array
345
-	 */
346
-	public static function get_recommend_wp_plugins(){
347
-		return array(
348
-			'ayecode-connect' => array(
349
-				'file'   => 'ayecode-connect/ayecode-connect.php',
350
-				'url'    => 'https://wordpress.org/plugins/ayecode-connect/',
351
-				'slug'   => 'ayecode-connect',
352
-				'name'   => 'AyeCode Connect',
353
-				'desc'   => __( 'Documentation and Support from within your WordPress admin.', 'geodirectory' ),
354
-			),
355
-			'invoicing-quotes' => array(
356
-				'file'   => 'invoicing-quotes/wpinv-quote.php',
357
-				'url'    => 'https://wordpress.org/plugins/invoicing-quotes/',
358
-				'slug'   => 'invoicing-quotes',
359
-				'name'   => 'Customer Quotes',
360
-				'desc'   => __('Create & Send Quotes to Customers and have them accept and pay.','geodirectory'),
361
-			),
362
-			'userswp'    => array(
363
-				'file'   => 'userswp/userswp.php',
364
-				'url'    => 'https://wordpress.org/plugins/userswp/',
365
-				'slug'   => 'userswp',
366
-				'name'   => 'UsersWP',
367
-				'desc'   => __('Frontend user login and registration as well as slick profile pages.','geodirectory'),
368
-			),
369
-		);
370
-	}
371
-
372
-	/**
373
-	 * Dummy Data setup.
374
-	 *
375
-	 * @since 2.4.0
376
-	 */
377
-	public function setup_payments() {
378
-		$next_url = $this->get_next_step_link();
379
-		include plugin_dir_path( __FILE__ ) . 'views/wizard-gateways.php';
380
-	}
381
-
382
-	/**
383
-	 * Dummy data save.
384
-	 *
385
-	 * This is done via ajax so we just pass onto the next step.
386
-	 *
387
-	 * @since 2.0.0
388
-	 */
389
-	public function setup_payments_save() {
390
-		check_admin_referer( 'getpaid-setup-wizard', 'getpaid-setup-wizard' );
391
-		wpinv_update_option( 'manual_active', ! empty( $_POST['enable-manual-gateway'] ) );
392
-
393
-		if ( ! empty( $_POST['paypal-email'] ) ) {
394
-			wpinv_update_option( 'paypal_email', sanitize_email( $_POST['paypal-email'] ) );
395
-			wpinv_update_option( 'paypal_active', 1 );
396
-			wpinv_update_option( 'paypal_sandbox', 0 );
397
-		}
398
-
399
-		wp_redirect( esc_url_raw( $this->get_next_step_link() ) );
400
-		exit;
401
-	}
402
-
403
-	/**
404
-	 * Final step.
405
-	 *
406
-	 * @since 2.0.0
407
-	 */
408
-	public function setup_ready() {
409
-		include plugin_dir_path( __FILE__ ) . 'views/wizard-thank-you.php';
410
-	}
248
+    }
249
+
250
+    /**
251
+     * Setup Wizard Footer.
252
+     *
253
+     * @since 2.4.0
254
+     */
255
+    public function display_footer() {
256
+
257
+        if ( isset( $_GET['step'] ) ) {
258
+            $next_url = esc_url( $this->get_next_step_link() );
259
+            $label    = $this->step == 'next_steps' ? __( 'Return to the WordPress Dashboard', 'invoicing' ) : __( 'Skip this step', 'invoicing' );
260
+
261
+            echo '<p class="gd-return-to-dashboard-wrap"> <a href="' . $next_url . '" class="gd-return-to-dashboard btn btn-link d-block text-muted">' . $label . '</a></p>';
262
+        }
263
+
264
+        echo '</body></html>';
265
+    }
266
+
267
+    /**
268
+     * Introduction step.
269
+     *
270
+     * @since 2.0.0
271
+     */
272
+    public function setup_introduction() {
273
+        $next_url = $this->get_next_step_link();
274
+        include plugin_dir_path( __FILE__ ) . 'views/wizard-introduction.php';
275
+    }
276
+
277
+    /**
278
+     * Get the URL for the next step's screen.
279
+     *
280
+     * @param string step   slug (default: current step)
281
+     *
282
+     * @return string       URL for next step if a next step exists.
283
+     *                      Admin URL if it's the last step.
284
+     *                      Empty string on failure.
285
+     * @since 3.0.0
286
+     */
287
+    public function get_next_step_link( $step = '' ) {
288
+        if ( ! $step ) {
289
+            $step = $this->step;
290
+        }
291
+
292
+        $keys = array_keys( $this->steps );
293
+        if ( end( $keys ) === $step ) {
294
+            return admin_url();
295
+        }
296
+
297
+        $step_index = array_search( $step, $keys );
298
+        if ( false === $step_index ) {
299
+            return '';
300
+        }
301
+
302
+        return remove_query_arg('settings-updated', add_query_arg( 'step', $keys[ $step_index + 1 ] ));
303
+    }
304
+
305
+    /**
306
+     * Setup maps api.
307
+     *
308
+     * @since 2.0.0
309
+     */
310
+    public function setup_business() {
311
+        $next_url = $this->get_next_step_link();
312
+        $wizard   = $this;
313
+        $page     = 'wpinv_settings_general_main';
314
+        $section  = 'wpinv_settings_general_main';
315
+        include plugin_dir_path( __FILE__ ) . 'views/wizard-settings.php';
316
+    }
317
+
318
+    /**
319
+     * Default Location settings.
320
+     *
321
+     * @since 2.0.0
322
+     */
323
+    public function setup_currency() {
324
+        $next_url = $this->get_next_step_link();
325
+        $wizard   = $this;
326
+        $page     = 'wpinv_settings_general_currency_section';
327
+        $section  = 'wpinv_settings_general_currency_section';
328
+        include plugin_dir_path( __FILE__ ) . 'views/wizard-settings.php';
329
+    }
330
+
331
+    /**
332
+     * Installation of recommended plugins.
333
+     *
334
+     * @since 1.0.0
335
+     */
336
+    public function setup_recommend() {
337
+        $next_url            = $this->get_next_step_link();
338
+        $recommended_plugins = self::get_recommend_wp_plugins();
339
+        include plugin_dir_path( __FILE__ ) . 'views/wizard-plugins.php';
340
+    }
341
+
342
+    /**
343
+     * A list of recommended wp.org plugins.
344
+     * @return array
345
+     */
346
+    public static function get_recommend_wp_plugins(){
347
+        return array(
348
+            'ayecode-connect' => array(
349
+                'file'   => 'ayecode-connect/ayecode-connect.php',
350
+                'url'    => 'https://wordpress.org/plugins/ayecode-connect/',
351
+                'slug'   => 'ayecode-connect',
352
+                'name'   => 'AyeCode Connect',
353
+                'desc'   => __( 'Documentation and Support from within your WordPress admin.', 'geodirectory' ),
354
+            ),
355
+            'invoicing-quotes' => array(
356
+                'file'   => 'invoicing-quotes/wpinv-quote.php',
357
+                'url'    => 'https://wordpress.org/plugins/invoicing-quotes/',
358
+                'slug'   => 'invoicing-quotes',
359
+                'name'   => 'Customer Quotes',
360
+                'desc'   => __('Create & Send Quotes to Customers and have them accept and pay.','geodirectory'),
361
+            ),
362
+            'userswp'    => array(
363
+                'file'   => 'userswp/userswp.php',
364
+                'url'    => 'https://wordpress.org/plugins/userswp/',
365
+                'slug'   => 'userswp',
366
+                'name'   => 'UsersWP',
367
+                'desc'   => __('Frontend user login and registration as well as slick profile pages.','geodirectory'),
368
+            ),
369
+        );
370
+    }
371
+
372
+    /**
373
+     * Dummy Data setup.
374
+     *
375
+     * @since 2.4.0
376
+     */
377
+    public function setup_payments() {
378
+        $next_url = $this->get_next_step_link();
379
+        include plugin_dir_path( __FILE__ ) . 'views/wizard-gateways.php';
380
+    }
381
+
382
+    /**
383
+     * Dummy data save.
384
+     *
385
+     * This is done via ajax so we just pass onto the next step.
386
+     *
387
+     * @since 2.0.0
388
+     */
389
+    public function setup_payments_save() {
390
+        check_admin_referer( 'getpaid-setup-wizard', 'getpaid-setup-wizard' );
391
+        wpinv_update_option( 'manual_active', ! empty( $_POST['enable-manual-gateway'] ) );
392
+
393
+        if ( ! empty( $_POST['paypal-email'] ) ) {
394
+            wpinv_update_option( 'paypal_email', sanitize_email( $_POST['paypal-email'] ) );
395
+            wpinv_update_option( 'paypal_active', 1 );
396
+            wpinv_update_option( 'paypal_sandbox', 0 );
397
+        }
398
+
399
+        wp_redirect( esc_url_raw( $this->get_next_step_link() ) );
400
+        exit;
401
+    }
402
+
403
+    /**
404
+     * Final step.
405
+     *
406
+     * @since 2.0.0
407
+     */
408
+    public function setup_ready() {
409
+        include plugin_dir_path( __FILE__ ) . 'views/wizard-thank-you.php';
410
+    }
411 411
 
412 412
 }
413 413
 
Please login to merge, or discard this patch.
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  * @version     2.4.0
11 11
  * @info        GetPaid Setup Wizard.
12 12
  */
13
-defined( 'ABSPATH' ) || exit;
13
+defined('ABSPATH') || exit;
14 14
 
15 15
 /**
16 16
  * GetPaid_Admin_Setup_Wizard class.
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
 	 */
45 45
 	public function __construct() {
46 46
 
47
-		if ( apply_filters( 'getpaid_enable_setup_wizard', true ) && wpinv_current_user_can_manage_invoicing() ) {
48
-			add_action( 'admin_menu', array( $this, 'add_menu' ) );
49
-			add_action( 'current_screen', array( $this, 'setup_wizard' ) );
47
+		if (apply_filters('getpaid_enable_setup_wizard', true) && wpinv_current_user_can_manage_invoicing()) {
48
+			add_action('admin_menu', array($this, 'add_menu'));
49
+			add_action('current_screen', array($this, 'setup_wizard'));
50 50
 		}
51 51
 
52 52
 	}
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	 * @since 2.4.0
58 58
 	 */
59 59
 	public function add_menu() {
60
-		add_dashboard_page( '', '', wpinv_get_capability(), 'gp-setup', '' );
60
+		add_dashboard_page('', '', wpinv_get_capability(), 'gp-setup', '');
61 61
 	}
62 62
 
63 63
 	/**
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	 */
68 68
 	public function setup_wizard() {
69 69
 
70
-		if ( isset( $_GET['page'] ) && 'gp-setup' === $_GET['page'] ) {
70
+		if (isset($_GET['page']) && 'gp-setup' === $_GET['page']) {
71 71
 			$this->setup_globals();
72 72
 			$this->maybe_save_current_step();
73 73
 			$this->display_wizard();
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
 	 * @since 2.4.0
95 95
 	 */
96 96
 	protected function maybe_save_current_step() {
97
-		if ( ! empty( $_POST['save_step'] ) && is_callable( $this->steps[ $this->step ]['handler'] ) ) {
98
-			call_user_func( $this->steps[ $this->step ]['handler'], $this );
97
+		if (!empty($_POST['save_step']) && is_callable($this->steps[$this->step]['handler'])) {
98
+			call_user_func($this->steps[$this->step]['handler'], $this);
99 99
 		}
100 100
 	}
101 101
 
@@ -110,44 +110,44 @@  discard block
 block discarded – undo
110 110
 		$steps = array(
111 111
 
112 112
 			'introduction'     => array(
113
-				'name'    => __( 'Introduction', 'invoicing' ),
114
-				'view'    => array( $this, 'setup_introduction' ),
113
+				'name'    => __('Introduction', 'invoicing'),
114
+				'view'    => array($this, 'setup_introduction'),
115 115
 				'handler' => '',
116 116
 			),
117 117
 
118 118
 			'business_details'             => array(
119
-				'name'    => __( "Business Details", 'invoicing' ),
120
-				'view'    => array( $this, 'setup_business' ),
119
+				'name'    => __("Business Details", 'invoicing'),
120
+				'view'    => array($this, 'setup_business'),
121 121
 				'handler' => '',
122 122
 			),
123 123
 
124 124
 			'currency' => array(
125
-				'name'    => __( 'Currency', 'invoicing' ),
126
-				'view'    => array( $this, 'setup_currency' ),
125
+				'name'    => __('Currency', 'invoicing'),
126
+				'view'    => array($this, 'setup_currency'),
127 127
 				'handler' => '',
128 128
 			),
129 129
 
130 130
 			'payments'        => array(
131
-				'name'    => __( 'Payment Gateways', 'invoicing' ),
132
-				'view'    => array( $this, 'setup_payments' ),
133
-				'handler' => array( $this, 'setup_payments_save' ),
131
+				'name'    => __('Payment Gateways', 'invoicing'),
132
+				'view'    => array($this, 'setup_payments'),
133
+				'handler' => array($this, 'setup_payments_save'),
134 134
 			),
135 135
 
136 136
 			'recommend'          => array(
137
-				'name'    => __( 'Recommend', 'invoicing' ),
138
-				'view'    => array( $this, 'setup_recommend' ),
137
+				'name'    => __('Recommend', 'invoicing'),
138
+				'view'    => array($this, 'setup_recommend'),
139 139
 				'handler' => '',
140 140
 			),
141 141
 
142 142
 			'next_steps'       => array(
143
-				'name'    => __( 'Get Paid', 'invoicing' ),
144
-				'view'    => array( $this, 'setup_ready' ),
143
+				'name'    => __('Get Paid', 'invoicing'),
144
+				'view'    => array($this, 'setup_ready'),
145 145
 				'handler' => '',
146 146
 			),
147 147
 
148 148
 		);
149 149
 
150
-		return apply_filters( 'getpaid_setup_wizard_steps', $steps );
150
+		return apply_filters('getpaid_setup_wizard_steps', $steps);
151 151
 
152 152
 	}
153 153
 
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
 	 * @return string
159 159
 	 */
160 160
 	protected function get_current_step() {
161
-		$step = isset( $_GET['step'] ) ? sanitize_key( $_GET['step'] ) : '';
162
-		return ! empty( $step ) && in_array( $step, array_keys( $this->steps ) ) ? $step : current( array_keys( $this->steps ) );
161
+		$step = isset($_GET['step']) ? sanitize_key($_GET['step']) : '';
162
+		return !empty($step) && in_array($step, array_keys($this->steps)) ? $step : current(array_keys($this->steps));
163 163
 	}
164 164
 
165 165
 	/**
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
172 172
 
173 173
 		$previous = false;
174 174
 		$current  = $this->step;
175
-		foreach ( array_keys( $this->steps ) as $step ) {
176
-			if ( $current === $step ) {
175
+		foreach (array_keys($this->steps) as $step) {
176
+			if ($current === $step) {
177 177
 				return $previous;
178 178
 			}
179 179
 
@@ -193,13 +193,13 @@  discard block
 block discarded – undo
193 193
 
194 194
 		$on_current = false;
195 195
 		$current    = $this->step;
196
-		foreach ( array_keys( $this->steps ) as $step ) {
196
+		foreach (array_keys($this->steps) as $step) {
197 197
 
198
-			if ( $on_current ) {
198
+			if ($on_current) {
199 199
 				return $step;
200 200
 			}
201 201
 
202
-			if ( $current === $step ) {
202
+			if ($current === $step) {
203 203
 				return $on_current = true;
204 204
 			}
205 205
 
@@ -228,8 +228,8 @@  discard block
 block discarded – undo
228 228
 		$steps     = $this->steps;
229 229
 		$current   = $this->step;
230 230
 		$next_step = $this->next_step;
231
-		array_shift( $steps );
232
-		include plugin_dir_path( __FILE__ ) . 'views/wizard-header.php';
231
+		array_shift($steps);
232
+		include plugin_dir_path(__FILE__) . 'views/wizard-header.php';
233 233
 	}
234 234
 
235 235
 	/**
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 		?>
242 242
 			<div class="gp-setup-content rowx mw-100 text-center mb-3">
243 243
 				<div class="col-12 col-md-5 m-auto">
244
-					<?php call_user_func( $this->steps[ $this->step ]['view'], $this ); ?>
244
+					<?php call_user_func($this->steps[$this->step]['view'], $this); ?>
245 245
 				</div>
246 246
 			</div>
247 247
 		<?php
@@ -254,9 +254,9 @@  discard block
 block discarded – undo
254 254
 	 */
255 255
 	public function display_footer() {
256 256
 
257
-		if ( isset( $_GET['step'] ) ) {
258
-			$next_url = esc_url( $this->get_next_step_link() );
259
-			$label    = $this->step == 'next_steps' ? __( 'Return to the WordPress Dashboard', 'invoicing' ) : __( 'Skip this step', 'invoicing' );
257
+		if (isset($_GET['step'])) {
258
+			$next_url = esc_url($this->get_next_step_link());
259
+			$label    = $this->step == 'next_steps' ? __('Return to the WordPress Dashboard', 'invoicing') : __('Skip this step', 'invoicing');
260 260
 
261 261
 			echo '<p class="gd-return-to-dashboard-wrap"> <a href="' . $next_url . '" class="gd-return-to-dashboard btn btn-link d-block text-muted">' . $label . '</a></p>';
262 262
 		}
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 	 */
272 272
 	public function setup_introduction() {
273 273
 		$next_url = $this->get_next_step_link();
274
-		include plugin_dir_path( __FILE__ ) . 'views/wizard-introduction.php';
274
+		include plugin_dir_path(__FILE__) . 'views/wizard-introduction.php';
275 275
 	}
276 276
 
277 277
 	/**
@@ -284,22 +284,22 @@  discard block
 block discarded – undo
284 284
 	 *                      Empty string on failure.
285 285
 	 * @since 3.0.0
286 286
 	 */
287
-	public function get_next_step_link( $step = '' ) {
288
-		if ( ! $step ) {
287
+	public function get_next_step_link($step = '') {
288
+		if (!$step) {
289 289
 			$step = $this->step;
290 290
 		}
291 291
 
292
-		$keys = array_keys( $this->steps );
293
-		if ( end( $keys ) === $step ) {
292
+		$keys = array_keys($this->steps);
293
+		if (end($keys) === $step) {
294 294
 			return admin_url();
295 295
 		}
296 296
 
297
-		$step_index = array_search( $step, $keys );
298
-		if ( false === $step_index ) {
297
+		$step_index = array_search($step, $keys);
298
+		if (false === $step_index) {
299 299
 			return '';
300 300
 		}
301 301
 
302
-		return remove_query_arg('settings-updated', add_query_arg( 'step', $keys[ $step_index + 1 ] ));
302
+		return remove_query_arg('settings-updated', add_query_arg('step', $keys[$step_index + 1]));
303 303
 	}
304 304
 
305 305
 	/**
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 		$wizard   = $this;
313 313
 		$page     = 'wpinv_settings_general_main';
314 314
 		$section  = 'wpinv_settings_general_main';
315
-		include plugin_dir_path( __FILE__ ) . 'views/wizard-settings.php';
315
+		include plugin_dir_path(__FILE__) . 'views/wizard-settings.php';
316 316
 	}
317 317
 
318 318
 	/**
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 		$wizard   = $this;
326 326
 		$page     = 'wpinv_settings_general_currency_section';
327 327
 		$section  = 'wpinv_settings_general_currency_section';
328
-		include plugin_dir_path( __FILE__ ) . 'views/wizard-settings.php';
328
+		include plugin_dir_path(__FILE__) . 'views/wizard-settings.php';
329 329
 	}
330 330
 
331 331
 	/**
@@ -336,35 +336,35 @@  discard block
 block discarded – undo
336 336
 	public function setup_recommend() {
337 337
 		$next_url            = $this->get_next_step_link();
338 338
 		$recommended_plugins = self::get_recommend_wp_plugins();
339
-		include plugin_dir_path( __FILE__ ) . 'views/wizard-plugins.php';
339
+		include plugin_dir_path(__FILE__) . 'views/wizard-plugins.php';
340 340
 	}
341 341
 
342 342
 	/**
343 343
 	 * A list of recommended wp.org plugins.
344 344
 	 * @return array
345 345
 	 */
346
-	public static function get_recommend_wp_plugins(){
346
+	public static function get_recommend_wp_plugins() {
347 347
 		return array(
348 348
 			'ayecode-connect' => array(
349 349
 				'file'   => 'ayecode-connect/ayecode-connect.php',
350 350
 				'url'    => 'https://wordpress.org/plugins/ayecode-connect/',
351 351
 				'slug'   => 'ayecode-connect',
352 352
 				'name'   => 'AyeCode Connect',
353
-				'desc'   => __( 'Documentation and Support from within your WordPress admin.', 'geodirectory' ),
353
+				'desc'   => __('Documentation and Support from within your WordPress admin.', 'geodirectory'),
354 354
 			),
355 355
 			'invoicing-quotes' => array(
356 356
 				'file'   => 'invoicing-quotes/wpinv-quote.php',
357 357
 				'url'    => 'https://wordpress.org/plugins/invoicing-quotes/',
358 358
 				'slug'   => 'invoicing-quotes',
359 359
 				'name'   => 'Customer Quotes',
360
-				'desc'   => __('Create & Send Quotes to Customers and have them accept and pay.','geodirectory'),
360
+				'desc'   => __('Create & Send Quotes to Customers and have them accept and pay.', 'geodirectory'),
361 361
 			),
362 362
 			'userswp'    => array(
363 363
 				'file'   => 'userswp/userswp.php',
364 364
 				'url'    => 'https://wordpress.org/plugins/userswp/',
365 365
 				'slug'   => 'userswp',
366 366
 				'name'   => 'UsersWP',
367
-				'desc'   => __('Frontend user login and registration as well as slick profile pages.','geodirectory'),
367
+				'desc'   => __('Frontend user login and registration as well as slick profile pages.', 'geodirectory'),
368 368
 			),
369 369
 		);
370 370
 	}
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 	 */
377 377
 	public function setup_payments() {
378 378
 		$next_url = $this->get_next_step_link();
379
-		include plugin_dir_path( __FILE__ ) . 'views/wizard-gateways.php';
379
+		include plugin_dir_path(__FILE__) . 'views/wizard-gateways.php';
380 380
 	}
381 381
 
382 382
 	/**
@@ -387,16 +387,16 @@  discard block
 block discarded – undo
387 387
 	 * @since 2.0.0
388 388
 	 */
389 389
 	public function setup_payments_save() {
390
-		check_admin_referer( 'getpaid-setup-wizard', 'getpaid-setup-wizard' );
391
-		wpinv_update_option( 'manual_active', ! empty( $_POST['enable-manual-gateway'] ) );
390
+		check_admin_referer('getpaid-setup-wizard', 'getpaid-setup-wizard');
391
+		wpinv_update_option('manual_active', !empty($_POST['enable-manual-gateway']));
392 392
 
393
-		if ( ! empty( $_POST['paypal-email'] ) ) {
394
-			wpinv_update_option( 'paypal_email', sanitize_email( $_POST['paypal-email'] ) );
395
-			wpinv_update_option( 'paypal_active', 1 );
396
-			wpinv_update_option( 'paypal_sandbox', 0 );
393
+		if (!empty($_POST['paypal-email'])) {
394
+			wpinv_update_option('paypal_email', sanitize_email($_POST['paypal-email']));
395
+			wpinv_update_option('paypal_active', 1);
396
+			wpinv_update_option('paypal_sandbox', 0);
397 397
 		}
398 398
 
399
-		wp_redirect( esc_url_raw( $this->get_next_step_link() ) );
399
+		wp_redirect(esc_url_raw($this->get_next_step_link()));
400 400
 		exit;
401 401
 	}
402 402
 
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 	 * @since 2.0.0
407 407
 	 */
408 408
 	public function setup_ready() {
409
-		include plugin_dir_path( __FILE__ ) . 'views/wizard-thank-you.php';
409
+		include plugin_dir_path(__FILE__) . 'views/wizard-thank-you.php';
410 410
 	}
411 411
 
412 412
 }
Please login to merge, or discard this patch.