84% cookiehub

Code Review | CookieHub Wordpress Plugin

WordPress plugin CookieHub Wordpress Plugin scored84%from 54 tests.

About plugin

  • Plugin page: cookiehub
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.4.1
  • WordPress version: 6.3.1
  • First release: Oct 2, 2020
  • Latest release: Nov 23, 2023
  • Number of updates: 28
  • Update frequency: every 41.0 days
  • Top authors: cookiehub (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

2,000+ active /19,727 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.11MB] [CPU: ▼4.63ms] Passed 4 tests

An overview of server-side resources used by CookieHub Wordpress Plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1240.03 ▼1.40
Dashboard /wp-admin3.42 ▲0.0848.06 ▼14.53
Posts /wp-admin/edit.php3.54 ▲0.1849.50 ▼0.03
Add New Post /wp-admin/post-new.php6.00 ▲0.1293.32 ▼2.57
Media Library /wp-admin/upload.php3.35 ▲0.1236.93 ▲0.66
CookieHub /wp-admin/options-general.php?page=my-setting-admin3.3231.62

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by CookieHub Wordpress Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,798 ▲5114.33 ▲0.061.53 ▼0.1043.07 ▼1.12
Dashboard /wp-admin2,200 ▲265.56 ▼0.0086.42 ▼16.1150.03 ▲6.49
Posts /wp-admin/edit.php2,105 ▲52.02 ▲0.0633.73 ▼12.1353.24 ▲19.71
Add New Post /wp-admin/post-new.php1,533 ▲723.42 ▲0.31607.44 ▼0.5872.53 ▲20.74
Media Library /wp-admin/upload.php1,411 ▲144.28 ▲0.0895.99 ▼5.1852.82 ▲9.35
CookieHub /wp-admin/options-general.php?page=my-setting-admin9192.0125.7755.32

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cookiehub/cookiehub.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/cookiehub/includes/ch-admin.php:62
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cookiehub/includes/ch-generate.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_uninstall_hook() in wp-content/plugins/cookiehub/includes/ch-install.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cookiehub/includes/ch-api.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/cookiehub/includes/ch-activate.php:7

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)
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
Attributes that require attention:
  • Screenshots: Add descriptions for screenshots #1, #2, #3, #4, #5, #6 in cookiehub/assets to your readme.txt
The official readme.txt might help

cookiehub/cookiehub.php Passed 13 tests

The main PHP script in "CookieHub Wordpress Plugin" version 1.0.2 is automatically included on every request by WordPress
106 characters long description:
Take control effortlessly with CookieHub – GDPR-compliant solution for cookie management and compliance.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin1,331 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP1011336727
CSS1577386
JavaScript15018218

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity6.60
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity3.55
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods11
▷ Static methods763.64%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
9 PNG files occupy 0.22MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/assets/cookiehub-wp-banner-bg.png33.75KB36.23KB0.00%
includes/assets/dashboard.png0.51KB0.44KB▼ 13.52%
includes/assets/cookiehub-wp-banner-bg_old.png132.59KB48.06KB▼ 63.75%
includes/assets/no_card.png0.26KB0.25KB▼ 5.99%
includes/assets/check.png0.18KB0.18KB▼ 2.16%