83% trackmage-woo-shipment-tracking

Code Review | TrackMage - Woo Shipment Tracking

WordPress plugin TrackMage - Woo Shipment Tracking scored83%from 54 tests.

About plugin

  • Plugin page: trackmage-woo-shi...
  • Plugin version: 2.0.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.4.1
  • WordPress version: 6.3.1
  • First release: Jun 8, 2020
  • Latest release: Nov 10, 2023
  • Number of updates: 24
  • Update frequency: every 52.3 days
  • Top authors: trackmage (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,640 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 successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by TrackMage - Woo Shipment Tracking
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.75 ▼3.84
Dashboard /wp-admin3.31 ▼0.0442.09 ▼18.63
Posts /wp-admin/edit.php3.36 ▲0.0044.15 ▼2.30
Add New Post /wp-admin/post-new.php5.89 ▲0.0095.98 ▼9.66
Media Library /wp-admin/upload.php3.23 ▲0.0031.53 ▼0.50

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 332 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for TrackMage - Woo Shipment Tracking
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6814.21 ▼0.111.75 ▲0.0139.26 ▼4.14
Dashboard /wp-admin2,195 ▲155.62 ▲0.0189.61 ▼3.6839.90 ▼3.65
Posts /wp-admin/edit.php2,097 ▼31.94 ▼0.2134.90 ▼2.1034.16 ▼1.82
Add New Post /wp-admin/post-new.php1,526 ▼423.28 ▲0.17601.48 ▼69.6658.88 ▲7.28
Media Library /wp-admin/upload.php1,400 ▼34.24 ▲0.0399.56 ▼2.1640.59 ▼5.19

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 82× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/trackmage-woo-shipment-tracking/vendor/guzzlehttp/psr7/src/MultipartStream.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Psr\\Log\\AbstractLogger' not found in wp-content/plugins/trackmage-woo-shipment-tracking/vendor/psr/log/Psr/Log/NullLogger.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/trackmage-woo-shipment-tracking/vendor/guzzlehttp/psr7/src/Request.php:13
    • > PHP Parse error
      syntax error, unexpected '|', expecting '{' in wp-content/plugins/trackmage-woo-shipment-tracking/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php on line 18
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Cookie\\CookieJarInterface' not found in wp-content/plugins/trackmage-woo-shipment-tracking/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'TrackMage\\WordPress\\Synchronization\\EntitySyncInterface' not found in wp-content/plugins/trackmage-woo-shipment-tracking/src/Synchronization/ShipmentItemSync.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'TrackMage\\WordPress\\Repository\\AbstractRepository' not found in wp-content/plugins/trackmage-woo-shipment-tracking/src/Repository/BackgroundTaskRepository.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'TrackMage\\WordPress\\Repository\\AbstractRepository' not found in wp-content/plugins/trackmage-woo-shipment-tracking/src/Repository/LogRepository.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/trackmage-woo-shipment-tracking/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'TrackMage\\WordPress\\Synchronization\\EntitySyncInterface' not found in wp-content/plugins/trackmage-woo-shipment-tracking/src/Synchronization/ShipmentSync.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
10 plugin tags: shipment tracking, tracking, order, order tracking, delivery...

trackmage-woo-shipment-tracking/trackmage.php 85% from 13 tests

Analyzing the main PHP file in "TrackMage - Woo Shipment Tracking" version 2.0.2
Please take the time to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("trackmage-woo-shipment-tracking.php" instead of "trackmage.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin72,084 lines of code in 294 files:
LanguageFilesBlank linesComment linesLines of code
PHP2053,2257,82132,850
CSS101,4994714,107
JavaScript292,7892,52913,061
JSON14006,432
Markdown171,26903,810
Sass516711,144
PO File1125150384
SVG512137
YAML6273128
XML12021
Dockerfile18010

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
The following items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity15.64
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity3.22
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces26
Interfaces21
Traits5
Classes131
▷ Abstract classes21.53%
▷ Concrete classes12998.47%
▷ Final classes2821.71%
Methods1,081
▷ Static methods23321.55%
▷ Public methods88982.24%
▷ Protected methods100.93%
▷ Private methods18216.84%
Functions204
▷ Named functions8340.69%
▷ Anonymous functions12159.31%
Constants227
▷ Global constants8437.00%
▷ Class constants14363.00%
▷ Public constants143100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.10MB with 0.04MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/dist/images/trackmage_logo_big.png49.87KB22.75KB▼ 54.38%
assets/dist/images/green-star.png1.12KB0.52KB▼ 53.26%
assets/dist/images/tm-support.png50.68KB21.98KB▼ 56.62%
assets/dist/images/trackmage-icon-white-16x16.png0.39KB0.53KB0.00%