@@ -179,8 +179,9 @@ discard block |
||
179 | 179 | |
180 | 180 | // Setup possible parts |
181 | 181 | $templates = array(); |
182 | - if ( isset( $name ) ) |
|
183 | - $templates[] = $slug . '-' . $name . '.php'; |
|
182 | + if ( isset( $name ) ) { |
|
183 | + $templates[] = $slug . '-' . $name . '.php'; |
|
184 | + } |
|
184 | 185 | $templates[] = $slug . '.php'; |
185 | 186 | |
186 | 187 | // Allow template parts to be filtered |
@@ -198,8 +199,9 @@ discard block |
||
198 | 199 | foreach ( (array)$template_names as $template_name ) { |
199 | 200 | |
200 | 201 | // Continue if template is empty |
201 | - if ( empty( $template_name ) ) |
|
202 | - continue; |
|
202 | + if ( empty( $template_name ) ) { |
|
203 | + continue; |
|
204 | + } |
|
203 | 205 | |
204 | 206 | // Trim off any slashes from the template name |
205 | 207 | $template_name = ltrim( $template_name, '/' ); |
@@ -218,8 +220,9 @@ discard block |
||
218 | 220 | } |
219 | 221 | } |
220 | 222 | |
221 | - if ( ( true == $load ) && ! empty( $located ) ) |
|
222 | - load_template( $located, $require_once ); |
|
223 | + if ( ( true == $load ) && ! empty( $located ) ) { |
|
224 | + load_template( $located, $require_once ); |
|
225 | + } |
|
223 | 226 | |
224 | 227 | return $located; |
225 | 228 | } |
@@ -256,8 +256,9 @@ |
||
256 | 256 | } |
257 | 257 | |
258 | 258 | function wpinv_cart_needs_tax_address_fields() { |
259 | - if( !wpinv_is_cart_taxed() ) |
|
260 | - return false; |
|
259 | + if( !wpinv_is_cart_taxed() ) { |
|
260 | + return false; |
|
261 | + } |
|
261 | 262 | |
262 | 263 | return ! did_action( 'wpinv_after_cc_fields', 'wpinv_default_cc_address_fields' ); |
263 | 264 | } |
@@ -1,7 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | // don't load directly |
3 | -if ( !defined('ABSPATH') ) |
|
3 | +if ( !defined('ABSPATH') ) { |
|
4 | 4 | die('-1'); |
5 | +} |
|
5 | 6 | |
6 | 7 | $email_footer = apply_filters( 'wpinv_email_footer_text', wpinv_get_option( 'email_footer_text', get_bloginfo( 'name', 'display' ) . ' - ' . __( 'Powered by GetPaid', 'invoicing' ) ) ); |
7 | 8 | $email_footer = $email_footer ? wpautop( wp_kses_post( wptexturize( $email_footer ) ) ) : ''; |
@@ -19,12 +19,18 @@ |
||
19 | 19 | |
20 | 20 | <?php if ( ! empty( $logo_width ) && ! empty( $logo_height ) ) : ?> |
21 | 21 | <img class="logo" style="max-width:100%; width:<?php echo absint( $logo_width ); ?>px; height:<?php echo absint( $logo_height ); ?>px;" src="<?php echo esc_url( $logo ); ?>"> |
22 | - <?php else: ?> |
|
23 | - <img class="logo" style="max-width:100%;" src="<?php echo esc_url( $logo ); ?>"> |
|
22 | + <?php else { |
|
23 | + : ?> |
|
24 | + <img class="logo" style="max-width:100%;" src="<?php echo esc_url( $logo ); |
|
25 | +} |
|
26 | +?>"> |
|
24 | 27 | <?php endif; ?> |
25 | 28 | |
26 | - <?php else: ?> |
|
27 | - <h1 class="h3"><?php echo esc_html( wpinv_get_business_name() ); ?></h1> |
|
29 | + <?php else { |
|
30 | + : ?> |
|
31 | + <h1 class="h3"><?php echo esc_html( wpinv_get_business_name() ); |
|
32 | +} |
|
33 | +?></h1> |
|
28 | 34 | <?php endif; ?> |
29 | 35 | |
30 | 36 | </a> |
@@ -126,8 +126,12 @@ discard block |
||
126 | 126 | public function constants(){ |
127 | 127 | define('AUI_PRIMARY_COLOR_ORIGINAL', "#1e73be"); |
128 | 128 | define('AUI_SECONDARY_COLOR_ORIGINAL', '#6c757d'); |
129 | - if (!defined('AUI_PRIMARY_COLOR')) define('AUI_PRIMARY_COLOR', AUI_PRIMARY_COLOR_ORIGINAL); |
|
130 | - if (!defined('AUI_SECONDARY_COLOR')) define('AUI_SECONDARY_COLOR', AUI_SECONDARY_COLOR_ORIGINAL); |
|
129 | + if (!defined('AUI_PRIMARY_COLOR')) { |
|
130 | + define('AUI_PRIMARY_COLOR', AUI_PRIMARY_COLOR_ORIGINAL); |
|
131 | + } |
|
132 | + if (!defined('AUI_SECONDARY_COLOR')) { |
|
133 | + define('AUI_SECONDARY_COLOR', AUI_SECONDARY_COLOR_ORIGINAL); |
|
134 | + } |
|
131 | 135 | } |
132 | 136 | |
133 | 137 | /** |
@@ -233,7 +237,7 @@ discard block |
||
233 | 237 | |
234 | 238 | if( is_admin() && !$this->is_aui_screen()){ |
235 | 239 | // don't add wp-admin scripts if not requested to |
236 | - }else{ |
|
240 | + } else{ |
|
237 | 241 | $css_setting = current_action() == 'wp_enqueue_scripts' ? 'css' : 'css_backend'; |
238 | 242 | |
239 | 243 | $rtl = is_rtl() ? '-rtl' : ''; |
@@ -1051,7 +1055,7 @@ discard block |
||
1051 | 1055 | |
1052 | 1056 | if( is_admin() && !$this->is_aui_screen()){ |
1053 | 1057 | // don't add wp-admin scripts if not requested to |
1054 | - }else { |
|
1058 | + } else { |
|
1055 | 1059 | |
1056 | 1060 | $js_setting = current_action() == 'wp_enqueue_scripts' ? 'js' : 'js_backend'; |
1057 | 1061 | |
@@ -2093,7 +2097,9 @@ discard block |
||
2093 | 2097 | * @return mixed |
2094 | 2098 | */ |
2095 | 2099 | public static function minify_js($input) { |
2096 | - if(trim($input) === "") return $input; |
|
2100 | + if(trim($input) === "") { |
|
2101 | + return $input; |
|
2102 | + } |
|
2097 | 2103 | return preg_replace( |
2098 | 2104 | array( |
2099 | 2105 | // Remove comment(s) |
@@ -2125,7 +2131,9 @@ discard block |
||
2125 | 2131 | * @return mixed |
2126 | 2132 | */ |
2127 | 2133 | public static function minify_css($input) { |
2128 | - if(trim($input) === "") return $input; |
|
2134 | + if(trim($input) === "") { |
|
2135 | + return $input; |
|
2136 | + } |
|
2129 | 2137 | return preg_replace( |
2130 | 2138 | array( |
2131 | 2139 | // Remove comment(s) |
@@ -45,8 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | if($section_id=='recommended_plugins'){ |
47 | 47 | $section_data->products = self::get_recommend_wp_plugins_edd_formatted(); |
48 | - } |
|
49 | - elseif ( ! empty( $section ) ) { |
|
48 | + } elseif ( ! empty( $section ) ) { |
|
50 | 49 | if ( false === ( $section_data = get_transient( 'wpi_addons_section_' . $section_id ) ) ) { //@todo restore after testing |
51 | 50 | //if ( 1==1) { |
52 | 51 | |
@@ -119,14 +118,14 @@ discard block |
||
119 | 118 | $status = install_plugin_install_status(array("slug"=>$button_args['slug'],"version"=>"")); |
120 | 119 | $button_args['install_status'] = isset($status['status']) ? $status['status'] : 'install'; |
121 | 120 | $button_args['file'] = isset($status['file']) ? $status['file'] : ''; |
122 | - }elseif( ($current_tab == 'addons' || $current_tab =='gateways') && isset($addon->info->id) && $addon->info->id){ |
|
121 | + } elseif( ($current_tab == 'addons' || $current_tab =='gateways') && isset($addon->info->id) && $addon->info->id){ |
|
123 | 122 | include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); //for plugins_api.. |
124 | 123 | if(!empty($addon->licensing->edd_slug)){$button_args['slug'] = $addon->licensing->edd_slug;} |
125 | 124 | $status = self::install_plugin_install_status($addon); |
126 | 125 | $button_args['file'] = isset($status['file']) ? $status['file'] : ''; |
127 | 126 | if(isset($status['status'])){$button_args['install_status'] = $status['status'];} |
128 | 127 | $button_args['update_url'] = "https://wpinvoicing.com"; |
129 | - }elseif($current_tab == 'themes' && isset($addon->info->id) && $addon->info->id) { |
|
128 | + } elseif($current_tab == 'themes' && isset($addon->info->id) && $addon->info->id) { |
|
130 | 129 | if(!empty($addon->licensing->edd_slug)){$button_args['slug'] = $addon->licensing->edd_slug;} |
131 | 130 | $button_args['installed'] = self::is_theme_installed($addon); |
132 | 131 | if(!in_array($button_args['slug'],$wp_org_themes)){ |
@@ -139,7 +138,7 @@ discard block |
||
139 | 138 | if(is_object($addon->pricing)){ |
140 | 139 | $prices = (Array)$addon->pricing; |
141 | 140 | $button_args['price'] = reset($prices); |
142 | - }elseif(isset($addon->pricing)){ |
|
141 | + } elseif(isset($addon->pricing)){ |
|
143 | 142 | $button_args['price'] = $addon->pricing; |
144 | 143 | } |
145 | 144 | } |
@@ -160,7 +159,7 @@ discard block |
||
160 | 159 | if($button_args['installed'] && ($button_args['file'] || $button_args['type'] == 'themes')){ |
161 | 160 | if($button_args['type'] != 'themes'){ |
162 | 161 | $button_args['active'] = is_plugin_active($button_args['file']); |
163 | - }else{ |
|
162 | + } else{ |
|
164 | 163 | $button_args['active'] = self::is_theme_active($addon); |
165 | 164 | } |
166 | 165 | } |
@@ -169,27 +168,27 @@ discard block |
||
169 | 168 | if($button_args['active']){ |
170 | 169 | $button_args['button_text'] = __('Active','invoicing'); |
171 | 170 | $button_args['class'] = ' button-secondary disabled '; |
172 | - }elseif($button_args['installed']){ |
|
171 | + } elseif($button_args['installed']){ |
|
173 | 172 | $button_args['button_text'] = __('Activate','invoicing'); |
174 | 173 | |
175 | 174 | if($button_args['type'] != 'themes'){ |
176 | 175 | if ( current_user_can( 'manage_options' ) ) { |
177 | 176 | $button_args['url'] = wp_nonce_url(admin_url('plugins.php?action=activate&plugin='.$button_args['file']), 'activate-plugin_' . $button_args['file']); |
178 | - }else{ |
|
177 | + } else{ |
|
179 | 178 | $button_args['url'] = '#'; |
180 | 179 | } |
181 | - }else{ |
|
180 | + } else{ |
|
182 | 181 | if ( current_user_can( 'switch_themes' ) ) { |
183 | 182 | $button_args['url'] = self::get_theme_activation_url($addon); |
184 | - }else{ |
|
183 | + } else{ |
|
185 | 184 | $button_args['url'] = '#'; |
186 | 185 | } |
187 | 186 | } |
188 | 187 | |
189 | - }else{ |
|
188 | + } else{ |
|
190 | 189 | if($button_args['type'] == 'recommended_plugins'){ |
191 | 190 | $button_args['button_text'] = __('Install','invoicing'); |
192 | - }else{ |
|
191 | + } else{ |
|
193 | 192 | $button_args['button_text'] = __('Get it','invoicing'); |
194 | 193 | |
195 | 194 | /*if($button_args['type'] == 'themes' && in_array($button_args['slug'],$wp_org_themes) ){ |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | </div> |
127 | 127 | </div> |
128 | 128 | <?php |
129 | - }else{ |
|
129 | + } else{ |
|
130 | 130 | $installed_plugins = get_plugins(); |
131 | 131 | $addon_obj = new WPInv_Admin_Addons(); |
132 | 132 | if ($addons = $addon_obj->get_section_data( $current_tab ) ) : |
@@ -157,14 +157,14 @@ discard block |
||
157 | 157 | echo '<a href="'.admin_url('/plugin-install.php?tab=plugin-information&plugin='.$addon->info->slug).'&width=770&height=660&TB_iframe=true" class="thickbox" >'; |
158 | 158 | echo '<span class="wpi-product-info">'.__('More info','invoicing').'</span>'; |
159 | 159 | echo '</a>'; |
160 | - }elseif(isset($addon->info->link) && ( substr( $addon->info->link, 0, 23 ) === "https://wpinvoicing.com" || substr( $addon->info->link, 0, 21 ) === "https://wpgetpaid.com" ) ){ |
|
160 | + } elseif(isset($addon->info->link) && ( substr( $addon->info->link, 0, 23 ) === "https://wpinvoicing.com" || substr( $addon->info->link, 0, 21 ) === "https://wpgetpaid.com" ) ){ |
|
161 | 161 | if(defined('WP_EASY_UPDATES_ACTIVE')){ |
162 | 162 | $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'); |
163 | - }else{ |
|
163 | + } else{ |
|
164 | 164 | // if installed show activation link |
165 | 165 | if(isset($installed_plugins['wp-easy-updates/external-updates.php'])){ |
166 | 166 | $url = '#TB_inline?width=600&height=50&inlineId=wpi-wpeu-required-activation'; |
167 | - }else{ |
|
167 | + } else{ |
|
168 | 168 | $url = '#TB_inline?width=600&height=50&inlineId=wpi-wpeu-required-for-external'; |
169 | 169 | } |
170 | 170 | } |
@@ -55,9 +55,12 @@ |
||
55 | 55 | </li> |
56 | 56 | <?php endforeach; ?> |
57 | 57 | </ol> |
58 | - <?php else: ?> |
|
58 | + <?php else { |
|
59 | + : ?> |
|
59 | 60 | <div class='mb-3'> </div> |
60 | - <?php endif; ?> |
|
61 | + <?php endif; |
|
62 | +} |
|
63 | +?> |
|
61 | 64 | |
62 | 65 | <div class="text-center pb-3 mt-5"> |
63 | 66 | <a class=" text-decoration-none" href="https://wpgetpaid.com/"> |
@@ -36,8 +36,11 @@ |
||
36 | 36 | 'getpaid-nonce' |
37 | 37 | ); ?>" |
38 | 38 | class="btn btn-sm btn-outline-primary"><?php _e( 'Connect', 'invoicing' ); ?></a> |
39 | - <?php else: ?> |
|
40 | - <span class="btn btn-sm btn-success"><?php _e( 'Connected', 'invoicing' ); ?></span> |
|
39 | + <?php else { |
|
40 | + : ?> |
|
41 | + <span class="btn btn-sm btn-success"><?php _e( 'Connected', 'invoicing' ); |
|
42 | +} |
|
43 | +?></span> |
|
41 | 44 | <?php endif; ?> |
42 | 45 | </li> |
43 | 46 |