78% tracksend-for-woocommerce

Code Review | Tracksend for WooCommerce

WordPress plugin Tracksend for WooCommerce scored 78% from 54 tests.

About plugin

  • Plugin page: tracksend-for-woo...
  • Plugin version: 1.0.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-5.9.1
  • WordPress version: 6.3.1
  • First release: May 24, 2021
  • Latest release: Mar 5, 2022
  • Number of updates: 18
  • Update frequency: every 16.6 days
  • Top authors: tracksend (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 681 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.55ms] Passed 4 tests

Server-side resources used by Tracksend for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.73 ▼3.74
Dashboard /wp-admin3.33 ▲0.0344.71 ▼7.80
Posts /wp-admin/edit.php3.38 ▲0.0346.52 ▲1.03
Add New Post /wp-admin/post-new.php5.91 ▲0.0394.11 ▼5.28
Media Library /wp-admin/upload.php3.25 ▲0.0333.80 ▼1.37

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Tracksend for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.32 ▼0.854.02 ▲2.2344.95 ▲0.96
Dashboard /wp-admin2,207 ▲155.85 ▲0.90108.38 ▼4.5242.78 ▲1.66
Posts /wp-admin/edit.php2,095 ▲62.02 ▼0.0339.78 ▲4.4335.83 ▼0.88
Add New Post /wp-admin/post-new.php1,538 ▲2423.31 ▲5.77599.01 ▼90.9252.50 ▼0.61
Media Library /wp-admin/upload.php1,392 ▲14.19 ▼0.0494.42 ▼6.0942.70 ▼3.47

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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 items
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/tracksend-for-woocommerce/public/partials/tracksend-public-display.php
    • > /wp-content/plugins/tracksend-for-woocommerce/admin/partials/tracksend-admin-display.php
    • > /wp-content/plugins/tracksend-for-woocommerce/vendor/automattic/woocommerce/tests/bootstrap.php
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/tracksend-for-woocommerce/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/BasicAuthTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/tracksend-for-woocommerce/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/RequestTest.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/tracksend-for-woocommerce/admin/partials/tracksend-settings-main.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/tracksend-for-woocommerce/vendor/automattic/woocommerce/tests/WooCommerce/Tests/ClientTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/tracksend-for-woocommerce/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/OAuthTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/tracksend-for-woocommerce/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/ResponseTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/tracksend-for-woocommerce/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/HttpClientExceptionTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/tracksend-for-woocommerce/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/OptionsTest.php:7

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 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
6 plugin tags: ecommerce, sms, analytics, tracksend, marketing...

tracksend-for-woocommerce/tracksend.php 77% from 13 tests

The main PHP file in "Tracksend for WooCommerce" ver. 1.0.4 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("tracksend-for-woocommerce.php" instead of "tracksend.php")
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.7" instead of "3.5.0")

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
There were no executable files found in this plugin2,090 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
PHP416631,5211,717
JSON400202
Markdown1400118
XML21026
YAML26021
JavaScript24546
CSS2080

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity5.29
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes28
▷ Abstract classes00.00%
▷ Concrete classes28100.00%
▷ Final classes00.00%
Methods171
▷ Static methods158.77%
▷ Public methods14484.21%
▷ Protected methods2011.70%
▷ Private methods74.09%
Functions10
▷ Named functions880.00%
▷ Anonymous functions220.00%
Constants9
▷ Global constants111.11%
▷ Class constants888.89%
▷ Public constants8100.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
There were not PNG files found in your plugin