84% cookie-panda

Code Review | Cookie Panda

WordPress plugin Cookie Panda scored84%from 54 tests.

About plugin

  • Plugin page: cookie-panda
  • Plugin version: 1.2.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.9.1
  • WordPress version: 6.3.1
  • First release: Feb 25, 2022
  • Latest release: Mar 9, 2022
  • Number of updates: 12
  • Update frequency: every 1.1 days
  • Top authors: shahidalionline (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /705 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼6.21ms] Passed 4 tests

An overview of server-side resources used by Cookie Panda
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0834.59 ▼3.59
Dashboard /wp-admin3.38 ▲0.0346.74 ▼9.09
Posts /wp-admin/edit.php3.50 ▲0.1447.38 ▼4.19
Add New Post /wp-admin/post-new.php5.98 ▲0.0995.68 ▼7.96
Media Library /wp-admin/upload.php3.31 ▲0.0733.22 ▲2.46

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_cookie_panda_widget

Browser metrics Passed 4 tests

Checking browser requirements for Cookie Panda
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,904 ▲13314.27 ▼0.476.35 ▲4.5036.50 ▼3.58
Dashboard /wp-admin2,224 ▲336.01 ▲1.1399.20 ▼3.8639.00 ▼3.78
Posts /wp-admin/edit.php2,112 ▲442.33 ▲0.2941.49 ▲2.2834.48 ▼1.75
Add New Post /wp-admin/post-new.php1,541 ▲2223.13 ▲0.04623.45 ▼23.7234.13 ▼25.15
Media Library /wp-admin/upload.php1,400 ▲154.52 ▲0.3398.49 ▼6.7340.81 ▼4.25

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
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_cookie_panda_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 fix the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/cookie-panda/cookie-panda.php
    • > /wp-content/plugins/cookie-panda/cookie-panda-widget.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 Passed 29 tests

readme.txt Passed 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
6 plugin tags: cookie notice, gdpr, cookie banner, ccpa, cookie consent...

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

The principal PHP file in "Cookie Panda" v. 1.2.0 is loaded by WordPress automatically on each request
46 characters long description:
Simple GDPR cookie notice plugin for WordPress

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin451 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP24124232
JavaScript22212104
CSS19068
Markdown122047

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity28.50
▷ Minimum class complexity2.00
▷ Maximum class complexity55.00
Average method complexity8.71
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods9
▷ Static methods222.22%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions00.00%
▷ Anonymous functions4100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin