77% cookie-manager

Code Review | Cookie Manager

WordPress plugin Cookie Manager scored 77% from 54 tests.

About plugin

  • Plugin page: cookie-manager
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.8
  • WordPress version: 6.3.1
  • First release: Aug 13, 2021
  • Latest release: Sep 11, 2021
  • Number of updates: 7
  • Update frequency: every 4.1 days
  • Top authors: deviware (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 466 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▲1.08ms] Passed 4 tests

This is a short check of server-side resources used by Cookie Manager
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2152.39 ▲7.48
Dashboard /wp-admin3.46 ▲0.1649.75 ▲0.30
Posts /wp-admin/edit.php3.57 ▲0.2246.62 ▼1.12
Add New Post /wp-admin/post-new.php6.06 ▲0.1793.26 ▲0.06
Media Library /wp-admin/upload.php3.38 ▲0.1538.19 ▲5.07

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 45 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Cookie Manager
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,235 ▲48914.35 ▲0.0314.04 ▲12.2449.10 ▲9.11
Dashboard /wp-admin2,243 ▲555.12 ▲0.27106.00 ▼6.9741.98 ▲1.35
Posts /wp-admin/edit.php2,107 ▲182.50 ▲0.4538.92 ▼2.4233.71 ▼2.75
Add New Post /wp-admin/post-new.php1,707 ▲17922.53 ▼0.51616.44 ▼73.8534.68 ▼34.38
Media Library /wp-admin/upload.php1,432 ▲474.27 ▲0.0994.50 ▼11.7042.30 ▼1.64

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
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/cookie-manager/public/index.php
    • > /wp-content/plugins/cookie-manager/includes/class-wp-cookie-manager-log.php
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/cookie-manager/admin/partials/wp-cookie-manager-admin-appearance.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/cookie-manager/public/partials/wp-cookie-manager-user-settings-desktop.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/cookie-manager/admin/partials/wp-cookie-manager-admin-header.php:27
    • > PHP Notice
      Undefined index: tab in wp-content/plugins/cookie-manager/admin/partials/wp-cookie-manager-admin-header.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/cookie-manager/admin/partials/wp-cookie-manager-admin-general.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_title() in wp-content/plugins/cookie-manager/admin/partials/wp-cookie-manager-admin-display.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/cookie-manager/public/partials/wp-cookie-manager-user-settings.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/cookie-manager/public/partials/wp-cookie-manager-user-settings-mobile.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/cookie-manager/admin/partials/wp-cookie-manager-admin-texts.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/cookie-manager/public/partials/wp-cookie-manager-cookie-notice.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
You can look at the official readme.txt

cookie-manager/wp-cookie-manager.php 77% from 13 tests

The primary PHP file in "Cookie Manager" version 1.0.2 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cookie-manager.php" instead of "wp-cookie-manager.php")
  • 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
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 148 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected2,810 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP221938291,522
JavaScript58234518
CSS46918450
PO File176129292
SVG20028

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity9.62
▷ Minimum class complexity1.00
▷ Maximum class complexity58.00
Average method complexity2.37
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods47
▷ Static methods24.26%
▷ Public methods3982.98%
▷ Protected methods00.00%
▷ Private methods817.02%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG files were detected