1 | <?php |
||||||
2 | namespace NirjharLo\Cgss; |
||||||
3 | |||||||
4 | if ( ! defined( 'ABSPATH' ) ) exit; |
||||||
5 | |||||||
6 | |||||||
7 | use \NirjharLo\Cgss\Lib\Script; |
||||||
0 ignored issues
–
show
|
|||||||
8 | |||||||
9 | use \NirjharLo\Cgss\Lib\Action\Scan; |
||||||
0 ignored issues
–
show
The type
\NirjharLo\Cgss\Lib\Action\Scan was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||||
10 | use \NirjharLo\Cgss\Lib\Action\Insight; |
||||||
0 ignored issues
–
show
The type
\NirjharLo\Cgss\Lib\Action\Insight was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||||
11 | |||||||
12 | use \NirjharLo\Cgss\Src\Db; |
||||||
0 ignored issues
–
show
The type
\NirjharLo\Cgss\Src\Db was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||||
13 | use \NirjharLo\Cgss\Src\Install; |
||||||
0 ignored issues
–
show
The type
\NirjharLo\Cgss\Src\Install was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||||
14 | use \NirjharLo\Cgss\Src\Settings; |
||||||
0 ignored issues
–
show
The type
\NirjharLo\Cgss\Src\Settings was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||||
15 | |||||||
16 | |||||||
17 | final class Loader { |
||||||
18 | |||||||
19 | /** |
||||||
20 | * Plugin Instance. |
||||||
21 | * |
||||||
22 | * @var PLUGIN_BUILD the PLUGIN Instance |
||||||
0 ignored issues
–
show
The type
NirjharLo\Cgss\PLUGIN_BUILD was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||||
23 | */ |
||||||
24 | protected static $instance; |
||||||
25 | |||||||
26 | |||||||
27 | /** |
||||||
28 | * Main Plugin Instance. |
||||||
29 | * |
||||||
30 | * @return PLUGIN_BUILD |
||||||
31 | */ |
||||||
32 | public static function instance() { |
||||||
33 | |||||||
34 | if ( is_null( self::$instance ) ) { |
||||||
35 | self::$instance = new self(); |
||||||
0 ignored issues
–
show
It seems like
new self() of type NirjharLo\Cgss\Loader is incompatible with the declared type NirjharLo\Cgss\PLUGIN_BUILD of property $instance .
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property. Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property.. ![]() |
|||||||
36 | self::$instance->init(); |
||||||
37 | } |
||||||
38 | |||||||
39 | return self::$instance; |
||||||
0 ignored issues
–
show
|
|||||||
40 | } |
||||||
41 | |||||||
42 | public function installation() { |
||||||
43 | |||||||
44 | $install = new Install(); |
||||||
45 | $install->textDomin = 'cgss'; |
||||||
46 | $install->phpVerAllowed = '5.4'; |
||||||
47 | $install->pluginPageLinks = array( |
||||||
48 | array( |
||||||
49 | 'slug' => home_url().'/wp-admin/admin.php?page=seo-scan', |
||||||
0 ignored issues
–
show
The function
home_url was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
50 | 'label' => __( 'Dashboard', 'cgss' ) |
||||||
0 ignored issues
–
show
The function
__ was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
51 | ), |
||||||
52 | ); |
||||||
53 | $install->execute(); |
||||||
54 | } |
||||||
55 | |||||||
56 | |||||||
57 | public function db_install() { |
||||||
58 | |||||||
59 | $db = new Db(); |
||||||
60 | $db->table = 'cgss_insight'; |
||||||
61 | $db->sql = "ID mediumint(9) NOT NULL AUTO_INCREMENT, |
||||||
62 | item varchar(256) NOT NULL, |
||||||
63 | remark varchar(512) NOT NULL, |
||||||
64 | UNIQUE KEY ID (ID)"; |
||||||
65 | $db->build(); |
||||||
66 | |||||||
67 | $insert_data = $this->insert_prelim_data(); |
||||||
0 ignored issues
–
show
Are you sure the assignment to
$insert_data is correct as $this->insert_prelim_data() targeting NirjharLo\Cgss\Loader::insert_prelim_data() seems to always return null.
This check looks for function or method calls that always return null and whose return value is assigned to a variable. class A
{
function getObject()
{
return null;
}
}
$a = new A();
$object = $a->getObject();
The method The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes. ![]() |
|||||||
68 | } |
||||||
69 | |||||||
70 | |||||||
71 | public function db_uninstall() { |
||||||
72 | |||||||
73 | $tableName = 'cgss_insight'; |
||||||
74 | |||||||
75 | global $wpdb; |
||||||
76 | $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}$tableName" ); |
||||||
77 | } |
||||||
78 | |||||||
79 | |||||||
80 | public function insert_prelim_data() { |
||||||
81 | |||||||
82 | global $wpdb; |
||||||
83 | |||||||
84 | $result = $wpdb->get_results("SELECT * from {$wpdb->prefix}cgss_insight"); |
||||||
85 | if(count($result) == 0) { |
||||||
86 | |||||||
87 | $init_insight = array( |
||||||
88 | __('Score','cgss'), |
||||||
0 ignored issues
–
show
The function
__ was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
89 | __('Snippet','cgss'), |
||||||
90 | __('Text','cgss'), |
||||||
91 | __('Links','cgss'), |
||||||
92 | __('Keywords','cgss'), |
||||||
93 | __('Images','cgss'), |
||||||
94 | __('Responsive','cgss'), |
||||||
95 | __('Speed','cgss'), |
||||||
96 | __('Social','cgss') |
||||||
97 | ); |
||||||
98 | $no_data = __( 'No scan reports are available yet', 'cgss' ); |
||||||
99 | foreach ($init_insight as $key => $value) { |
||||||
100 | $sql = $wpdb->prepare( |
||||||
101 | "INSERT INTO {$wpdb->prefix}cgss_insight ( ID, item, remark ) VALUES ( %d, %s, %s )", ($key+1), $value, $no_data |
||||||
102 | ); |
||||||
103 | $query = $wpdb->query($sql); |
||||||
104 | } |
||||||
105 | } |
||||||
106 | } |
||||||
107 | |||||||
108 | |||||||
109 | //Include scripts |
||||||
110 | public function scripts() { |
||||||
111 | |||||||
112 | new Script(); |
||||||
113 | } |
||||||
114 | |||||||
115 | |||||||
116 | |||||||
117 | //Include settings pages |
||||||
118 | public function settings() { |
||||||
119 | |||||||
120 | new Settings(); |
||||||
121 | } |
||||||
122 | |||||||
123 | |||||||
124 | |||||||
125 | // Add custom insight action |
||||||
126 | public function insight() { |
||||||
127 | |||||||
128 | new Insight(); |
||||||
129 | } |
||||||
130 | |||||||
131 | |||||||
132 | |||||||
133 | // Add custom insight action |
||||||
134 | public function scan() { |
||||||
135 | |||||||
136 | new Scan(); |
||||||
137 | } |
||||||
138 | |||||||
139 | |||||||
140 | public function init() { |
||||||
141 | |||||||
142 | register_activation_hook( CGSS_FILE, array( $this, 'db_install' ) ); |
||||||
0 ignored issues
–
show
The function
register_activation_hook was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
143 | register_uninstall_hook( CGSS_FILE, array( 'BUILD', 'db_uninstall' ) ); //$this won't work here. |
||||||
0 ignored issues
–
show
The function
register_uninstall_hook was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
144 | |||||||
145 | add_action('init', array($this, 'installation')); |
||||||
0 ignored issues
–
show
The function
add_action was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
146 | |||||||
147 | $this->scripts(); |
||||||
148 | $this->settings(); |
||||||
149 | |||||||
150 | // Add custom actions, defined in settings |
||||||
151 | add_action( 'cgss_scan', array( $this, 'scan' ) ); |
||||||
152 | add_action( 'cgss_fetch_insight', array( $this, 'insight' ) ); |
||||||
153 | } |
||||||
154 | } ?> |
||||||
155 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths