77% cashbene-payment-gateway

Code Review | Cashbene Payment Gateway

WordPress plugin Cashbene Payment Gateway scored 77% from 54 tests.

About plugin

  • Plugin page: cashbene-payment-...
  • Plugin version: 1.0.5
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.2
  • WordPress version: 6.3.1
  • First release: Apr 28, 2023
  • Latest release: Aug 17, 2023
  • Number of updates: 7
  • Update frequency: every 17.1 days
  • Top authors: cashbene (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 162 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by Cashbene Payment Gateway
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.04 ▼3.64
Dashboard /wp-admin3.31 ▲0.0146.27 ▼5.90
Posts /wp-admin/edit.php3.36 ▲0.0046.74 ▲2.06
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.86 ▼13.41
Media Library /wp-admin/upload.php3.23 ▲0.0033.88 ▲2.51

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 2,022 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Cashbene Payment Gateway
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.16 ▼1.521.61 ▼0.1541.05 ▼2.59
Dashboard /wp-admin2,206 ▲155.80 ▼0.10100.38 ▼10.3037.25 ▼10.30
Posts /wp-admin/edit.php2,086 ▼31.99 ▼0.0136.20 ▲1.6533.16 ▼0.61
Add New Post /wp-admin/post-new.php1,520 ▼1323.54 ▲0.43689.61 ▲35.1760.39 ▲5.98
Media Library /wp-admin/upload.php1,388 ▲34.17 ▼0.0393.91 ▼8.3940.79 ▼4.91

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • 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
Good news, no errors were detected

SRP 0% 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
Please fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/cashbene-payment-gateway/vendor/cashbene/core/tests/test.php
  • 370× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/cashbene-payment-gateway/templates/admin/admin_page.php:2
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Contracts\\HttpClient\\ChunkInterface' not found in wp-content/plugins/cashbene-payment-gateway/vendor/symfony/http-client/Chunk/ErrorChunk.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'phpDocumentor\\Reflection\\DocBlock\\Tags\\BaseTag' not found in wp-content/plugins/cashbene-payment-gateway/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Method.php:26
    • > PHP Fatal error
      Uncaught LogicException: You cannot use the "Symfony\\Component\\HttpClient\\Psr18Client" as the "psr/http-factory" package is not installed. Try running "composer require nyholm/psr7". in wp-content/plugins/cashbene-payment-gateway/vendor/symfony/http-client/Psr18Client.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Intl\\DateFormatter\\DateFormat\\Transformer' not found in wp-content/plugins/cashbene-payment-gateway/vendor/symfony/intl/DateFormatter/DateFormat/MonthTransformer.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Intl\\Data\\Bundle\\Reader\\BundleReaderInterface' not found in wp-content/plugins/cashbene-payment-gateway/vendor/symfony/intl/Data/Bundle/Reader/BufferedBundleReader.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'phpDocumentor\\Reflection\\DocBlock\\Tags\\BaseTag' not found in wp-content/plugins/cashbene-payment-gateway/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Deprecated.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Serializer\ormalizer\\AbstractNormalizer' not found in wp-content/plugins/cashbene-payment-gateway/vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php:37
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Mime\\Encoder\\EncoderInterface' not found in wp-content/plugins/cashbene-payment-gateway/vendor/symfony/mime/Encoder/Base64Encoder.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Contracts\\HttpClient\\Exception\\RedirectionExceptionInterface' not found in wp-content/plugins/cashbene-payment-gateway/vendor/symfony/http-client/Exception/RedirectionException.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Donate link: Invalid URI ("")
  • Requires php: Invalid plugin version format
Please take inspiration from this readme.txt

cashbene-payment-gateway/cashbene-gateway.php 85% from 13 tests

"Cashbene Payment Gateway" version 1.0.5'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:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cashbene-payment-gateway.php" instead of "cashbene-gateway.php")

Code Analysis 97% from 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 plugin401,712 lines of code in 1,857 files:
LanguageFilesBlank linesComment linesLines of code
JSON1,17410341,904
PHP6238,99720,26657,931
Markdown3136901,110
YAML8570459
XML891110
PO File1272778
XSD111072
make17028
Bourne Again Shell12011
SVG4004
HTML3003
CSS1001
JavaScript1001

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity9.46
▷ Minimum class complexity1.00
▷ Maximum class complexity224.00
Average method complexity2.94
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces99
Interfaces94
Traits13
Classes467
▷ Abstract classes347.28%
▷ Concrete classes43392.72%
▷ Final classes12428.64%
Methods2,719
▷ Static methods68925.34%
▷ Public methods2,26183.16%
▷ Protected methods1425.22%
▷ Private methods31611.62%
Functions245
▷ Named functions14458.78%
▷ Anonymous functions10141.22%
Constants604
▷ Global constants8514.07%
▷ Class constants51985.93%
▷ Public constants45387.28%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
public/dist/images/content/no-image.png4.42KB4.30KB▼ 2.63%