83% toyyibpay-for-woocommerce

Code Review | toyyibPay for WooCommerce

WordPress plugin toyyibPay for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: toyyibpay-for-woo...
  • Plugin version: 1.3.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-6.3.1
  • WordPress version: 6.3.1
  • First release: Jun 13, 2019
  • Latest release: Oct 2, 2023
  • Number of updates: 52
  • Update frequency: every 30.3 days
  • Top authors: toyyibpay (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

10,000+ active /79,104 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

Server-side resources used by toyyibPay for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0145.29 ▲2.19
Dashboard /wp-admin3.31 ▼0.0348.09 ▼13.24
Posts /wp-admin/edit.php3.36 ▲0.0147.81 ▼0.39
Add New Post /wp-admin/post-new.php5.89 ▲0.0197.49 ▲1.77
Media Library /wp-admin/upload.php3.23 ▲0.0035.60 ▼2.71

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by toyyibPay for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.23 ▼0.982.06 ▲0.1146.76 ▲6.56
Dashboard /wp-admin2,209 ▲174.85 ▼0.13101.67 ▼6.0441.66 ▼0.97
Posts /wp-admin/edit.php2,086 ▼61.99 ▼0.0236.29 ▲0.9433.92 ▲1.35
Add New Post /wp-admin/post-new.php1,543 ▼018.12 ▼0.29628.36 ▲5.8753.71 ▼2.42
Media Library /wp-admin/upload.php1,391 ▲64.28 ▲0.0499.26 ▼8.1243.45 ▼1.49

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

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
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/toyyibpay-for-woocommerce/src/toyyibpay.php:9

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === toyyibpay-for-woocommerce === )
Please take inspiration from this readme.txt

toyyibpay-for-woocommerce/index.php 92% from 13 tests

This is the main PHP file of "toyyibPay for WooCommerce" version 1.3.5, 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: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("toyyibpay-for-woocommerce.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin514 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP212328514

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity88.00
▷ Minimum class complexity88.00
▷ Maximum class complexity88.00
Average method complexity9.70
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods990.00%
▷ Protected methods00.00%
▷ Private methods110.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 1.12MB with 0.66MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/assets/hor-all.png217.52KB89.41KB▼ 58.89%
src/assets/mini-all.png121.06KB47.99KB▼ 60.36%
src/assets/mini-fpx.png121.06KB47.99KB▼ 60.36%
src/assets/hor-fpx.png217.52KB89.41KB▼ 58.89%
src/assets/ver-all.png233.58KB104.27KB▼ 55.36%