Passed
Push — master ( e110bf...98a9e1 )
by Brian
14:22
created
includes/admin/html-admin-page-addons.php 1 patch
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -3,27 +3,27 @@  discard block
 block discarded – undo
3 3
  * Admin View: Page - Addons
4 4
  *
5 5
  */
6
-if ( ! defined( 'ABSPATH' ) ) {
6
+if (!defined('ABSPATH')) {
7 7
 	exit;
8 8
 }
9 9
 add_ThickBox();
10 10
 ?>
11 11
 <div class="wrap wpi_addons_wrap">
12
-	<h1><?php echo esc_html( get_admin_page_title() ); ?></h1>
12
+	<h1><?php echo esc_html(get_admin_page_title()); ?></h1>
13 13
 
14
-	<?php if ( $tabs ) { ?>
14
+	<?php if ($tabs) { ?>
15 15
 		<nav class="nav-tab-wrapper wpi-nav-tab-wrapper">
16 16
 			<?php
17
-			foreach ( $tabs as $name => $label ) {
18
-				echo '<a href="' . esc_url( admin_url( 'admin.php?page=wpi-addons&tab=' . $name ) ) . '" class="nav-tab ' . ( $current_tab == $name ? 'nav-tab-active' : '' ) . '">' . esc_html( $label ) . '</a>';
17
+			foreach ($tabs as $name => $label) {
18
+				echo '<a href="' . esc_url(admin_url('admin.php?page=wpi-addons&tab=' . $name)) . '" class="nav-tab ' . ($current_tab == $name ? 'nav-tab-active' : '') . '">' . esc_html($label) . '</a>';
19 19
 			}
20
-			do_action( 'wpi_addons_tabs' );
20
+			do_action('wpi_addons_tabs');
21 21
 			?>
22 22
 		</nav>
23 23
 
24 24
 		<?php
25 25
 
26
-		if ( $current_tab == 'membership' ) {
26
+		if ($current_tab == 'membership') {
27 27
 
28 28
 			?>
29 29
 
@@ -32,42 +32,42 @@  discard block
 block discarded – undo
32 32
 <!--
33 33
 				<h2>With our WPInvoicing Membership you get access to all our products!</h2>
34 34
 				<p><a class="button button-primary" href="https://wpinvoicing.com/downloads/membership/">View Memberships</a></p>-->
35
-				<?php if ( defined( 'WP_EASY_UPDATES_ACTIVE' ) ) { ?>
36
-					<h2><?php esc_html_e( 'Have a membership key?', 'invoicing' ); ?></h2>
35
+				<?php if (defined('WP_EASY_UPDATES_ACTIVE')) { ?>
36
+					<h2><?php esc_html_e('Have a membership key?', 'invoicing'); ?></h2>
37 37
 					<p>
38 38
 						<?php
39
-						$wpeu_admin = new External_Updates_Admin( 'wpinvoicing.com', '1' );
40
-						echo $wpeu_admin->render_licence_actions( 'wpinvoicing.com', 'membership', array( 95, 106, 108, 12351 ) );
39
+						$wpeu_admin = new External_Updates_Admin('wpinvoicing.com', '1');
40
+						echo $wpeu_admin->render_licence_actions('wpinvoicing.com', 'membership', array(95, 106, 108, 12351));
41 41
 						?>
42 42
 					</p>
43 43
 				<?php } ?>
44 44
 
45 45
 				<div class="membership-cta-contet">
46 46
 					<div class="main-cta">
47
-							<h2><?php esc_html_e( 'Membership benefits Include:', 'invoicing' ); ?></h2>
47
+							<h2><?php esc_html_e('Membership benefits Include:', 'invoicing'); ?></h2>
48 48
 							<div class="feature-list">
49 49
 								<ul>
50 50
 									<?php
51 51
 									$addon_obj = new WPInv_Admin_Addons();
52
-									if ( $addons = $addon_obj->get_section_data( 'addons' ) ) {
53
-										foreach ( $addons as $addon ) {
54
-											echo '<li><i class="far fa-check-circle fa-sm"></i> ' . esc_html( $addon->info->title ) . '</li>';
52
+									if ($addons = $addon_obj->get_section_data('addons')) {
53
+										foreach ($addons as $addon) {
54
+											echo '<li><i class="far fa-check-circle fa-sm"></i> ' . esc_html($addon->info->title) . '</li>';
55 55
 										}
56 56
 									}
57 57
 									?>
58 58
 									</ul>
59 59
 
60 60
 									<div class="feature-cta">
61
-										<h3><?php esc_html_e( 'Membership Starts from', 'invoicing' ); ?></h3>
61
+										<h3><?php esc_html_e('Membership Starts from', 'invoicing'); ?></h3>
62 62
 										<h4>$99</h4>
63
-										<a href="https://wpinvoicing.com/downloads/membership/" target="_blank"><?php esc_attr_e( 'Buy Membership', 'invoicing' ); ?></a>
63
+										<a href="https://wpinvoicing.com/downloads/membership/" target="_blank"><?php esc_attr_e('Buy Membership', 'invoicing'); ?></a>
64 64
 									</div>
65
-									<h3><?php esc_html_e( 'Included Gateways:', 'invoicing' ); ?></h3>
65
+									<h3><?php esc_html_e('Included Gateways:', 'invoicing'); ?></h3>
66 66
 									<ul>
67 67
 										<?php
68
-										if ( $addons = $addon_obj->get_section_data( 'gateways' ) ) {
69
-											foreach ( $addons as $addon ) {
70
-												echo '<li><i class="far fa-check-circle fa-sm"></i> ' . esc_html( $addon->info->title ) . '</li>';
68
+										if ($addons = $addon_obj->get_section_data('gateways')) {
69
+											foreach ($addons as $addon) {
70
+												echo '<li><i class="far fa-check-circle fa-sm"></i> ' . esc_html($addon->info->title) . '</li>';
71 71
 											}
72 72
 										}
73 73
 										?>
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 						<div class="testimonial-content">
82 82
 							<div class="t-image">
83 83
 								<?php
84
-									echo '<img src="' . esc_url( plugins_url( 'images/t-image2.png', dirname( __FILE__ ) ) ) . '" > ';
84
+									echo '<img src="' . esc_url(plugins_url('images/t-image2.png', dirname(__FILE__))) . '" > ';
85 85
 								?>
86 86
 							</div>
87 87
 							<div class="t-content">
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 						<div class="testimonial-content">
102 102
 							<div class="t-image">
103 103
 								<?php
104
-									echo '<img src="' . esc_url( plugins_url( 'images/t-image1.png', dirname( __FILE__ ) ) ) . '" > ';
104
+									echo '<img src="' . esc_url(plugins_url('images/t-image1.png', dirname(__FILE__))) . '" > ';
105 105
 								?>
106 106
 							</div>
107 107
 							<div class="t-content">
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
 						</div>
118 118
 					</div>
119 119
 					<div class="member-footer">
120
-						<a class="footer-btn" href="https://wpinvoicing.com/downloads/membership/" target="_blank"><?php esc_html_e( 'Buy Membership', 'invoicing' ); ?></a>
121
-						<a class="footer-link" href="post-new.php?post_type=wpi_invoice"><?php esc_html_e( 'Create Invoice', 'invoicing' ); ?></a>
120
+						<a class="footer-btn" href="https://wpinvoicing.com/downloads/membership/" target="_blank"><?php esc_html_e('Buy Membership', 'invoicing'); ?></a>
121
+						<a class="footer-link" href="post-new.php?post_type=wpi_invoice"><?php esc_html_e('Create Invoice', 'invoicing'); ?></a>
122 122
 					</div>
123 123
 				</div>
124 124
 
@@ -129,55 +129,55 @@  discard block
 block discarded – undo
129 129
 		} else {
130 130
 			$installed_plugins = get_plugins();
131 131
             $addon_obj = new WPInv_Admin_Addons();
132
-			if ( $addons = $addon_obj->get_section_data( $current_tab ) ) :
132
+			if ($addons = $addon_obj->get_section_data($current_tab)) :
133 133
 				//print_r($addons);
134 134
 				?>
135 135
 				<ul class="wpi-products">
136 136
                 <?php
137
-                foreach ( $addons as $addon ) :
138
-                        if ( 965 == $addon->info->id ) {
139
-continue;}// don't show quote add on
137
+                foreach ($addons as $addon) :
138
+                        if (965 == $addon->info->id) {
139
+continue; }// don't show quote add on
140 140
 						?>
141 141
                         <li class="wpi-product">
142 142
 								<div class="wpi-product-title">
143 143
 									<h3>
144 144
                                     <?php
145
-										if ( ! empty( $addon->info->excerpt ) ) {
146
-										wpi_help_tip( $addon->info->excerpt, false, false, true );
145
+										if (!empty($addon->info->excerpt)) {
146
+										wpi_help_tip($addon->info->excerpt, false, false, true);
147 147
 										}
148
-										echo esc_html( $addon->info->title );
148
+										echo esc_html($addon->info->title);
149 149
                                         ?>
150 150
                                         </h3>
151 151
 								</div>
152 152
 
153 153
 								<span class="wpi-product-image">
154
-									<?php if ( ! empty( $addon->info->thumbnail ) ) : ?>
155
-										<img src="<?php echo esc_attr( $addon->info->thumbnail ); ?>"/>
154
+									<?php if (!empty($addon->info->thumbnail)) : ?>
155
+										<img src="<?php echo esc_attr($addon->info->thumbnail); ?>"/>
156 156
 									<?php
157 157
                                     endif;
158 158
 
159
-									if ( 'stripe-payment-gateway' == $addon->info->slug ) {
159
+									if ('stripe-payment-gateway' == $addon->info->slug) {
160 160
 										$addon->info->slug = 'getpaid-stripe-payments';
161 161
 										$addon->info->link = 'https://wordpress.org/plugins/getpaid-stripe-payments/';
162 162
 									}
163 163
 
164
-									if ( isset( $addon->info->link ) && substr( $addon->info->link, 0, 21 ) === 'https://wordpress.org' ) {
165
-										echo '<a href="' . esc_url( admin_url( '/plugin-install.php?tab=plugin-information&plugin=' . $addon->info->slug ) ) . '&width=770&height=660&TB_iframe=true" class="thickbox" >';
166
-										echo '<span class="wpi-product-info">' . esc_html__( 'More info', 'invoicing' ) . '</span>';
164
+									if (isset($addon->info->link) && substr($addon->info->link, 0, 21) === 'https://wordpress.org') {
165
+										echo '<a href="' . esc_url(admin_url('/plugin-install.php?tab=plugin-information&plugin=' . $addon->info->slug)) . '&width=770&height=660&TB_iframe=true" class="thickbox" >';
166
+										echo '<span class="wpi-product-info">' . esc_html__('More info', 'invoicing') . '</span>';
167 167
 										echo '</a>';
168
-									} elseif ( isset( $addon->info->link ) && ( substr( $addon->info->link, 0, 23 ) === 'https://wpinvoicing.com' || substr( $addon->info->link, 0, 21 ) === 'https://wpgetpaid.com' ) ) {
169
-										if ( defined( 'WP_EASY_UPDATES_ACTIVE' ) ) {
170
-											$url = admin_url( '/plugin-install.php?tab=plugin-information&plugin=' . $addon->info->slug . '&width=770&height=660&item_id=' . $addon->info->id . '&update_url=https://wpgetpaid.com&TB_iframe=true' );
168
+									} elseif (isset($addon->info->link) && (substr($addon->info->link, 0, 23) === 'https://wpinvoicing.com' || substr($addon->info->link, 0, 21) === 'https://wpgetpaid.com')) {
169
+										if (defined('WP_EASY_UPDATES_ACTIVE')) {
170
+											$url = admin_url('/plugin-install.php?tab=plugin-information&plugin=' . $addon->info->slug . '&width=770&height=660&item_id=' . $addon->info->id . '&update_url=https://wpgetpaid.com&TB_iframe=true');
171 171
 										} else {
172 172
 											// if installed show activation link
173
-											if ( isset( $installed_plugins['wp-easy-updates/external-updates.php'] ) ) {
173
+											if (isset($installed_plugins['wp-easy-updates/external-updates.php'])) {
174 174
 												$url = '#TB_inline?width=600&height=50&inlineId=wpi-wpeu-required-activation';
175 175
 											} else {
176 176
 												$url = '#TB_inline?width=600&height=50&inlineId=wpi-wpeu-required-for-external';
177 177
 											}
178 178
 										}
179
-										echo '<a href="' . esc_url( $url ) . '" class="thickbox">';
180
-										echo '<span class="wpi-product-info">' . esc_html__( 'More info', 'invoicing' ) . '</span>';
179
+										echo '<a href="' . esc_url($url) . '" class="thickbox">';
180
+										echo '<span class="wpi-product-info">' . esc_html__('More info', 'invoicing') . '</span>';
181 181
 										echo '</a>';
182 182
 									}
183 183
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 
189 189
 								<span class="wpi-product-button">
190 190
 									<?php
191
-                                    $addon_obj->output_button( $addon );
191
+                                    $addon_obj->output_button($addon);
192 192
 									?>
193 193
 								</span>
194 194
 
@@ -202,21 +202,21 @@  discard block
 block discarded – undo
202 202
 
203 203
 	<div class="clearfix" ></div>
204 204
 
205
-	<?php if ( $current_tab == 'addons' ) { ?>
206
-	<p><?php printf(  esc_attr__( 'All of our Addons can be found on wpGetPaid.com here: %sInvoicing Addons%s', 'invoicing' ), '<a href="https://wpinvoicing.com/downloads/category/addons/">','</a>' ); ?></p>
207
-	<?php } if ( $current_tab == 'gateways' ) { ?>
208
-    <p><?php printf( esc_attr__( 'All of our Payment Gateways can be found on wpGetPaid.com here: %sGetPaid Payment Gateways %s', 'invoicing' ), '<a href="https://wpinvoicing.com/downloads/category/gateways/">','</a>'  ); ?></p>
205
+	<?php if ($current_tab == 'addons') { ?>
206
+	<p><?php printf(esc_attr__('All of our Addons can be found on wpGetPaid.com here: %sInvoicing Addons%s', 'invoicing'), '<a href="https://wpinvoicing.com/downloads/category/addons/">', '</a>'); ?></p>
207
+	<?php } if ($current_tab == 'gateways') { ?>
208
+    <p><?php printf(esc_attr__('All of our Payment Gateways can be found on wpGetPaid.com here: %sGetPaid Payment Gateways %s', 'invoicing'), '<a href="https://wpinvoicing.com/downloads/category/gateways/">', '</a>'); ?></p>
209 209
     <?php } ?>
210 210
 
211
-	<div id="wpi-wpeu-required-activation" style="display:none;"><span class="wpi-notification "><?php echo wp_kses_post(  sprintf( __( "The plugin <a href='https://wpeasyupdates.com/' target='_blank'>WP Easy Updates</a> is required to check for and update some installed plugins/themes, please <a href='%s'>activate</a> it now.", 'invoicing' ), wp_nonce_url( admin_url( 'plugins.php?action=activate&plugin=wp-easy-updates/external-updates.php' ), 'activate-plugin_wp-easy-updates/external-updates.php' ) ) ); ?></span></div>
212
-	<div id="wpi-wpeu-required-for-external" style="display:none;"><span class="wpi-notification "><?php echo wp_kses_post( sprintf( __( "The plugin <a href='https://wpeasyupdates.com/' target='_blank'>WP Easy Updates</a> is required to check for and update some installed plugins/themes, please <a href='%s' onclick='window.open(\"https://wpeasyupdates.com/wp-easy-updates.zip\", \"_blank\");' >download</a> and install it now.", 'invoicing' ), admin_url( 'plugin-install.php?tab=upload&wpeu-install=true' ) ) ); ?></span></div>
211
+	<div id="wpi-wpeu-required-activation" style="display:none;"><span class="wpi-notification "><?php echo wp_kses_post(sprintf(__("The plugin <a href='https://wpeasyupdates.com/' target='_blank'>WP Easy Updates</a> is required to check for and update some installed plugins/themes, please <a href='%s'>activate</a> it now.", 'invoicing'), wp_nonce_url(admin_url('plugins.php?action=activate&plugin=wp-easy-updates/external-updates.php'), 'activate-plugin_wp-easy-updates/external-updates.php'))); ?></span></div>
212
+	<div id="wpi-wpeu-required-for-external" style="display:none;"><span class="wpi-notification "><?php echo wp_kses_post(sprintf(__("The plugin <a href='https://wpeasyupdates.com/' target='_blank'>WP Easy Updates</a> is required to check for and update some installed plugins/themes, please <a href='%s' onclick='window.open(\"https://wpeasyupdates.com/wp-easy-updates.zip\", \"_blank\");' >download</a> and install it now.", 'invoicing'), admin_url('plugin-install.php?tab=upload&wpeu-install=true'))); ?></span></div>
213 213
 	<div id="wpeu-licence-popup" style="display:none;">
214 214
 		<span class="wpi-notification noti-white">
215
-			<h3 class="wpeu-licence-title"><?php esc_html_e( 'Licence key', 'invoicing' ); ?></h3>
216
-			<input class="wpeu-licence-key" type="text" placeholder="<?php esc_attr_e( 'Enter your licence key', 'invoicing' ); ?>"> <button class="button-primary wpeu-licence-popup-button" ><?php esc_html_e( 'Install', 'invoicing' ); ?></button>
215
+			<h3 class="wpeu-licence-title"><?php esc_html_e('Licence key', 'invoicing'); ?></h3>
216
+			<input class="wpeu-licence-key" type="text" placeholder="<?php esc_attr_e('Enter your licence key', 'invoicing'); ?>"> <button class="button-primary wpeu-licence-popup-button" ><?php esc_html_e('Install', 'invoicing'); ?></button>
217 217
 			<br>
218 218
 			<?php
219
-			printf( esc_html__( '%1$sFind your licence key here%2$s OR %3$sBuy one here%4$s', 'invoicing' ), '<a href="https://wpinvoicing.com/your-account/" target="_blank">', '</a>', '<a class="wpeu-licence-link" href="https://wpinvoicing.com/downloads/category/addons/" target="_blank">', '</a>' );
219
+			printf(esc_html__('%1$sFind your licence key here%2$s OR %3$sBuy one here%4$s', 'invoicing'), '<a href="https://wpinvoicing.com/your-account/" target="_blank">', '</a>', '<a class="wpeu-licence-link" href="https://wpinvoicing.com/downloads/category/addons/" target="_blank">', '</a>');
220 220
 			?>
221 221
 		</span>
222 222
 	</div>
Please login to merge, or discard this patch.