68% beautiful-and-responsive-cookie-consent

Code Review | Beautiful Cookie Consent Banner

WordPress plugin Beautiful Cookie Consent Banner scored68%from 54 tests.

About plugin

  • Plugin page: beautiful-and-res...
  • Plugin version: 3.1.0
  • PHP compatiblity: 7.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Jun 22, 2018
  • Latest release: Nov 12, 2023
  • Number of updates: 125
  • Update frequency: every 15.8 days
  • Top authors: nikelschubert (100%)

Code review

54 tests

User reviews

48 reviews

Install metrics

40,000+ active /678,349 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.72MB] [CPU: ▲4.81ms] Passed 4 tests

Server-side resources used by Beautiful Cookie Consent Banner
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.97 ▲0.5146.63 ▲6.84
Dashboard /wp-admin4.09 ▲0.7954.84 ▲5.87
Posts /wp-admin/edit.php4.15 ▲0.7954.61 ▲8.91
Add New Post /wp-admin/post-new.php6.68 ▲0.7996.39 ▼2.40
Media Library /wp-admin/upload.php4.02 ▲0.7945.93 ▲10.83
Cookie Consent Banner /wp-admin/options-general.php?page=nsc_bar-cookie-consent4.1945.35

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 38 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
nsc_bar_first_activation
db_upgraded
can_compress_scripts
theysaidso_admin_options
nsc_bar_db_version
widget_recent-comments

Browser metrics Passed 4 tests

Beautiful Cookie Consent Banner: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲4714.22 ▼0.481.91 ▲0.3442.66 ▲6.64
Dashboard /wp-admin2,202 ▲215.63 ▲0.0290.23 ▼18.1444.63 ▲1.86
Posts /wp-admin/edit.php2,107 ▲72.01 ▼0.0636.83 ▼2.1234.76 ▼0.39
Add New Post /wp-admin/post-new.php1,529 ▲323.35 ▲0.12646.56 ▼4.8954.55 ▲5.11
Media Library /wp-admin/upload.php1,401 ▼24.19 ▲0.0097.60 ▼2.8243.36 ▼2.30
Cookie Consent Banner /wp-admin/options-general.php?page=nsc_bar-cookie-consent1,1551.8231.6052.43

Uninstaller [IO: ▲0.42MB] [DB: ▲0.31MB] 25% from 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/beautiful-and-responsive-cookie-consent/uninstall.php+12
    Constant NSC_BAR_PLUGIN_DIR already defined
  • The plugin did not uninstall successfully, leaving 38 files (0.42MB) in the plugin directory
    • (new file) admin/js/admin.consentmode.min.js
    • (new file) admin/img/banner3.png
    • (new file) admin/img/banner1.png
    • (new file) admin/img/banner2.png
    • (new file) admin/img/rating-stars.png
    • (new file) admin/tpl/admin.php
    • (new file) admin/img/icon-96x96.png
    • (new file) admin/js/cookietypes.v2.js
    • (new file) admin/css/nsc_bar_admin.css
    • (new file) admin/tpl/premium_addon_desc.html
    • ...
  • The uninstall procedure has failed, leaving 9 options in the database
    • db_upgraded
    • widget_recent-comments
    • nsc_bar_first_activation
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • nsc_bar_db_version
    • recovery_mode_email_last_sent
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

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

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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 79% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Contributors: Contributors not specified
  • Screenshots: These screenshots need descriptions #14, #15, #16, #17 in beautiful-and-responsive-cookie-consent/assets to your readme.txt
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

beautiful-and-responsive-cookie-consent/nsc_bar-cookie-consent.php 77% from 13 tests

The entry point to "Beautiful Cookie Consent Banner" version 3.1.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 165 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("beautiful-and-responsive-cookie-consent.php" instead of "nsc_bar-cookie-consent.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin3,619 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP16318531,875
JSON2001,121
JavaScript47023403
CSS2281168
HTML60052

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity24.58
▷ Minimum class complexity1.00
▷ Maximum class complexity53.00
Average method complexity3.36
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods120
▷ Static methods00.00%
▷ Public methods7260.00%
▷ Protected methods00.00%
▷ Private methods4840.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.17MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/rating-stars.png44.94KB19.13KB▼ 57.45%
admin/img/banner2.png45.99KB19.52KB▼ 57.56%
admin/img/banner3.png48.70KB19.75KB▼ 59.45%
admin/img/icon-96x96.png9.35KB4.11KB▼ 56.08%
admin/img/banner1.png28.96KB11.61KB▼ 59.89%