10% automated-aramex-livemanual-shipping-rates-labels

Code Review | Automated Aramex Express live/manual shipping rates, labels and pickup

WordPress plugin Automated Aramex Express live/manual shipping rates, labels and pickup scored10%from 54 tests.

About plugin

  • Plugin page: automated-aramex-...
  • Plugin version: 2.2.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-6.3
  • WordPress version: 6.3.1
  • First release: May 7, 2021
  • Latest release: Sep 15, 2023
  • Number of updates: 34
  • Update frequency: every 25.4 days
  • Top authors: hitstacks (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,868 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • The plugin did not install without errors
    • > Error in wp-content/plugins/automated-aramex-livemanual-shipping-rates-labels/a2zaramexexpress_basic.php+32
    Uncaught Error: Call to undefined function WC() in wp-content/plugins/automated-aramex-livemanual-shipping-rates-labels/a2zaramexexpress_basic.php:32
    Stack trace:
    #0 wp-includes/class-wp-hook.php(312): hit_woo_aramex_express_plugin_activation()
    #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/includes/plugin.php(720): do_action()

Server metrics [RAM: ▲0.38MB] [CPU: ▼3.62ms] Passed 4 tests

Server-side resources used by Automated Aramex Express live/manual shipping rates, labels and pickup
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.86 ▲0.4042.52 ▲0.30
Dashboard /wp-admin3.70 ▲0.3546.61 ▼8.79
Posts /wp-admin/edit.php3.81 ▲0.4551.98 ▲4.98
Add New Post /wp-admin/post-new.php6.28 ▲0.3993.36 ▼5.78
Media Library /wp-admin/upload.php3.62 ▲0.3933.44 ▼0.20

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 1,341 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Automated Aramex Express live/manual shipping rates, labels and pickup: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.21 ▼1.464.73 ▲3.0244.47 ▲6.39
Dashboard /wp-admin2,206 ▲155.84 ▲0.97102.90 ▼1.5138.45 ▼1.24
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0039.36 ▲4.8734.91 ▲0.25
Add New Post /wp-admin/post-new.php1,513 ▼2017.47 ▼5.46677.34 ▲20.3064.38 ▲6.73
Media Library /wp-admin/upload.php1,388 ▼34.14 ▼0.05101.79 ▼3.7442.38 ▼3.22

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

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
Even though everything seems fine, this is not an exhaustive test

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
  • 693× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\SocketHandler' not found in wp-content/plugins/automated-aramex-livemanual-shipping-rates-labels/controllors/classes/gtrans/vendor/monolog/monolog/src/Monolog/Handler/LogmaticHandler.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Protobuf\\Internal\\Message' not found in wp-content/plugins/automated-aramex-livemanual-shipping-rates-labels/controllors/classes/gtrans/vendor/google/common-protos/src/Cloud/ServiceManagement/V1/OperationMetadata/Step.php:16
    • > PHP Fatal error
      Trait 'Google\\Cloud\\Core\\Batch\\HandleFailureTrait' not found in wp-content/plugins/automated-aramex-livemanual-shipping-rates-labels/controllors/classes/gtrans/vendor/google/cloud-core/src/Batch/Retry.php on line 28
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/automated-aramex-livemanual-shipping-rates-labels/controllors/classes/gtrans/vendor/guzzlehttp/promises/src/RejectedPromise.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Protobuf\\Internal\\Message' not found in wp-content/plugins/automated-aramex-livemanual-shipping-rates-labels/controllors/classes/gtrans/vendor/google/common-protos/src/Api/AuthProvider.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Protobuf\\Internal\\Message' not found in wp-content/plugins/automated-aramex-livemanual-shipping-rates-labels/controllors/classes/gtrans/vendor/google/cloud-translate/src/V3/DeleteGlossaryRequest.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Protobuf\\Internal\\Message' not found in wp-content/plugins/automated-aramex-livemanual-shipping-rates-labels/controllors/classes/gtrans/vendor/google/common-protos/src/Api/Expr/V1beta1/MapValue.php:18
    • > PHP Fatal error
      Trait 'Google\\ApiCore\\GapicClientTrait' not found in wp-content/plugins/automated-aramex-livemanual-shipping-rates-labels/controllors/classes/gtrans/vendor/google/cloud-translate/src/V3/Gapic/TranslationServiceGapicClient.php on line 83
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Protobuf\\Internal\\Message' not found in wp-content/plugins/automated-aramex-livemanual-shipping-rates-labels/controllors/classes/gtrans/vendor/google/common-protos/src/Api/Expr/V1beta1/Expr/Comprehension.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Protobuf\\Internal\\Message' not found in wp-content/plugins/automated-aramex-livemanual-shipping-rates-labels/controllors/classes/gtrans/vendor/google/common-protos/src/Rpc/Help/Link.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 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
6 plugin tags: automated, aramex woocommerce, shipping rates, aramex, aramex express...

automated-aramex-livemanual-shipping-rates-labels/a2zaramexexpress_basic.php 77% from 13 tests

The primary PHP file in "Automated Aramex Express live/manual shipping rates, labels and pickup" version 2.2.1 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Requires at least: The required version number must match the one declared in readme.txt ("4.0.1" instead of "2.6")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("automated-aramex-livemanual-shipping-rates-labels.php" instead of "a2zaramexexpress_basic.php")

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
These items require your attention
  • Do not include executable or dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/automated-aramex-livemanual-shipping-rates-labels/controllors/classes/gtrans/vendor/bin/google-cloud-batch.bat
83,308 lines of code in 1,293 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,18816,29771,44173,488
Markdown421,66805,164
JSON36403,250
PO File2232274549
XML505257
XSLT22320209
Bourne Shell94681172
YAML410098
Protocol Buffers2143862
Python1174346
make1409
DOS Batch1004

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 156)
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity5.78
▷ Minimum class complexity1.00
▷ Maximum class complexity582.00
Average method complexity1.85
▷ Minimum method complexity1.00
▷ Maximum method complexity156.00
Code structure
Namespaces165
Interfaces52
Traits58
Classes1,051
▷ Abstract classes181.71%
▷ Concrete classes1,03398.29%
▷ Final classes151.45%
Methods6,443
▷ Static methods5628.72%
▷ Public methods5,71288.65%
▷ Protected methods2353.65%
▷ Private methods4967.70%
Functions293
▷ Named functions7826.62%
▷ Anonymous functions21573.38%
Constants584
▷ Global constants30.51%
▷ Class constants58199.49%
▷ Public constants56196.56%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
controllors/views/aramex_logo.png12.45KB6.01KB▼ 51.77%
controllors/views/haramex.png5.42KB3.58KB▼ 33.84%