77% wooplatnica

Code Review | Wooplatnica

WordPress plugin Wooplatnica scored77%from 54 tests.

About plugin

  • Plugin page: wooplatnica
  • Plugin version: 1.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.2
  • WordPress version: 6.3.1
  • First release: Sep 21, 2017
  • Latest release: Apr 26, 2023
  • Number of updates: 30
  • Update frequency: every 68.1 days
  • Top authors: Avram (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

300+ active /3,106 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

Server-side resources used by Wooplatnica
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.85 ▲2.48
Dashboard /wp-admin3.31 ▲0.0047.29 ▼3.86
Posts /wp-admin/edit.php3.36 ▲0.0050.62 ▼2.80
Add New Post /wp-admin/post-new.php5.89 ▲0.0099.61 ▼8.05
Media Library /wp-admin/upload.php3.23 ▲0.0040.17 ▲4.05

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Wooplatnica
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.37 ▼0.031.63 ▼0.0839.86 ▼4.89
Dashboard /wp-admin2,195 ▲175.61 ▼0.1084.27 ▼23.6638.56 ▼7.83
Posts /wp-admin/edit.php2,100 ▲32.02 ▲0.0240.94 ▲3.5236.24 ▲2.13
Add New Post /wp-admin/post-new.php1,423 ▼10817.87 ▼5.14613.92 ▼72.7249.39 ▼6.92
Media Library /wp-admin/upload.php1,400 ▼34.23 ▲0.05122.33 ▲16.7344.91 ▼5.37

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
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/wooplatnica/wooplatnica.php
  • 453× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\MpdfException' not found in wp-content/plugins/wooplatnica/vendor/mpdf/mpdf/src/Barcode/BarcodeException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Endroid\\QrCode\\Label\\Font\\FontInterface' not found in wp-content/plugins/wooplatnica/vendor/endroid/qr-code/src/Label/Font/Font.php:7
    • > PHP Fatal error
      Trait 'Mpdf\\Strict' not found in wp-content/plugins/wooplatnica/vendor/mpdf/mpdf/src/Writer/PageWriter.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wooplatnica/vendor/bacon/bacon-qr-code/test/Common/VersionTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/wooplatnica/vendor/setasign/fpdi/src/PdfParser/Type/PdfNumeric.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'BaconQrCode\\Renderer\\Eye\\EyeInterface' not found in wp-content/plugins/wooplatnica/vendor/bacon/bacon-qr-code/src/Renderer/Eye/SimpleCircleEye.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Log\\LoggerInterface' not found in wp-content/plugins/wooplatnica/vendor/psr/log/Psr/Log/AbstractLogger.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/wooplatnica/vendor/setasign/fpdi/src/PdfParser/Type/PdfNull.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Barcode\\AbstractBarcode' not found in wp-content/plugins/wooplatnica/vendor/mpdf/mpdf/src/Barcode/Msi.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/wooplatnica/vendor/mpdf/mpdf/src/Tag/BlockQuote.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Odabir načina plaćanja), #2 (Generisana PDF uplatnica), #3 (Generisani NBS IPS QR kôd)
Please take inspiration from this readme.txt

wooplatnica/wooplatnica.php Passed 13 tests

"Wooplatnica" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
83 characters long description:
Generisanje opšte uplatnice i NBS IPS QR kôda za uplate iz Srbije, u PDF formatu.

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin100,752 lines of code in 791 files:
LanguageFilesBlank linesComment linesLines of code
PHP73316,38319,02695,715
Markdown211,12602,646
JSON18001,606
CSS26518405
YAML11744273
XML5110104
Bourne Shell1203

PHP code 0% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 7,024)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 460)
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity31.54
▷ Minimum class complexity1.00
▷ Maximum class complexity7,024.00
Average method complexity8.06
▷ Minimum method complexity1.00
▷ Maximum method complexity460.00
Code structure
Namespaces97
Interfaces58
Traits8
Classes579
▷ Abstract classes203.45%
▷ Concrete classes55996.55%
▷ Final classes14025.04%
Methods2,986
▷ Static methods30710.28%
▷ Public methods2,57586.24%
▷ Protected methods1153.85%
▷ Private methods2969.91%
Functions72
▷ Named functions79.72%
▷ Anonymous functions6590.28%
Constants562
▷ Global constants61.07%
▷ Class constants55698.93%
▷ Public constants46082.73%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
7 PNG files occupy 0.53MB with 0.25MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png143.93KB36.69KB▼ 74.51%
screenshot-3.png62.15KB61.42KB▼ 1.18%
assets/ips_logo.png4.93KB2.48KB▼ 49.79%
screenshot-2.png288.65KB90.34KB▼ 68.70%
vendor/bacon/bacon-qr-code/test/Integration/__snapshots__/files/ImagickRenderingTest__testGenericQrCode__1.png3.04KB1.72KB▼ 43.30%