@@ -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 ) ) { |
@@ -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() ); |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | if($type=='a'){ |
50 | 50 | $new_window = !empty($args['new_window']) ? ' target="_blank" ' : ''; |
51 | 51 | $output .= '<a href="' . $args['href'] . '"'.$new_window; |
52 | - }elseif($type=='badge'){ |
|
52 | + } elseif($type=='badge'){ |
|
53 | 53 | $output .= '<span '; |
54 | - }else{ |
|
54 | + } else{ |
|
55 | 55 | $output .= '<button type="' . $type . '" '; |
56 | 56 | } |
57 | 57 | |
@@ -118,9 +118,9 @@ discard block |
||
118 | 118 | // close |
119 | 119 | if($type=='a'){ |
120 | 120 | $output .= '</a>'; |
121 | - }elseif($type=='badge'){ |
|
121 | + } elseif($type=='badge'){ |
|
122 | 122 | $output .= '</span>'; |
123 | - }else{ |
|
123 | + } else{ |
|
124 | 124 | $output .= '</button>'; |
125 | 125 | } |
126 | 126 |
@@ -42,10 +42,7 @@ |
||
42 | 42 | |
43 | 43 | // set default icon |
44 | 44 | if(!$icon && $args['icon']!==false && $type){ |
45 | - if($type=='danger'){$icon = '<i class="fas fa-exclamation-circle"></i>';} |
|
46 | - elseif($type=='warning'){$icon = '<i class="fas fa-exclamation-triangle"></i>';} |
|
47 | - elseif($type=='success'){$icon = '<i class="fas fa-check-circle"></i>';} |
|
48 | - elseif($type=='info'){$icon = '<i class="fas fa-info-circle"></i>';} |
|
45 | + if($type=='danger'){$icon = '<i class="fas fa-exclamation-circle"></i>';} elseif($type=='warning'){$icon = '<i class="fas fa-exclamation-triangle"></i>';} elseif($type=='success'){$icon = '<i class="fas fa-check-circle"></i>';} elseif($type=='info'){$icon = '<i class="fas fa-info-circle"></i>';} |
|
49 | 46 | } |
50 | 47 | |
51 | 48 | $data = ''; |
@@ -55,7 +55,7 @@ |
||
55 | 55 | // dropdown-menu |
56 | 56 | if(!empty($args['dropdown_menu'])){ |
57 | 57 | $output .= $args['dropdown_menu']; |
58 | - }elseif(!empty($args['dropdown_items'])){ |
|
58 | + } elseif(!empty($args['dropdown_items'])){ |
|
59 | 59 | $output .= '<div class="dropdown-menu '.AUI_Component_Helper::esc_classes($args['dropdown_menu_class']).'" aria-labelledby="'.sanitize_html_class($args['id']).'">'; |
60 | 60 | $output .= aui()->render($args['dropdown_items']); |
61 | 61 | $output .= '</div>'; |
@@ -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' ) ) { |