73% mandatly-cookie-compliance-and-consent-solution

Code Review | Mandatly | Cookie Compliance and Consent solution

WordPress plugin Mandatly | Cookie Compliance and Consent solution scored73%from 54 tests.

About plugin

  • Plugin page: mandatly-cookie-c...
  • Plugin version: 1.2.2
  • PHP compatiblity: 4.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.9-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 15, 2023
  • Latest release: Jul 27, 2023
  • Number of updates: 16
  • Update frequency: every 10.1 days
  • Top authors: mandatly (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /293 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.87MB] [CPU: ▲44.80ms] Passed 4 tests

This is a short check of server-side resources used by Mandatly | Cookie Compliance and Consent solution
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.11114.54 ▲66.28
Dashboard /wp-admin3.07 ▼0.23100.81 ▲53.43
Posts /wp-admin/edit.php3.08 ▼0.28102.45 ▲56.44
Add New Post /wp-admin/post-new.php3.08 ▼2.8297.96 ▲3.06
Media Library /wp-admin/upload.php3.08 ▼0.16112.52 ▲76.17

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 38 new files
Database: no new tables, 10 new options
New WordPress options
mdt_cookie_demo_status
db_upgraded
widget_recent-posts
mdt_cookie_live_url
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
mdt_cookie_banner_status
can_compress_scripts
mdt_cookie_demo_url

Browser metrics Passed 4 tests

This is an overview of browser requirements for Mandatly | Cookie Compliance and Consent solution
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,192 ▲44613.85 ▼0.5210.27 ▲8.4538.23 ▼5.83
Dashboard /wp-admin2,221 ▲394.90 ▼0.03100.98 ▼7.5980.31 ▲36.89
Posts /wp-admin/edit.php2,107 ▲392.11 ▲0.0934.59 ▼0.1132.74 ▲0.02
Add New Post /wp-admin/post-new.php1,680 ▲16021.28 ▼1.82776.26 ▲90.3256.82 ▲4.54
Media Library /wp-admin/upload.php1,403 ▲184.20 ▼0.0295.84 ▼1.4571.55 ▲26.22

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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 take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/mandatly-cookie-compliance-and-consent-solution/admin/partials/mcc-admin-display.php:18

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
  • Contributors: The plugin contributors field is not present
The official readme.txt might help

mandatly-cookie-compliance-and-consent-solution/mandatly-cookie-compliance-and-consent-solution.php 85% from 13 tests

The main file in "Mandatly | Cookie Compliance and Consent solution" v. 1.2.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 169 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
Good job! No executable or dangerous file extensions detected959 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP1183401413
CSS1475312
JavaScript11428193
SVG20136
JSON1005

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity4.50
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity1.81
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods26
▷ Static methods27.69%
▷ Public methods2284.62%
▷ Protected methods00.00%
▷ Private methods415.38%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants37
▷ Global constants37100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
12 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/icon-info.png0.90KB0.59KB▼ 34.56%
admin/assets/icon-128x128.png6.62KB3.56KB▼ 46.28%
admin/assets/cookie-icon.png3.57KB1.12KB▼ 68.55%
admin/assets/icon-256x256.png13.13KB6.10KB▼ 53.59%
assets/icon-mandatly.png0.59KB0.61KB0.00%