84% woocommerce-w3c-digital-data-layer

Code Review | Digital Data Layer Plugin for WooCommerce

WordPress plugin Digital Data Layer Plugin for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: woocommerce-w3c-d...
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.1-3.9.1
  • WordPress version: 6.3.1
  • First release: Aug 26, 2014
  • Latest release: Aug 26, 2014
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: longplay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,227 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

Server-side resources used by Digital Data Layer Plugin for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.42 ▼4.23
Dashboard /wp-admin3.31 ▼0.0450.49 ▼14.57
Posts /wp-admin/edit.php3.36 ▲0.0048.44 ▼1.35
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.72 ▼14.64
Media Library /wp-admin/upload.php3.23 ▲0.0034.21 ▼7.28

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Digital Data Layer Plugin for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲1814.35 ▲0.131.88 ▲0.1343.02 ▼1.81
Dashboard /wp-admin2,198 ▲175.59 ▼0.0587.68 ▼13.9141.79 ▼1.48
Posts /wp-admin/edit.php2,100 ▼01.97 ▼0.0437.09 ▲0.3434.40 ▼3.52
Add New Post /wp-admin/post-new.php1,537 ▲1118.31 ▼5.24636.26 ▼21.3363.30 ▼3.43
Media Library /wp-admin/upload.php1,400 ▼04.21 ▲0.0997.05 ▼15.9047.58 ▼2.70

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

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)
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/woocommerce-w3c-digital-data-layer/woocommerce-ddl.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === woocommerce-w3c-digital-data-layer === )
You can look at the official readme.txt

woocommerce-w3c-digital-data-layer/woocommerce-ddl.php 92% from 13 tests

"Digital Data Layer Plugin for WooCommerce" version 0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woocommerce-w3c-digital-data-layer.php" instead of "woocommerce-ddl.php")

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
No dangerous file extensions were detected122 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP13812122

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.19
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%
Functions8
▷ Named functions8100.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 images were found in this plugin