@@ -227,7 +227,7 @@ |
||
227 | 227 | |
228 | 228 | if($args['type']=='image'){ |
229 | 229 | $output .= "<img src='https://maps.googleapis.com/maps/api/staticmap?center=".esc_attr($args['location'])."&maptype=".esc_attr($args['maptype'])."&zoom=".esc_attr($args['zoom'])."&size=".esc_attr($args['static_width'])."x".esc_attr($args['static_height'])."&key=".esc_attr($args['api_key'])."' />"; |
230 | - }else{ |
|
230 | + } else{ |
|
231 | 231 | $output .= "<iframe width='".esc_attr($args['width'])."' height='".esc_attr($args['height'])."' frameborder='0' allowfullscreen style='border:0;' src='https://www.google.com/maps/embed/v1/".esc_attr($args['type'])."?q=".esc_attr($args['location'])."&maptype=".esc_attr($args['maptype'])."&zoom=".esc_attr($args['zoom'])."&key=".esc_attr($args['api_key'])."' ></iframe> "; |
232 | 232 | } |
233 | 233 |
@@ -1100,10 +1100,11 @@ discard block |
||
1100 | 1100 | |
1101 | 1101 | $checked = false; |
1102 | 1102 | |
1103 | - if ( isset( $wpinv_options[ $args['id'] ] ) && $wpinv_options[ $args['id'] ] == $key ) |
|
1104 | - $checked = true; |
|
1105 | - elseif( isset( $args['std'] ) && $args['std'] == $key && ! isset( $wpinv_options[ $args['id'] ] ) ) |
|
1106 | - $checked = true; |
|
1103 | + if ( isset( $wpinv_options[ $args['id'] ] ) && $wpinv_options[ $args['id'] ] == $key ) { |
|
1104 | + $checked = true; |
|
1105 | + } elseif( isset( $args['std'] ) && $args['std'] == $key && ! isset( $wpinv_options[ $args['id'] ] ) ) { |
|
1106 | + $checked = true; |
|
1107 | + } |
|
1107 | 1108 | |
1108 | 1109 | echo '<input name="wpinv_settings[' . $sanitize_id . ']" id="wpinv_settings[' . $sanitize_id . '][' . $sanitize_key . ']" type="radio" value="' . $sanitize_key . '" ' . checked(true, $checked, false) . '/> '; |
1109 | 1110 | echo '<label for="wpinv_settings[' . $sanitize_id . '][' . $sanitize_key . ']">' . esc_html( $option ) . '</label><br/>'; |
@@ -1120,10 +1121,11 @@ discard block |
||
1120 | 1121 | foreach ( $args['options'] as $key => $option ) : |
1121 | 1122 | $sanitize_key = wpinv_sanitize_key( $key ); |
1122 | 1123 | |
1123 | - if ( isset( $wpinv_options['gateways'][ $key ] ) ) |
|
1124 | - $enabled = '1'; |
|
1125 | - else |
|
1126 | - $enabled = null; |
|
1124 | + if ( isset( $wpinv_options['gateways'][ $key ] ) ) { |
|
1125 | + $enabled = '1'; |
|
1126 | + } else { |
|
1127 | + $enabled = null; |
|
1128 | + } |
|
1127 | 1129 | |
1128 | 1130 | echo '<input name="wpinv_settings[' . esc_attr( $args['id'] ) . '][' . $sanitize_key . ']" id="wpinv_settings[' . $sanitize_id . '][' . $sanitize_key . ']" type="checkbox" value="1" ' . checked('1', $enabled, false) . '/> '; |
1129 | 1131 | echo '<label for="wpinv_settings[' . $sanitize_id . '][' . $sanitize_key . ']">' . esc_html( $option['admin_label'] ) . '</label><br/>'; |
@@ -1487,7 +1489,8 @@ discard block |
||
1487 | 1489 | <td class="wpinv_tax_action"><span class="wpinv_remove_tax_rate button-secondary"><?php _e( 'Remove Rate', 'invoicing' ); ?></span></td> |
1488 | 1490 | </tr> |
1489 | 1491 | <?php endforeach; ?> |
1490 | - <?php else : ?> |
|
1492 | + <?php else { |
|
1493 | + : ?> |
|
1491 | 1494 | <tr> |
1492 | 1495 | <td class="wpinv_tax_country"> |
1493 | 1496 | <?php |
@@ -1498,7 +1501,9 @@ discard block |
||
1498 | 1501 | 'show_option_none' => false, |
1499 | 1502 | 'class' => 'wpinv-tax-country wpi_select2', |
1500 | 1503 | 'placeholder' => __( 'Choose a country', 'invoicing' ) |
1501 | - ) ); ?> |
|
1504 | + ) ); |
|
1505 | +} |
|
1506 | +?> |
|
1502 | 1507 | </td> |
1503 | 1508 | <td class="wpinv_tax_state"> |
1504 | 1509 | <?php echo wpinv_html_text( array( |
@@ -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 | |
@@ -121,13 +120,13 @@ discard block |
||
121 | 120 | $button_args['file'] = isset($status['file']) ? $status['file'] : ''; |
122 | 121 | if(isset($status['status'])){$button_args['install_status'] = $status['status'];} |
123 | 122 | $button_args['update_url'] = "https://wpinvoicing.com"; |
124 | - }elseif($current_tab == 'themes' && isset($addon->info->id) && $addon->info->id) { |
|
123 | + } elseif($current_tab == 'themes' && isset($addon->info->id) && $addon->info->id) { |
|
125 | 124 | if(!empty($addon->licensing->edd_slug)){$button_args['slug'] = $addon->licensing->edd_slug;} |
126 | 125 | $button_args['installed'] = self::is_theme_installed($addon); |
127 | 126 | if(!in_array($button_args['slug'],$wp_org_themes)){ |
128 | 127 | $button_args['update_url'] = "https://wpinvoicing.com"; |
129 | 128 | } |
130 | - }elseif($current_tab == 'recommended_plugins' && isset($addon->info->slug) && $addon->info->slug){ |
|
129 | + } elseif($current_tab == 'recommended_plugins' && isset($addon->info->slug) && $addon->info->slug){ |
|
131 | 130 | include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); //for plugins_api.. |
132 | 131 | $status = install_plugin_install_status(array("slug"=>$button_args['slug'],"version"=>"")); |
133 | 132 | $button_args['install_status'] = isset($status['status']) ? $status['status'] : 'install'; |
@@ -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) ){ |
@@ -1,6 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | // Exit if accessed directly |
3 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
3 | +if ( ! defined( 'ABSPATH' ) ) { |
|
4 | + exit; |
|
5 | +} |
|
4 | 6 | if(!class_exists('Ayecode_Addons')) { |
5 | 7 | |
6 | 8 | abstract class Ayecode_Addons |
@@ -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 ) ) : |
@@ -151,14 +151,14 @@ discard block |
||
151 | 151 | echo '<a href="'.admin_url('/plugin-install.php?tab=plugin-information&plugin='.$addon->info->slug).'&width=770&height=660&TB_iframe=true" class="thickbox" >'; |
152 | 152 | echo '<span class="wpi-product-info">'.__('More info','invoicing').'</span>'; |
153 | 153 | echo '</a>'; |
154 | - }elseif(isset($addon->info->link) && substr( $addon->info->link, 0, 23 ) === "https://wpinvoicing.com"){ |
|
154 | + } elseif(isset($addon->info->link) && substr( $addon->info->link, 0, 23 ) === "https://wpinvoicing.com"){ |
|
155 | 155 | if(defined('WP_EASY_UPDATES_ACTIVE')){ |
156 | 156 | $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://wpinvoicing.com&TB_iframe=true'); |
157 | - }else{ |
|
157 | + } else{ |
|
158 | 158 | // if installed show activation link |
159 | 159 | if(isset($installed_plugins['wp-easy-updates/external-updates.php'])){ |
160 | 160 | $url = '#TB_inline?width=600&height=50&inlineId=wpi-wpeu-required-activation'; |
161 | - }else{ |
|
161 | + } else{ |
|
162 | 162 | $url = '#TB_inline?width=600&height=50&inlineId=wpi-wpeu-required-for-external'; |
163 | 163 | } |
164 | 164 | } |
@@ -132,11 +132,13 @@ |
||
132 | 132 | if ( 'id' == strtolower( $field ) ) { |
133 | 133 | // Make sure the value is numeric to avoid casting objects, for example, |
134 | 134 | // to int 1. |
135 | - if ( ! is_numeric( $value ) ) |
|
136 | - return false; |
|
135 | + if ( ! is_numeric( $value ) ) { |
|
136 | + return false; |
|
137 | + } |
|
137 | 138 | $value = intval( $value ); |
138 | - if ( $value < 1 ) |
|
139 | - return false; |
|
139 | + if ( $value < 1 ) { |
|
140 | + return false; |
|
141 | + } |
|
140 | 142 | } |
141 | 143 | |
142 | 144 | if ( ! $value || ! is_string( $field ) ) { |
@@ -5,7 +5,9 @@ |
||
5 | 5 | */ |
6 | 6 | |
7 | 7 | // Exit if accessed directly |
8 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
8 | +if ( ! defined( 'ABSPATH' ) ) { |
|
9 | + exit; |
|
10 | +} |
|
9 | 11 | |
10 | 12 | // Load WP_List_Table if not loaded |
11 | 13 | if ( ! class_exists( 'WP_List_Table' ) ) { |
@@ -112,8 +112,9 @@ |
||
112 | 112 | $views = apply_filters( 'wpinv_report_views', $views ); |
113 | 113 | $current = 'earnings'; |
114 | 114 | |
115 | - if ( isset( $_GET['view'] ) && array_key_exists( $_GET['view'], $views ) ) |
|
116 | - $current = $_GET['view']; |
|
115 | + if ( isset( $_GET['view'] ) && array_key_exists( $_GET['view'], $views ) ) { |
|
116 | + $current = $_GET['view']; |
|
117 | + } |
|
117 | 118 | |
118 | 119 | ?> |
119 | 120 | <form id="wpinv-reports-filter" method="get" class="tablenav"> |
@@ -974,8 +974,9 @@ |
||
974 | 974 | return false; |
975 | 975 | } |
976 | 976 | |
977 | - if ( empty( $this->ID ) ) |
|
978 | - return false; |
|
977 | + if ( empty( $this->ID ) ) { |
|
978 | + return false; |
|
979 | + } |
|
979 | 980 | |
980 | 981 | if ( ( ( is_user_logged_in() && wpinv_current_user_can_manage_invoicing() ) || $added_by_user ) && !$system ) { |
981 | 982 | $user = get_user_by( 'id', get_current_user_id() ); |