83% splitoff-pay-woocommerce

Code Review | TogetherPay for WooCommerce

WordPress plugin TogetherPay for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: splitoff-pay-wooc...
  • Plugin version: 1.0.10
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-6.1
  • WordPress version: 6.3.1
  • First release: Mar 2, 2021
  • Latest release: Aug 9, 2022
  • Number of updates: 39
  • Update frequency: every 13.6 days
  • Top authors: splitoff (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /912 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▼3.95ms] Passed 4 tests

Analyzing server-side resources used by TogetherPay for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1737.99 ▲1.22
Dashboard /wp-admin3.48 ▲0.1844.55 ▼3.35
Posts /wp-admin/edit.php3.59 ▲0.2344.84 ▼2.29
Add New Post /wp-admin/post-new.php6.06 ▲0.1780.54 ▼11.38
Media Library /wp-admin/upload.php3.40 ▲0.1738.30 ▲3.36

Server storage [IO: ▲0.35MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 29 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
splitoff_rating_notification_timestamp
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by TogetherPay for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲5414.35 ▲0.011.74 ▼0.1040.00 ▼1.25
Dashboard /wp-admin2,192 ▲155.56 ▼0.0582.66 ▼10.2138.20 ▼5.15
Posts /wp-admin/edit.php2,100 ▼02.03 ▲0.0434.01 ▼2.9932.56 ▼2.10
Add New Post /wp-admin/post-new.php1,526 ▼023.46 ▲0.17669.50 ▲42.6453.88 ▲2.78
Media Library /wp-admin/upload.php1,400 ▼04.21 ▲0.02101.46 ▲3.3343.75 ▲2.18

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • splitoff_rating_notification_timestamp
    • widget_recent-posts
    • theysaidso_admin_options

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)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/splitoff-pay-woocommerce/class/WC_Gateway_SplitOff.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/splitoff-pay-woocommerce/class/WC_Gateway_SplitOff/instalments.html.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_editor() in wp-content/plugins/splitoff-pay-woocommerce/class/WC_Gateway_SplitOff/wysiwyg.html.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/splitoff-pay-woocommerce/class/WC_Gateway_SplitOff/form_fields.php:8
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/splitoff-pay-woocommerce/class/WC_Gateway_SplitOff/environments.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/splitoff-pay-woocommerce/class/WC_Gateway_SplitOff/splitoff_js_init.html.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: woocommerce, splitoff

splitoff-pay-woocommerce/splitoff-gateway-for-woocommerce.php 77% from 13 tests

"TogetherPay for WooCommerce" version 1.0.10's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.4.0" instead of "2.6.0")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("splitoff-pay-woocommerce.php" instead of "splitoff-gateway-for-woocommerce.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin3,737 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP107351,9393,244
JavaScript2480211
Markdown1430121
CSS119689
XML40072

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity199.33
▷ Minimum class complexity21.00
▷ Maximum class complexity422.00
Average method complexity6.95
▷ Minimum method complexity1.00
▷ Maximum method complexity49.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods100
▷ Static methods88.00%
▷ Public methods7272.00%
▷ Protected methods00.00%
▷ Private methods2828.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
10 PNG files occupy 0.09MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icon-check.png2.45KB1.50KB▼ 38.46%
class/logo.png12.02KB4.73KB▼ 60.63%
class/splitoff-logo-colour.png4.63KB2.25KB▼ 51.37%
images/icon-statistics.png3.17KB1.90KB▼ 40.08%
class/logo1.png12.02KB4.73KB▼ 60.63%