84% dastra

Code Review | Dastra CMP cookies

WordPress plugin Dastra CMP cookies scored84%from 54 tests.

About plugin

  • Plugin page: dastra
  • Plugin version: 0.1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.2-6.0.1
  • WordPress version: 6.3.1
  • First release: May 7, 2021
  • Latest release: Aug 12, 2022
  • Number of updates: 7
  • Update frequency: every 66.1 days
  • Top authors: bidass (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /409 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼7.15ms] Passed 4 tests

Server-side resources used by Dastra CMP cookies
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.17 ▼6.63
Dashboard /wp-admin3.33 ▲0.0348.08 ▼1.58
Posts /wp-admin/edit.php3.38 ▲0.0246.08 ▼6.96
Add New Post /wp-admin/post-new.php5.91 ▲0.0280.68 ▼13.44
Media Library /wp-admin/upload.php3.25 ▲0.0240.14 ▲4.55

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Dastra CMP cookies
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲6113.60 ▼0.681.71 ▼0.1737.25 ▼10.32
Dashboard /wp-admin2,226 ▲435.83 ▲0.88110.24 ▼0.6581.52 ▲41.74
Posts /wp-admin/edit.php2,103 ▲142.04 ▲0.0436.73 ▼4.7234.74 ▼0.95
Add New Post /wp-admin/post-new.php1,682 ▲16822.36 ▲4.74755.93 ▲125.4343.17 ▼20.67
Media Library /wp-admin/upload.php1,408 ▲174.20 ▼0.09102.82 ▲2.0253.47 ▲10.97

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dastra/dastra.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: consents management platform, data protection, cmp, universal consent, gdpr...

dastra/dastra.php 92% from 13 tests

The main PHP file in "Dastra CMP cookies" ver. 0.1.5 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected181 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP12715110
CSS19071

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.45
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 0.91MB with 0.55MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png6.93KB3.52KB▼ 49.16%
assets/banner-772x250.png116.78KB24.94KB▼ 78.65%
assets/screenshot-2.png108.70KB48.83KB▼ 55.08%
assets/screenshot-3.png131.06KB48.00KB▼ 63.38%
assets/icon-256x256.png20.59KB8.39KB▼ 59.27%