78% kpir

Code Review | KPiR

WordPress plugin KPiR scored78%from 54 tests.

About plugin

  • Plugin page: kpir
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.2
  • WordPress version: 6.3.1
  • First release: Feb 18, 2018
  • Latest release: Jun 7, 2023
  • Number of updates: 37
  • Update frequency: every 55.0 days
  • Top authors: iworks (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,440 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.65MB] [CPU: ▼0.70ms] Passed 4 tests

A check of server-side resources used by KPiR
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.12 ▲0.6647.45 ▲6.99
Dashboard /wp-admin4.00 ▲0.7056.67 ▲3.17
Posts /wp-admin/edit.php4.05 ▲0.6956.60 ▲4.65
Add New Post /wp-admin/post-new.php6.51 ▲0.6392.61 ▼13.75
Media Library /wp-admin/upload.php3.85 ▲0.6341.62 ▲3.12
JPK V7M /wp-admin/edit.php?post_type=iworks_kpir_invoice&page=iworks_kpir_jpk_v7m3.9537.46
All Invoices /wp-admin/edit.php?post_type=iworks_kpir_invoice3.9741.84
Annually /wp-admin/edit.php?post_type=iworks_kpir_invoice&page=iworks_kpir_report_annually3.9738.52
Add New /wp-admin/post-new.php?post_type=iworks_kpir_invoice3.9649.35
Monthly /wp-admin/edit.php?post_type=iworks_kpir_invoice&page=iworks_kpir_report_monthly4.0240.33
Configuration /wp-admin/edit.php?post_type=iworks_kpir_invoice&page=iworks_kpir_index3.8942.40
Contractors /wp-admin/edit.php?post_type=iworks_kpir_contract3.9640.97

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 82 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
iworks_kpir_cache_stamp
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for KPiR
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,025 ▲27913.41 ▼0.972.20 ▲0.4844.37 ▲3.30
Dashboard /wp-admin2,397 ▲2065.88 ▲0.95100.85 ▼4.1239.00 ▼8.36
Posts /wp-admin/edit.php2,136 ▲472.04 ▲0.0537.30 ▼3.6131.43 ▼2.94
Add New Post /wp-admin/post-new.php1,571 ▲5723.62 ▲6.05683.60 ▲10.1263.62 ▲4.65
Media Library /wp-admin/upload.php1,429 ▲414.21 ▼0.16102.64 ▼1.0945.75 ▲0.52
JPK V7M /wp-admin/edit.php?post_type=iworks_kpir_invoice&page=iworks_kpir_jpk_v7m9002.3132.4226.39
All Invoices /wp-admin/edit.php?post_type=iworks_kpir_invoice1,1462.4637.1329.60
Annually /wp-admin/edit.php?post_type=iworks_kpir_invoice&page=iworks_kpir_report_annually8992.3332.8824.34
Add New /wp-admin/post-new.php?post_type=iworks_kpir_invoice2,0793.2966.6535.91
Monthly /wp-admin/edit.php?post_type=iworks_kpir_invoice&page=iworks_kpir_report_monthly8932.2730.0124.93
Configuration /wp-admin/edit.php?post_type=iworks_kpir_invoice&page=iworks_kpir_index2,6492.6542.9028.14
Contractors /wp-admin/edit.php?post_type=iworks_kpir_contract1,1132.4436.7128.84

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 22× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/kpir/template-parts/jpk/v7m-2/xml/footer.php
    • > /wp-content/plugins/kpir/template-parts/jpk/v7m-2/xml/expense.php
    • > /wp-content/plugins/kpir/template-parts/jpk/v7m-2/xml/head.php
    • > /wp-content/plugins/kpir/template-parts/jpk/v7m/xml/expenses-summary.php
    • > /wp-content/plugins/kpir/template-parts/jpk/v7m-2/xml/company.php
    • > /wp-content/plugins/kpir/template-parts/jpk/v7m-2/xml/income.php
    • > /wp-content/plugins/kpir/template-parts/jpk/v7m-2/xml/person.php
    • > /wp-content/plugins/kpir/template-parts/jpk/v7m/xml/header.php
    • > /wp-content/plugins/kpir/template-parts/jpk/v7m/xml/incomes-empty.php
    • > /wp-content/plugins/kpir/template-parts/jpk/v7m/xml/income.php
  • 139× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/kpir/template-parts/jpk/v7m-2/xml/income.php on line 6
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/kpir/template-parts/jpk/v7m-2/xml/expenses-summary.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/kpir/template-parts/jpk/v7m-2/xml/expense.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/kpir/template-parts/jpk/v7m/xml/expense.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/kpir/template-parts/jpk/v7m-2/xml/company.php on line 4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/kpir/template-parts/jpk/v7m-2/xml/company.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/kpir/template-parts/jpk/v7m-2/xml/head.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/kpir/template-parts/jpk/v7m-2/xml/person.php on line 4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/kpir/template-parts/jpk/v7m/xml/income.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/kpir/template-parts/jpk/v7m-2/xml/person.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: faktura, jpk, vat, ksigowo, kpir

kpir/kpir.php Passed 13 tests

Analyzing the main PHP file in "KPiR" version 1.0.0
38 characters long description:
Podatkowa Księga Przychodu i Rozchodu

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin6,882 lines of code in 58 files:
LanguageFilesBlank linesComment linesLines of code
PHP303431,1565,291
CSS144442883
JavaScript117694569
Sass350139

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 192)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity68.36
▷ Minimum class complexity16.00
▷ Maximum class complexity387.00
Average method complexity5.16
▷ Minimum method complexity1.00
▷ Maximum method complexity192.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes19.09%
▷ Concrete classes1090.91%
▷ Final classes00.00%
Methods178
▷ Static methods00.00%
▷ Public methods11464.04%
▷ Protected methods147.87%
▷ Private methods5028.09%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
12 PNG files occupy 0.07MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/iworks/options/assets/styles/images/ui-icons_555555_256x240.png6.91KB4.18KB▼ 39.47%
includes/iworks/options/assets/styles/images/ui-icons_777777_256x240.png6.94KB4.18KB▼ 39.78%
includes/iworks/options/assets/styles/images/ui-icons_444444_256x240.png6.92KB4.18KB▼ 39.61%
assets/externals/datepicker/css/images/ui-icons_555555_256x240.png6.82KB4.17KB▼ 38.82%
includes/iworks/options/assets/styles/images/ui-icons_777620_256x240.png4.51KB4.18KB▼ 7.28%