67% smartpay

Code Review | Download Manager and Payment Form WordPress Plugin - WP SmartPay

WordPress plugin Download Manager and Payment Form WordPress Plugin - WP SmartPay scored67%from 54 tests.

About plugin

  • Plugin page: smartpay
  • Plugin version: 2.7.8
  • PHP compatiblity: 7.4.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2.2
  • WordPress version: 6.3.1
  • First release: Jun 11, 2020
  • Latest release: Jul 30, 2023
  • Number of updates: 48
  • Update frequency: every 23.8 days
  • Top authors: themesgrove (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

200+ active /9,992 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.75MB] [CPU: ▲12.65ms] Passed 4 tests

Server-side resources used by Download Manager and Payment Form WordPress Plugin - WP SmartPay
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /5.33 ▲1.8655.13 ▲12.66
Dashboard /wp-admin4.99 ▲1.6958.21 ▲6.73
Posts /wp-admin/edit.php5.10 ▲1.7562.41 ▲16.64
Add New Post /wp-admin/post-new.php7.76 ▲1.88112.14 ▲22.02
Media Library /wp-admin/upload.php4.92 ▲1.6952.13 ▲14.56
Dashboard /wp-admin/admin.php?page=smartpay5.0349.07
Getting Started /wp-admin/admin.php?page=wpsmartpay-getting-started4.8843.97
Integrations /wp-admin/admin.php?page=smartpay-integrations4.9358.72
Forms /wp-admin/admin.php?page=smartpay-form5.2651.08
Settings /wp-admin/admin.php?page=smartpay-setting5.0852.79

Server storage [IO: ▲3.37MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 475 new files
Database: 5 new tables, 8 new options
New tables
wp_smartpay_payments
wp_smartpay_coupons
wp_smartpay_products
wp_smartpay_forms
wp_smartpay_customers
New WordPress options
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget
smartpay_db_version
can_compress_scripts
theysaidso_admin_options
smartpay_settings

Browser metrics Passed 4 tests

Checking browser requirements for Download Manager and Payment Form WordPress Plugin - WP SmartPay
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,200 ▲42920.45 ▲5.9013.77 ▲11.6435.40 ▼10.13
Dashboard /wp-admin2,459 ▲2719.79 ▲3.88260.37 ▲142.0252.74 ▲7.79
Posts /wp-admin/edit.php2,368 ▲2799.28 ▲7.2680.09 ▲42.4339.87 ▲6.01
Add New Post /wp-admin/post-new.php6,283 ▲4,76919.02 ▲1.51806.76 ▲95.4541.00 ▼22.78
Media Library /wp-admin/upload.php1,662 ▲27412.06 ▲7.91135.08 ▲19.2051.01 ▲1.14
Coupons /wp-admin/admin.php?page=smartpay#/coupons1,45212.43164.2274.94
Dashboard /wp-admin/admin.php?page=smartpay1,68417.27311.37103.08
Getting Started /wp-admin/admin.php?page=wpsmartpay-getting-started1,65519.55360.4983.93
Integrations /wp-admin/admin.php?page=smartpay-integrations1,3978.9478.5734.49
Products /wp-admin/admin.php?page=smartpay#/products1,45512.64124.1773.15
Forms /wp-admin/admin.php?page=smartpay-form1,26513.09144.5126.53
Payments /wp-admin/admin.php?page=smartpay#/payments1,45812.39120.0275.77
Settings /wp-admin/admin.php?page=smartpay-setting1,9479.0867.4254.29
Customers /wp-admin/admin.php?page=smartpay#/customers1,46012.36125.4869.88

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The plugin did not uninstall successfully, leaving 5 tables in the database
    • wp_smartpay_payments
    • wp_smartpay_products
    • wp_smartpay_coupons
    • wp_smartpay_customers
    • wp_smartpay_forms
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_recent-comments
    • widget_recent-posts
    • smartpay_settings
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • smartpay_db_version

Smoke tests 50% 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 0% 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
The following issues need your attention
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/smartpay/resources/views/form-builder.php
    • > /wp-content/plugins/smartpay/resources/views/admin.php
  • 260× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\SessionStorageFactoryInterface' not found in wp-content/plugins/smartpay/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorageFactory.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\HttpFoundation\\File\\Exception\\FileException' not found in wp-content/plugins/smartpay/vendor/symfony/http-foundation/File/Exception/FormSizeFileException.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Exception\\UuidExceptionInterface' not found in wp-content/plugins/smartpay/vendor/ramsey/uuid/src/Exception/InvalidArgumentException.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Generator\\TimeGeneratorInterface' not found in wp-content/plugins/smartpay/vendor/ramsey/uuid/src/Generator/PeclUuidTimeGenerator.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'SmartPay\\Framework\\Support\\ServiceProvider' not found in wp-content/plugins/smartpay/app/Providers/IntegrationServiceProvider.php:7
    • > PHP Notice
      Undefined variable: payment in wp-content/plugins/smartpay/resources/views/mail/payment-receipt/form-payment.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'Ramsey\\Collection\\AbstractArray' not found in wp-content/plugins/smartpay/vendor/ramsey/collection/src/Map/AbstractMap.php:32
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Converter\umberConverterInterface' not found in wp-content/plugins/smartpay/vendor/ramsey/uuid/src/Converter/Number/GenericNumberConverter.php:27
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Builder\\UuidBuilderInterface' not found in wp-content/plugins/smartpay/vendor/ramsey/uuid/src/Guid/GuidBuilder.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'SmartPay\\Framework\\Database\\Eloquent\\Relation\\HasOneOrMany' not found in wp-content/plugins/smartpay/framework/Database/Eloquent/Relation/HasMany.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: There are too many tags (30 tag instead of maximum 10)
You can look at the official readme.txt

smartpay/smartpay.php 85% from 13 tests

The entry point to "Download Manager and Payment Form WordPress Plugin - WP SmartPay" version 2.7.8 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Domain Path: The domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("resources/languages")
  • Description: Keep the plugin description shorter than 140 characters (currently 148 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin34,428 lines of code in 434 files:
LanguageFilesBlank linesComment linesLines of code
PHP4078,09018,38232,799
Markdown143200823
JSON100785
JavaScript80815
CSS40106

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 292)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity10.69
▷ Minimum class complexity1.00
▷ Maximum class complexity388.00
Average method complexity2.49
▷ Minimum method complexity1.00
▷ Maximum method complexity292.00
Code structure
Namespaces85
Interfaces50
Traits11
Classes309
▷ Abstract classes175.50%
▷ Concrete classes29294.50%
▷ Final classes4816.44%
Methods2,610
▷ Static methods2589.89%
▷ Public methods2,24085.82%
▷ Protected methods2469.43%
▷ Private methods1244.75%
Functions236
▷ Named functions12050.85%
▷ Anonymous functions11649.15%
Constants237
▷ Global constants93.80%
▷ Class constants22896.20%
▷ Public constants20288.60%

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
23 PNG files occupy 0.24MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/integrations/paytm.png7.33KB2.85KB▼ 61.10%
public/img/integrations/mailerlite.png7.86KB3.18KB▼ 59.50%
public/img/integrations/mailchimp.png14.87KB6.60KB▼ 55.61%
public/img/integrations/paddle.png5.77KB5.33KB▼ 7.65%
public/img/mollie.png1.99KB1.45KB▼ 27.22%