84% airwallex-online-payments-gateway

Code Review | Airwallex Online Payments Gateway

WordPress plugin Airwallex Online Payments Gateway scored84%from 54 tests.

About plugin

  • Plugin page: airwallex-online-...
  • Plugin version: 1.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.2
  • WordPress version: 6.3.1
  • First release: Apr 14, 2021
  • Latest release: Nov 9, 2023
  • Number of updates: 40
  • Update frequency: every 23.5 days
  • Top authors: airwallex (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /11,286 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

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

Server-side resources used by Airwallex Online Payments Gateway
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0138.22 ▼3.07
Dashboard /wp-admin3.32 ▼0.0344.11 ▼15.75
Posts /wp-admin/edit.php3.37 ▲0.0144.53 ▼9.05
Add New Post /wp-admin/post-new.php5.90 ▲0.0179.55 ▼20.76
Media Library /wp-admin/upload.php3.24 ▲0.0132.95 ▲1.06

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 53 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Airwallex Online Payments Gateway
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲714.13 ▼0.241.78 ▼0.1148.02 ▲3.54
Dashboard /wp-admin2,202 ▲255.63 ▲0.0190.11 ▼14.2938.42 ▼4.39
Posts /wp-admin/edit.php2,104 ▲71.94 ▼0.0339.20 ▲2.3938.73 ▲6.47
Add New Post /wp-admin/post-new.php1,530 ▲423.15 ▲0.12596.33 ▼82.0049.36 ▼2.94
Media Library /wp-admin/upload.php1,398 ▼54.18 ▲0.0495.70 ▼6.0941.81 ▼1.19

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 13× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Airwallex\\Gateways\\Blocks\\AirwallexWCBlockSupport' not found in wp-content/plugins/airwallex-online-payments-gateway/includes/gateways/blocks/AirwallexMainWCBlockSupport.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Airwallex\\Gateways\\Blocks\\AirwallexWCBlockSupport' not found in wp-content/plugins/airwallex-online-payments-gateway/includes/gateways/blocks/AirwallexCardWCBlockSupport.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Airwallex\\AbstractClient' not found in wp-content/plugins/airwallex-online-payments-gateway/includes/client/AdminClient.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\WooCommerce\\Blocks\\Payments\\Integrations\\AbstractPaymentMethodType' not found in wp-content/plugins/airwallex-online-payments-gateway/includes/gateways/blocks/AirwallexWCBlockSupport.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Airwallex\\Struct\\AbstractBase' not found in wp-content/plugins/airwallex-online-payments-gateway/includes/struct/Refund.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Airwallex\\AbstractClient' not found in wp-content/plugins/airwallex-online-payments-gateway/includes/client/CardClient.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Airwallex\\Gateways\\Blocks\\AirwallexWCBlockSupport' not found in wp-content/plugins/airwallex-online-payments-gateway/includes/gateways/blocks/AirwallexWeChatWCBlockSupport.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Airwallex\\AbstractClient' not found in wp-content/plugins/airwallex-online-payments-gateway/includes/client/LoggingClient.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Airwallex\\AbstractClient' not found in wp-content/plugins/airwallex-online-payments-gateway/includes/client/WeChatClient.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Airwallex\\AbstractClient' not found in wp-content/plugins/airwallex-online-payments-gateway/includes/client/MainClient.php:5

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 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention: The official readme.txt might help

airwallex-online-payments-gateway/airwallex-online-payments-gateway.php Passed 13 tests

The entry point to "Airwallex Online Payments Gateway" version 1.3.1 is a PHP file that has certain tags in its header comment area
25 characters long description:
Official Airwallex Plugin

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected5,465 lines of code in 47 files:
LanguageFilesBlank linesComment linesLines of code
PHP395988634,427
JavaScript49351737
CSS2423196
SVG201105

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity14.07
▷ Minimum class complexity1.00
▷ Maximum class complexity67.00
Average method complexity2.56
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces7
Interfaces0
Traits1
Classes28
▷ Abstract classes310.71%
▷ Concrete classes2589.29%
▷ Final classes00.00%
Methods244
▷ Static methods83.28%
▷ Public methods22391.39%
▷ Protected methods135.33%
▷ Private methods83.28%
Functions10
▷ Named functions110.00%
▷ Anonymous functions990.00%
Constants43
▷ Global constants511.63%
▷ Class constants3888.37%
▷ Public constants38100.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
3 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/layout/2col-2.png15.33KB8.38KB▼ 45.30%
assets/images/layout/2col-1.png15.03KB8.40KB▼ 44.14%
assets/images/layout/2row.png8.53KB3.94KB▼ 53.85%