84% lightweight-cookie-notice-free

Code Review | Lightweight Cookie Notice

WordPress plugin Lightweight Cookie Notice scored84%from 54 tests.

About plugin

  • Plugin page: lightweight-cooki...
  • Plugin version: 1.09
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Mar 26, 2021
  • Latest release: Oct 22, 2023
  • Number of updates: 11
  • Update frequency: every 85.5 days
  • Top authors: daext (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

2,000+ active /7,692 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲1.03MB] [CPU: ▲1.94ms] Passed 4 tests

A check of server-side resources used by Lightweight Cookie Notice
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.90 ▲0.4448.12 ▲9.80
Dashboard /wp-admin4.53 ▲1.2351.62 ▲2.37
Posts /wp-admin/edit.php4.65 ▲1.2949.24 ▲0.78
Add New Post /wp-admin/post-new.php7.11 ▲1.2388.67 ▼2.79
Media Library /wp-admin/upload.php4.46 ▲1.2342.80 ▲7.40
Help /wp-admin/admin.php?page=daextlwcnf-help4.4236.22
Pro Version /wp-admin/admin.php?page=daextlwcnf-pro-version4.4336.13
Options /wp-admin/admin.php?page=daextlwcnf-options4.4532.62

Server storage [IO: ▲1.44MB] [DB: ▲0.02MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 186 new files
Database: no new tables, 108 new options
New WordPress options
daextlwcnf_cookie_notice_button_2_border_color_hover
daextlwcnf_cookie_notice_button_2_text
daextlwcnf_cookie_notice_button_dismiss_url
widget_recent-posts
daextlwcnf_revisit_consent_button_tooltip_text
daextlwcnf_cookie_settings_button_1_url
theysaidso_admin_options
daextlwcnf_cookie_notice_button_2_url
daextlwcnf_cookie_settings_button_2_background_color
daextlwcnf_cookie_settings_button_1_background_color_hover
...

Browser metrics Passed 4 tests

A check of browser resources used by Lightweight Cookie Notice
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,890 ▲12914.13 ▼0.454.88 ▲3.3550.13 ▲3.24
Dashboard /wp-admin2,242 ▲625.66 ▼0.0083.71 ▼3.9039.69 ▼0.13
Posts /wp-admin/edit.php2,153 ▲531.99 ▼0.0236.86 ▲0.7933.35 ▼5.44
Add New Post /wp-admin/post-new.php1,551 ▲2523.31 ▲0.20659.32 ▼34.0162.90 ▲11.64
Media Library /wp-admin/upload.php1,450 ▲504.25 ▲0.0296.41 ▼5.3039.90 ▼6.68
Help /wp-admin/admin.php?page=daextlwcnf-help8572.0325.5624.66
Pro Version /wp-admin/admin.php?page=daextlwcnf-pro-version9062.0023.7528.86
Options /wp-admin/admin.php?page=daextlwcnf-options1,0212.5134.6929.78

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 37× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'MaxMind\\Exception\\WebServiceException' not found in wp-content/plugins/lightweight-cookie-notice-free/vendor/maxmind/web-service-common/src/Exception/HttpException.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Exception\\GeoIp2Exception' not found in wp-content/plugins/lightweight-cookie-notice-free/vendor/geoip2/geoip2/src/Exception/HttpException.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'MaxMind\\WebService\\Http\\Request' not found in wp-content/plugins/lightweight-cookie-notice-free/vendor/maxmind/web-service-common/src/WebService/Http/CurlRequest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Model\\AbstractModel' not found in wp-content/plugins/lightweight-cookie-notice-free/vendor/geoip2/geoip2/src/Model/Domain.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'MaxMind\\Exception\\InvalidRequestException' not found in wp-content/plugins/lightweight-cookie-notice-free/vendor/maxmind/web-service-common/src/Exception/InsufficientFundsException.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'MaxMind\\Exception\\InvalidRequestException' not found in wp-content/plugins/lightweight-cookie-notice-free/vendor/maxmind/web-service-common/src/Exception/AuthenticationException.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'MaxMind\\Exception\\InvalidRequestException' not found in wp-content/plugins/lightweight-cookie-notice-free/vendor/maxmind/web-service-common/src/Exception/IpAddressNotFoundException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Record\\AbstractPlaceRecord' not found in wp-content/plugins/lightweight-cookie-notice-free/vendor/geoip2/geoip2/src/Record/City.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Model\\City' not found in wp-content/plugins/lightweight-cookie-notice-free/vendor/geoip2/geoip2/src/Model/Insights.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Model\\AbstractModel' not found in wp-content/plugins/lightweight-cookie-notice-free/vendor/geoip2/geoip2/src/Model/Isp.php:27

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 errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
The official readme.txt might help

lightweight-cookie-notice-free/init.php 92% from 13 tests

The main file in "Lightweight Cookie Notice" v. 1.09 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("lightweight-cookie-notice-free.php" instead of "init.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin21,891 lines of code in 175 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript742,8841,09010,943
PHP732,1382,1107,241
CSS8249281,438
Markdown1043901,001
C111724665
JSON600507
XML14056
m418032
C/C++ Header14128

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity9.51
▷ Minimum class complexity1.00
▷ Maximum class complexity72.00
Average method complexity2.19
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces15
Interfaces2
Traits0
Classes59
▷ Abstract classes35.08%
▷ Concrete classes5694.92%
▷ Final classes00.00%
Methods425
▷ Static methods337.76%
▷ Public methods35784.00%
▷ Protected methods153.53%
▷ Private methods5312.47%
Functions7
▷ Named functions342.86%
▷ Anonymous functions457.14%
Constants19
▷ Global constants15.26%
▷ Class constants1894.74%
▷ Public constants211.11%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.03MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/img/help-f7f7f7.png15.86KB0.59KB▼ 96.25%
admin/assets/img/select2-multiple-choice-close.png1.87KB0.29KB▼ 84.67%
admin/assets/img/help-fdfdfd.png15.52KB0.53KB▼ 96.60%