84% opay-now-payment-gateway-for-woocommerce

Code Review | Opay Now Payment Gateway for WooCommerce

WordPress plugin Opay Now Payment Gateway for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: opay-now-payment-...
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.0
  • WordPress version: 6.3.1
  • First release: Jul 21, 2022
  • Latest release: Jul 25, 2022
  • Number of updates: 6
  • Update frequency: every 1.7 days
  • Top authors: opaynow (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /559 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Opay Now Payment Gateway for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0042.78 ▼1.40
Dashboard /wp-admin3.31 ▼0.0464.32 ▲1.62
Posts /wp-admin/edit.php3.36 ▲0.0051.59 ▲0.41
Add New Post /wp-admin/post-new.php5.89 ▲0.0096.55 ▼3.92
Media Library /wp-admin/upload.php3.23 ▲0.0041.25 ▲7.87

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Opay Now Payment Gateway for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.27 ▼0.941.73 ▲0.0243.85 ▼2.60
Dashboard /wp-admin2,218 ▲175.77 ▲0.8698.85 ▼17.3543.24 ▼0.91
Posts /wp-admin/edit.php2,100 ▼02.03 ▼0.0338.69 ▲3.4336.93 ▲1.32
Add New Post /wp-admin/post-new.php1,526 ▼1517.61 ▼5.44672.64 ▼20.4058.88 ▲6.00
Media Library /wp-admin/upload.php1,400 ▼04.20 ▼0.0199.33 ▼20.6047.81 ▼2.00

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
You still need to fix the following
  • Zombie WordPress options were found after 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 | This is a short smoke test looking for 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
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/opay-now-payment-gateway-for-woocommerce/front/index.php:5

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed: You can look at the official readme.txt

opay-now-payment-gateway-for-woocommerce/opaynow_woocommerce.php 92% from 13 tests

This is the main PHP file of "Opay Now Payment Gateway for WooCommerce" version 1.1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("opay-now-payment-gateway-for-woocommerce.php" instead of "opaynow_woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected707 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP696210690
JavaScript11017

PHP code Passed 2 tests

An short overview of 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.29
Average class complexity11.33
▷ Minimum class complexity2.00
▷ Maximum class complexity30.00
Average method complexity2.94
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods1275.00%
▷ Protected methods00.00%
▷ Private methods425.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants541.67%
▷ Class constants758.33%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and 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
assets/images/logo.png10.76KB4.37KB▼ 59.39%