78% payplug

Code Review | PayPlug for WooCommerce (Official)

WordPress plugin PayPlug for WooCommerce (Official) scored78%from 54 tests.

About plugin

  • Plugin page: payplug
  • Plugin version: 2.6.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.4.1
  • WordPress version: 6.3.1
  • First release: Sep 12, 2018
  • Latest release: Nov 9, 2023
  • Number of updates: 104
  • Update frequency: every 18.1 days
  • Top authors: PayPlug (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

4,000+ active /99,454 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.30MB] [CPU: ▼2.74ms] Passed 4 tests

An overview of server-side resources used by PayPlug for WooCommerce (Official)
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.3134.34 ▼6.14
Dashboard /wp-admin3.61 ▲0.3046.59 ▼0.81
Posts /wp-admin/edit.php3.66 ▲0.3048.16 ▲3.50
Add New Post /wp-admin/post-new.php6.19 ▲0.3090.76 ▼4.09
Media Library /wp-admin/upload.php3.53 ▲0.3033.30 ▲0.07

Server storage [IO: ▲9.97MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 929 new files
Database: 1 new table, 6 new options
New tables
wp_woocommerce_payplug_lock
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for PayPlug for WooCommerce (Official)
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲3414.22 ▼0.121.60 ▼0.1639.91 ▼5.67
Dashboard /wp-admin2,201 ▲215.61 ▲0.0187.76 ▼11.1138.28 ▼4.34
Posts /wp-admin/edit.php2,107 ▲101.95 ▲0.0140.97 ▲4.0536.05 ▲3.89
Add New Post /wp-admin/post-new.php1,532 ▲623.14 ▼0.10665.80 ▲33.1961.12 ▲9.56
Media Library /wp-admin/upload.php1,409 ▲94.19 ▲0.03101.15 ▲6.3142.06 ▼0.92

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% 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 0% 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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/payplug/assets/images/integrated/index.php
  • 77× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Payplug\\PayplugWoocommerce\\Gateway\\PayplugGateway' not found in wp-content/plugins/payplug/src/Controller/ApplePay.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Payplug\\Exception\\PayplugException' not found in wp-content/plugins/payplug/vendor/payplug/payplug-php/lib/Payplug/Exception/ConfigurationException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Payplug\\PayplugWoocommerce\\Controller\\PayplugGenericGateway' not found in wp-content/plugins/payplug/src/Gateway/PPRO/Satispay.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/payplug/vendor/payplug/payplug-php/tests/unit_tests/Resource/PaymentAuthorizationTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/payplug/vendor/payplug/payplug-php/tests/unit_tests/Resource/OneySimulationResourceTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Payplug\\Resource\\APIResource' not found in wp-content/plugins/payplug/vendor/payplug/payplug-php/lib/Payplug/Resource/Refund.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Payplug\\Exception\\PayplugException' not found in wp-content/plugins/payplug/vendor/payplug/payplug-php/lib/Payplug/Exception/DependencyException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Payplug\\Exception\\HttpException' not found in wp-content/plugins/payplug/vendor/payplug/payplug-php/lib/Payplug/Exception/UnexpectedAPIResponseException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Payplug\\Resource\\APIResource' not found in wp-content/plugins/payplug/vendor/payplug/payplug-php/lib/Payplug/Resource/OneySimulationResource.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Payplug\\Resource\\APIResource' not found in wp-content/plugins/payplug/vendor/payplug/payplug-php/lib/Payplug/Resource/PaymentPaymentFailure.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Tags: There are too many tags (16 tag instead of maximum 10)
  • Screenshots: These screenshots lack descriptions #3, #4 in payplug/assets to your readme.txt
The official readme.txt is a good inspiration

payplug/payplug.php Passed 13 tests

"PayPlug for WooCommerce (Official)" version 2.6.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
92 characters long description:
The online payment solution combining simplicity and first-rate support to boost your sales.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected101,035 lines of code in 842 files:
LanguageFilesBlank linesComment linesLines of code
PHP6994,29911,32892,982
SVG106053,419
PO File38763001,849
JSON4101,141
JavaScript87039667
CSS9192531
make1286143
Markdown3530109
reStructuredText3607091
YAML110055
Python16816030
XML10013
INI1003
HTML2002

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity12.03
▷ Minimum class complexity1.00
▷ Maximum class complexity369.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces23
Interfaces12
Traits0
Classes135
▷ Abstract classes53.70%
▷ Concrete classes13096.30%
▷ Final classes00.00%
Methods1,020
▷ Static methods21220.78%
▷ Public methods92090.20%
▷ Protected methods757.35%
▷ Private methods252.45%
Functions106
▷ Named functions54.72%
▷ Anonymous functions10195.28%
Constants109
▷ Global constants87.34%
▷ Class constants10192.66%
▷ Public constants101100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
37 PNG files occupy 0.76MB with 0.46MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/Oney3x.png4.91KB4.93KB0.00%
assets/img/logos_schemes_installment_2_default.85b94ced.png8.33KB3.32KB▼ 60.16%
assets/img/logos_schemes_installment_4_gb.8f408211.png8.21KB3.33KB▼ 59.51%
assets/images/lg-3xoney-disabled.png10.35KB0.82KB▼ 92.10%
assets/images/lg-step3-oney.png7.42KB0.72KB▼ 90.27%