83% turinpay-for-woocommerce

Code Review | TurinPay Plugins for WooCommerce

WordPress plugin TurinPay Plugins for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: turinpay-for-wooc...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 26, 2022
  • Latest release: Feb 28, 2023
  • Number of updates: 10
  • Update frequency: every 7.7 days
  • Top authors: turinpay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /409 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
Installer ran successfully

Server metrics [RAM: ▲0.23MB] [CPU: ▼3.98ms] Passed 4 tests

Analyzing server-side resources used by TurinPay Plugins for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2440.52 ▲1.43
Dashboard /wp-admin3.53 ▲0.2352.36 ▲3.03
Posts /wp-admin/edit.php3.65 ▲0.2953.97 ▼3.46
Add New Post /wp-admin/post-new.php6.11 ▲0.2390.40 ▼16.90
Media Library /wp-admin/upload.php3.46 ▲0.2340.80 ▲4.39

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 38 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
tpfw_start_onboarding
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

TurinPay Plugins for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲4913.91 ▼0.531.65 ▼0.3641.45 ▼2.70
Dashboard /wp-admin2,216 ▲395.51 ▼0.1987.49 ▼1.5341.00 ▼5.64
Posts /wp-admin/edit.php2,124 ▲212.03 ▲0.0642.68 ▲1.0037.88 ▼0.48
Add New Post /wp-admin/post-new.php1,542 ▲1623.37 ▲0.20676.83 ▲24.9155.74 ▼13.62
Media Library /wp-admin/upload.php1,421 ▲244.19 ▼0.07108.65 ▲6.6949.58 ▲7.02

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • tpfw_start_onboarding
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 9× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Trait 'TPFW\\Inc\\Traits\\Get_Instance' not found in wp-content/plugins/turinpay-for-woocommerce/gateway/turinpay/frontend-scripts.php on line 17
    • > PHP Fatal error
      Trait 'TPFW\\Inc\\Traits\\Get_Instance' not found in wp-content/plugins/turinpay-for-woocommerce/inc/notice.php on line 19
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/turinpay-for-woocommerce/gateway/abstract-payment-gateway.php:19
    • > PHP Fatal error
      Trait 'TPFW\\Inc\\Traits\\Get_Instance' not found in wp-content/plugins/turinpay-for-woocommerce/inc/logger.php on line 17
    • > PHP Fatal error
      Uncaught Error: Class 'TPFW\\Gateway\\Abstract_Payment_Gateway' not found in wp-content/plugins/turinpay-for-woocommerce/gateway/turinpay/webhook.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function TPFW\\register_activation_hook() in wp-content/plugins/turinpay-for-woocommerce/autoloader.php:81
    • > PHP Fatal error
      Trait 'TPFW\\Inc\\Traits\\Get_Instance' not found in wp-content/plugins/turinpay-for-woocommerce/admin/admin-controller.php on line 22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/turinpay-for-woocommerce/turinpay-plugins-for-woocommerce.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'TPFW\\Gateway\\Abstract_Payment_Gateway' not found in wp-content/plugins/turinpay-for-woocommerce/gateway/turinpay/turinpay-payments.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
2 plugin tags: turinpay, wc

turinpay-for-woocommerce/turinpay-plugins-for-woocommerce.php 77% from 13 tests

The main file in "TurinPay Plugins for WooCommerce" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("turinpay-for-woocommerce.php" instead of "turinpay-plugins-for-woocommerce.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 169 characters long)
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin47,258 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
JSON50044,756
PHP214031,2681,790
JavaScript632207358
CSS2313160
Markdown227071
XML2171262
HTML12061

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity18.33
▷ Minimum class complexity1.00
▷ Maximum class complexity95.00
Average method complexity2.98
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces8
Interfaces0
Traits1
Classes14
▷ Abstract classes17.14%
▷ Concrete classes1392.86%
▷ Final classes00.00%
Methods133
▷ Static methods3828.57%
▷ Public methods13097.74%
▷ Protected methods00.00%
▷ Private methods32.26%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/icon/tpfw_payment.png2.48KB2.28KB▼ 7.96%