84% advanced-cookies

Code Review | HOB Advanced Cookies for Wordpress

WordPress plugin HOB Advanced Cookies for Wordpress scored84%from 54 tests.

About plugin

  • Plugin page: advanced-cookies
  • Plugin version: 1.4.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.4.1
  • WordPress version: 6.3.1
  • First release: May 4, 2023
  • Latest release: Nov 29, 2023
  • Number of updates: 10
  • Update frequency: every 21.6 days
  • Top authors: hoblucas (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /232 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
Installer ran successfully

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

An overview of server-side resources used by HOB Advanced Cookies for Wordpress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.07 ▼4.16
Dashboard /wp-admin3.31 ▼0.0450.06 ▼10.21
Posts /wp-admin/edit.php3.36 ▲0.0045.82 ▼15.27
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.77 ▼14.25
Media Library /wp-admin/upload.php3.23 ▲0.0032.91 ▼0.55

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for HOB Advanced Cookies for Wordpress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.25 ▲0.021.71 ▼0.0640.01 ▲0.86
Dashboard /wp-admin2,195 ▲215.62 ▲0.0193.28 ▼2.6840.49 ▼1.43
Posts /wp-admin/edit.php2,100 ▼31.96 ▼0.0440.45 ▼0.1336.03 ▼1.43
Add New Post /wp-admin/post-new.php1,526 ▼923.14 ▼0.03632.68 ▲18.4754.38 ▲3.17
Media Library /wp-admin/upload.php1,403 ▲64.19 ▲0.0295.30 ▼5.0443.12 ▲1.58

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not 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 items
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/advanced-cookies/partials/gestion/gestion.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/advanced-cookies/includes/Hob_ac_request.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-cookies/includes/Hob_ac_admin.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/advanced-cookies/partials/licence/licence.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_file_data() in wp-content/plugins/advanced-cookies/advanced_cookies.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/advanced-cookies/partials/description/description.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Hob_ac_view' not found in wp-content/plugins/advanced-cookies/partials/front/front.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Hob_ac_view' not found in wp-content/plugins/advanced-cookies/partials/configuration/configuration.php:2

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 93% from 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
4 plugin tags: advancedcookies, cookie, rgpd, gdpr

advanced-cookies/advanced_cookies.php 85% from 13 tests

The principal PHP file in "HOB Advanced Cookies for Wordpress" v. 1.4.3 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("advanced-cookies.php" instead of "advanced_cookies.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin4,961 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP132064163,927
CSS211210643
PO File180125250
JavaScript1269141

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity14.80
▷ Minimum class complexity1.00
▷ Maximum class complexity50.00
Average method complexity2.68
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods41
▷ Static methods1946.34%
▷ Public methods3380.49%
▷ Protected methods819.51%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
asset/img/logo-cookies.png4.43KB4.41KB0.44%
asset/img/c-logo.png16.23KB1.25KB▼ 92.32%
asset/img/disquette.png8.80KB4.53KB▼ 48.50%