84% cookie-law-bar

Code Review | Cookie Law Bar

WordPress plugin Cookie Law Bar scored 84% from 54 tests.

About plugin

  • Plugin page: cookie-law-bar
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.7
  • WordPress version: 6.3.1
  • First release: Jul 27, 2016
  • Latest release: Feb 15, 2017
  • Number of updates: 13
  • Update frequency: every 15.5 days
  • Top authors: widgetpack (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

3,000+ active / 24,819 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
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.35ms] Passed 4 tests

A check of server-side resources used by Cookie Law Bar
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0442.96 ▼7.43
Dashboard /wp-admin3.34 ▲0.0348.89 ▼3.33
Posts /wp-admin/edit.php3.39 ▲0.0347.56 ▼3.79
Add New Post /wp-admin/post-new.php5.92 ▲0.03100.12 ▲5.15
Media Library /wp-admin/upload.php3.26 ▲0.0337.86 ▲5.90
Cookie Law Bar /wp-admin/options-general.php?page=clb3.2737.46

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 14 new options
New WordPress options
clb_version
clb_bar_color
clb_btn_color
clb_btn_text_color
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options
clb_bar_text_color
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

Cookie Law Bar: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,897 ▲12613.65 ▼1.116.26 ▲4.2643.00 ▲4.15
Dashboard /wp-admin2,210 ▲224.86 ▼0.01116.69 ▲6.8041.86 ▲0.92
Posts /wp-admin/edit.php2,090 ▼22.05 ▲0.0540.96 ▼2.1134.77 ▼1.80
Add New Post /wp-admin/post-new.php1,517 ▼1117.82 ▼0.77644.88 ▼4.1754.05 ▲1.85
Media Library /wp-admin/upload.php1,389 ▼24.24 ▲0.02101.33 ▼3.4942.93 ▼3.53
Cookie Law Bar /wp-admin/options-general.php?page=clb9282.0223.3829.42

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cookie-law-bar/cookie-law-bar.php:59
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/cookie-law-bar/cookie-law-bar-setting.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 16 tag instead of maximum 10
You can look at the official readme.txt

cookie-law-bar/cookie-law-bar.php 92% from 13 tests

"Cookie Law Bar" version 1.2.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 180 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin424 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP23125287
JavaScript18072
CSS18065

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
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%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin