94% cookie-notification

Code Review | Cookie Notification

WordPress plugin Cookie Notification scored 94% from 54 tests.

About plugin

  • Plugin page: cookie-notification
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.5-4.7.5
  • WordPress version: 5.8.1
  • First release: May 24, 2017
  • Latest release: Jun 1, 2017
  • Number of updates: 9
  • Update frequency: every 1.0 days
  • Top authors: johsjensen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 3,523 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼145.14ms] Passed 4 tests

Analyzing server-side resources used by Cookie Notification
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.0140.28 ▲5.43
Dashboard /wp-admin3.09 ▲0.0449.73 ▲6.60
Posts /wp-admin/edit.php3.18 ▲0.0738.66 ▼7.88
Add New Post /wp-admin/post-new.php5.45 ▲0.0192.54 ▼576.21
Media Library /wp-admin/upload.php3.03 ▲0.0334.02 ▼1.89
Cookie Notification /wp-admin/options-general.php?page=cpwp_settings2.9836.68

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 13 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Cookie Notification
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,850 ▲25416.56 ▲1.0016.72 ▲6.6150.65 ▲1.83
Dashboard /wp-admin3,003 ▲696.58 ▲0.42149.72 ▲1.77123.29 ▲2.79
Posts /wp-admin/edit.php2,784 ▲453.16 ▲0.3577.83 ▲9.17114.10 ▲20.29
Add New Post /wp-admin/post-new.php1,652 ▼3121.56 ▲2.87292.08 ▼102.44122.60 ▲7.24
Media Library /wp-admin/upload.php1,842 ▲355.35 ▲0.31125.60 ▼20.29125.70 ▲9.81
Cookie Notification /wp-admin/options-general.php?page=cpwp_settings1,9222.8784.9883.40

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstaller ran successfully

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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
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-notification/cookie-notification.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: cookie, notify, cookies, notice, notification

cookie-notification/cookie-notification.php Passed 13 tests

The main PHP file in "Cookie Notification" ver. 1.4 adds more information about the plugin and also serves as the entry point for this plugin
118 characters long description:
Displays customizable cookie notifications. Includes a preview function for viewing your changes before your users do.

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
Everything looks great! No dangerous files found in this plugin794 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP19019350
JavaScript43923175
CSS2160167
PO File1323298
INI1004

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.01
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

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png5.12KB2.57KB▼ 49.88%