84% payer-for-woocommerce

Code Review | Payer for WooCommerce

WordPress plugin Payer for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: payer-for-woocomm...
  • Plugin version: 1.1.10
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.1.0
  • WordPress version: 6.3.1
  • First release: Feb 26, 2018
  • Latest release: Nov 14, 2022
  • Number of updates: 39
  • Update frequency: every 46.4 days
  • Top authors: payertech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /2,405 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼11.60ms] Passed 4 tests

This is a short check of server-side resources used by Payer for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.40 ▼0.0632.53 ▼5.78
Dashboard /wp-admin3.32 ▼0.0244.39 ▼16.10
Posts /wp-admin/edit.php3.38 ▲0.0247.78 ▼3.58
Add New Post /wp-admin/post-new.php5.90 ▲0.0290.36 ▼20.95
Media Library /wp-admin/upload.php3.25 ▲0.0233.57 ▼3.05

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 133 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Payer for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,465 ▼28114.45 ▲0.180.52 ▼1.1015.78 ▼28.94
Dashboard /wp-admin2,206 ▲184.84 ▼0.08101.17 ▼11.0637.42 ▼6.18
Posts /wp-admin/edit.php2,092 ▲32.05 ▲0.0339.04 ▼1.7833.82 ▼3.67
Add New Post /wp-admin/post-new.php1,514 ▼517.55 ▼5.81660.14 ▼6.8370.40 ▲20.73
Media Library /wp-admin/upload.php1,379 ▼64.31 ▲0.0699.21 ▼1.0646.16 ▲3.81

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 64× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required '../../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/payer-for-woocommerce/vendor/payer/sdk/docs/examples/CreateInvoiceExample.php on line 26
    • > PHP Warning
      require_once(../../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/payer-for-woocommerce/vendor/payer/sdk/docs/examples/GetOrderStatusExample.php on line 26
    • > PHP Fatal error
      require_once(): Failed opening required '../../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/payer-for-woocommerce/vendor/payer/sdk/docs/examples/CreateOrderExample.php on line 26
    • > PHP Fatal error
      require_once(): Failed opening required '../../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/payer-for-woocommerce/vendor/payer/sdk/docs/examples/PurchaseCustomSettlementExample.php on line 57
    • > PHP Fatal error
      require_once(): Failed opening required '../../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/payer-for-woocommerce/vendor/payer/sdk/docs/examples/CallbackEndpointSettlementExample.php on line 57
    • > PHP Fatal error
      require_once(): Failed opening required '../../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/payer-for-woocommerce/vendor/payer/sdk/docs/examples/RecurringStoreCustomerExample.php on line 26
    • > PHP Warning
      require_once(../../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/payer-for-woocommerce/vendor/payer/sdk/docs/examples/ActivateInvoiceExample.php on line 26
    • > PHP Warning
      require_once(../../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/payer-for-woocommerce/vendor/payer/sdk/docs/examples/InvoiceTemplateBindingExample.php on line 26
    • > PHP Fatal error
      require_once(): Failed opening required '../../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/payer-for-woocommerce/vendor/payer/sdk/docs/examples/GetPostDataExample.php on line 26
    • > PHP Fatal error
      require_once(): Failed opening required '../../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/payer-for-woocommerce/vendor/payer/sdk/docs/examples/RecurringFetchTokenExample.php on line 26

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: checkout, e-commerce, payer, woocommerce, ecommerce

payer-for-woocommerce/payer-for-woocommerce.php 92% from 13 tests

"Payer for WooCommerce" version 1.1.10's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.7" instead of "4.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected7,225 lines of code in 120 files:
LanguageFilesBlank linesComment linesLines of code
PHP1111,4944,7466,398
JavaScript43872423
PO File182103201
JSON100112
CSS27088
YAML1003

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity8.09
▷ Minimum class complexity1.00
▷ Maximum class complexity68.00
Average method complexity2.57
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces15
Interfaces4
Traits0
Classes78
▷ Abstract classes56.41%
▷ Concrete classes7393.59%
▷ Final classes00.00%
Methods374
▷ Static methods6016.04%
▷ Public methods32787.43%
▷ Protected methods71.87%
▷ Private methods4010.70%
Functions22
▷ Named functions2195.45%
▷ Anonymous functions14.55%
Constants10
▷ Global constants990.00%
▷ Class constants110.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
8 PNG files occupy 0.17MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/payer-icon-payment_method-bank.png23.70KB2.84KB▼ 88.03%
assets/img/payer-icon-payment_method-masterpass.png19.47KB1.98KB▼ 89.85%
assets/img/payer-icon-payment_method-card_01.png20.72KB2.51KB▼ 87.89%
assets/img/payer-icon-payment_method-payer_rent_payment.png19.78KB2.25KB▼ 88.60%
assets/img/payer-icon-payment_method-swish.png20.80KB2.19KB▼ 89.47%