83% cookie-notice-bar

Code Review | Cookie Notice Bar

WordPress plugin Cookie Notice Bar scored83%from 54 tests.

About plugin

  • Plugin page: cookie-notice-bar
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7.2
  • WordPress version: 6.3.1
  • First release: Sep 27, 2016
  • Latest release: Feb 27, 2017
  • Number of updates: 11
  • Update frequency: every 13.7 days
  • Top authors: dcurasi (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /3,992 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼9.91ms] Passed 4 tests

A check of server-side resources used by Cookie Notice Bar
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1141.60 ▼2.09
Dashboard /wp-admin3.40 ▲0.0548.78 ▼15.48
Posts /wp-admin/edit.php3.51 ▲0.1554.22 ▲4.88
Add New Post /wp-admin/post-new.php6.00 ▲0.1184.98 ▼21.56
Media Library /wp-admin/upload.php3.32 ▲0.0939.63 ▼0.49

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 25 new files
Database: no new tables, 23 new options
New WordPress options
dc_cnb_text_color
dc_cnb_read_more_target
dc_cnb_button_background
dc_cnb_button_border_radius
dc_cnb_time
dc_cnb_text_background
dc_cnb_read_more_link
dc_cnb_position
can_compress_scripts
db_upgraded
...

Browser metrics Passed 4 tests

Checking browser requirements for Cookie Notice Bar
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,925 ▲17913.93 ▼0.427.99 ▲6.1146.06 ▼0.13
Dashboard /wp-admin2,229 ▲525.81 ▲0.2891.46 ▼8.5140.42 ▼0.64
Posts /wp-admin/edit.php2,142 ▲452.29 ▲0.3040.32 ▲0.4935.73 ▼5.11
Add New Post /wp-admin/post-new.php1,561 ▲2623.04 ▼1.53691.86 ▲65.7437.76 ▼24.69
Media Library /wp-admin/upload.php1,438 ▲414.34 ▲0.2298.32 ▼2.9544.76 ▼0.38

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% from 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
Please fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/cookie-notice-bar/public/partials/dc-cookie-notice-bar-public-display.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cookie-notice-bar/admin/partials/dc-cookie-notice-bar-admin-display.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: There are too many tags (14 tag instead of maximum 10)
You can take inspiration from this readme.txt

cookie-notice-bar/dc-cookie-notice-bar.php 85% from 13 tests

"Cookie Notice Bar" version 1.3.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("cookie-notice-bar.php" instead of "dc-cookie-notice-bar.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin697 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP12130582516
PO File15151140
JavaScript225424
CSS21817

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.09
Average class complexity3.43
▷ Minimum class complexity1.00
▷ Maximum class complexity8.00
Average method complexity1.55
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods31
▷ Static methods26.45%
▷ Public methods2683.87%
▷ Protected methods00.00%
▷ Private methods516.13%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG files were detected