83% wp-gtm-data-privacy

Code Review | Cookie Dash

WordPress plugin Cookie Dash scored83%from 54 tests.

About plugin

  • Plugin page: wp-gtm-data-privacy
  • Plugin version: 1.2.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.9
  • WordPress version: 6.3.1
  • First release: Sep 17, 2020
  • Latest release: Jun 9, 2022
  • Number of updates: 91
  • Update frequency: every 6.9 days
  • Top authors: tnhsaesop (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /616 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

A check of server-side resources used by Cookie Dash
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0242.26 ▲2.77
Dashboard /wp-admin3.32 ▲0.0143.67 ▼3.88
Posts /wp-admin/edit.php3.37 ▲0.0142.23 ▲0.12
Add New Post /wp-admin/post-new.php5.90 ▲0.0179.82 ▼8.21
Media Library /wp-admin/upload.php3.24 ▲0.0136.50 ▲5.44
Cookie Dash /wp-admin/options-general.php?page=tnhs-cookie-dash3.2029.04

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 11 new options
New WordPress options
widget_recent-comments
tnhs_cookie_dash_plugin_version
allowed_domains
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
privay_policy_slug
can_compress_scripts
widget_recent-posts
privacy_consent_option
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Cookie Dash
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲4814.35 ▼0.021.94 ▲0.2240.70 ▼6.32
Dashboard /wp-admin2,213 ▲365.58 ▲0.0184.80 ▼15.8740.60 ▼6.06
Posts /wp-admin/edit.php2,118 ▲181.99 ▼0.0135.94 ▼1.0433.22 ▼4.42
Add New Post /wp-admin/post-new.php1,548 ▲2023.06 ▲0.02688.65 ▲8.2054.08 ▼6.37
Media Library /wp-admin/upload.php1,415 ▲214.19 ▲0.0196.75 ▲3.4442.42 ▼2.70
Cookie Dash /wp-admin/options-general.php?page=tnhs-cookie-dash9001.8223.9726.46

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • privay_policy_slug
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% 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)
Everything seems fine, however this is by no means 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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/wp-gtm-data-privacy/cookie-dash.php:36

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: gdpr, ccpa, data privacy, tag manager, google tag manager

wp-gtm-data-privacy/cookie-dash.php 69% from 13 tests

The primary PHP file in "Cookie Dash" version 1.2.2 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-gtm-data-privacy.php" instead of "cookie-dash.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Domain Path: The domain path folder does not exist ("/languages")
  • Description: Keep the plugin description shorter than 140 characters (currently 170 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin262 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP18754219
JavaScript13738
Markdown1305

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity30.00
▷ Minimum class complexity30.00
▷ Maximum class complexity30.00
Average method complexity3.23
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods430.77%
▷ Public methods1184.62%
▷ Protected methods00.00%
▷ Private methods215.38%
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected