@@ -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 cgss |
| 36 | 36 | public function text_domain_cb() { |
| 37 | 37 | |
| 38 | - load_plugin_cgss( $this->textDomin, false, CGSS_LN ); |
|
| 38 | + load_plugin_cgss($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; |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | * $myPluginNameTable->display(); |
| 8 | 8 | * |
| 9 | 9 | */ |
| 10 | -if ( ! class_exists( 'CGSS_OVERVIEW_TABLE' ) ) { |
|
| 10 | +if ( ! class_exists('CGSS_OVERVIEW_TABLE')) { |
|
| 11 | 11 | |
| 12 | 12 | final class CGSS_OVERVIEW_TABLE extends WP_List_Table { |
| 13 | 13 | |
@@ -15,11 +15,11 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | public function __construct() { |
| 17 | 17 | |
| 18 | - parent::__construct( [ |
|
| 19 | - 'singular' => __( 'Insight', 'cgss' ), |
|
| 20 | - 'plural' => __( 'Inssight', 'cgss' ), |
|
| 18 | + parent::__construct([ |
|
| 19 | + 'singular' => __('Insight', 'cgss'), |
|
| 20 | + 'plural' => __('Inssight', 'cgss'), |
|
| 21 | 21 | 'ajax' => false, |
| 22 | - ] ); |
|
| 22 | + ]); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | $sql = "SELECT * FROM {$wpdb->prefix}cgss_insight"; |
| 34 | 34 | |
| 35 | 35 | //get the data from database |
| 36 | - $result = $wpdb->get_results( $sql, 'ARRAY_A' ); |
|
| 36 | + $result = $wpdb->get_results($sql, 'ARRAY_A'); |
|
| 37 | 37 | |
| 38 | 38 | return $result; |
| 39 | 39 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | //If there is no data to show |
| 44 | 44 | public function no_items() { |
| 45 | 45 | |
| 46 | - _e( 'Database is empty. Please reactivate the plugin.', 'cgss' ); |
|
| 46 | + _e('Database is empty. Please reactivate the plugin.', 'cgss'); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
@@ -56,38 +56,38 @@ discard block |
||
| 56 | 56 | //Build the db query base |
| 57 | 57 | $sql = "SELECT COUNT(*) FROM {$wpdb->prefix}cgss_insight"; |
| 58 | 58 | |
| 59 | - return $wpdb->get_var( $sql ); |
|
| 59 | + return $wpdb->get_var($sql); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | |
| 63 | 63 | |
| 64 | 64 | //Display columns content |
| 65 | - public function column_name( $item ) { |
|
| 65 | + public function column_name($item) { |
|
| 66 | 66 | |
| 67 | - $title = sprintf( '<strong>%s</strong>', $item['item'] ); |
|
| 67 | + $title = sprintf('<strong>%s</strong>', $item['item']); |
|
| 68 | 68 | |
| 69 | 69 | //Change the page instruction where you want to show it |
| 70 | 70 | $actions = array(); |
| 71 | - return $title . $this->row_actions( $actions ); |
|
| 71 | + return $title . $this->row_actions($actions); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | |
| 75 | 75 | |
| 76 | 76 | //set coulmns name |
| 77 | - public function column_default( $item, $column_name ) { |
|
| 77 | + public function column_default($item, $column_name) { |
|
| 78 | 78 | |
| 79 | - switch ( $column_name ) { |
|
| 79 | + switch ($column_name) { |
|
| 80 | 80 | |
| 81 | 81 | case 'item': |
| 82 | 82 | //This is the first column |
| 83 | - return $this->column_name( $item ); |
|
| 83 | + return $this->column_name($item); |
|
| 84 | 84 | case 'remark': |
| 85 | - return $item[ $column_name ]; |
|
| 85 | + return $item[$column_name]; |
|
| 86 | 86 | |
| 87 | 87 | default: |
| 88 | 88 | |
| 89 | 89 | //Show the whole array for troubleshooting purposes |
| 90 | - return print_r( $item, true ); |
|
| 90 | + return print_r($item, true); |
|
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | |
@@ -97,8 +97,8 @@ discard block |
||
| 97 | 97 | public function get_columns() { |
| 98 | 98 | |
| 99 | 99 | $columns = array( |
| 100 | - 'item' => __( 'Item', 'cgss' ), |
|
| 101 | - 'remark' => __( 'Remark', 'cgss' ), |
|
| 100 | + 'item' => __('Item', 'cgss'), |
|
| 101 | + 'remark' => __('Remark', 'cgss'), |
|
| 102 | 102 | ); |
| 103 | 103 | return $columns; |
| 104 | 104 | } |