83% onepay-payment-for-woocommerce

Code Review | Payment with Onepay for Woocommerce

WordPress plugin Payment with Onepay for Woocommerce scored83%from 54 tests.

About plugin

  • Plugin page: onepay-payment-fo...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.4.26+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8.3-5.9.3
  • WordPress version: 6.3.1
  • First release: May 23, 2022
  • Latest release: May 24, 2022
  • Number of updates: 3
  • Update frequency: every 2.3 days
  • Top authors: onepay9801 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /572 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

Server-side resources used by Payment with Onepay for Woocommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0151.34 ▲6.21
Dashboard /wp-admin3.31 ▲0.0150.88 ▼2.79
Posts /wp-admin/edit.php3.36 ▲0.0147.47 ▼2.27
Add New Post /wp-admin/post-new.php5.89 ▲0.0188.78 ▼6.08
Media Library /wp-admin/upload.php3.23 ▲0.0140.99 ▲2.52

Server storage [IO: ▲2.01MB] [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: 24 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Payment with Onepay for Woocommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.07 ▼0.281.85 ▲0.3343.99 ▲2.95
Dashboard /wp-admin2,195 ▲155.63 ▼0.0491.22 ▲3.3739.32 ▼0.84
Posts /wp-admin/edit.php2,103 ▼01.97 ▼0.1334.75 ▼2.1033.12 ▼2.29
Add New Post /wp-admin/post-new.php1,526 ▼023.05 ▼0.07679.10 ▲3.6363.80 ▲0.84
Media Library /wp-admin/upload.php1,403 ▼04.28 ▲0.0999.81 ▼6.0243.78 ▼2.56

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • 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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/onepay-payment-for-woocommerce/includes/class-wc-payment-gateway-onepay.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/onepay-payment-for-woocommerce/includes/onepay-order-statuses.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/onepay-payment-for-woocommerce/includes/onepay-checkout-description-fields.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
3 plugin tags: woocommerce, onepay, paymentgateway

onepay-payment-for-woocommerce/onepay-for-wc.php 92% from 13 tests

The main PHP file in "Payment with Onepay for Woocommerce" ver. 1.0.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:
  • Main file name: Name the main plugin file the same as the plugin slug ("onepay-payment-for-woocommerce.php" instead of "onepay-for-wc.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin720 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP415043633
CSS111152
JavaScript116035

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity53.00
▷ Minimum class complexity53.00
▷ Maximum class complexity53.00
Average method complexity3.48
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods21
▷ Static methods00.00%
▷ Public methods1466.67%
▷ Protected methods14.76%
▷ Private methods628.57%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 0% from 2 tests

Image compression 0% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
16 PNG files occupy 1.96MB with 1.44MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-9.png78.12KB25.78KB▼ 67.00%
(invalid) assets/banner-772x250.png76.85KB0.00KB▼ 100.00%
assets/screenshot-5.png112.45KB35.24KB▼ 68.66%
assets/screenshot-12.png104.57KB36.37KB▼ 65.22%
assets/screenshot-3.png66.12KB22.66KB▼ 65.72%