89% smart-cookie-kit

Code Review | Smart Cookie Kit

WordPress plugin Smart Cookie Kit scored89%from 54 tests.

About plugin

  • Plugin page: smart-cookie-kit
  • Plugin version: 2.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.6
  • WordPress version: 6.3.1
  • First release: Dec 1, 2015
  • Latest release: Oct 6, 2023
  • Number of updates: 100
  • Update frequency: every 28.7 days
  • Top authors: shark986 (100%)

Code review

54 tests

User reviews

39 reviews

Install metrics

4,000+ active /51,280 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.61MB] [CPU: ▼3.95ms] Passed 4 tests

An overview of server-side resources used by Smart Cookie Kit
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /7.38 ▲3.9257.24 ▲11.89
Dashboard /wp-admin3.95 ▲0.6454.00 ▼2.25
Posts /wp-admin/edit.php4.00 ▲0.6451.08 ▼4.16
Add New Post /wp-admin/post-new.php6.46 ▲0.5894.13 ▼11.35
Media Library /wp-admin/upload.php3.81 ▲0.5840.02 ▲1.98
Logic settings /wp-admin/admin.php?page=nmod_sck_logics3.7937.75
Graphic settings /wp-admin/admin.php?page=nmod_sck_graphics3.8342.68
Help and support /wp-admin/admin.php?page=nmod_sck_help3.8437.98

Server storage [IO: ▲0.43MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
These are issues you should consider
  • There were 1 file (0.01KB) illegally modified outside of "wp-content/plugins/smart-cookie-kit/" and "wp-content/uploads/"
    • (new file) wp-content/cookie-preferences-log/.htaccess
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Smart Cookie Kit
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,904 ▲14314.29 ▼0.082.91 ▲0.8337.10 ▼5.58
Dashboard /wp-admin2,262 ▲855.70 ▲0.1289.04 ▼11.0041.22 ▼3.41
Posts /wp-admin/edit.php2,165 ▲652.13 ▲0.1537.78 ▲2.3036.51 ▼0.49
Add New Post /wp-admin/post-new.php1,580 ▲5423.18 ▼0.40692.49 ▲26.8556.26 ▲2.95
Media Library /wp-admin/upload.php1,467 ▲674.21 ▲0.0598.00 ▼16.7341.20 ▼7.80
Logic settings /wp-admin/admin.php?page=nmod_sck_logics1,0261.8726.8534.78
Graphic settings /wp-admin/admin.php?page=nmod_sck_graphics2,0306.84133.6791.45
Help and support /wp-admin/admin.php?page=nmod_sck_help1,3372.2950.9450.37

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: cookie law, eprivacy, gdpr, cookie, banner

smart-cookie-kit/plugin.php 92% from 13 tests

The main PHP script in "Smart Cookie Kit" version 2.3.2 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("smart-cookie-kit.php" instead of "plugin.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected6,425 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP121,0211,3125,608
JavaScript215749795
CSS10013
XML1208
HTML1001

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 113)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity161.67
▷ Minimum class complexity44.00
▷ Maximum class complexity234.00
Average method complexity4.87
▷ Minimum method complexity1.00
▷ Maximum method complexity113.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods249
▷ Static methods2811.24%
▷ Public methods20582.33%
▷ Protected methods176.83%
▷ Private methods2710.84%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants32
▷ Global constants2371.88%
▷ Class constants928.12%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
res/info.png16.34KB1.95KB▼ 88.09%