84% cookie-notice-lite

Code Review | Cookie Notice lite

WordPress plugin Cookie Notice lite scored84%from 54 tests.

About plugin

  • Plugin page: cookie-notice-lite
  • Plugin version: 1.9.9
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Jun 17, 2020
  • Latest release: Aug 12, 2023
  • Number of updates: 39
  • Update frequency: every 29.5 days
  • Top authors: MarcDK (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

400+ active /3,641 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼7.41ms] Passed 4 tests

Analyzing server-side resources used by Cookie Notice lite
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.05 ▼6.22
Dashboard /wp-admin3.31 ▲0.0147.24 ▼11.73
Posts /wp-admin/edit.php3.36 ▲0.0149.35 ▼4.54
Add New Post /wp-admin/post-new.php5.89 ▲0.0192.77 ▼7.13
Media Library /wp-admin/upload.php3.24 ▲0.0136.62 ▼1.28
Cookie Notice Lite /wp-admin/options-general.php?page=cookie_notice_lite3.2034.19

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Cookie Notice lite: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲6814.81 ▲0.532.37 ▲0.6543.84 ▲1.00
Dashboard /wp-admin2,207 ▲255.79 ▲0.88101.65 ▼23.6242.81 ▼11.88
Posts /wp-admin/edit.php2,093 ▲42.03 ▼0.0339.90 ▲3.7435.64 ▲4.56
Add New Post /wp-admin/post-new.php1,522 ▲323.26 ▲0.23670.85 ▲2.8157.66 ▲5.87
Media Library /wp-admin/upload.php1,389 ▲14.20 ▼0.0398.02 ▼9.9848.95 ▲6.38
Cookie Notice Lite /wp-admin/options-general.php?page=cookie_notice_lite7812.0524.9331.85

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cookie-notice-lite/cookie-notice.php:14

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

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: consent, cookie, dsgvo, notice

cookie-notice-lite/cookie-notice.php 92% from 13 tests

The primary PHP file in "Cookie Notice lite" version 1.9.9 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cookie-notice-lite.php" instead of "cookie-notice.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin57 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1131157

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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