10% paymill

Code Review | PAYMILL for WordPress

WordPress plugin PAYMILL for WordPress scored 10% from 54 tests.

About plugin

  • Plugin page: paymill
  • Plugin version: 1.12a
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.8
  • WordPress version: 5.8.1
  • First release: Jun 21, 2013
  • Latest release: Jan 3, 2019
  • Number of updates: 94
  • Update frequency: every 21.5 days
  • Top authors: Matthias Reuter (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

200+ active / 15,919 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/paymill/lib/integration/pay_button.inc.php+397
    Function create_function() is deprecated

Server metrics [RAM: ▼1.89MB] [CPU: ▼186.96ms] Passed 4 tests

This is a short check of server-side resources used by PAYMILL for WordPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /1.74 ▼1.0910.27 ▼27.27
Dashboard /wp-admin1.76 ▼1.297.29 ▼38.24
Posts /wp-admin/edit.php1.76 ▼1.347.49 ▼41.65
Add New Post /wp-admin/post-new.php1.76 ▼3.677.45 ▼640.68
Media Library /wp-admin/upload.php1.76 ▼1.249.82 ▼24.24

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 203 new files
Database: 4 new tables, 2 new options
New tables
wp_paymill_clients
wp_paymill_cache_offers
wp_paymill_transactions
wp_paymill_subscriptions
New WordPress options
paymill_db_version
widget_paymill_pay_button_widget

Browser metrics Passed 4 tests

A check of browser resources used by PAYMILL for WordPress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,704 ▲10815.90 ▼0.109.75 ▲2.1447.53 ▼0.08
Dashboard /wp-admin2,988 ▲576.11 ▲0.18134.05 ▼16.28130.40 ▲11.96
Posts /wp-admin/edit.php2,764 ▲252.71 ▲0.0161.16 ▼18.1282.84 ▼11.33
Add New Post /wp-admin/post-new.php1,634 ▼4922.01 ▲3.21279.57 ▼89.29123.47 ▲10.77
Media Library /wp-admin/upload.php1,776 ▼345.01 ▼0.00143.50 ▼18.83154.74 ▲32.57

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/paymill/lib/integration/pay_button.inc.php+397
    Function create_function() is deprecated
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_paymill_cache_offers
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • widget_paymill_pay_button_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
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 64× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/paymill/lib/api/samples/authentication/authentication.php
    • > /wp-content/plugins/paymill/lib/api/samples/clients/list_clients.php
    • > /wp-content/plugins/paymill/lib/api/samples/payments/get_payment_details.php
    • > /wp-content/plugins/paymill/lib/api/samples/transactions/create_new_transaction_with_client_and_payment.php
    • > /wp-content/plugins/paymill/lib/api/samples/payments/remove_payment.php
    • > /wp-content/plugins/paymill/lib/api/samples/payments/list_payments.php
    • > /wp-content/plugins/paymill/lib/api/samples/webhooks/remove_webhook.php
    • > /wp-content/plugins/paymill/lib/api/samples/refunds/list_refunds.php
    • > /wp-content/plugins/paymill/lib/api/samples/subscriptions/pause_subscription.php
    • > /wp-content/plugins/paymill/lib/api/samples/offers/export_offers_list.php
  • 99× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/paymill/lib/api/tests/unit/Paymill/API/CurlTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/paymill/lib/api/tests/unit/Paymill/Models/Request/TransactionTest.php:12
    • > PHP Notice
      Trying to get property 'code' of non-object in wp-content/plugins/paymill/lib/tpl/mgm/payment/paymill/html/settings_box.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/paymill/lib/integration/pay_button.inc.php:259
    • > PHP Fatal error
      Uncaught Error: Class 'Paymill\\Models\\Request\\Base' not found in wp-content/plugins/paymill/lib/api/lib/Paymill/Models/Request/Subscription.php:12
    • > PHP Notice
      Trying to get property 'code' of non-object in wp-content/plugins/paymill/lib/tpl/mgm/payment/paymill/html/settings_box.php on line 5
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/paymill/lib/tpl/mgm/payment/paymill/html/settings_box.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/paymill/lib/tpl/mgm/payment/paymill/html/settings.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/paymill/lib/api/tests/unit/Paymill/Models/Request/ClientTest.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Paymill\\Models\\Response\\Base' not found in wp-content/plugins/paymill/lib/api/lib/Paymill/Models/Response/Webhook.php:13

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

readme.txt 81% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Please describe screenshot #7 in paymill/assets to your readme.txt
  • Donate link: Invalid url: ""
  • Tags: Please delete some tags, you are using 16 tag instead of maximum 10
The official readme.txt is a good inspiration

paymill/paymill.php 92% from 13 tests

The primary PHP file in "PAYMILL for WordPress" version 1.12a is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Version: Use periods and digits only for your plugin's version number (ex. "1.0.3" instead of "1.12a")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected15,700 lines of code in 163 files:
LanguageFilesBlank linesComment linesLines of code
PHP1433,4756,05410,794
PO File51,3361,4673,246
JavaScript81694691,184
CSS2129271
Markdown1480114
Ant18046
JSON13019
XML11013
YAML12013

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity11.49
▷ Minimum class complexity1.00
▷ Maximum class complexity222.00
Average method complexity2.04
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces10
Interfaces0
Traits0
Classes76
▷ Abstract classes33.95%
▷ Concrete classes7396.05%
▷ Final classes00.00%
Methods768
▷ Static methods00.00%
▷ Public methods64383.72%
▷ Protected methods719.24%
▷ Private methods547.03%
Functions43
▷ Named functions3990.70%
▷ Anonymous functions49.30%
Constants24
▷ Global constants2187.50%
▷ Class constants312.50%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
19 PNG files occupy 0.07MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/img/logo.png2.52KB2.44KB▼ 3.33%
lib/img/icon.png0.44KB0.50KB0.00%
lib/img/logos/elv.png3.14KB1.58KB▼ 49.53%
lib/img/logo_small.png2.25KB1.79KB▼ 20.72%
lib/img/logos/discover.png1.92KB1.40KB▼ 27.12%