84% dn-cookie-notice

Code Review | DN Cookie Notice

WordPress plugin DN Cookie Notice scored84%from 54 tests.

About plugin

  • Plugin page: dn-cookie-notice
  • Plugin version: 1.4
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Sep 22, 2020
  • Latest release: Jun 20, 2023
  • Number of updates: 15
  • Update frequency: every 66.7 days
  • Top authors: digireturn (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,024 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼1.81ms] Passed 4 tests

An overview of server-side resources used by DN Cookie Notice
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0943.02 ▲2.51
Dashboard /wp-admin3.39 ▲0.0851.96 ▲5.07
Posts /wp-admin/edit.php3.44 ▲0.0851.76 ▼7.07
Add New Post /wp-admin/post-new.php5.97 ▲0.0892.09 ▼7.76
Media Library /wp-admin/upload.php3.31 ▲0.0845.04 ▲10.30
Cookie Notice /wp-admin/options-general.php?page=dn_cookie_notice_manage3.3042.93

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments
dn_cookie_notice_settings

Browser metrics Passed 4 tests

An overview of browser requirements for DN Cookie Notice
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲3513.23 ▼1.161.90 ▼0.2545.95 ▼6.26
Dashboard /wp-admin2,212 ▲275.89 ▲1.05111.36 ▼6.7842.19 ▼8.38
Posts /wp-admin/edit.php2,098 ▲92.00 ▼0.0239.17 ▼4.0932.22 ▼6.25
Add New Post /wp-admin/post-new.php1,532 ▲1322.12 ▼0.89698.20 ▼15.5754.45 ▼7.82
Media Library /wp-admin/upload.php1,394 ▲94.20 ▼0.01113.67 ▼12.4549.08 ▼3.06
Cookie Notice /wp-admin/options-general.php?page=dn_cookie_notice_manage8422.0330.0333.49

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • dn_cookie_notice_settings
    • widget_theysaidso_widget
    • can_compress_scripts

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/dn-cookie-notice/dn-cookie-notice.php

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 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: banner, cookie, notice, popup, info banner

dn-cookie-notice/dn-cookie-notice.php 92% from 13 tests

The entry point to "DN Cookie Notice" version 1.4 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Text Domain: Please use dashes and lowercase characters for text domains

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
There were no executable files found in this plugin353 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP1526262
PO File19418284
CSS1007

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.54
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%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
2 PNG files occupy 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/logo.png15.59KB3.79KB▼ 75.67%
images/icon.png6.66KB0.64KB▼ 90.44%