63% sonawp-simple-payment-block

Code Review | SonaWP - Stripe Payment Block - PayPal Payment Block - Donations Block - Sell Digital Work

WordPress plugin SonaWP - Stripe Payment Block - PayPal Payment Block - Donations Block - Sell Digital Work scored63%from 54 tests.

About plugin

  • Plugin page: sonawp-simple-pay...
  • Plugin version: 1.2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Jun 7, 2023
  • Latest release: Nov 28, 2023
  • Number of updates: 32
  • Update frequency: every 5.6 days
  • Top authors: sonawp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /420 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲5.47MB] [CPU: ▲25.42ms] 75% from 4 tests

Analyzing server-side resources used by SonaWP - Stripe Payment Block - PayPal Payment Block - Donations Block - Sell Digital Work
The following require your attention
  • Extra RAM: The extra memory usage should kept under 5MB (currently 5.47MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.23 ▲5.7664.05 ▲20.23
Dashboard /wp-admin9.25 ▲5.9480.10 ▲32.19
Posts /wp-admin/edit.php9.25 ▲5.8982.00 ▲30.58
Add New Post /wp-admin/post-new.php10.19 ▲4.30112.64 ▲18.66
Media Library /wp-admin/upload.php9.25 ▲6.0169.97 ▲32.44
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius9.2563.35

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 523 new files
Database: no new tables, 13 new options
New WordPress options
fs_accounts
theysaidso_admin_options
widget_recent-posts
fs_active_plugins
fs_debug_mode
sonawp_payment_confirmation
sonawp_paypal_settings
sonawp_stripe_settings
sona
can_compress_scripts
...

Browser metrics Passed 4 tests

Checking browser requirements for SonaWP - Stripe Payment Block - PayPal Payment Block - Donations Block - Sell Digital Work
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,015 ▲25314.17 ▼0.4611.86 ▲10.2227.37 ▼15.37
Dashboard /wp-admin2,287 ▲1095.47 ▼0.24102.63 ▼7.5345.74 ▼1.04
Posts /wp-admin/edit.php2,197 ▲972.39 ▲0.3744.75 ▼1.3841.64 ▲4.88
Add New Post /wp-admin/post-new.php6,245 ▲4,71919.44 ▼3.61824.11 ▲169.8435.50 ▼25.80
Media Library /wp-admin/upload.php1,492 ▲924.75 ▲0.6398.96 ▼21.7746.13 ▼3.82
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,1262.2229.9328.06

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/sonawp-simple-payment-block/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • Zombie WordPress options detected upon uninstall: 13 options
    • theysaidso_admin_options
    • sona
    • sonawp_stripe_settings
    • widget_recent-comments
    • widget_theysaidso_widget
    • fs_active_plugins
    • sonawp_payment_confirmation
    • db_upgraded
    • fs_debug_mode
    • widget_recent-posts
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not 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
  • 261× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/sonawp-simple-payment-block/includes/vendor/stripe/stripe-php/lib/BillingPortal/Session.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/sonawp-simple-payment-block/includes/vendor/stripe/stripe-php/lib/SingletonApiResource.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/sonawp-simple-payment-block/includes/vendor/stripe/stripe-php/lib/PromotionCode.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/sonawp-simple-payment-block/includes/vendor/stripe/stripe-php/lib/Service/OAuthService.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Exception\\ApiErrorException' not found in wp-content/plugins/sonawp-simple-payment-block/includes/vendor/stripe/stripe-php/lib/Exception/AuthenticationException.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Stripe\\Exception\\ExceptionInterface' not found in wp-content/plugins/sonawp-simple-payment-block/includes/vendor/stripe/stripe-php/lib/Exception/ApiErrorException.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Stripe\\BaseStripeClientInterface' not found in wp-content/plugins/sonawp-simple-payment-block/includes/vendor/stripe/stripe-php/lib/StripeClientInterface.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/sonawp-simple-payment-block/includes/vendor/stripe/stripe-php/lib/Service/TestHelpers/Treasury/OutboundPaymentService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/sonawp-simple-payment-block/includes/vendor/stripe/stripe-php/lib/InvoiceLineItem.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/sonawp-simple-payment-block/includes/vendor/stripe/stripe-php/lib/TestHelpers/TestClock.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention: You can look at the official readme.txt

sonawp-simple-payment-block/sonawp.php 85% from 13 tests

"SonaWP - Stripe Payment Block - PayPal Payment Block - Donations Block - Sell Digital Work" version 1.2.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sonawp-simple-payment-block.php" instead of "sonawp.php")
  • 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 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Please fix the following items
  • Do not distribute dangerous files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/sonawp-simple-payment-block/includes/vendor/stripe/stripe-php/data/ca-certificates.crt
48,373 lines of code in 467 files:
LanguageFilesBlank linesComment linesLines of code
PHP42510,94329,64145,259
Markdown387601,840
JavaScript98786482
CSS17711385
PO File390126249
JSON1000158

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity15.70
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity3.32
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces38
Interfaces9
Traits9
Classes324
▷ Abstract classes123.70%
▷ Concrete classes31296.30%
▷ Final classes00.00%
Methods2,196
▷ Static methods39718.08%
▷ Public methods1,72178.37%
▷ Protected methods582.64%
▷ Private methods41718.99%
Functions141
▷ Named functions12185.82%
▷ Anonymous functions2014.18%
Constants1,584
▷ Global constants1036.50%
▷ Class constants1,48193.50%
▷ Public constants1,481100.00%

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.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/sonawp-simple-payment-block.png5.85KB2.13KB▼ 63.69%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%