@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | License: GPLv3 |
12 | 12 | License URI: http://www.gnu.org/licenses/gpl-3.0.html |
13 | 13 | */ |
14 | -if (!defined('ABSPATH')) exit; |
|
14 | +if ( ! defined('ABSPATH')) exit; |
|
15 | 15 | |
16 | 16 | |
17 | 17 | //Define basic names |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | defined('CGSS_PATH') or define('CGSS_PATH', plugin_dir_path(__FILE__)); |
22 | 22 | defined('CGSS_FILE') or define('CGSS_FILE', plugin_basename(__FILE__)); |
23 | 23 | |
24 | -defined('CGSS_EXECUTE') or define('CGSS_EXECUTE', plugin_dir_path(__FILE__).'src/'); |
|
25 | -defined('CGSS_HELPER') or define('CGSS_HELPER', plugin_dir_path(__FILE__).'helper/'); |
|
26 | -defined('CGSS_TRANSLATE') or define('CGSS_TRANSLATE', plugin_basename( plugin_dir_path(__FILE__).'asset/ln/')); |
|
24 | +defined('CGSS_EXECUTE') or define('CGSS_EXECUTE', plugin_dir_path(__FILE__) . 'src/'); |
|
25 | +defined('CGSS_HELPER') or define('CGSS_HELPER', plugin_dir_path(__FILE__) . 'helper/'); |
|
26 | +defined('CGSS_TRANSLATE') or define('CGSS_TRANSLATE', plugin_basename(plugin_dir_path(__FILE__) . 'asset/ln/')); |
|
27 | 27 | |
28 | 28 | //change /wp-plugin-framework/ with your /plugin-name/ |
29 | -defined('CGSS_JS') or define('CGSS_JS', plugins_url().'/complete-google-seo-scan/asset/js/'); |
|
30 | -defined('CGSS_CSS') or define('CGSS_CSS', plugins_url().'/complete-google-seo-scan/asset/css/'); |
|
31 | -defined('CGSS_IMAGE') or define('CGSS_IMAGE', plugins_url().'/complete-google-seo-scan/asset/img/'); |
|
29 | +defined('CGSS_JS') or define('CGSS_JS', plugins_url() . '/complete-google-seo-scan/asset/js/'); |
|
30 | +defined('CGSS_CSS') or define('CGSS_CSS', plugins_url() . '/complete-google-seo-scan/asset/css/'); |
|
31 | +defined('CGSS_IMAGE') or define('CGSS_IMAGE', plugins_url() . '/complete-google-seo-scan/asset/img/'); |
|
32 | 32 | |
33 | 33 | |
34 | 34 | //The Plugin |
35 | 35 | require_once('autoload.php'); |
36 | -if ( class_exists( 'CGSS_BUILD' ) ) new CGSS_BUILD(); ?> |
|
37 | 36 | \ No newline at end of file |
37 | +if (class_exists('CGSS_BUILD')) new CGSS_BUILD(); ?> |
|
38 | 38 | \ No newline at end of file |
@@ -11,7 +11,9 @@ discard block |
||
11 | 11 | License: GPLv3 |
12 | 12 | License URI: http://www.gnu.org/licenses/gpl-3.0.html |
13 | 13 | */ |
14 | -if (!defined('ABSPATH')) exit; |
|
14 | +if (!defined('ABSPATH')) { |
|
15 | + exit; |
|
16 | +} |
|
15 | 17 | |
16 | 18 | |
17 | 19 | //Define basic names |
@@ -33,4 +35,7 @@ discard block |
||
33 | 35 | |
34 | 36 | //The Plugin |
35 | 37 | require_once('autoload.php'); |
36 | -if ( class_exists( 'CGSS_BUILD' ) ) new CGSS_BUILD(); ?> |
|
37 | 38 | \ No newline at end of file |
39 | +if ( class_exists( 'CGSS_BUILD' ) ) { |
|
40 | + new CGSS_BUILD(); |
|
41 | +} |
|
42 | +?> |
|
38 | 43 | \ No newline at end of file |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
2 | +if ( ! defined('ABSPATH')) exit; |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Perform scan action |
6 | 6 | */ |
7 | -if ( ! class_exists( 'CGSS_SCAN' ) ) { |
|
7 | +if ( ! class_exists('CGSS_SCAN')) { |
|
8 | 8 | |
9 | 9 | final class CGSS_SCAN { |
10 | 10 | |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | public function __construct() { |
13 | 13 | |
14 | 14 | $post_id = intval($_GET['scan']); |
15 | - $url = get_permalink( $post_id ); |
|
15 | + $url = get_permalink($post_id); |
|
16 | 16 | |
17 | 17 | if (class_exists('CGSS_CRAWL')) { |
18 | 18 | |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $crawl->execute(); |
22 | 22 | $this->result = $crawl->result(); |
23 | 23 | |
24 | - update_post_meta( $post_id, 'cgss_scan_result', $this->result ); |
|
24 | + update_post_meta($post_id, 'cgss_scan_result', $this->result); |
|
25 | 25 | |
26 | 26 | $this->render(); |
27 | 27 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $fb_like = $social['fb_like']; |
39 | 39 | |
40 | 40 | $score_html = |
41 | - '<span>'.sprintf(__('Overall SEO score %d out of 10. Total gPlus shares: %d Facebook shares: %d and likes: %d', 'cgss' ), $score, $gplus, $fb_share, $fb_like ).'</span>'; |
|
41 | + '<span>' . sprintf(__('Overall SEO score %d out of 10. Total gPlus shares: %d Facebook shares: %d and likes: %d', 'cgss'), $score, $gplus, $fb_share, $fb_like) . '</span>'; |
|
42 | 42 | |
43 | 43 | return $score_html; |
44 | 44 | } |
@@ -59,17 +59,17 @@ discard block |
||
59 | 59 | $not_found = __('NOT_FOUND', 'cgss'); |
60 | 60 | $snippet_html = |
61 | 61 | '<ul> |
62 | - <li><strong>'.__('Search snippet', 'cgss').':</strong> |
|
62 | + <li><strong>'.__('Search snippet', 'cgss') . ':</strong> |
|
63 | 63 | <ul> |
64 | - <li>'.sprintf(__('Title: %s', 'cgss'),($title ? $title : $not_found)).'</li> |
|
65 | - <li>'.sprintf(__('Description: %s', 'cgss'),($desc ? $desc : $not_found)).'</li> |
|
64 | + <li>'.sprintf(__('Title: %s', 'cgss'), ($title ? $title : $not_found)) . '</li> |
|
65 | + <li>'.sprintf(__('Description: %s', 'cgss'), ($desc ? $desc : $not_found)) . '</li> |
|
66 | 66 | </ul> |
67 | 67 | </li> |
68 | - <li><strong>'.__('Social snippet(OGP)', 'cgss').':</strong> |
|
68 | + <li><strong>'.__('Social snippet(OGP)', 'cgss') . ':</strong> |
|
69 | 69 | <ul> |
70 | - <li>'.sprintf(__('Title: %s', 'cgss'),($social_title ? $social_title : $not_found)).'</li> |
|
71 | - <li>'.sprintf(__('Description: %s', 'cgss'),( $social_desc ? $social_desc : $not_found)).'</li> |
|
72 | - <li>'.sprintf(__('Image: %s', 'cgss'),( $social_image ? $social_image : $not_found)).'</li> |
|
70 | + <li>'.sprintf(__('Title: %s', 'cgss'), ($social_title ? $social_title : $not_found)) . '</li> |
|
71 | + <li>'.sprintf(__('Description: %s', 'cgss'), ($social_desc ? $social_desc : $not_found)) . '</li> |
|
72 | + <li>'.sprintf(__('Image: %s', 'cgss'), ($social_image ? $social_image : $not_found)) . '</li> |
|
73 | 73 | </ul></li> |
74 | 74 | </ul>'; |
75 | 75 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $ratio = $text['ratio']; |
87 | 87 | |
88 | 88 | $htags = $text['htags']; |
89 | - $headings = implode( ', ', $htags['names'] ); |
|
89 | + $headings = implode(', ', $htags['names']); |
|
90 | 90 | |
91 | 91 | $links = $text['links']; |
92 | 92 | $link_count = $links['count']; |
@@ -95,11 +95,11 @@ discard block |
||
95 | 95 | |
96 | 96 | $text_html = |
97 | 97 | '<ul> |
98 | - <li>'.sprintf(__('Keywords: %s','cgss'), $keys).'</li> |
|
99 | - <li>'.sprintf(__('Number of words: %s','cgss'), $count).'</li> |
|
100 | - <li>'.sprintf(__('Text to html ratio: %s percent','cgss'), $ratio).'</li> |
|
101 | - <li>'.sprintf(__('Heading tags in text hierarchy: %s','cgss'), $headings).'</li> |
|
102 | - <li>'.sprintf(__('Total Links: %d, Nofollow Links %d, External Links: %d','cgss'), $link_count, $link_nofollow, $link_external).'</li> |
|
98 | + <li>'.sprintf(__('Keywords: %s', 'cgss'), $keys) . '</li> |
|
99 | + <li>'.sprintf(__('Number of words: %s', 'cgss'), $count) . '</li> |
|
100 | + <li>'.sprintf(__('Text to html ratio: %s percent', 'cgss'), $ratio) . '</li> |
|
101 | + <li>'.sprintf(__('Heading tags in text hierarchy: %s', 'cgss'), $headings) . '</li> |
|
102 | + <li>'.sprintf(__('Total Links: %d, Nofollow Links %d, External Links: %d', 'cgss'), $link_count, $link_nofollow, $link_external) . '</li> |
|
103 | 103 | </ul>'; |
104 | 104 | |
105 | 105 | return $text_html; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | $tag_style = $design['tag_style']; |
118 | 118 | $tag_style_count = $tag_style['count']; |
119 | - $tag_style_attributes = implode( ', ', $tag_style['tags'] ); |
|
119 | + $tag_style_attributes = implode(', ', $tag_style['tags']); |
|
120 | 120 | |
121 | 121 | $nested_table = $design['nested_table']; |
122 | 122 | $vport = $design['vport']; |
@@ -127,11 +127,11 @@ discard block |
||
127 | 127 | |
128 | 128 | $design_html = |
129 | 129 | '<ul> |
130 | - <li>'.sprintf(__('Total images: %d and images without alt tags: %d','cgss'), $image_count, $image_no_alt_count).'</li> |
|
131 | - <li>'.sprintf(__('iframe: %d','cgss'), $iframe).'</li> |
|
132 | - <li>'.sprintf(__('Nested Tables: %d','cgss'), $nested_table).'</li> |
|
133 | - <li>'.sprintf(__('Tags with style attribute: %s(%s)','cgss'), $tag_style_count, $tag_style_attributes).'</li> |
|
134 | - <li>'.sprintf(__('Mobile optimization: Viewport Tag: %d, @media Queries: %d','cgss'), $vport, $media).'</li> |
|
130 | + <li>'.sprintf(__('Total images: %d and images without alt tags: %d', 'cgss'), $image_count, $image_no_alt_count) . '</li> |
|
131 | + <li>'.sprintf(__('iframe: %d', 'cgss'), $iframe) . '</li> |
|
132 | + <li>'.sprintf(__('Nested Tables: %d', 'cgss'), $nested_table) . '</li> |
|
133 | + <li>'.sprintf(__('Tags with style attribute: %s(%s)', 'cgss'), $tag_style_count, $tag_style_attributes) . '</li> |
|
134 | + <li>'.sprintf(__('Mobile optimization: Viewport Tag: %d, @media Queries: %d', 'cgss'), $vport, $media) . '</li> |
|
135 | 135 | </ul>'; |
136 | 136 | |
137 | 137 | return $design_html; |
@@ -153,17 +153,17 @@ discard block |
||
153 | 153 | $alive = $crawl['alive']; |
154 | 154 | $robot = $crawl['meta_robot']; |
155 | 155 | |
156 | - $on = __( 'on', 'cgss' ); |
|
157 | - $off = __( 'off', 'cgss' ); |
|
156 | + $on = __('on', 'cgss'); |
|
157 | + $off = __('off', 'cgss'); |
|
158 | 158 | |
159 | 159 | $crawl_html = |
160 | 160 | '<ul> |
161 | - <li>'.sprintf(__('Your URL parameters: SSL security: %s, Static url: %s, underscores in Url: %s','cgss'), (!$ssl ? $off : $on ), (!$dynamic ? $off : $on ), (!$underscore ? $off : $on )).'</li> |
|
162 | - <li>'.sprintf(__('If modified since header: %s','cgss'), ($if_mod == 0 ? $off : $on )).'</li> |
|
163 | - <li>'.sprintf(__('Canonical Url: %s','cgss'), ($cano == 0 ? $off : $on )).'</li> |
|
164 | - <li>'.sprintf(__('Meta Robot: %s','cgss'), (!$robot['ok'] ? $off : $on )).'</li> |
|
165 | - <li>'.sprintf(__('IP Forward: %s','cgss'), ($ip ? $ip : $off )).'</li> |
|
166 | - <li>'.sprintf(__('Keep alive connection: %s','cgss'), ($alive == 0 ? $off : $on )).'</li> |
|
161 | + <li>'.sprintf(__('Your URL parameters: SSL security: %s, Static url: %s, underscores in Url: %s', 'cgss'), ( ! $ssl ? $off : $on), ( ! $dynamic ? $off : $on), ( ! $underscore ? $off : $on)) . '</li> |
|
162 | + <li>'.sprintf(__('If modified since header: %s', 'cgss'), ($if_mod == 0 ? $off : $on)) . '</li> |
|
163 | + <li>'.sprintf(__('Canonical Url: %s', 'cgss'), ($cano == 0 ? $off : $on)) . '</li> |
|
164 | + <li>'.sprintf(__('Meta Robot: %s', 'cgss'), ( ! $robot['ok'] ? $off : $on)) . '</li> |
|
165 | + <li>'.sprintf(__('IP Forward: %s', 'cgss'), ($ip ? $ip : $off)) . '</li> |
|
166 | + <li>'.sprintf(__('Keep alive connection: %s', 'cgss'), ($alive == 0 ? $off : $on)) . '</li> |
|
167 | 167 | </ul>'; |
168 | 168 | |
169 | 169 | return $crawl_html; |
@@ -182,16 +182,16 @@ discard block |
||
182 | 182 | $css = $speed['css']; |
183 | 183 | $js = $speed['js']; |
184 | 184 | |
185 | - $on = __( 'on', 'cgss' ); |
|
186 | - $off = __( 'off', 'cgss' ); |
|
185 | + $on = __('on', 'cgss'); |
|
186 | + $off = __('off', 'cgss'); |
|
187 | 187 | |
188 | 188 | $speed_html = |
189 | 189 | '<ul> |
190 | - <li>'. sprintf( __( 'Header response time %s s and page downloading time %s s', 'cgss' ), $res_time, $down_time ). '</li> |
|
191 | - <li>'.sprintf(__('gZip compression: %s','cgss'), ($gzip ? $off : $on )).'</li> |
|
192 | - <li>'.sprintf(__('Browser caching: %s','cgss'), ($cache ? $off : $on )).'</li> |
|
193 | - <li>'.sprintf(__('Requests made by CSS is %s and by JS is %s','cgss'), $css['count'], $js['count']).'</li> |
|
194 | - <li>'.sprintf(__('Resources can be compressed by %s kb for CSS and %s kb for JS','cgss'), $css['compress_num'], $js['compress_num']).'</li> |
|
190 | + <li>'. sprintf(__('Header response time %s s and page downloading time %s s', 'cgss'), $res_time, $down_time) . '</li> |
|
191 | + <li>'.sprintf(__('gZip compression: %s', 'cgss'), ($gzip ? $off : $on)) . '</li> |
|
192 | + <li>'.sprintf(__('Browser caching: %s', 'cgss'), ($cache ? $off : $on)) . '</li> |
|
193 | + <li>'.sprintf(__('Requests made by CSS is %s and by JS is %s', 'cgss'), $css['count'], $js['count']) . '</li> |
|
194 | + <li>'.sprintf(__('Resources can be compressed by %s kb for CSS and %s kb for JS', 'cgss'), $css['compress_num'], $js['compress_num']) . '</li> |
|
195 | 195 | </ul>'; |
196 | 196 | |
197 | 197 | return $speed_html; |
@@ -201,19 +201,19 @@ discard block |
||
201 | 201 | // Render the HTML |
202 | 202 | public function render() { |
203 | 203 | |
204 | - $this->score_html = $this->score_html(); |
|
205 | - $this->snippets_html = $this->snippet_display(); |
|
204 | + $this->score_html = $this->score_html(); |
|
205 | + $this->snippets_html = $this->snippet_display(); |
|
206 | 206 | $this->text_html = $this->text_display(); |
207 | 207 | $this->design_html = $this->design_display(); |
208 | 208 | $this->crawl_html = $this->crawl_display(); |
209 | 209 | $this->speed_html = $this->speed_display(); |
210 | 210 | |
211 | - $this->box( null, null, $this->score_html ); |
|
212 | - $this->box( __( 'Snippets', 'cgss' ), $this->dashicon('align-none'), $this->snippets_html ); |
|
213 | - $this->box( __( 'Text & Links', 'cgss' ), $this->dashicon('text'), $this->text_html ); |
|
214 | - $this->box( __( 'Design', 'cgss' ), $this->dashicon('smartphone'), $this->design_html ); |
|
215 | - $this->box( __( 'Crawl', 'cgss' ), $this->dashicon('randomize'), $this->crawl_html ); |
|
216 | - $this->box( __( 'Speed', 'cgss' ), $this->dashicon('clock'), $this->speed_html ); |
|
211 | + $this->box(null, null, $this->score_html); |
|
212 | + $this->box(__('Snippets', 'cgss'), $this->dashicon('align-none'), $this->snippets_html); |
|
213 | + $this->box(__('Text & Links', 'cgss'), $this->dashicon('text'), $this->text_html); |
|
214 | + $this->box(__('Design', 'cgss'), $this->dashicon('smartphone'), $this->design_html); |
|
215 | + $this->box(__('Crawl', 'cgss'), $this->dashicon('randomize'), $this->crawl_html); |
|
216 | + $this->box(__('Speed', 'cgss'), $this->dashicon('clock'), $this->speed_html); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | |
234 | 234 | public function dashicon($icon) { |
235 | 235 | |
236 | - return '<span class="dashicons dashicons-'.$icon.'"></span>'; |
|
236 | + return '<span class="dashicons dashicons-' . $icon . '"></span>'; |
|
237 | 237 | } |
238 | 238 | } |
239 | 239 | } ?> |
240 | 240 | \ No newline at end of file |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
2 | +if ( ! defined('ABSPATH')) exit; |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Perform fetch insight action |
6 | 6 | */ |
7 | -if ( ! class_exists( 'CGSS_INSIGHT' ) ) { |
|
7 | +if ( ! class_exists('CGSS_INSIGHT')) { |
|
8 | 8 | |
9 | 9 | final class CGSS_INSIGHT { |
10 | 10 | |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $this->social, |
35 | 35 | ); |
36 | 36 | foreach ($result as $key => $value) { |
37 | - $sql = $wpdb->prepare("UPDATE {$wpdb->prefix}cgss_insight SET remark = %s WHERE ID = %d", $value, ($key+1)); |
|
37 | + $sql = $wpdb->prepare("UPDATE {$wpdb->prefix}cgss_insight SET remark = %s WHERE ID = %d", $value, ($key + 1)); |
|
38 | 38 | $update = $wpdb->query($sql); |
39 | 39 | } |
40 | 40 | } |
@@ -45,9 +45,9 @@ discard block |
||
45 | 45 | |
46 | 46 | $score = $this->data['score']; |
47 | 47 | $this->count = count($score); |
48 | - $avarage_score = round(array_sum($score)/count($score), 0); |
|
48 | + $avarage_score = round(array_sum($score) / count($score), 0); |
|
49 | 49 | |
50 | - $this->score = sprintf(__('Avarage SEO score is %d', 'cgss'),$avarage_score); |
|
50 | + $this->score = sprintf(__('Avarage SEO score is %d', 'cgss'), $avarage_score); |
|
51 | 51 | $this->snippet = $this->snippet_analyze(); |
52 | 52 | $this->text = $this->text_analyze(); |
53 | 53 | $this->links = $this->link_analyze(); |
@@ -68,10 +68,10 @@ discard block |
||
68 | 68 | $count = round(array_sum(array_column($links, 'count')) / $this->count, 0); |
69 | 69 | $external = round(array_sum(array_column($links, 'external')) / $this->count, 0); |
70 | 70 | $nofollow = round(array_sum(array_column($links, 'external')) / $this->count, 0); |
71 | - $external_percentage = round(($external/$count)*100, 0); |
|
72 | - $nofollow_percentage = round(($nofollow/$count)*100, 0); |
|
71 | + $external_percentage = round(($external / $count) * 100, 0); |
|
72 | + $nofollow_percentage = round(($nofollow / $count) * 100, 0); |
|
73 | 73 | |
74 | - $output = sprintf(__('Avarage', 'cgss') . ' '. _n( '%d link is','%d links are', $count, 'cgss' ) . ' ' . __('found per page and %d percent are external and %d percent are nofollow among them.', 'cgss'),$count,$external_percentage,$nofollow_percentage); |
|
74 | + $output = sprintf(__('Avarage', 'cgss') . ' ' . _n('%d link is', '%d links are', $count, 'cgss') . ' ' . __('found per page and %d percent are external and %d percent are nofollow among them.', 'cgss'), $count, $external_percentage, $nofollow_percentage); |
|
75 | 75 | return $output; |
76 | 76 | } |
77 | 77 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | $key_count = round(array_sum($key_collect) / $this->count, 1); |
95 | 95 | $percent = round(array_sum($percent_collect) / $this->count, 1); |
96 | 96 | |
97 | - $output = sprintf(__('Avarage foucs keyword is', 'cgss') . ' ' . _n( '%d word','%d words',$key_count, 'cgss' ) . ' ' . __('long with keywords frequency of %d percent','cgss'),$key_count,$percent); |
|
97 | + $output = sprintf(__('Avarage foucs keyword is', 'cgss') . ' ' . _n('%d word', '%d words', $key_count, 'cgss') . ' ' . __('long with keywords frequency of %d percent', 'cgss'), $key_count, $percent); |
|
98 | 98 | |
99 | 99 | return $output; |
100 | 100 | } |
@@ -109,14 +109,14 @@ discard block |
||
109 | 109 | $image_count = array_sum(array_column($images, 'count')); |
110 | 110 | $no_alt_image = array_sum(array_column($images, 'no_alt_count')); |
111 | 111 | |
112 | - $avg_image = round(($image_count/$this->count), 0); |
|
112 | + $avg_image = round(($image_count / $this->count), 0); |
|
113 | 113 | |
114 | - $output = sprintf(__('Avarage', 'cgss') . ' ' . _n( '%d image is', '%d images are', $avg_image, 'cgss' ) . ' ' . __( 'found per page and', 'cgss'),$avg_image) . ' '; |
|
114 | + $output = sprintf(__('Avarage', 'cgss') . ' ' . _n('%d image is', '%d images are', $avg_image, 'cgss') . ' ' . __('found per page and', 'cgss'), $avg_image) . ' '; |
|
115 | 115 | if ($no_alt_image == 0) { |
116 | 116 | $output .= __('all of them are optimized', 'cgss'); |
117 | 117 | } else { |
118 | - $no_alt_percent = round(($no_alt_image/$image_count)*100, 0); |
|
119 | - $output .= sprintf(__('%d percent among them doesn\'t have alt tag', 'cgss'),$no_alt_percent); |
|
118 | + $no_alt_percent = round(($no_alt_image / $image_count) * 100, 0); |
|
119 | + $output .= sprintf(__('%d percent among them doesn\'t have alt tag', 'cgss'), $no_alt_percent); |
|
120 | 120 | } |
121 | 121 | return $output; |
122 | 122 | |
@@ -132,8 +132,8 @@ discard block |
||
132 | 132 | if ($vport == $this->count) { |
133 | 133 | $output = __('All pages are mobile optimized', 'cgss'); |
134 | 134 | } else { |
135 | - $no_mobile_percent = round(($vport/$this->count)*100, 0); |
|
136 | - $output = sprintf(__('%d percent pages aren\'t mobile optimized', 'cgss'),$no_mobile_percent); |
|
135 | + $no_mobile_percent = round(($vport / $this->count) * 100, 0); |
|
136 | + $output = sprintf(__('%d percent pages aren\'t mobile optimized', 'cgss'), $no_mobile_percent); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | return $output; |
@@ -147,10 +147,10 @@ discard block |
||
147 | 147 | $res_time = array_sum(array_column($speed, 'res_time')); |
148 | 148 | $down_time = array_sum(array_column($speed, 'down_time')); |
149 | 149 | |
150 | - $avg_res_time = round(($res_time/$this->count), 2); |
|
151 | - $avg_down_time = round(($down_time/$this->count), 2); |
|
150 | + $avg_res_time = round(($res_time / $this->count), 2); |
|
151 | + $avg_down_time = round(($down_time / $this->count), 2); |
|
152 | 152 | |
153 | - $output = sprintf( __('Average response time is %d s and average download time is %d s', 'cgss'), $avg_res_time, $avg_down_time); |
|
153 | + $output = sprintf(__('Average response time is %d s and average download time is %d s', 'cgss'), $avg_res_time, $avg_down_time); |
|
154 | 154 | |
155 | 155 | return $output; |
156 | 156 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $fb_share = array_sum(array_column($social, 'fb_share')); |
166 | 166 | $fb_like = array_sum(array_column($social, 'fb_like')); |
167 | 167 | |
168 | - $output = sprintf( __('Total', 'cgss' ). ' ' . _n( '%d share', '%d shares', $gplus, 'cgss' ) . ' ' . __( 'in g+ and', 'cgss' ). ' ' . _n( '%d share', '%d shares', $fb_share, 'cgss' ) . ' ' . __( 'in FB and', 'cgss' ). ' ' . _n( '%d FB like', '%d FB likes', $fb_like, 'cgss' ) . ' ' . __( 'are present', 'cgss'), $gplus, $fb_share, $fb_like); |
|
168 | + $output = sprintf(__('Total', 'cgss') . ' ' . _n('%d share', '%d shares', $gplus, 'cgss') . ' ' . __('in g+ and', 'cgss') . ' ' . _n('%d share', '%d shares', $fb_share, 'cgss') . ' ' . __('in FB and', 'cgss') . ' ' . _n('%d FB like', '%d FB likes', $fb_like, 'cgss') . ' ' . __('are present', 'cgss'), $gplus, $fb_share, $fb_like); |
|
169 | 169 | |
170 | 170 | return $output; |
171 | 171 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $count = round(array_sum(array_column($text, 'count')) / $this->count, 0); |
179 | 179 | $ratio = round(array_sum(array_column($text, 'ratio')) / $this->count, 2); |
180 | 180 | |
181 | - $output = sprintf(__('Avarage', 'cgss') . ' ' . _n('%d word is','%d words are',$count,'cgss') . ' ' . __( 'found per page and avarage text to HTML ratio is %d percent', 'cgss'),$count,$ratio); |
|
181 | + $output = sprintf(__('Avarage', 'cgss') . ' ' . _n('%d word is', '%d words are', $count, 'cgss') . ' ' . __('found per page and avarage text to HTML ratio is %d percent', 'cgss'), $count, $ratio); |
|
182 | 182 | return $output; |
183 | 183 | } |
184 | 184 | |
@@ -191,13 +191,13 @@ discard block |
||
191 | 191 | foreach ($snippets as $snippet) { |
192 | 192 | $title = $snippet['title']; |
193 | 193 | $desc = $snippet['desc']; |
194 | - if (!empty($title) && !empty($desc)) { |
|
194 | + if ( ! empty($title) && ! empty($desc)) { |
|
195 | 195 | $snip_count++; |
196 | 196 | } |
197 | 197 | } |
198 | 198 | $snip_fraction = $this->count - $snip_count; |
199 | 199 | |
200 | - $output = ($snip_fraction == 0) ? __( 'All snippets are ok', 'cgss' ) : sprintf(_n('%d page', '%d pages', $snip_fraction, 'cgss'), $snip_fraction) . ' ' . __( 'have incomplete snippets', 'cgss' ); |
|
200 | + $output = ($snip_fraction == 0) ? __('All snippets are ok', 'cgss') : sprintf(_n('%d page', '%d pages', $snip_fraction, 'cgss'), $snip_fraction) . ' ' . __('have incomplete snippets', 'cgss'); |
|
201 | 201 | return $output; |
202 | 202 | } |
203 | 203 | |
@@ -207,12 +207,12 @@ discard block |
||
207 | 207 | |
208 | 208 | global $wpdb; |
209 | 209 | $sql = "SELECT ID FROM {$wpdb->prefix}posts WHERE post_type!='attachment'"; |
210 | - $ids = $wpdb->get_results( $sql, 'ARRAY_A' );; |
|
210 | + $ids = $wpdb->get_results($sql, 'ARRAY_A'); ; |
|
211 | 211 | |
212 | 212 | $data_piece = array(); |
213 | 213 | foreach ($ids as $id) { |
214 | 214 | |
215 | - $meta = get_post_meta( $id['ID'], 'cgss_scan_result', true ); |
|
215 | + $meta = get_post_meta($id['ID'], 'cgss_scan_result', true); |
|
216 | 216 | if ($meta) { |
217 | 217 | $data_piece[] = $meta; |
218 | 218 | } |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
2 | +if ( ! defined('ABSPATH')) exit; |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Implimentation of WordPress inbuilt functions for plugin activation. |
6 | 6 | */ |
7 | -if ( ! class_exists( 'CGSS_INSTALL' ) ) { |
|
7 | +if ( ! class_exists('CGSS_INSTALL')) { |
|
8 | 8 | |
9 | 9 | final class CGSS_INSTALL { |
10 | 10 | |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | |
26 | 26 | |
27 | 27 | public function execute() { |
28 | - add_action( 'plugins_loaded', array( $this, 'text_domain_cb' ) ); |
|
29 | - add_action( 'admin_notices', array( $this, 'php_ver_incompatible' ) ); |
|
30 | - add_filter( 'plugin_action_links', array( $this, 'menu_page_link' ), 10, 2 ); |
|
28 | + add_action('plugins_loaded', array($this, 'text_domain_cb')); |
|
29 | + add_action('admin_notices', array($this, 'php_ver_incompatible')); |
|
30 | + add_filter('plugin_action_links', array($this, 'menu_page_link'), 10, 2); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | //Load plugin textdomain |
36 | 36 | public function text_domain_cb() { |
37 | 37 | |
38 | - load_plugin_textdomain( $this->textDomin, false, CGSS_LN ); |
|
38 | + load_plugin_textdomain($this->textDomin, false, CGSS_LN); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | |
@@ -43,9 +43,9 @@ discard block |
||
43 | 43 | //Define low php verson errors |
44 | 44 | public function php_ver_incompatible() { |
45 | 45 | |
46 | - if ( version_compare( phpversion(), $this->phpVerAllowed, '<' ) ) : |
|
47 | - $text = __( 'The Plugin can\'t be activated because your PHP version', 'InLinkMaster' ); |
|
48 | - $text_last = __( 'is less than required 5.3. See more information', 'InLinkMaster' ); |
|
46 | + if (version_compare(phpversion(), $this->phpVerAllowed, '<')) : |
|
47 | + $text = __('The Plugin can\'t be activated because your PHP version', 'InLinkMaster'); |
|
48 | + $text_last = __('is less than required 5.3. See more information', 'InLinkMaster'); |
|
49 | 49 | $text_link = 'php.net/eol.php'; ?> |
50 | 50 | |
51 | 51 | <div id="message" class="updated notice notice-success is-dismissible"><p><?php echo $text . ' ' . phpversion() . ' ' . $text_last . ': '; ?><a href="http://php.net/eol.php/" target="_blank"><?php echo $text_link; ?></a></p></div> |
@@ -55,20 +55,20 @@ discard block |
||
55 | 55 | |
56 | 56 | |
57 | 57 | // Add settings link to plugin page |
58 | - public function menu_page_link( $links, $file ) { |
|
58 | + public function menu_page_link($links, $file) { |
|
59 | 59 | |
60 | 60 | if ($this->pluginPageLinks) { |
61 | 61 | static $this_plugin; |
62 | - if ( ! $this_plugin ) { |
|
62 | + if ( ! $this_plugin) { |
|
63 | 63 | $this_plugin = CGSS_FILE; |
64 | 64 | } |
65 | - if ( $file == $this_plugin ) { |
|
65 | + if ($file == $this_plugin) { |
|
66 | 66 | $shift_link = array(); |
67 | 67 | foreach ($this->pluginPageLinks as $value) { |
68 | - $shift_link[] = '<a href="'.$value['slug'].'">'.$value['label'].'</a>'; |
|
68 | + $shift_link[] = '<a href="' . $value['slug'] . '">' . $value['label'] . '</a>'; |
|
69 | 69 | } |
70 | - foreach( $shift_link as $val ) { |
|
71 | - array_unshift( $links, $val ); |
|
70 | + foreach ($shift_link as $val) { |
|
71 | + array_unshift($links, $val); |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | return $links; |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + exit; |
|
4 | +} |
|
3 | 5 | |
4 | 6 | /** |
5 | 7 | * Implimentation of WordPress inbuilt functions for plugin activation. |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
2 | +if ( ! defined('ABSPATH')) exit; |
|
3 | 3 | |
4 | 4 | //Main plugin object to define the plugin |
5 | -if ( ! class_exists( 'CGSS_BUILD' ) ) { |
|
5 | +if ( ! class_exists('CGSS_BUILD')) { |
|
6 | 6 | |
7 | 7 | final class CGSS_BUILD { |
8 | 8 | |
@@ -17,8 +17,8 @@ discard block |
||
17 | 17 | $install->phpVerAllowed = '5.4'; |
18 | 18 | $install->pluginPageLinks = array( |
19 | 19 | array( |
20 | - 'slug' => home_url().'/wp-admin/admin.php?page=seo-scan', |
|
21 | - 'label' => __( 'Dashboard', 'cgss' ) |
|
20 | + 'slug' => home_url() . '/wp-admin/admin.php?page=seo-scan', |
|
21 | + 'label' => __('Dashboard', 'cgss') |
|
22 | 22 | ), |
23 | 23 | ); |
24 | 24 | $install->execute(); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | public function db_install() { |
30 | 30 | |
31 | - if ( class_exists( 'CGSS_DB' ) ) { |
|
31 | + if (class_exists('CGSS_DB')) { |
|
32 | 32 | $db = new CGSS_DB(); |
33 | 33 | $db->table = 'cgss_insight'; |
34 | 34 | $db->sql = "ID mediumint(9) NOT NULL AUTO_INCREMENT, |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $tableName = 'cgss_insight'; |
48 | 48 | |
49 | 49 | global $wpdb; |
50 | - $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}$tableName" ); |
|
50 | + $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}$tableName"); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
@@ -56,23 +56,23 @@ discard block |
||
56 | 56 | global $wpdb; |
57 | 57 | |
58 | 58 | $result = $wpdb->get_results("SELECT * from {$wpdb->prefix}cgss_insight"); |
59 | - if(count($result) == 0) { |
|
59 | + if (count($result) == 0) { |
|
60 | 60 | |
61 | 61 | $init_insight = array( |
62 | - __('Score','cgss'), |
|
63 | - __('Snippet','cgss'), |
|
64 | - __('Text','cgss'), |
|
65 | - __('Links','cgss'), |
|
66 | - __('Keywords','cgss'), |
|
67 | - __('Images','cgss'), |
|
68 | - __('Responsive','cgss'), |
|
69 | - __('Speed','cgss'), |
|
70 | - __('Social','cgss') |
|
62 | + __('Score', 'cgss'), |
|
63 | + __('Snippet', 'cgss'), |
|
64 | + __('Text', 'cgss'), |
|
65 | + __('Links', 'cgss'), |
|
66 | + __('Keywords', 'cgss'), |
|
67 | + __('Images', 'cgss'), |
|
68 | + __('Responsive', 'cgss'), |
|
69 | + __('Speed', 'cgss'), |
|
70 | + __('Social', 'cgss') |
|
71 | 71 | ); |
72 | - $no_data = __( 'No scan reports are available yet', 'cgss' ); |
|
72 | + $no_data = __('No scan reports are available yet', 'cgss'); |
|
73 | 73 | foreach ($init_insight as $key => $value) { |
74 | 74 | $sql = $wpdb->prepare( |
75 | - "INSERT INTO {$wpdb->prefix}cgss_insight ( ID, item, remark ) VALUES ( %d, %s, %s )", ($key+1), $value, $no_data |
|
75 | + "INSERT INTO {$wpdb->prefix}cgss_insight ( ID, item, remark ) VALUES ( %d, %s, %s )", ($key + 1), $value, $no_data |
|
76 | 76 | ); |
77 | 77 | $query = $wpdb->query($sql); |
78 | 78 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | //Include scripts |
84 | 84 | public function scripts() { |
85 | 85 | |
86 | - if ( class_exists( 'CGSS_SCRIPT' ) ) new CGSS_SCRIPT(); |
|
86 | + if (class_exists('CGSS_SCRIPT')) new CGSS_SCRIPT(); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | //Include settings pages |
92 | 92 | public function settings() { |
93 | 93 | |
94 | - if ( class_exists( 'CGSS_SETTINGS' ) ) new CGSS_SETTINGS(); |
|
94 | + if (class_exists('CGSS_SETTINGS')) new CGSS_SETTINGS(); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | // Add custom insight action |
100 | 100 | public function insight() { |
101 | 101 | |
102 | - if ( class_exists( 'CGSS_INSIGHT' ) ) new CGSS_INSIGHT(); |
|
102 | + if (class_exists('CGSS_INSIGHT')) new CGSS_INSIGHT(); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | // Add custom insight action |
108 | 108 | public function scan() { |
109 | 109 | |
110 | - if ( class_exists( 'CGSS_SCAN' ) ) new CGSS_SCAN(); |
|
110 | + if (class_exists('CGSS_SCAN')) new CGSS_SCAN(); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | |
@@ -140,9 +140,9 @@ discard block |
||
140 | 140 | //Call the dependency files |
141 | 141 | public function helpers() { |
142 | 142 | |
143 | - if ( ! class_exists( 'WP_List_Table' ) ) { |
|
144 | - require_once( ABSPATH . 'wp-admin/includes/screen.php' ); |
|
145 | - require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' ); |
|
143 | + if ( ! class_exists('WP_List_Table')) { |
|
144 | + require_once(ABSPATH . 'wp-admin/includes/screen.php'); |
|
145 | + require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php'); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | require_once ('lib/table.php'); |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | $this->helpers(); |
162 | 162 | $this->functionality(); |
163 | 163 | |
164 | - register_activation_hook( CGSS_FILE, array( $this, 'db_install' ) ); |
|
165 | - register_uninstall_hook( CGSS_FILE, array( 'CGSS_BUILD', 'db_uninstall' ) ); //$this won't work here. |
|
164 | + register_activation_hook(CGSS_FILE, array($this, 'db_install')); |
|
165 | + register_uninstall_hook(CGSS_FILE, array('CGSS_BUILD', 'db_uninstall')); //$this won't work here. |
|
166 | 166 | |
167 | 167 | add_action('init', array($this, 'installation')); |
168 | 168 | |
@@ -171,8 +171,8 @@ discard block |
||
171 | 171 | $this->settings(); |
172 | 172 | |
173 | 173 | // Add custom actions, defined in settings |
174 | - add_action( 'cgss_scan', array( $this, 'scan' ) ); |
|
175 | - add_action( 'cgss_fetch_insight', array( $this, 'insight' ) ); |
|
174 | + add_action('cgss_scan', array($this, 'scan')); |
|
175 | + add_action('cgss_fetch_insight', array($this, 'insight')); |
|
176 | 176 | } |
177 | 177 | } |
178 | 178 | } ?> |
179 | 179 | \ No newline at end of file |