72% cookiebar-by-beard

Code Review | Cookiebar by Beard

WordPress plugin Cookiebar by Beard scored72%from 54 tests.

About plugin

  • Plugin page: cookiebar-by-beard
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.4
  • WordPress version: 6.3.1
  • First release: Feb 18, 2020
  • Latest release: Jun 8, 2020
  • Number of updates: 21
  • Update frequency: every 5.3 days
  • Top authors: beardeddev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /673 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼2.31ms] Passed 4 tests

This is a short check of server-side resources used by Cookiebar by Beard
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.68 ▼2.96
Dashboard /wp-admin3.34 ▲0.0444.03 ▼2.36
Posts /wp-admin/edit.php3.39 ▲0.0447.69 ▲2.89
Add New Post /wp-admin/post-new.php5.98 ▲0.1090.91 ▼4.03
Media Library /wp-admin/upload.php3.26 ▲0.0333.90 ▲0.10
Add New /wp-admin/post-new.php?post_type=cbbb_cookie5.9789.52
Cookie Scripts /wp-admin/edit.php?post_type=cbbb_cookie3.3033.04
Cookiebar by Beard /wp-admin/options-general.php?page=cookiebar-by-beard3.2531.49

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Cookiebar by Beard
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,984 ▲22713.99 ▼0.695.77 ▲3.8358.18 ▲10.33
Dashboard /wp-admin2,234 ▲495.98 ▲0.1398.01 ▼10.3538.75 ▼7.24
Posts /wp-admin/edit.php2,123 ▲342.04 ▲0.0639.00 ▼5.5635.28 ▼1.06
Add New Post /wp-admin/post-new.php1,560 ▲3223.28 ▲4.98615.98 ▼15.0261.17 ▲6.82
Media Library /wp-admin/upload.php1,419 ▲314.21 ▼0.0098.13 ▼1.8642.25 ▼1.99
Add New /wp-admin/post-new.php?post_type=cbbb_cookie11,45523.731,099.7139.74
Cookie Scripts /wp-admin/edit.php?post_type=cbbb_cookie1,0811.9930.6730.39
Cookiebar by Beard /wp-admin/options-general.php?page=cookiebar-by-beard8922.0225.2531.77

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

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
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=cookiebar-by-beard
    • > Notice in wp-content/plugins/cookiebar-by-beard/cookiebar-by-beard.php+130
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/cookiebar-by-beard/includes/plugin-functions.php
    • > /wp-content/plugins/cookiebar-by-beard/cookiebar-by-beard.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/edit.php?post_type=cbbb_cookie
    • > Intervention (severe) in unknown
    /wp-admin/post-new.php?post_type=cbbb_cookie - Blocked attempt to show a 'beforeunload' confirmation panel for a frame that never had a user gesture since its load. https://www.chromestatus.com/feature/5082396709879808

Optimizations

Plugin configuration 93% 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
4 plugin tags: gdpr, opt-in, cookiebar, cookies

cookiebar-by-beard/cookiebar-by-beard.php 85% from 13 tests

"Cookiebar by Beard" version 1.0.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected513 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP610671510
CSS1001
JavaScript1011
SVG1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity15.00
▷ Minimum class complexity15.00
▷ Maximum class complexity15.00
Average method complexity2.27
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods216.67%
▷ Public methods1191.67%
▷ Protected methods00.00%
▷ Private methods18.33%
Functions10
▷ Named functions10100.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
No PNG images were found in this plugin