83% online-payments-for-woocommerce

Code Review | Online Payments for WooCommerce

WordPress plugin Online Payments for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: online-payments-f...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7
  • WordPress version: 6.3.1
  • First release: Jul 19, 2017
  • Latest release: Jul 19, 2017
  • Number of updates: 9
  • Update frequency: N/A
  • Top authors: fzuwqy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,450 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.01MB] [CPU: ▼9.58ms] Passed 4 tests

An overview of server-side resources used by Online Payments for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0039.19 ▼0.50
Dashboard /wp-admin3.31 ▼0.0447.98 ▼13.77
Posts /wp-admin/edit.php3.36 ▲0.0047.94 ▼4.45
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.66 ▼19.59
Media Library /wp-admin/upload.php3.23 ▲0.0034.97 ▼0.39

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Online Payments for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.72 ▲0.441.86 ▲0.1436.78 ▼10.26
Dashboard /wp-admin2,195 ▲185.56 ▼0.1187.16 ▼19.2835.77 ▼11.95
Posts /wp-admin/edit.php2,100 ▼32.00 ▼0.0135.41 ▼8.3232.83 ▼8.25
Add New Post /wp-admin/post-new.php1,526 ▼022.93 ▼0.25604.13 ▼10.9281.99 ▲25.87
Media Library /wp-admin/upload.php1,400 ▼04.17 ▼0.0399.12 ▼7.2445.22 ▼2.97

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

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
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function com\\unionpay\\acp\\sdk\\plugin_dir_path() in wp-content/plugins/online-payments-for-woocommerce/sdk/SDKConfig.php:51
    • > PHP Fatal error
      Uncaught Error: Call to undefined function com\\unionpay\\acp\\sdk\\plugin_dir_path() in wp-content/plugins/online-payments-for-woocommerce/sdk/SDKConfig.php:51
    • > PHP Fatal error
      Uncaught Error: Call to undefined function com\\unionpay\\acp\\sdk\\plugin_dir_path() in wp-content/plugins/online-payments-for-woocommerce/sdk/SDKConfig.php:51

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: Add an image for screenshot #4 (Pay screen in Online)
You can take inspiration from this readme.txt

online-payments-for-woocommerce/init.php 85% from 13 tests

"Online Payments for WooCommerce" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("online-payments-for-woocommerce.php" instead of "init.php")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected1,145 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP71933691,072
PO File1202073

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity15.14
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity2.90
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods52
▷ Static methods3057.69%
▷ Public methods4076.92%
▷ Protected methods00.00%
▷ Private methods1223.08%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants35
▷ Global constants1131.43%
▷ Class constants2468.57%
▷ Public constants24100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/union.png9.82KB4.08KB▼ 58.44%