78% croatian-payment-slip-generator-for-woocommerce

Code Review | Croatian payment slip generator for WooCommerce

WordPress plugin Croatian payment slip generator for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: croatian-payment-...
  • Plugin version: 1.7.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Oct 8, 2019
  • Latest release: Apr 2, 2022
  • Number of updates: 71
  • Update frequency: every 12.8 days
  • Top authors: marlevak (78.87%)zeko868 (22.54%)

Code review

54 tests

User reviews

9 reviews

Install metrics

400+ active /5,147 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼0.79ms] Passed 4 tests

An overview of server-side resources used by Croatian payment slip generator for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.37 ▼1.45
Dashboard /wp-admin3.31 ▲0.0058.17 ▲3.59
Posts /wp-admin/edit.php3.36 ▲0.0051.17 ▲2.13
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.30 ▼5.89
Media Library /wp-admin/upload.php3.23 ▲0.0036.26 ▲2.05

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Croatian payment slip generator for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.29 ▲0.061.89 ▲0.1342.06 ▼0.20
Dashboard /wp-admin2,195 ▲185.64 ▼0.0493.78 ▲2.3438.22 ▼5.60
Posts /wp-admin/edit.php2,100 ▼31.99 ▼0.0339.65 ▼5.2935.38 ▼2.91
Add New Post /wp-admin/post-new.php1,534 ▼1123.26 ▲0.10646.79 ▲27.1453.84 ▼2.66
Media Library /wp-admin/upload.php1,397 ▲64.23 ▲0.0593.31 ▼14.1742.90 ▼1.49

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
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

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 | 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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/croatian-payment-slip-generator-for-woocommerce/Wooplatnica_Initializer.php
  • 139× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'BigFish\\PDF417\\EncoderInterface' not found in wp-content/plugins/croatian-payment-slip-generator-for-woocommerce/vendor/bigfish/pdf417/src/Encoders/NumberEncoder.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Intervention\\Image\\File' not found in wp-content/plugins/croatian-payment-slip-generator-for-woocommerce/vendor/intervention/image/src/Intervention/Image/Image.php:56
    • > PHP Fatal error
      Uncaught Error: Class 'Intervention\\Image\\AbstractEncoder' not found in wp-content/plugins/croatian-payment-slip-generator-for-woocommerce/vendor/intervention/image/src/Intervention/Image/Gd/Encoder.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Intervention\\Image\\Exception\\ImageException' not found in wp-content/plugins/croatian-payment-slip-generator-for-woocommerce/vendor/intervention/image/src/Intervention/Image/Exception/NotWritableException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/croatian-payment-slip-generator-for-woocommerce/vendor/guzzlehttp/psr7/src/LimitStream.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Intervention\\Image\\Commands\\AbstractCommand' not found in wp-content/plugins/croatian-payment-slip-generator-for-woocommerce/vendor/intervention/image/src/Intervention/Image/Gd/Commands/InvertCommand.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Intervention\\Image\\Commands\\AbstractCommand' not found in wp-content/plugins/croatian-payment-slip-generator-for-woocommerce/vendor/intervention/image/src/Intervention/Image/Gd/Commands/ResetCommand.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Intervention\\Image\\Commands\\AbstractCommand' not found in wp-content/plugins/croatian-payment-slip-generator-for-woocommerce/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/BrightnessCommand.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/croatian-payment-slip-generator-for-woocommerce/vendor/guzzlehttp/psr7/src/DroppingStream.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Intervention\\Image\\Commands\\AbstractCommand' not found in wp-content/plugins/croatian-payment-slip-generator-for-woocommerce/vendor/intervention/image/src/Intervention/Image/Gd/Commands/MaskCommand.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 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
9 plugin tags: hrvatska, opa uplatnica, woocommerce, virman, croatia...

croatian-payment-slip-generator-for-woocommerce/Wooplatnica_Initializer.php 92% from 13 tests

Analyzing the main PHP file in "Croatian payment slip generator for WooCommerce" version 1.7.1
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("croatian-payment-slip-generator-for-woocommerce.php" instead of "Wooplatnica_Initializer.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin16,570 lines of code in 260 files:
LanguageFilesBlank linesComment linesLines of code
PHP2203,0276,84514,259
Markdown105190906
JSON1300688
PO File1785257
CSS200182
JavaScript567600147
YAML8263116
XML12015

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity9.78
▷ Minimum class complexity1.00
▷ Maximum class complexity337.00
Average method complexity2.91
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces19
Interfaces16
Traits2
Classes175
▷ Abstract classes84.57%
▷ Concrete classes16795.43%
▷ Final classes95.39%
Methods981
▷ Static methods838.46%
▷ Public methods80582.06%
▷ Protected methods798.05%
▷ Private methods979.89%
Functions72
▷ Named functions3954.17%
▷ Anonymous functions3345.83%
Constants45
▷ Global constants12.22%
▷ Class constants4497.78%
▷ Public constants44100.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.11MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/payment-slip-template-hub-3a.png52.66KB42.82KB▼ 18.68%
assets/images/payment-slip-template-hub-3.png59.88KB50.20KB▼ 16.16%