94% wen-cookie-notice-bar

Code Review | WEN Cookie Notice Bar

WordPress plugin WEN Cookie Notice Bar scored 94% from 54 tests.

About plugin

  • Plugin page: wen-cookie-notice...
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.3
  • WordPress version: 5.8.1
  • First release: Aug 8, 2019
  • Latest release: Dec 5, 2019
  • Number of updates: 6
  • Update frequency: every 19.8 days
  • Top authors: webexpertsnepal (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 331 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by WEN Cookie Notice Bar
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.1537.80 ▲15.31
Dashboard /wp-admin3.09 ▲0.0445.80 ▼2.64
Posts /wp-admin/edit.php3.14 ▲0.0450.10 ▲5.68
Add New Post /wp-admin/post-new.php5.45 ▲0.0297.96 ▼571.02
Media Library /wp-admin/upload.php3.03 ▲0.0335.19 ▼0.74
Cookie Notice Bar /wp-admin/options-general.php?page=wen-cookie-notice-bar3.0425.61

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 10 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for WEN Cookie Notice Bar
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,818 ▲22216.11 ▲0.1412.89 ▲3.2051.09 ▲1.10
Dashboard /wp-admin2,972 ▲385.84 ▼0.10141.48 ▼25.24115.43 ▲4.83
Posts /wp-admin/edit.php2,744 ▲82.70 ▲0.0169.82 ▼2.1096.35 ▲4.08
Add New Post /wp-admin/post-new.php1,686 ▲318.70 ▲0.16377.26 ▼9.27123.89 ▲9.81
Media Library /wp-admin/upload.php1,812 ▲55.05 ▲0.02161.98 ▼17.52121.98 ▼27.52
Cookie Notice Bar /wp-admin/options-general.php?page=wen-cookie-notice-bar1,7076.72150.26123.51

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wen-cookie-notice-bar/inc/classes/class-wcnb.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Backend: Cookie Notice Bar Settings), #2 (Frontend: Cookie Notice Bar with WP default Twenty Nineteen theme)
Please take inspiration from this readme.txt

wen-cookie-notice-bar/wen-cookie-notice-bar.php Passed 13 tests

The principal PHP file in "WEN Cookie Notice Bar" v. 1.0 is loaded by WordPress automatically on each request
95 characters long description:
Allow to add a simple cookie notice bar for making your site GDPR compliant according to EU law

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected203 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP41923128
CSS10047
JavaScript13028

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity4.50
▷ Minimum class complexity3.00
▷ Maximum class complexity6.00
Average method complexity1.88
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There are no PNG files in this plugin