68% wc-tracktum

Code Review | Conversion for Tracktum on Woocommerce

WordPress plugin Conversion for Tracktum on Woocommerce scored68%from 54 tests.

About plugin

  • Plugin page: wc-tracktum
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.6
  • WordPress version: 6.3.1
  • First release: Dec 24, 2020
  • Latest release: Mar 9, 2021
  • Number of updates: 11
  • Update frequency: every 7.3 days
  • Top authors: rajib00002 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /397 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by Conversion for Tracktum on Woocommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0837.98 ▼3.93
Dashboard /wp-admin3.37 ▲0.0745.31 ▼3.10
Posts /wp-admin/edit.php3.49 ▲0.1348.52 ▲2.02
Add New Post /wp-admin/post-new.php5.95 ▲0.0790.98 ▼5.37
Media Library /wp-admin/upload.php3.30 ▲0.0735.67 ▲4.08

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Conversion for Tracktum on Woocommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.29 ▼1.481.87 ▼0.0442.64 ▼0.92
Dashboard /wp-admin2,206 ▲215.86 ▲0.93105.04 ▼10.4741.81 ▼4.53
Posts /wp-admin/edit.php2,092 ▼02.05 ▲0.0639.69 ▲3.2335.25 ▲4.39
Add New Post /wp-admin/post-new.php1,533 ▼023.11 ▲0.05643.23 ▼23.4055.43 ▼2.56
Media Library /wp-admin/upload.php1,382 ▼64.19 ▼0.2195.78 ▼16.2140.34 ▼8.74

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 4× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wc-tracktum/vendor/automattic/vipwpcs/WordPress-VIP-Go/ruleset-test.php
    • > /wp-content/plugins/wc-tracktum/vendor/squizlabs/php_codesniffer/scripts/build-phar.php
    • > /wp-content/plugins/wc-tracktum/vendor/automattic/vipwpcs/tests/bootstrap.php
    • > /wp-content/plugins/wc-tracktum/vendor/automattic/vipwpcs/WordPressVIPMinimum/ruleset-test.php
  • 720× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer\\Sniffs\\Sniff' not found in wp-content/plugins/wc-tracktum/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/GlobalFunctionSniff.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Tests\\Standards\\AbstractSniffUnitTest' not found in wp-content/plugins/wc-tracktum/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Tests\\Standards\\AbstractSniffUnitTest' not found in wp-content/plugins/wc-tracktum/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneClassPerFileUnitTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WordPressCS\\WordPress\\Sniff' not found in wp-content/plugins/wc-tracktum/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/EmptyStatementSniff.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'WordPressCS\\WordPress\\AbstractFunctionParameterSniff' not found in wp-content/plugins/wc-tracktum/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/EscapedNotTranslatedSniff.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer\\Sniffs\\Sniff' not found in wp-content/plugins/wc-tracktum/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowInlineIfSniff.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Sniffs\\AbstractArraySniff' not found in wp-content/plugins/wc-tracktum/vendor/squizlabs/php_codesniffer/tests/Core/Sniffs/AbstractArraySniffTestable.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wc-tracktum/vendor/squizlabs/php_codesniffer/tests/Core/AbstractMethodUnitTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Tests\\Standards\\AbstractSniffUnitTest' not found in wp-content/plugins/wc-tracktum/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionClosingBraceUnitTest.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer\\Sniffs\\Sniff' not found in wp-content/plugins/wc-tracktum/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/NoSilencedErrorsSniff.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% 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: e-ecommerce, tracking, ecommerce, commerce, woocommerce

wc-tracktum/tracktum.php 92% from 13 tests

The main PHP file in "Conversion for Tracktum on Woocommerce" ver. 1.3 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wc-tracktum.php" instead of "tracktum.php")

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
It is important to fix the following items
  • Do not distribute dangerous files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/wc-tracktum/vendor/squizlabs/php_codesniffer/bin/phpcbf.bat
      • wp-content/plugins/wc-tracktum/vendor/squizlabs/php_codesniffer/bin/phpcs.bat
98,455 lines of code in 1,314 files:
LanguageFilesBlank linesComment linesLines of code
PHP90020,55636,82880,824
XML1704167656,025
Pascal1232,6525,3925,699
Markdown1254102,253
JavaScript647798632,237
CSS35209108988
JSON100270
XSD160130
Bourne Again Shell688319
DOS Batch241010

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 357)
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity15.64
▷ Minimum class complexity1.00
▷ Maximum class complexity505.00
Average method complexity5.91
▷ Minimum method complexity1.00
▷ Maximum method complexity357.00
Code structure
Namespaces193
Interfaces2
Traits0
Classes751
▷ Abstract classes182.40%
▷ Concrete classes73397.60%
▷ Final classes10.14%
Methods2,260
▷ Static methods1145.04%
▷ Public methods1,86682.57%
▷ Protected methods29413.01%
▷ Private methods1004.42%
Functions17
▷ Named functions317.65%
▷ Anonymous functions1482.35%
Constants138
▷ Global constants10676.81%
▷ Class constants3223.19%
▷ Public constants32100.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
3 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/google.png41.17KB14.04KB▼ 65.90%
assets/images/facebook.png1.48KB0.74KB▼ 49.64%
assets/images/pinterest.png16.31KB16.84KB0.00%