73% zestard-cookie-consent

Code Review | Zestard Cookie Consent

WordPress plugin Zestard Cookie Consent scored73%from 54 tests.

About plugin

  • Plugin page: zestard-cookie-co...
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1.1
  • WordPress version: 6.3.1
  • First release: May 11, 2020
  • Latest release: Dec 16, 2022
  • Number of updates: 12
  • Update frequency: every 79.3 days
  • Top authors: zestardtechnologies (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /526 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.06MB] [CPU: ▼6.97ms] Passed 4 tests

This is a short check of server-side resources used by Zestard Cookie Consent
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0940.35 ▲1.70
Dashboard /wp-admin3.36 ▲0.0650.60 ▼0.76
Posts /wp-admin/edit.php3.41 ▲0.0649.14 ▼3.96
Add New Post /wp-admin/post-new.php5.96 ▲0.0785.30 ▼24.84
Media Library /wp-admin/upload.php3.28 ▲0.0538.42 ▲3.07
Cookie Consent /wp-admin/options-general.php?page=zestard_cookie_consent3.3632.91

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, 31 new options
New WordPress options
widget_recent-posts
read_more_text
cookie_bar_status
cookie_bar_show_in
accept_btn_text
read_more_option
bar_bg_color
read_more_text_color
reject_btn_or_link_option
accept_btn_or_link_option
...

Browser metrics Passed 4 tests

An overview of browser requirements for Zestard Cookie Consent
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲8513.34 ▼1.031.79 ▲0.0344.16 ▼0.39
Dashboard /wp-admin2,236 ▲485.14 ▲0.24104.47 ▼17.9942.66 ▲1.56
Posts /wp-admin/edit.php2,121 ▲292.48 ▲0.4941.22 ▼12.0834.02 ▼8.92
Add New Post /wp-admin/post-new.php1,548 ▲2923.01 ▼0.18675.81 ▲57.0040.30 ▼11.47
Media Library /wp-admin/upload.php1,418 ▲334.50 ▲0.18106.13 ▼1.3846.34 ▼4.74
Cookie Consent /wp-admin/options-general.php?page=zestard_cookie_consent2,1343.0074.7526.27

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

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=zestard_cookie_consent
    • > Notice in wp-content/plugins/zestard-cookie-consent/admin/inc/admin-layout.php+73
    Undefined index: ztpl-tab-select

SRP 0% 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 take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/zestard-cookie-consent/zestard-cookie-consent.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/zestard-cookie-consent/public/inc/front-cookiebar-view.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/zestard-cookie-consent/admin/inc/admin-layout.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_site_url() in wp-content/plugins/zestard-cookie-consent/admin/inc/add-option.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/zestard-cookie-consent/public/inc/front-cookiebar-view.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Donate link: Please fix this invalid URI: "''"
The official readme.txt is a good inspiration

zestard-cookie-consent/zestard-cookie-consent.php Passed 13 tests

The main PHP file in "Zestard Cookie Consent" ver. 1.0.3 adds more information about the plugin and also serves as the entry point for this plugin
55 characters long description:
Simple and easy to manage cookie consent bar with GDPR.

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 plugin768 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP819469463
CSS23018170
JavaScript33626135

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.08
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There were not PNG files found in your plugin