72% awsa-shipping

Code Review | AWSA Shipping - Advanced Shipping for Woocommerce and Dokan

WordPress plugin AWSA Shipping - Advanced Shipping for Woocommerce and Dokan scored72%from 54 tests.

About plugin

  • Plugin page: awsa-shipping
  • Plugin version: 1.3.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3.0-6.0
  • WordPress version: 6.3.1
  • First release: Oct 25, 2020
  • Latest release: Jun 4, 2022
  • Number of updates: 18
  • Update frequency: every 32.7 days
  • Top authors: sajjadaslani (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

200+ active /5,405 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 gracefully, with no errors

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

An overview of server-side resources used by AWSA Shipping - Advanced Shipping for Woocommerce and Dokan
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.06 ▲2.22
Dashboard /wp-admin3.36 ▲0.0150.32 ▼18.14
Posts /wp-admin/edit.php3.41 ▲0.0555.78 ▲5.50
Add New Post /wp-admin/post-new.php7.98 ▲2.09107.54 ▲11.24
Media Library /wp-admin/upload.php3.28 ▲0.0540.62 ▲3.41
Tools /wp-admin/admin.php?page=awsa-shipping-tools3.2933.13
Sefareshi Post /wp-admin/admin.php?page=wc-settings&tab=shipping§ion=awsa-sefareshi3.0522.33
Shipping Settings /wp-admin/admin.php?page=awsa-shipping-settings3.3329.44
Fast Delivery /wp-admin/admin.php?page=wc-settings&tab=shipping§ion=awsa-pishtaz3.0526.00
Air Delivery /wp-admin/admin.php?page=wc-settings&tab=shipping§ion=awsa-air-delivery3.0520.24
Express delivery /wp-admin/admin.php?page=wc-settings&tab=shipping§ion=awsa-express3.0529.09

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

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

Browser metrics Passed 4 tests

A check of browser resources used by AWSA Shipping - Advanced Shipping for Woocommerce and Dokan
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,858 ▲11213.26 ▼1.034.35 ▲2.1242.94 ▼0.47
Dashboard /wp-admin2,264 ▲765.86 ▲0.82112.53 ▼2.0739.89 ▼3.36
Posts /wp-admin/edit.php2,147 ▲582.05 ▲0.0040.94 ▲0.5736.48 ▲0.38
Add New Post /wp-admin/post-new.php1,559 ▲2923.46 ▲5.02680.32 ▲40.9558.27 ▼2.61
Media Library /wp-admin/upload.php1,447 ▲594.20 ▲0.0296.86 ▼11.0045.67 ▼3.22
Tools /wp-admin/admin.php?page=awsa-shipping-tools8422.0728.2231.54
Sefareshi Post /wp-admin/admin.php?page=wc-settings&tab=shipping§ion=awsa-sefareshi280.440.063.82
Shipping Settings /wp-admin/admin.php?page=awsa-shipping-settings9921.9731.0829.40
Fast Delivery /wp-admin/admin.php?page=wc-settings&tab=shipping§ion=awsa-pishtaz280.440.103.80
Air Delivery /wp-admin/admin.php?page=wc-settings&tab=shipping§ion=awsa-air-delivery280.440.083.66
Express delivery /wp-admin/admin.php?page=wc-settings&tab=shipping§ion=awsa-express280.440.145.39

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests 25% 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 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 take a closer look at the following
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/awsa-shipping/vendor/asan/phpexcel/tests/xlsTest.php
    • > /wp-content/plugins/awsa-shipping/vendor/asan/phpexcel/tests/csvTest.php
    • > /wp-content/plugins/awsa-shipping/vendor/asan/phpexcel/tests/xlsxTest.php
  • 37× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'AWSA_Core\\APIs\\Settings\\Fields\\Display\\Base' not found in wp-content/plugins/awsa-shipping/includes/core/apis/settings/fields/display/class-html.php:5
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/awsa-shipping/vendor/asan/phpexcel/src/Parser/Excel2007.php on line 404
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/awsa-shipping/includes/class-shipping-method-sefareshi.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/awsa-shipping/includes/class-shipping-method-express.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'AWSA_Core\\APIs\\Settings\\Fields\\Display\\Base' not found in wp-content/plugins/awsa-shipping/includes/core/apis/settings/fields/display/class-select.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'AWSA_Settings_Page_Fields' not found in wp-content/plugins/awsa-shipping/includes/class-shipping-settings-page-fields.php:15
    • > PHP Warning
      require_once(wp-content/plugins/awsa-shipping/vendor/ellumilel/php-excel-writer/examples/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/awsa-shipping/vendor/ellumilel/php-excel-writer/examples/more-than-one.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'AWSA_Core\\APIs\\Settings\\Fields\\Validate\\Base' not found in wp-content/plugins/awsa-shipping/includes/core/apis/settings/fields/validate/class-select.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'AWSA_Core\\APIs\\Settings\\Settings_Page_Fields' not found in wp-content/plugins/awsa-shipping/includes/class-settings-page-fields.php:17
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/awsa-shipping/vendor/ellumilel/php-excel-writer/examples/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/awsa-shipping/vendor/ellumilel/php-excel-writer/examples/more-than-one.php on line 2

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=wc-settings&tab=shipping§ion=awsa-sefareshi
    • > Network (severe)
    wp-admin/admin.php?page=wc-settings&tab=shipping&section=awsa-sefareshi - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=wc-settings&tab=shipping§ion=awsa-pishtaz
    • > Network (severe)
    wp-admin/admin.php?page=wc-settings&tab=shipping&section=awsa-pishtaz - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=wc-settings&tab=shipping§ion=awsa-air-delivery
    • > Network (severe)
    wp-admin/admin.php?page=wc-settings&tab=shipping&section=awsa-air-delivery - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=wc-settings&tab=shipping§ion=awsa-express
    • > Network (severe)
    wp-admin/admin.php?page=wc-settings&tab=shipping&section=awsa-express - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
1 plugin tags: awsa-shipping

awsa-shipping/awsa-shipping.php 85% from 13 tests

The main PHP file in "AWSA Shipping - Advanced Shipping for Woocommerce and Dokan" ver. 1.3.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 184 characters long)
  • Requires PHP: The required version number did not match the one declared in readme.txt ("7.0" instead of "7.2")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected24,026 lines of code in 139 files:
LanguageFilesBlank linesComment linesLines of code
PHP1173,3075,31322,311
JavaScript1014460892
PO File1156378380
Markdown2620233
JSON400170
YAML24027
XML1008
CSS2005

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity16.24
▷ Minimum class complexity1.00
▷ Maximum class complexity276.00
Average method complexity3.44
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces21
Interfaces1
Traits0
Classes88
▷ Abstract classes55.68%
▷ Concrete classes8394.32%
▷ Final classes33.61%
Methods562
▷ Static methods19634.88%
▷ Public methods46282.21%
▷ Protected methods223.91%
▷ Private methods7813.88%
Functions54
▷ Named functions4888.89%
▷ Anonymous functions611.11%
Constants84
▷ Global constants2327.38%
▷ Class constants6172.62%
▷ Public constants61100.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
PNG images were not found in this plugin