78% cookiealert

Code Review | CookieAlert

WordPress plugin CookieAlert scored78%from 54 tests.

About plugin

  • Plugin page: cookiealert
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-5.2
  • WordPress version: 6.3.1
  • First release: Jun 3, 2019
  • Latest release: Jun 3, 2019
  • Number of updates: 3
  • Update frequency: every 1.0 days
  • Top authors: kernelroni (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /482 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.99ms] Passed 4 tests

An overview of server-side resources used by CookieAlert
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0243.24 ▼3.08
Dashboard /wp-admin3.32 ▲0.0151.57 ▼5.79
Posts /wp-admin/edit.php3.37 ▲0.0151.82 ▲2.81
Add New Post /wp-admin/post-new.php5.92 ▲0.0394.69 ▲0.88
Media Library /wp-admin/upload.php3.24 ▲0.0136.82 ▲0.02

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for CookieAlert
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,952 ▲20613.93 ▼0.386.59 ▲4.8051.37 ▲3.13
Dashboard /wp-admin2,216 ▲285.80 ▼0.10102.36 ▼15.6241.76 ▼2.89
Posts /wp-admin/edit.php2,105 ▲162.03 ▲0.0240.29 ▲3.0035.01 ▼1.03
Add New Post /wp-admin/post-new.php1,537 ▲2318.54 ▲0.94680.21 ▲41.9661.93 ▼0.00
Media Library /wp-admin/upload.php1,407 ▲224.17 ▼0.0699.40 ▼5.4143.79 ▼1.08

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
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/cookiealert/public/partials/cookiealert-public-display.php
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined variable: popup_interval in wp-content/plugins/cookiealert/admin/partials/cookiealert-admin-display.php on line 7
    • > PHP Notice
      Undefined variable: duration in wp-content/plugins/cookiealert/admin/partials/cookiealert-admin-display.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/cookiealert/admin/partials/cookiealert-admin-display.php:14
    • > PHP Notice
      Undefined variable: btn_text in wp-content/plugins/cookiealert/public/partials/cookiealert-public-display.php on line 27
    • > PHP Notice
      Undefined variable: message in wp-content/plugins/cookiealert/public/partials/cookiealert-public-display.php on line 23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === cookiealert === )
  • Screenshots: Please add images for these screenshots: #1 (frontend.png), #2 (backend.png)
The official readme.txt might help

cookiealert/cookiealert.php Passed 13 tests

The main PHP script in "CookieAlert" version 1.0.0 is automatically included on every request by WordPress
77 characters long description:
Cookie alert, A cooking consent plugin to show nitifiation to the front user.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin445 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP12188528252
CSS2144138
JavaScript2142839
SVG10116

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity2.00
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.27
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods26
▷ Static methods27.69%
▷ Public methods2180.77%
▷ Protected methods00.00%
▷ Private methods519.23%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
2 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
frontend.png23.42KB9.40KB▼ 59.86%
backend.png35.46KB14.31KB▼ 59.63%