83% qr-payments-via-paypal

Code Review | WooCommerce Qr payments via PayPal

WordPress plugin WooCommerce Qr payments via PayPal scored83%from 54 tests.

About plugin

  • Plugin page: qr-payments-via-p...
  • Plugin version: 0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-5.5
  • WordPress version: 6.3.1
  • First release: Aug 16, 2019
  • Latest release: Nov 20, 2020
  • Number of updates: 29
  • Update frequency: every 16.0 days
  • Top authors: nor1m (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

60+ active /7,769 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

Analyzing server-side resources used by WooCommerce Qr payments via PayPal
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0036.94 ▲0.53
Dashboard /wp-admin3.31 ▼0.0447.28 ▼16.36
Posts /wp-admin/edit.php3.36 ▲0.0042.28 ▼8.30
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.04 ▼18.34
Media Library /wp-admin/upload.php3.23 ▲0.0033.66 ▲1.89

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 32 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

WooCommerce Qr payments via PayPal: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.80 ▲0.171.87 ▲0.2742.87 ▼1.52
Dashboard /wp-admin2,206 ▲185.85 ▲0.96113.33 ▲13.2141.97 ▲0.01
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0435.74 ▼6.2736.74 ▲1.72
Add New Post /wp-admin/post-new.php1,519 ▼923.52 ▲5.25656.84 ▲53.4351.04 ▲0.56
Media Library /wp-admin/upload.php1,391 ▲34.20 ▲0.0099.62 ▲3.2643.24 ▼0.67

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however 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
The following issues need your attention
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/qr-payments-via-paypal/nor1m-paypal-qr-payment.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/qr-payments-via-paypal/includes/class-npqp-form-invoice-data.php:4
    • > PHP Notice
      Undefined variable: order in wp-content/plugins/qr-payments-via-paypal/includes/class-npqp-form-invoice-data.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/qr-payments-via-paypal/includes/class-npqp-form-fields.php:4

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

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: Please add images for these screenshots: #1 (Settings), #2 (API Credentials), #3 (QR code settings), #4 (Invoice details), #5 (Invoicer data), #6 (Invoicer data), #7 (Term/Custom amount), #8 (Tax/Configuration), #9 (Checkout), #10 (QR code)
The official readme.txt is a good inspiration

qr-payments-via-paypal/nor1m-paypal-qr-payment.php 92% from 13 tests

The principal PHP file in "WooCommerce Qr payments via PayPal" v. 0.9 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("qr-payments-via-paypal.php" instead of "nor1m-paypal-qr-payment.php")

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
There were no executable files found in this plugin1,840 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP5157681,148
JSON100254
PO File1104109232
JavaScript6256117
CSS26087
Markdown1002

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity17.67
▷ Minimum class complexity7.00
▷ Maximum class complexity23.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods22
▷ Static methods00.00%
▷ Public methods22100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions1285.71%
▷ Anonymous functions214.29%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
10 PNG files occupy 0.99MB with 0.38MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png103.77KB61.84KB▼ 40.41%
screenshot-7.png95.58KB60.27KB▼ 36.95%
screenshot-9.png101.27KB63.01KB▼ 37.78%
screenshot-3.png92.06KB59.40KB▼ 35.47%
screenshot-8.png110.37KB62.64KB▼ 43.25%