58% cookie-scanner

Code Review | Cookie Scanner - automated cookie list

WordPress plugin Cookie Scanner - automated cookie list scored58%from 54 tests.

About plugin

  • Plugin page: cookie-scanner
  • Plugin version: 1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.1
  • WordPress version: 6.3.1
  • First release: May 17, 2020
  • Latest release: Feb 3, 2023
  • Number of updates: 10
  • Update frequency: every 101.1 days
  • Top authors: nikelschubert (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,037 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.36MB] [CPU: ▼0.08ms] Passed 4 tests

An overview of server-side resources used by Cookie Scanner - automated cookie list
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.78 ▲0.3243.91 ▲2.36
Dashboard /wp-admin3.72 ▲0.4156.74 ▲2.02
Posts /wp-admin/edit.php3.77 ▲0.4153.57 ▲5.85
Add New Post /wp-admin/post-new.php6.23 ▲0.3593.09 ▼10.56
Media Library /wp-admin/upload.php3.58 ▲0.3545.06 ▲9.45
Cookie List /wp-admin/edit.php?post_type=cookielist_nscs3.6846.02
Settings /wp-admin/edit.php?post_type=cookielist_nscs&page=cookie-scanner-nscs3.6046.02
Add New /wp-admin/post-new.php?post_type=cookielist_nscs3.7553.84

Server storage [IO: ▲0.12MB] [DB: ▲0.00MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 33 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Cookie Scanner - automated cookie list: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲6414.27 ▼0.081.72 ▲0.1143.51 ▼0.75
Dashboard /wp-admin2,226 ▲495.58 ▼0.0783.67 ▼8.3140.67 ▲3.02
Posts /wp-admin/edit.php2,131 ▲311.95 ▼0.0436.80 ▲1.0233.43 ▼2.37
Add New Post /wp-admin/post-new.php1,552 ▲2423.77 ▲0.83682.17 ▼37.9656.67 ▼4.36
Media Library /wp-admin/upload.php1,434 ▲404.20 ▲0.01100.20 ▼3.9444.43 ▼2.62
Cookie List /wp-admin/edit.php?post_type=cookielist_nscs1,1391.9730.7031.04
Settings /wp-admin/edit.php?post_type=cookielist_nscs&page=cookie-scanner-nscs1,0422.1222.6435.14
Add New /wp-admin/post-new.php?post_type=cookielist_nscs2,3917.63167.7560.94

Uninstaller [IO: ▲0.12MB] [DB: ▲0.00MB] 25% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/cookie-scanner/uninstall.php+8
    Constant PLUGIN_PATH_NSCS already defined
  • Uninstaller has failed for this plugin, leaving 33 files (0.12MB) in the plugin directory
    • (new file) admin/tpl/admin_head.php
    • (new file) admin/tpl/tab_license.html
    • (new file) admin/js/admin.js
    • (new file) admin/tpl/top_description.html
    • (new file) admin/tpl/tab_crawling_settings.html
    • (new file) admin/tpl/admin_head_no_license.php
    • (new file) admin/tpl/tab_general.html
    • (new file) admin/tpl/admin_tabs.php
    • (new file) admin/tpl/tab_faq.html
    • (new file) admin/tpl/admin.php
    • ...
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • recovery_mode_email_last_sent
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/cookie-scanner/admin/tpl/admin_head.php
    • > /wp-content/plugins/cookie-scanner/admin/tpl/admin_head_no_license.php
    • > /wp-content/plugins/cookie-scanner/uninstall.php
    • > /wp-content/plugins/cookie-scanner/admin/tpl/admin_tabs.php
  • 29× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: settings_object in wp-content/plugins/cookie-scanner/admin/tpl/admin.php on line 1
    • > PHP Notice
      Trying to get property 'active_tab_index' of non-object in wp-content/plugins/cookie-scanner/admin/tpl/admin_tabs.php on line 11
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/cookie-scanner/admin/tpl/admin_tabs.php on line 16
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/cookie-scanner/admin/tpl/admin_tabs.php on line 4
    • > PHP Notice
      Undefined variable: settings_object in wp-content/plugins/cookie-scanner/admin/tpl/admin_head_no_license.php on line 3
    • > PHP Notice
      Trying to get property 'settings_page_configs' of non-object in wp-content/plugins/cookie-scanner/admin/tpl/admin_head_no_license.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/cookie-scanner/admin/tpl/admin.php:3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/cookie-scanner/admin/tpl/admin.php on line 1
    • > PHP Notice
      Trying to get property 'setting_page_fields' of non-object in wp-content/plugins/cookie-scanner/admin/tpl/admin_tabs.php on line 4
    • > PHP Notice
      Trying to get property 'description' of non-object in wp-content/plugins/cookie-scanner/admin/tpl/admin_head.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Contributors: The plugin contributors field is missing
Please take inspiration from this readme.txt

cookie-scanner/cookie-scanner-nscs.php 92% from 13 tests

The main file in "Cookie Scanner - automated cookie list" v. 1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("cookie-scanner.php" instead of "cookie-scanner-nscs.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected2,133 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP21230481,480
HTML4029319
JSON200309
CSS15025

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity10.80
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity2.28
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods115
▷ Static methods00.00%
▷ Public methods7766.96%
▷ Protected methods00.00%
▷ Private methods3833.04%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin