Passed
Push — master ( e0c498...d80a24 )
by Nirjhar
04:11
created
src/db.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,13 +44,13 @@
 block discarded – undo
44 44
 			global $wpdb;
45 45
 			$wpdb->hide_errors();
46 46
 			$collate = "";
47
-		    if ( $wpdb->has_cap( 'collation' ) ) {
47
+			if ( $wpdb->has_cap( 'collation' ) ) {
48 48
 				if( ! empty($wpdb->charset ) )
49 49
 					$collate .= "DEFAULT CHARACTER SET $wpdb->charset";
50 50
 				if( ! empty($wpdb->collate ) )
51 51
 					$collate .= " COLLATE $wpdb->collate";
52
-		    }
53
-    		require_once( $this->up_path );
52
+			}
53
+			require_once( $this->up_path );
54 54
 			return $collate;
55 55
 		}
56 56
 
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) exit;
2
+if ( ! defined('ABSPATH')) exit;
3 3
 
4 4
 /**
5 5
  * DB installation class
6 6
  */
7
-if ( ! class_exists( 'CGSS_DB' ) ) {
7
+if ( ! class_exists('CGSS_DB')) {
8 8
 
9 9
 	class CGSS_DB {
10 10
 
@@ -29,10 +29,10 @@  discard block
 block discarded – undo
29 29
 			global $wpdb;
30 30
 			$wpdb->hide_errors();
31 31
 			$this->table_name = $wpdb->prefix . $this->table;
32
-			update_option( '_plugin_db_exist', 0 );
33
-			if ( $wpdb->get_var("SHOW TABLES LIKE '$this->table_name'") != $this->table_name ) {
34
-				$execute_sql = $this->execute( $this->table_name, $this->collate(), $this->sql );
35
-				dbDelta( $execute_sql );
32
+			update_option('_plugin_db_exist', 0);
33
+			if ($wpdb->get_var("SHOW TABLES LIKE '$this->table_name'") != $this->table_name) {
34
+				$execute_sql = $this->execute($this->table_name, $this->collate(), $this->sql);
35
+				dbDelta($execute_sql);
36 36
 			}
37 37
 		}
38 38
 
@@ -44,20 +44,20 @@  discard block
 block discarded – undo
44 44
 			global $wpdb;
45 45
 			$wpdb->hide_errors();
46 46
 			$collate = "";
47
-		    if ( $wpdb->has_cap( 'collation' ) ) {
48
-				if( ! empty($wpdb->charset ) )
47
+		    if ($wpdb->has_cap('collation')) {
48
+				if ( ! empty($wpdb->charset))
49 49
 					$collate .= "DEFAULT CHARACTER SET $wpdb->charset";
50
-				if( ! empty($wpdb->collate ) )
50
+				if ( ! empty($wpdb->collate))
51 51
 					$collate .= " COLLATE $wpdb->collate";
52 52
 		    }
53
-    		require_once( $this->up_path );
53
+    		require_once($this->up_path);
54 54
 			return $collate;
55 55
 		}
56 56
 
57 57
 
58 58
 
59 59
 		//SQL query to create the main plugin table.
60
-		public function execute( $table_name, $collate, $sql ) {
60
+		public function execute($table_name, $collate, $sql) {
61 61
 			return "CREATE TABLE $table_name ( $sql ) $collate;";
62 62
 		}
63 63
 
@@ -67,8 +67,8 @@  discard block
 block discarded – undo
67 67
 		public function __destruct() {
68 68
 			global $wpdb;
69 69
 			$this->table_name = $wpdb->prefix . $this->table;
70
-			if ( $wpdb->get_var("SHOW TABLES LIKE '$this->table_name'") == $this->table_name ) {
71
-				update_option( '_plugin_db_exist', 1 );
70
+			if ($wpdb->get_var("SHOW TABLES LIKE '$this->table_name'") == $this->table_name) {
71
+				update_option('_plugin_db_exist', 1);
72 72
 			}
73 73
 		}
74 74
 	}
Please login to merge, or discard this patch.
src/install.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 									'label' => ''
20 20
 								),
21 21
 							);
22
-		*/
22
+		 */
23 23
 		public $pluginPageLinks;
24 24
 
25 25
 
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
25 25
 
26 26
 
27 27
 		public function do() {
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/settings.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -158,8 +158,8 @@
 block discarded – undo
158 158
 		//Set screen option
159 159
 		public function set_screen($status, $option, $value) {
160 160
  
161
-    		if ( 'post_per_page' == $option ) return $value; // Related to PLUGIN_TABLE()
162
-    			//return $status; 
161
+			if ( 'post_per_page' == $option ) return $value; // Related to PLUGIN_TABLE()
162
+				//return $status; 
163 163
 		}
164 164
 
165 165
 
Please login to merge, or discard this patch.
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) exit;
2
+if ( ! defined('ABSPATH')) exit;
3 3
 
4 4
 /**
5 5
  * Backend settings page class, can have settings fields or data table
6 6
  */
7
-if ( ! class_exists( 'CGSS_SETTINGS' ) ) {
7
+if ( ! class_exists('CGSS_SETTINGS')) {
8 8
 
9 9
 	final class CGSS_SETTINGS {
10 10
 
@@ -22,13 +22,13 @@  discard block
 block discarded – undo
22 22
 
23 23
 			$this->capability = 'manage_options';
24 24
 			$this->menuPage = array(
25
-								'name' => __( 'SEO Scan', 'cgss' ),
26
-								'heading' => __( 'SEO Scan', 'cgss' ),
25
+								'name' => __('SEO Scan', 'cgss'),
26
+								'heading' => __('SEO Scan', 'cgss'),
27 27
 								'slug' => 'seo-scan'
28 28
 							);
29 29
 			$this->subMenuPage = array(
30
-									'name' => __( 'Seo Scan Overview', 'cgss' ),
31
-									'heading' => __( 'Overview', 'cgss' ),
30
+									'name' => __('Seo Scan Overview', 'cgss'),
31
+									'heading' => __('Overview', 'cgss'),
32 32
 									'slug' => 'seo-scan',
33 33
 									'parent_slug' => 'seo-scan',
34 34
 									'help' => true,
@@ -43,20 +43,20 @@  discard block
 block discarded – undo
43 43
 											'info' => array(
44 44
 														array(
45 45
 															'id' => 'helpId',
46
-															'title' => __( 'Title', 'textdomain' ),
47
-															'content' => __( 'Description', 'textdomain' ),
46
+															'title' => __('Title', 'textdomain'),
47
+															'content' => __('Description', 'textdomain'),
48 48
 														),
49 49
 													),
50
-											'link' => '<p><a href="#">' . __( 'helpLink', 'textdomain' ) . '</a></p>',
50
+											'link' => '<p><a href="#">' . __('helpLink', 'textdomain') . '</a></p>',
51 51
 											)
52 52
 								)
53 53
 							);
54 54
 			$this->screen = ''; // true/false
55 55
 
56
-			add_action( 'admin_menu', array( $this, 'menu_page' ) );
57
-			add_action( 'admin_menu', array( $this, 'sub_menu_page' ) );
58
-			add_action( 'admin_menu', array( $this, 'cpt_sub_menu_page' ) );
59
-			add_filter( 'set-screen-option', array( $this, 'set_screen' ), 10, 3 );
56
+			add_action('admin_menu', array($this, 'menu_page'));
57
+			add_action('admin_menu', array($this, 'sub_menu_page'));
58
+			add_action('admin_menu', array($this, 'cpt_sub_menu_page'));
59
+			add_filter('set-screen-option', array($this, 'set_screen'), 10, 3);
60 60
 		}
61 61
 
62 62
 
@@ -66,17 +66,17 @@  discard block
 block discarded – undo
66 66
 
67 67
 			$menu_vars = array();
68 68
 
69
-			$post_types = get_post_types( array( 'public' => true, ), 'names' );
70
-			unset( $post_types['attachment'] );
69
+			$post_types = get_post_types(array('public' => true,), 'names');
70
+			unset($post_types['attachment']);
71 71
 
72
-			foreach ( $post_types as $type ) {
72
+			foreach ($post_types as $type) {
73 73
 
74
-				$count_posts = wp_count_posts( $type );
75
-				if ( $count_posts->publish > 0 ) {
74
+				$count_posts = wp_count_posts($type);
75
+				if ($count_posts->publish > 0) {
76 76
 
77
-					$type_name = ucwords( get_post_type_object( $type )->labels->singular_name );
77
+					$type_name = ucwords(get_post_type_object($type)->labels->singular_name);
78 78
 					$menu_vars[] = array(
79
-									'name' => $type_name . ' ' . __( 'Seo Scan', 'cgss' ),
79
+									'name' => $type_name . ' ' . __('Seo Scan', 'cgss'),
80 80
 									'heading' => $type_name,
81 81
 									'slug' => 'seo-scan-' . $type,
82 82
 									'parent_slug' => 'seo-scan',
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 					$this->menuPage['heading'],
100 100
 					$this->capability,
101 101
 					$this->menuPage['slug'],
102
-					array( $this, 'overview_content_cb' ),
102
+					array($this, 'overview_content_cb'),
103 103
 					'dashicons-search'
104 104
 				);
105 105
 			}
@@ -117,13 +117,13 @@  discard block
 block discarded – undo
117 117
 							$this->subMenuPage['heading'],
118 118
 							$this->capability,
119 119
 							$this->subMenuPage['slug'],
120
-							array( $this, 'overview_content_cb' )
120
+							array($this, 'overview_content_cb')
121 121
 						);
122 122
 					if ($this->subMenuPage['screen']) {
123
-						add_action( 'load-' . $hook, array( $this, 'overview_screen_option' ) );
123
+						add_action('load-' . $hook, array($this, 'overview_screen_option'));
124 124
 					}
125 125
 					if ($this->subMenuPage['help']) {
126
-						add_action( 'load-' . $hook, array( $this, 'help_tabs' ) );
126
+						add_action('load-' . $hook, array($this, 'help_tabs'));
127 127
 					}
128 128
 				}
129 129
 			}
@@ -141,13 +141,13 @@  discard block
 block discarded – undo
141 141
 							$value['heading'],
142 142
 							$this->capability,
143 143
 							$value['slug'],
144
-							array( $this, 'cpt_content_cb' )
144
+							array($this, 'cpt_content_cb')
145 145
 						);
146 146
 					if ($value['screen']) {
147
-						add_action( 'load-' . $hook, array( $this, 'screen_option' ) );
147
+						add_action('load-' . $hook, array($this, 'screen_option'));
148 148
 					}
149 149
 					if ($value['help']) {
150
-						add_action( 'load-' . $hook, array( $this, 'help_tabs' ) );
150
+						add_action('load-' . $hook, array($this, 'help_tabs'));
151 151
 					}
152 152
 				}
153 153
 			}
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 		//Set screen option
159 159
 		public function set_screen($status, $option, $value) {
160 160
  
161
-    		if ( 'post_per_page' == $option ) return $value; // Related to PLUGIN_TABLE()
161
+    		if ('post_per_page' == $option) return $value; // Related to PLUGIN_TABLE()
162 162
     			//return $status; 
163 163
 		}
164 164
 
@@ -185,11 +185,11 @@  discard block
 block discarded – undo
185 185
 
186 186
 			$option = 'per_page';
187 187
 			$args   = array(
188
-						'label'   => __( 'Show per page', 'cgss' ),
188
+						'label'   => __('Show per page', 'cgss'),
189 189
 						'default' => 10,
190 190
 						'option'  => 'post_per_page' // Related to CGSS_TABLE()
191 191
 						);
192
-			add_screen_option( $option, $args );
192
+			add_screen_option($option, $args);
193 193
 			$this->table = new CGSS_TABLE();
194 194
 		}
195 195
 
@@ -200,11 +200,11 @@  discard block
 block discarded – undo
200 200
 
201 201
 			<div class="wrap">
202 202
 				<h1><?php echo get_admin_page_title(); ?>
203
-					&nbsp;<a href="?page=seo-scan&fetch=true" class="button button-secondary"><?php _e( 'Fetch Insight', 'cgss' ); ?></a>
203
+					&nbsp;<a href="?page=seo-scan&fetch=true" class="button button-secondary"><?php _e('Fetch Insight', 'cgss'); ?></a>
204 204
 				</h1>
205 205
 				<br class="clear">
206 206
 				<?php if (isset($_GET['fetch'])) : ?>
207
-					<?php do_action( 'cgss_fetch_insight' ); ?>
207
+					<?php do_action('cgss_fetch_insight'); ?>
208 208
 				<?php endif; ?>
209 209
 				<?php
210 210
 					// Source: /lib/overview-table.php
@@ -226,9 +226,9 @@  discard block
 block discarded – undo
226 226
 				<h1><?php echo get_admin_page_title(); ?></h1>
227 227
 				<br class="clear">
228 228
 					<?php if (isset($_GET['scan'])) : ?>
229
-						<?php do_action( 'cgss_scan' ); ?>
229
+						<?php do_action('cgss_scan'); ?>
230 230
 					<?php elseif (isset($_GET['compete'])) : ?>
231
-						<?php do_action( 'cgss_compete' ); ?>
231
+						<?php do_action('cgss_compete'); ?>
232 232
 					<?php else : ?>
233 233
 						<form method="post" action="">
234 234
 						<?php
@@ -252,10 +252,10 @@  discard block
 block discarded – undo
252 252
 			foreach ($this->helpData as $value) {
253 253
 				if ($_GET['page'] == $value['slug']) {
254 254
 					$this->screen = get_current_screen();
255
-					foreach( $value['info'] as $key ) {
256
-						$this->screen->add_help_tab( $key );
255
+					foreach ($value['info'] as $key) {
256
+						$this->screen->add_help_tab($key);
257 257
 					}
258
-					$this->screen->set_help_sidebar( $value['link'] );
258
+					$this->screen->set_help_sidebar($value['link']);
259 259
 				}
260 260
 			}
261 261
 		}
Please login to merge, or discard this patch.
autoload.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
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 62
 					__('Score','cgss'),
@@ -149,8 +149,8 @@  discard block
 block discarded – undo
149 149
 		public function helpers() {
150 150
 
151 151
 			if ( ! class_exists( 'WP_List_Table' ) ) {
152
-    			require_once( ABSPATH . 'wp-admin/includes/screen.php' );
153
-    			require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
152
+				require_once( ABSPATH . 'wp-admin/includes/screen.php' );
153
+				require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
154 154
 			}
155 155
 
156 156
 			require_once ('lib/table.php');
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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->do();
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
107 107
 		// Add custom insight action
108 108
 		public function compete() {
109 109
 
110
-			if ( class_exists( 'CGSS_COMPETE' ) ) new CGSS_COMPETE();
110
+			if (class_exists('CGSS_COMPETE')) new CGSS_COMPETE();
111 111
 		}
112 112
 
113 113
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 		// Add custom insight action
116 116
 		public function scan() {
117 117
 
118
-			if ( class_exists( 'CGSS_SCAN' ) ) new CGSS_SCAN();
118
+			if (class_exists('CGSS_SCAN')) new CGSS_SCAN();
119 119
 		}
120 120
 
121 121
 
@@ -148,9 +148,9 @@  discard block
 block discarded – undo
148 148
 		//Call the dependency files
149 149
 		public function helpers() {
150 150
 
151
-			if ( ! class_exists( 'WP_List_Table' ) ) {
152
-    			require_once( ABSPATH . 'wp-admin/includes/screen.php' );
153
-    			require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
151
+			if ( ! class_exists('WP_List_Table')) {
152
+    			require_once(ABSPATH . 'wp-admin/includes/screen.php');
153
+    			require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
154 154
 			}
155 155
 
156 156
 			require_once ('lib/table.php');
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
 			$this->helpers();
171 171
 			$this->functionality();
172 172
 
173
-			register_activation_hook( CGSS_FILE, array( $this, 'db_install' ) );
174
-			register_uninstall_hook( CGSS_FILE, array( 'CGSS_BUILD', 'db_uninstall' ) ); //$this won't work here.
173
+			register_activation_hook(CGSS_FILE, array($this, 'db_install'));
174
+			register_uninstall_hook(CGSS_FILE, array('CGSS_BUILD', 'db_uninstall')); //$this won't work here.
175 175
 
176 176
 			add_action('init', array($this, 'installation'));
177 177
 
@@ -180,9 +180,9 @@  discard block
 block discarded – undo
180 180
 			$this->settings();
181 181
 
182 182
 			// Add custom actions, defined in settings
183
-			add_action( 'cgss_scan', array( $this, 'scan' ) );
184
-			add_action( 'cgss_compete', array( $this, 'compete' ) );
185
-			add_action( 'cgss_fetch_insight', array( $this, 'insight' ) );
183
+			add_action('cgss_scan', array($this, 'scan'));
184
+			add_action('cgss_compete', array($this, 'compete'));
185
+			add_action('cgss_fetch_insight', array($this, 'insight'));
186 186
 		}
187 187
 	}
188 188
 } ?>
189 189
\ No newline at end of file
Please login to merge, or discard this patch.
lib/action/compete.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) exit;
2
+if ( ! defined('ABSPATH')) exit;
3 3
 
4 4
 /**
5 5
  * Perform compete action
6 6
  */
7
-if ( ! class_exists( 'CGSS_COMPETE' ) ) {
7
+if ( ! class_exists('CGSS_COMPETE')) {
8 8
 
9 9
 	final class CGSS_COMPETE {
10 10
 
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 		public function __construct() {
13 13
 
14 14
 			$post_id = intval($_GET['compete']);
15
-			$url = get_permalink( $post_id );
15
+			$url = get_permalink($post_id);
16 16
 
17 17
 			if (class_exists('CGSS_COMPETE_CRAWL')) {
18 18
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 				$compete->do();
22 22
 				$result = $compete->results();
23 23
 
24
-				update_post_meta( $post_id, 'cgss_scan_result', $result );
24
+				update_post_meta($post_id, 'cgss_scan_result', $result);
25 25
 
26 26
 				$this->render($result);
27 27
 			}
Please login to merge, or discard this patch.
lib/action/scan.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
21 21
 				$crawl->do();
22 22
 				$result = $crawl->result();
23 23
 
24
-				update_post_meta( $post_id, 'cgss_scan_result', $result );
24
+				update_post_meta($post_id, 'cgss_scan_result', $result);
25 25
 
26 26
 				$this->render($result);
27 27
 			}
@@ -31,15 +31,15 @@  discard block
 block discarded – undo
31 31
 
32 32
 		public function render($result) {
33 33
 
34
-			$this->box( 'content', __( 'Text & Links', 'cgss' ), $this->dashicon('text'), 'content', 'width: 49.5%' );
34
+			$this->box('content', __('Text & Links', 'cgss'), $this->dashicon('text'), 'content', 'width: 49.5%');
35 35
 		}
36 36
 
37 37
 
38 38
 		public function box($id, $icon, $title, $desc, $style) {
39 39
 
40
-			echo '<div id="dashboard_right_now" class="postbox" style="'.$style.'">
40
+			echo '<div id="dashboard_right_now" class="postbox" style="' . $style . '">
41 41
 				<div class="handlediv handlediv-' . $id . '">' . $icon . '</div>
42
-					<h3 id="hndle-' . $id . '" class="hndle ui-sortable-handle" title="' . __( 'Click to toggle', 'cgss' ) . '"><span>' . $title . '</span></h3>
42
+					<h3 id="hndle-' . $id . '" class="hndle ui-sortable-handle" title="' . __('Click to toggle', 'cgss') . '"><span>' . $title . '</span></h3>
43 43
 					<div id="inside-' . $id . '" class="inside">
44 44
 						<div class="main">' .
45 45
 							$desc .
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
 		public function dashicon($icon) {
53 53
 
54
-			echo '<span class="dashicon dashicon-'.$icon.'"></span>';
54
+			echo '<span class="dashicon dashicon-' . $icon . '"></span>';
55 55
 		}
56 56
 	}
57 57
 } ?>
58 58
\ No newline at end of file
Please login to merge, or discard this patch.
lib/script.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -2,18 +2,18 @@  discard block
 block discarded – undo
2 2
 /**
3 3
  * Add scripts to the plugin. CSS and JS.
4 4
  */
5
-if ( ! defined( 'ABSPATH' ) ) exit;
5
+if ( ! defined('ABSPATH')) exit;
6 6
 
7
-if ( ! class_exists( 'CGSS_SCRIPT' ) ) {
7
+if ( ! class_exists('CGSS_SCRIPT')) {
8 8
 
9 9
 	final class CGSS_SCRIPT {
10 10
 
11 11
 
12 12
 		public function __construct() {
13 13
 
14
-			add_action( 'admin_head', array( $this, 'data_table_css' ) );
15
-			add_action( 'admin_enqueue_scripts', array( $this, 'backend_scripts' ) );
16
-			add_action( 'wp_enqueue_scripts', array( $this, 'frontend_scripts' ) );
14
+			add_action('admin_head', array($this, 'data_table_css'));
15
+			add_action('admin_enqueue_scripts', array($this, 'backend_scripts'));
16
+			add_action('wp_enqueue_scripts', array($this, 'frontend_scripts'));
17 17
 		}
18 18
 
19 19
 
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
 			// Set condition to add script
49 49
 			// if ( ! isset( $_GET['page'] ) || $_GET['page'] != 'pageName' ) return;
50 50
 
51
-			wp_enqueue_script( 'jsName', CGSS_JS . 'ui.js', array() );
52
-			wp_enqueue_style( 'cssName', CGSS_CSS . 'css.css' );
51
+			wp_enqueue_script('jsName', CGSS_JS . 'ui.js', array());
52
+			wp_enqueue_style('cssName', CGSS_CSS . 'css.css');
53 53
 		}
54 54
 
55 55
 
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
 		// Enter scripts into pages
58 58
 		public function frontend_scripts() {
59 59
 
60
-			wp_enqueue_script( 'jsName', CGSS_JS . 'ui.js', array() );
61
-			wp_enqueue_style( 'cssName', CGSS_CSS . 'css.css' );
60
+			wp_enqueue_script('jsName', CGSS_JS . 'ui.js', array());
61
+			wp_enqueue_style('cssName', CGSS_CSS . 'css.css');
62 62
 		}
63 63
 	}
64 64
 } ?>
65 65
\ No newline at end of file
Please login to merge, or discard this patch.
complete-google-seo-scan.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  License: GPLv2
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
 block discarded – undo
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
Please login to merge, or discard this patch.
lib/table.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -7,24 +7,24 @@  discard block
 block discarded – undo
7 7
  * $Table->display();
8 8
  *
9 9
  */
10
-if ( ! class_exists( 'CGSS_TABLE' ) ) {
10
+if ( ! class_exists('CGSS_TABLE')) {
11 11
 
12 12
 	final class CGSS_TABLE extends WP_List_Table {
13 13
 
14 14
 
15 15
 		public function __construct() {
16 16
 
17
-			parent::__construct( [
18
-				'singular' => __( 'Post', 'cgss' ),
19
-				'plural'   => __( 'Posts', 'cgss' ),
17
+			parent::__construct([
18
+				'singular' => __('Post', 'cgss'),
19
+				'plural'   => __('Posts', 'cgss'),
20 20
 				'ajax'     => false,
21
-			] );
21
+			]);
22 22
 		}
23 23
 
24 24
 
25 25
 
26 26
 		//fetch the data using custom named method function
27
-		public static function get_posts( $per_page = 10, $page_number = 1 ) {
27
+		public static function get_posts($per_page = 10, $page_number = 1) {
28 28
 
29 29
 			global $wpdb;
30 30
 
@@ -35,15 +35,15 @@  discard block
 block discarded – undo
35 35
 			$sql .= " QUERIES WHERE post_status='publish' AND post_type='$page'";
36 36
 
37 37
 			//Set filters in the query using $_REQUEST
38
-			if ( ! empty( $_REQUEST['orderby'] ) ) {
39
-				$sql .= ' ORDER BY ' . esc_sql( $_REQUEST['orderby'] );
40
-				$sql .= ! empty( $_REQUEST['order'] ) ? ' ' . esc_sql( $_REQUEST['order'] ) : ' ASC';
38
+			if ( ! empty($_REQUEST['orderby'])) {
39
+				$sql .= ' ORDER BY ' . esc_sql($_REQUEST['orderby']);
40
+				$sql .= ! empty($_REQUEST['order']) ? ' ' . esc_sql($_REQUEST['order']) : ' ASC';
41 41
 			}
42 42
 			$sql .= " LIMIT $per_page";
43
-			$sql .= ' OFFSET ' . ( $page_number - 1 ) * $per_page;
43
+			$sql .= ' OFFSET ' . ($page_number - 1) * $per_page;
44 44
 
45 45
 			//get the data from database
46
-			$result = $wpdb->get_results( $sql, 'ARRAY_A' );
46
+			$result = $wpdb->get_results($sql, 'ARRAY_A');
47 47
 
48 48
 			// FETCH POST META DATA AND MERGE IT WITH RESULTS
49 49
 			$result = SELF::get_post_meta_data($result);
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 		//If there is no data to show
57 57
 		public function no_items() {
58 58
 
59
-			_e( 'No Published Posts are available.', 'cgss' );
59
+			_e('No Published Posts are available.', 'cgss');
60 60
 		}
61 61
 
62 62
 
@@ -73,46 +73,46 @@  discard block
 block discarded – undo
73 73
 			$sql = "SELECT COUNT(*) FROM {$wpdb->prefix}posts";
74 74
 			$sql .= " QUERIES WHERE post_status='publish' AND post_type='$page'";
75 75
 
76
-			return $wpdb->get_var( $sql );
76
+			return $wpdb->get_var($sql);
77 77
 		}
78 78
 
79 79
 
80 80
 
81 81
 		//Display columns content
82
-		public function column_name( $item ) {
82
+		public function column_name($item) {
83 83
 
84
-			$title = sprintf( '<strong>%s</strong>', $item['post_title'] );
84
+			$title = sprintf('<strong>%s</strong>', $item['post_title']);
85 85
 
86 86
 			//Change the page instruction where you want to show it
87 87
 			$actions = array(
88
-					'scan' => sprintf( '<a href="?page='.$_GET['page'].'&scan='.$item['ID'].'" target="_blank">%s</a>', __( 'Scan', 'cgss' ) ),
89
-					'compete' => sprintf( '<a href="?page='.$_GET['page'].'&compete='.$item['ID'].'" target="_blank">%s</a>', __( 'Compete', 'cgss' ) ),
90
-					'view' => sprintf( '<a href="'.get_permalink($item['ID']).'" target="_blank">%s</a>', __( 'View', 'cgss' ) )
88
+					'scan' => sprintf('<a href="?page=' . $_GET['page'] . '&scan=' . $item['ID'] . '" target="_blank">%s</a>', __('Scan', 'cgss')),
89
+					'compete' => sprintf('<a href="?page=' . $_GET['page'] . '&compete=' . $item['ID'] . '" target="_blank">%s</a>', __('Compete', 'cgss')),
90
+					'view' => sprintf('<a href="' . get_permalink($item['ID']) . '" target="_blank">%s</a>', __('View', 'cgss'))
91 91
 					);
92
-			return $title . $this->row_actions( $actions );
92
+			return $title . $this->row_actions($actions);
93 93
 		}
94 94
 
95 95
 
96 96
 
97 97
 		//set coulmns name
98
-		public function column_default( $item, $column_name ) {
98
+		public function column_default($item, $column_name) {
99 99
 
100
-			switch ( $column_name ) {
100
+			switch ($column_name) {
101 101
 
102 102
 				case 'post_title':
103 103
 					//This is the first column
104
-					return $this->column_name( $item );
104
+					return $this->column_name($item);
105 105
 				case 'focus':
106 106
 				case 'word':
107 107
 				case 'link':
108 108
 				case 'image':
109 109
 				case 'share':
110
-					return $item[ $column_name ];
110
+					return $item[$column_name];
111 111
 				case 'time':
112
-					return $item[ $column_name ];
112
+					return $item[$column_name];
113 113
 				default:
114 114
 					//Show the whole array for troubleshooting purposes
115
-					return print_r( $item, true );
115
+					return print_r($item, true);
116 116
 			}
117 117
 		}
118 118
 
@@ -122,13 +122,13 @@  discard block
 block discarded – undo
122 122
 		public function get_columns() {
123 123
 
124 124
 			$columns = array(
125
-							'post_title'	=> __( 'Post', 'cgss' ),
126
-							'focus'	=> __( 'Focus', 'cgss' ),
127
-							'word'	=> __( 'Words', 'cgss' ),
128
-							'link'	=> __( 'Links', 'cgss' ),
129
-							'image'	=> __( 'Images', 'cgss' ),
130
-							'share'	=> __( 'Shares', 'cgss' ),
131
-							'time'	=> __( 'Time(s)', 'cgss' ),
125
+							'post_title'	=> __('Post', 'cgss'),
126
+							'focus'	=> __('Focus', 'cgss'),
127
+							'word'	=> __('Words', 'cgss'),
128
+							'link'	=> __('Links', 'cgss'),
129
+							'image'	=> __('Images', 'cgss'),
130
+							'share'	=> __('Shares', 'cgss'),
131
+							'time'	=> __('Time(s)', 'cgss'),
132 132
 							
133 133
 						);
134 134
 			return $columns;
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 		public function get_sortable_columns() {
141 141
 
142 142
 			$sortable_columns = array(
143
-				'post_title' => array( 'post_title', true ),
143
+				'post_title' => array('post_title', true),
144 144
 			);
145 145
 			return $sortable_columns;
146 146
 		}
@@ -153,15 +153,15 @@  discard block
 block discarded – undo
153 153
 			$this->_column_headers = $this->get_column_info();
154 154
 
155 155
 			/** Process bulk action */
156
-			$per_page     = $this->get_items_per_page( 'post_per_page', 5 );
156
+			$per_page     = $this->get_items_per_page('post_per_page', 5);
157 157
 			$current_page = $this->get_pagenum();
158 158
 			$total_items  = self::record_count();
159
-			$this->set_pagination_args( array(
159
+			$this->set_pagination_args(array(
160 160
 				'total_items' => $total_items,
161 161
 				'per_page'    => $per_page,
162
-			) );
162
+			));
163 163
 
164
-			$this->items = self::get_posts( $per_page, $current_page );
164
+			$this->items = self::get_posts($per_page, $current_page);
165 165
 		}
166 166
 
167 167
 
@@ -175,18 +175,18 @@  discard block
 block discarded – undo
175 175
 							'text' => array(
176 176
 										'count' => '--',
177 177
 										'top_key' => '--',
178
-										'links' => array( 'count' => '--' ),
178
+										'links' => array('count' => '--'),
179 179
 										),
180 180
 							'design' => array(
181
-										'image' => array( 'count' => '--' )
181
+										'image' => array('count' => '--')
182 182
 										),
183 183
 							'social' => '--',
184
-							'speed' => array( 'down_time' => '--' ),
184
+							'speed' => array('down_time' => '--'),
185 185
 							);
186 186
 
187 187
 			$metas = array();
188 188
 			foreach ($IDs as $post_id) {
189
-				$meta = get_post_meta( $post_id, 'cgss_scan_result', true );
189
+				$meta = get_post_meta($post_id, 'cgss_scan_result', true);
190 190
 				$metas[] = is_array($meta) ? $meta : $empty_metas;
191 191
 			}
192 192
 			$text = array_column($metas, 'text');
Please login to merge, or discard this patch.