83% sqrip-swiss-qr-invoice

Code Review | sqrip.ch

WordPress plugin sqrip.ch scored83%from 54 tests.

About plugin

  • Plugin page: sqrip-swiss-qr-in...
  • Plugin version: 1.7.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2
  • WordPress version: 6.3.1
  • First release: Aug 31, 2021
  • Latest release: Jun 5, 2023
  • Number of updates: 43
  • Update frequency: every 15.2 days
  • Top authors: sqrip (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /5,258 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

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

A check of server-side resources used by sqrip.ch
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0034.38 ▼3.89
Dashboard /wp-admin3.31 ▼0.0446.85 ▼13.15
Posts /wp-admin/edit.php3.36 ▲0.0046.63 ▼1.18
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.37 ▼15.70
Media Library /wp-admin/upload.php3.23 ▲0.0036.77 ▲0.58

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for sqrip.ch
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.34 ▲0.311.59 ▼0.0242.89 ▲2.89
Dashboard /wp-admin2,198 ▲185.61 ▼0.0483.37 ▼7.1937.01 ▲0.73
Posts /wp-admin/edit.php2,097 ▼31.97 ▼0.0536.40 ▼0.9632.90 ▼6.19
Add New Post /wp-admin/post-new.php1,526 ▼023.05 ▲0.09614.87 ▼7.1353.67 ▼9.82
Media Library /wp-admin/upload.php1,403 ▼04.27 ▲0.03103.94 ▼3.7944.71 ▼1.12

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sqrip-swiss-qr-invoice/inc/sqrip-ajax.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sqrip_get_plugin_option() in wp-content/plugins/sqrip-swiss-qr-invoice/inc/class-sqrip-media-cleaner.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/sqrip-swiss-qr-invoice/inc/countries-array.php:5
    • > Onetime script executed on
      2023-10-22 08:37:07

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Tags: You are using too many tags: 18 tag instead of maximum 10
You can take inspiration from this readme.txt

sqrip-swiss-qr-invoice/sqrip-woocommerce.php 85% from 13 tests

"sqrip.ch" version 1.7.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sqrip-swiss-qr-invoice.php" instead of "sqrip-woocommerce.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 147 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin3,288 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP76463862,192
JavaScript314438776
CSS27835318
Markdown1102

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity32.00
▷ Minimum class complexity10.00
▷ Maximum class complexity54.00
Average method complexity3.82
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods22
▷ Static methods00.00%
▷ Public methods22100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions55
▷ Named functions4989.09%
▷ Anonymous functions610.91%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/payment_confirmed.png6.43KB5.26KB▼ 18.13%
css/payment_confirmed_blue.png14.14KB3.85KB▼ 72.78%