78% tendopay

Code Review | TendoPay

WordPress plugin TendoPay scored78%from 54 tests.

About plugin

  • Plugin page: tendopay
  • Plugin version: 3.2.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-5.8.1
  • WordPress version: 6.3.1
  • First release: Jul 5, 2019
  • Latest release: Feb 9, 2023
  • Number of updates: 24
  • Update frequency: every 64.6 days
  • Top authors: tendopay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /1,634 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼5.38ms] Passed 4 tests

Server-side resources used by TendoPay
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0835.59 ▼3.71
Dashboard /wp-admin3.45 ▲0.1554.17 ▲6.01
Posts /wp-admin/edit.php3.56 ▲0.2154.52 ▲0.61
Add New Post /wp-admin/post-new.php6.03 ▲0.1589.31 ▼19.49
Media Library /wp-admin/upload.php3.38 ▲0.1538.18 ▲1.09

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 113 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for TendoPay
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,465 ▼29614.28 ▼0.270.54 ▼1.0819.72 ▼25.36
Dashboard /wp-admin2,206 ▲295.61 ▼0.0490.95 ▼11.7541.67 ▲1.04
Posts /wp-admin/edit.php2,115 ▲122.02 ▲0.0739.45 ▼2.4236.67 ▲1.23
Add New Post /wp-admin/post-new.php1,537 ▲223.23 ▲4.93659.67 ▲16.1466.79 ▼1.91
Media Library /wp-admin/upload.php1,411 ▲144.21 ▲0.0194.92 ▼15.6745.81 ▲0.54

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

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/tendopay/vendor/tendopay/tendopay-sdk-php/samples/index.php
    • > /wp-content/plugins/tendopay/tendopay.php
    • > /wp-content/plugins/tendopay/vendor/tendopay/tendopay-sdk-php/samples/index.html.php
    • > /wp-content/plugins/tendopay/partials/pdp-calc-init.php
  • 28× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Trait 'TendoPay\\SDK\\Traits\\TpConfigTrait' not found in wp-content/plugins/tendopay/vendor/tendopay/tendopay-sdk-php/src/V2/ConstantsV2.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tendopay/src/TendoPay/Marketing/functions.php:6
    • > PHP Warning
      Use of undefined constant TENDOPAY_BASEURL - assumed 'TENDOPAY_BASEURL' (this will throw an Error in a future version of PHP) in wp-content/plugins/tendopay/partials/pdp-calc-popup.php on line 11
    • > PHP Fatal error
      Uncaught TypeError: Argument 1 passed to TendoPay\\SDK\\Models\\Payment::setMerchantOrderId() must be of the type string, null given, called in wp-content/plugins/tendopay/vendor/tendopay/tendopay-sdk-php/samples/payment.php on line 26 and defined in wp-content/plugins/tendopay/vendor/tendopay/tendopay-sdk-php/src/Models/Payment.php:82
    • > PHP Fatal error
      Trait 'TendoPay\\SDK\\Traits\\V2\\TendoPayHelper' not found in wp-content/plugins/tendopay/vendor/tendopay/tendopay-sdk-php/src/V2/TendoPayClient.php on line 26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tendopay/src/TendoPay/Marketing/functions.php:6
    • > PHP Notice
      Undefined index: tp_description in wp-content/plugins/tendopay/vendor/tendopay/tendopay-sdk-php/samples/payment.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/tendopay/partials/pdp-calc-popup.php:14
    • > PHP Fatal error
      Trait 'TendoPay\\SDK\\Traits\\TendoPayHelper' not found in wp-content/plugins/tendopay/vendor/tendopay/tendopay-sdk-php/src/TendoPayClient.php on line 24
    • > PHP Warning
      Use of undefined constant TENDOPAY_BASEURL - assumed 'TENDOPAY_BASEURL' (this will throw an Error in a future version of PHP) in wp-content/plugins/tendopay/partials/pdp-calc-popup.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Please add descriptions for these screenshots #1, #2 in tendopay/assets to your readme.txt
Please take inspiration from this readme.txt

tendopay/tendopay.php 92% from 13 tests

The principal PHP file in "TendoPay" v. 3.2.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 150 characters long)

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
Success! There were no dangerous files found in this plugin4,931 lines of code in 91 files:
LanguageFilesBlank linesComment linesLines of code
PHP678321,5473,630
CSS3983461
Vuejs Component4277333
Markdown31080298
JSON300129
JavaScript34038
SVG50023
XML23116
Bourne Shell1103

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity6.51
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity1.93
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces17
Interfaces1
Traits4
Classes36
▷ Abstract classes00.00%
▷ Concrete classes36100.00%
▷ Final classes00.00%
Methods244
▷ Static methods7631.15%
▷ Public methods20282.79%
▷ Protected methods249.84%
▷ Private methods187.38%
Functions16
▷ Named functions850.00%
▷ Anonymous functions850.00%
Constants124
▷ Global constants43.23%
▷ Class constants12096.77%
▷ Public constants11999.17%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/tp-logo-example-payments.png10.20KB5.73KB▼ 43.81%
assets/img/tp-logo-blue_66x12.png1.44KB1.48KB0.00%
assets/img/tp-logo-blue_180x33.png4.73KB2.65KB▼ 43.89%