62% torod

Code Review | Torod - The smart shipping and delivery portal for e-shops and retailers

WordPress plugin Torod - The smart shipping and delivery portal for e-shops and retailers scored62%from 54 tests.

About plugin

  • Plugin page: torod
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 1.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Jul 4, 2023
  • Latest release: Sep 20, 2023
  • Number of updates: 8
  • Update frequency: every 11.5 days
  • Top authors: torod (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active /515 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.58MB] [CPU: ▼2.98ms] Passed 4 tests

Server-side resources used by Torod - The smart shipping and delivery portal for e-shops and retailers
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.06 ▲0.6044.72 ▲1.94
Dashboard /wp-admin3.91 ▲0.6050.96 ▲0.49
Posts /wp-admin/edit.php3.96 ▲0.6054.42 ▲3.38
Add New Post /wp-admin/post-new.php6.45 ▲0.5686.09 ▼17.72
Media Library /wp-admin/upload.php3.77 ▲0.5438.94 ▲5.30
Settings /wp-admin/admin.php?page=torod-settings3.7852.63
Torod /wp-admin/admin.php?page=torodpage3.7035.28
Order Log /wp-admin/admin.php?page=torod-order-log3.7434.83

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 346 new files
Database: 4 new tables, 17 new options
New tables
wp_torod_countries
wp_torod_regions
wp_torod_order_log
wp_torod_cities
New WordPress options
torod_version
torod_payment_gateway
torod_wp_all_settings
torod_status_settings
torod_log_mode
torod_token
widget_theysaidso_widget
recovery_mode_email_last_sent
db_upgraded
torod_demo_account
...

Browser metrics Passed 4 tests

An overview of browser requirements for Torod - The smart shipping and delivery portal for e-shops and retailers
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,013 ▲27813.82 ▼0.552.77 ▲0.9642.97 ▼7.44
Dashboard /wp-admin2,416 ▲2275.21 ▲0.24115.60 ▼2.4339.00 ▼3.97
Posts /wp-admin/edit.php2,305 ▲2132.38 ▲0.3343.69 ▼1.1233.91 ▼1.11
Add New Post /wp-admin/post-new.php1,547 ▲3323.59 ▲5.82704.44 ▲4.8164.75 ▲8.02
Media Library /wp-admin/upload.php1,602 ▲2174.60 ▲0.39101.96 ▲6.7845.02 ▲2.29
Settings /wp-admin/admin.php?page=torod-settings1,1412.2342.8433.10
Torod /wp-admin/admin.php?page=torodpage1,1181.536.5027.39
Order Log /wp-admin/admin.php?page=torod-order-log9891.9331.5026.56

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_torod_regions
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=torod-order-log
    • > POST request to /wp-admin/admin-ajax.php
    • > Error in wp-content/plugins/torod/inc/ajaxyk.php+151
    Uncaught Error: Call to undefined function wc_get_order_statuses() in wp-content/plugins/torod/inc/ajaxyk.php:151
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): ajaxyk->get_torod_status_reg()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin-ajax.php(188): do_action()
    #4 {main}
    thrown
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=torod-order-log
    • > POST request to /wp-admin/admin-ajax.php
    • > Error in wp-content/plugins/torod/inc/ajaxyk.php+72
    Uncaught Error: Call to undefined function WC() in wp-content/plugins/torod/inc/ajaxyk.php:72
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): ajaxyk->getPaymentMethod()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin-ajax.php(188): do_action()
    #4 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=torodpage
    • > Error in wp-content/plugins/torod/inc/screen.php+223
    Uncaught Error: Call to undefined function wc_get_order_statuses() in wp-content/plugins/torod/inc/screen.php:223
    Stack trace:
    #0 wp-content/plugins/torod/inc/screen.php(8): screen->loginform()
    #1 wp-content/plugins/torod/torod-mmar.php(132): screen->firstscreen()
    #2 wp-includes/class-wp-hook.php(310): torod_login()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=torod-order-log
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)

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
The following issues need your attention
  • 207× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/torod/assets/states/AU.php:29
    • > PHP Fatal error
      Uncaught Error: Interface 'React\\Promise\\PromiseInterface' not found in wp-content/plugins/torod/inc/vendor/react/promise/src/ExtendedPromiseInterface.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/torod/assets/places/PT.php:385
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Ring\\Future\\FutureInterface' not found in wp-content/plugins/torod/inc/vendor/guzzlehttp/guzzle/src/Pool.php:34
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Ring\\Future\\FutureArrayInterface' not found in wp-content/plugins/torod/inc/vendor/guzzlehttp/ringphp/src/Future/FutureArray.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Cookie\\CookieJar' not found in wp-content/plugins/torod/inc/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'React\\Promise\\ExtendedPromiseInterface' not found in wp-content/plugins/torod/inc/vendor/react/promise/src/RejectedPromise.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\ToArrayInterface' not found in wp-content/plugins/torod/inc/vendor/guzzlehttp/guzzle/src/Collection.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/torod/inc/vendor/guzzlehttp/streams/tests/DroppingStreamTest.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/torod/assets/places/ES.php:8302

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=torod-order-log
    • > Network (severe)
    wp-admin/admin-ajax.php - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
  • Requires php: Version not formatted correctly
You can look at the official readme.txt

torod/torod-mmar.php 85% from 13 tests

This is the main PHP file of "Torod - The smart shipping and delivery portal for e-shops and retailers" version 1.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 172 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("torod.php" instead of "torod-mmar.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin84,896 lines of code in 317 files:
LanguageFilesBlank linesComment linesLines of code
PHP2692,9106,53379,878
Markdown775602,749
JavaScript553118640
reStructuredText9263333517
JSON500419
XML1100188
make3415172
CSS3336158
YAML319291
SVG10165
Python14019

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity9.97
▷ Minimum class complexity1.00
▷ Maximum class complexity182.00
Average method complexity2.34
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces24
Interfaces23
Traits6
Classes139
▷ Abstract classes42.88%
▷ Concrete classes13597.12%
▷ Final classes32.22%
Methods1,223
▷ Static methods1008.18%
▷ Public methods1,11391.01%
▷ Protected methods141.14%
▷ Private methods967.85%
Functions167
▷ Named functions2615.57%
▷ Anonymous functions14184.43%
Constants18
▷ Global constants738.89%
▷ Class constants1161.11%
▷ Public constants11100.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
There are no PNG files in this plugin