84% jquery-cookie-law

Code Review | MT Cookie Consent

WordPress plugin MT Cookie Consent scored84%from 54 tests.

About plugin

  • Plugin page: jquery-cookie-law
  • Plugin version: 3.0.7
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.5
  • WordPress version: 6.3.1
  • First release: Dec 13, 2015
  • Latest release: Jul 8, 2020
  • Number of updates: 107
  • Update frequency: every 15.6 days
  • Top authors: camaran (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /3,101 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.07MB] [CPU: ▼3.21ms] Passed 4 tests

Analyzing server-side resources used by MT Cookie Consent
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0838.41 ▲0.17
Dashboard /wp-admin3.37 ▲0.0747.46 ▼2.63
Posts /wp-admin/edit.php3.42 ▲0.0742.70 ▼0.68
Add New Post /wp-admin/post-new.php5.97 ▲0.0991.19 ▼6.77
Media Library /wp-admin/upload.php3.30 ▲0.0733.36 ▼2.77
MT Cookie Consent /wp-admin/options-general.php?page=jquery-cookie-law3.2837.34

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

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

Browser metrics Passed 4 tests

MT Cookie Consent: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,873 ▲12713.81 ▼0.586.26 ▲4.3647.56 ▲3.80
Dashboard /wp-admin2,229 ▲404.98 ▲0.0599.48 ▼21.9138.84 ▼7.55
Posts /wp-admin/edit.php2,117 ▲282.32 ▲0.2837.36 ▲1.4333.32 ▲0.78
Add New Post /wp-admin/post-new.php1,531 ▲1223.50 ▲0.39598.66 ▼131.3835.96 ▼18.73
Media Library /wp-admin/upload.php1,411 ▲204.50 ▲0.3296.07 ▼2.2641.90 ▼0.22
MT Cookie Consent /wp-admin/options-general.php?page=jquery-cookie-law1,5352.7756.5230.71

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/jquery-cookie-law/jquery-cookie-law.php:34

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Screenshots: Screenshot #1 (The Cookies Bar) image missing
The official readme.txt is a good inspiration

jquery-cookie-law/jquery-cookie-law.php Passed 13 tests

Analyzing the main PHP file in "MT Cookie Consent" version 3.0.7
50 characters long description:
This plugin add the javascript code for Cookie Law

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected283 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP23311268
JavaScript2219
CSS1006

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.06
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin