10% postpay

Code Review | WooCommerce Postpay Payment Gateway

WordPress plugin WooCommerce Postpay Payment Gateway scored10%from 54 tests.

About plugin

  • Plugin page: postpay
  • Plugin version: 0.2.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: Mar 25, 2020
  • Latest release: Aug 28, 2023
  • Number of updates: 27
  • Update frequency: every 46.3 days
  • Top authors: postpay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /2,188 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/postpay/postpay.php+64
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.96MB] [CPU: ▼56.94ms] Passed 4 tests

Server-side resources used by WooCommerce Postpay Payment Gateway
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.446.21 ▼37.52
Dashboard /wp-admin2.05 ▼1.266.92 ▼44.56
Posts /wp-admin/edit.php2.05 ▼1.316.37 ▼43.93
Add New Post /wp-admin/post-new.php2.05 ▼3.845.97 ▼101.75
Media Library /wp-admin/upload.php2.05 ▼1.185.07 ▼31.79

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

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

Browser metrics Passed 4 tests

WooCommerce Postpay Payment Gateway: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▼0.381.69 ▼0.4344.57 ▲3.02
Dashboard /wp-admin2,198 ▲215.64 ▲0.0483.69 ▼8.6139.92 ▼4.23
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0335.88 ▲0.8835.64 ▼1.18
Add New Post /wp-admin/post-new.php1,526 ▼022.93 ▼0.77642.41 ▼41.9449.41 ▼4.43
Media Library /wp-admin/upload.php1,403 ▲64.22 ▲0.1596.75 ▼7.0242.76 ▼2.70

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/postpay/postpay.php+64
    Trying to access array offset on value of type bool
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

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 no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Postpay\\Exceptions\\ApiException' not found in wp-content/plugins/postpay/vendor/postpay/postpay-php/src/Exceptions/RESTfulException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Postpay\\Exceptions\\PostpayException' not found in wp-content/plugins/postpay/vendor/postpay/postpay-php/src/Exceptions/ApiException.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Postpay\\HttpClients\\ClientInterface' not found in wp-content/plugins/postpay/vendor/postpay/postpay-php/src/HttpClients/CurlClient.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Postpay\\HttpClients\\ClientInterface' not found in wp-content/plugins/postpay/vendor/postpay/postpay-php/src/HttpClients/GuzzleClient.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Postpay\\Exceptions\\ApiException' not found in wp-content/plugins/postpay/vendor/postpay/postpay-php/src/Exceptions/GraphQLException.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: payment, postpay, wordpress, woocommerce, gateway

postpay/postpay.php Passed 13 tests

The main PHP file in "WooCommerce Postpay Payment Gateway" ver. 0.2.3 adds more information about the plugin and also serves as the entry point for this plugin
55 characters long description:
Buy now and pay later with zero interest and zero fees.

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
Everything looks great! No dangerous files found in this plugin2,236 lines of code in 51 files:
LanguageFilesBlank linesComment linesLines of code
PHP443741,1471,791
JSON200254
PO File15895137
Markdown112024
reStructuredText112020
JavaScript22810

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity4.85
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity1.93
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces6
Interfaces1
Traits0
Classes32
▷ Abstract classes26.25%
▷ Concrete classes3093.75%
▷ Final classes26.67%
Methods136
▷ Static methods2316.91%
▷ Public methods13397.79%
▷ Protected methods10.74%
▷ Private methods21.47%
Functions8
▷ Named functions450.00%
▷ Anonymous functions450.00%
Constants21
▷ Global constants419.05%
▷ Class constants1780.95%
▷ Public constants17100.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.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/postpay-pay-now.png2.09KB1.67KB▼ 20.00%
assets/images/postpay-dark.png4.07KB1.83KB▼ 55.00%
assets/images/postpay-light.png4.14KB1.82KB▼ 55.97%