78% kjrocker-cookie-consent

Code Review | kjrocker Cookie Consent

WordPress plugin kjrocker Cookie Consent scored78%from 54 tests.

About plugin

  • Plugin page: kjrocker-cookie-c...
  • Plugin version: 1.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.6
  • WordPress version: 6.3.1
  • First release: Nov 5, 2020
  • Latest release: Jan 15, 2021
  • Number of updates: 10
  • Update frequency: every 8.0 days
  • Top authors: kj Rocker (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /401 total downloads

Benchmarks

Plugin footprint 83% from 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: ▼12.60ms] Passed 4 tests

An overview of server-side resources used by kjrocker Cookie Consent
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.39 ▼0.0729.03 ▼13.11
Dashboard /wp-admin3.31 ▼0.0348.84 ▼21.73
Posts /wp-admin/edit.php3.37 ▲0.0148.84 ▼1.45
Add New Post /wp-admin/post-new.php5.89 ▲0.0187.37 ▼14.09
Media Library /wp-admin/upload.php3.24 ▲0.0139.42 ▲3.18
kjrocker Cookie Consent /wp-admin/options-general.php?page=rocker_kjcookie3.1829.07

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 18 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
kj_version_number
rocker_kjcookie
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

kjrocker Cookie Consent: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,929 ▲16813.91 ▼0.4710.37 ▲8.2744.24 ▼1.04
Dashboard /wp-admin2,196 ▲195.57 ▼0.0388.93 ▼8.2239.09 ▼6.56
Posts /wp-admin/edit.php2,104 ▲71.99 ▼0.0039.95 ▲4.2435.23 ▲3.90
Add New Post /wp-admin/post-new.php1,548 ▼623.11 ▼0.06702.13 ▲88.8356.53 ▲1.18
Media Library /wp-admin/upload.php1,404 ▲44.21 ▼0.0794.85 ▼5.9242.57 ▼0.26
kjrocker Cookie Consent /wp-admin/options-general.php?page=rocker_kjcookie1,3622.2546.9133.27

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • rocker_kjcookie
    • widget_recent-comments
    • kj_version_number
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=rocker_kjcookie
    • > Notice in wp-content/plugins/kjrocker-cookie-consent/defaults.php+53
    Undefined index: port
    • > GET request to /wp-admin/options-general.php?page=rocker_kjcookie
    • > Notice in wp-content/plugins/kjrocker-cookie-consent/class-admin.php+56
    Undefined index: lengthnum
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=rocker_kjcookie
    • > Notice in wp-content/plugins/kjrocker-cookie-consent/class-admin.php+143
    Undefined index: blinkid

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/kjrocker-cookie-consent/inc/tinymce.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/kjrocker-cookie-consent/defaults.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/kjrocker-cookie-consent/eu-cookie-law.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/kjrocker-cookie-consent/class-frontend.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/kjrocker-cookie-consent/class-admin.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: cookie consent, gdpr, cookie bar

kjrocker-cookie-consent/eu-cookie-law.php 92% from 13 tests

The main PHP file in "kjrocker Cookie Consent" ver. 1.1.1 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("kjrocker-cookie-consent.php" instead of "eu-cookie-law.php")

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 detected836 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP57916500
JavaScript3238161
CSS1152155
XML10016
INI1104

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
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%
Functions30
▷ Named functions2583.33%
▷ Anonymous functions516.67%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/block.png10.61KB4.91KB▼ 53.75%
img/cookie.png1.03KB0.96KB▼ 7.37%