82% aramex-shipping-woocommerce

Code Review | Aramex Shipping WooCommerce

WordPress plugin Aramex Shipping WooCommerce scored82%from 54 tests.

About plugin

  • Plugin page: aramex-shipping-w...
  • Plugin version: 1.1.16
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9-6.0
  • WordPress version: 6.3.1
  • First release: Sep 3, 2018
  • Latest release: Aug 29, 2023
  • Number of updates: 92
  • Update frequency: every 19.8 days
  • Top authors: aramex (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active /20,931 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.49ms] Passed 4 tests

This is a short check of server-side resources used by Aramex Shipping WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0044.51 ▲6.65
Dashboard /wp-admin3.31 ▲0.0049.01 ▼3.24
Posts /wp-admin/edit.php3.36 ▲0.0051.86 ▼2.28
Add New Post /wp-admin/post-new.php5.89 ▲0.0094.89 ▼13.08
Media Library /wp-admin/upload.php3.23 ▲0.0039.39 ▲0.65

Server storage [IO: ▲1.67MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
These are issues you should consider
  • Illegal file modification found: 3 files (0.00KB) outside of "wp-content/plugins/aramex-shipping-woocommerce/" and "wp-content/uploads/"
    • (new file) "wp-content/plugins/aramex-shipping-woocommerce/assets/icon-256\303\227256.png"
    • (new file) "wp-content/plugins/aramex-shipping-woocommerce/assets/icon-128\303\203\342\200\224128.png"
    • (new file) "wp-content/plugins/aramex-shipping-woocommerce/assets/icon-128\303\227128.png"
Filesystem: 65 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Aramex Shipping WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▼0.011.66 ▼0.2141.04 ▼7.60
Dashboard /wp-admin2,192 ▲155.61 ▼0.0692.91 ▲3.5042.47 ▲1.60
Posts /wp-admin/edit.php2,100 ▼01.97 ▼0.0540.15 ▲3.5435.27 ▼1.99
Add New Post /wp-admin/post-new.php1,526 ▼023.03 ▼0.23602.95 ▼54.4547.69 ▼2.62
Media Library /wp-admin/upload.php1,397 ▼34.19 ▲0.05101.45 ▼12.5345.85 ▼4.00

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% 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 50% 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 items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/aramex-shipping-woocommerce/includes/shipping/data-aramex-settings.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Aramex_Shipping_Method' not found in wp-content/plugins/aramex-shipping-woocommerce/templates/adminhtml/block_button.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/aramex-shipping-woocommerce/includes/shipping/class-aramex-woocommerce-shipping.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% from 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
Attributes that need to be fixed:
  • Screenshots: Screenshot #7 ("Track Aramex Shipment"page.) image not found
  • Donate link: Please fix this invalid URI: "aramex.com"
  • Tags: Please delete some tags, you are using 19 tag instead of maximum 10
Please take inspiration from this readme.txt

aramex-shipping-woocommerce/aramex-shipping.php 85% from 13 tests

The entry point to "Aramex Shipping WooCommerce" version 1.1.16 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("aramex-shipping-woocommerce.php" instead of "aramex-shipping.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected9,335 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
PHP274269035,901
XML89842,581
CSS212964764
JavaScript3204589

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity19.62
▷ Minimum class complexity1.00
▷ Maximum class complexity71.00
Average method complexity6.10
▷ Minimum method complexity1.00
▷ Maximum method complexity51.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods40
▷ Static methods00.00%
▷ Public methods2255.00%
▷ Protected methods37.50%
▷ Private methods1537.50%
Functions31
▷ Named functions31100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
23 PNG files occupy 1.09MB with 0.44MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png39.65KB15.60KB▼ 60.66%
assets/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
assets/screenshot-5.png34.82KB13.73KB▼ 60.57%
assets/css/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
assets/icon-256×256.png23.65KB4.13KB▼ 82.55%