72% fakturo

Code Review | Fakturo

WordPress plugin Fakturo scored72%from 54 tests.

About plugin

  • Plugin page: fakturo
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.0.1
  • WordPress version: 6.3.1
  • First release: Sep 9, 2016
  • Latest release: Aug 3, 2022
  • Number of updates: 21
  • Update frequency: every 103.5 days
  • Top authors: etruel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /4,016 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.96MB] [CPU: ▼2.93ms] 75% from 4 tests

Server-side resources used by Fakturo
Please take the time to fix the following items
  • CPU: The total CPU usage must kept under 500.00ms (currently 1,757.63ms on /wp-admin/plugins.php?page=fakturo)
PageMemory (MB)CPU Time (ms)
Home /4.42 ▲0.9640.45 ▼1.53
Dashboard /wp-admin4.28 ▲0.9450.29 ▼10.15
Posts /wp-admin/edit.php4.40 ▲1.0451.16 ▲3.66
Add New Post /wp-admin/post-new.php6.86 ▲0.9884.89 ▼3.70
Media Library /wp-admin/upload.php4.19 ▲0.9641.66 ▲6.48
Add Client /wp-admin/post-new.php?post_type=fktr_client4.30113.02
Add New Receipt /wp-admin/post-new.php?post_type=fktr_receipt4.2979.76
Add Provider /wp-admin/post-new.php?post_type=fktr_provider4.3183.86
Dashboard /wp-admin/admin.php?page=fakturo_dashboard4.1932.73
Fakturo News /wp-admin/index.php?page=fakturo-about4.1634.89
Settings /wp-admin/admin.php?page=fakturo-settings-system4.1838.47
Category /wp-admin/edit-tags.php?taxonomy=fktr_category4.1944.55
Extensions /wp-admin/plugins.php?page=fakturo5.271,757.63
Add Product /wp-admin/post-new.php?post_type=fktr_product4.38101.09
Receipts /wp-admin/edit.php?post_type=fktr_receipt4.2646.63

Server storage [IO: ▲15.01MB] [DB: ▲0.03MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 575 new files
Database: no new tables, 15 new options
New WordPress options
can_compress_scripts
fakturo_redirects
widget_recent-comments
fakturo_info_options_group
fakturo_system_options_group
db_upgraded
fakturo_dashboard_options_group
last_receipt_number
fktr_countries_children
fktr_last_mananger_caps
...

Browser metrics Passed 4 tests

A check of browser resources used by Fakturo
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,184 ▲43414.36 ▲0.011.55 ▼0.1837.59 ▼2.63
Dashboard /wp-admin2,590 ▲4105.56 ▼0.1282.43 ▼18.2839.56 ▼3.04
Posts /wp-admin/edit.php2,426 ▲3232.05 ▲0.0835.72 ▼6.5838.28 ▲0.53
Add New Post /wp-admin/post-new.php1,661 ▲13323.26 ▲0.12647.01 ▼61.7953.53 ▲0.79
Media Library /wp-admin/upload.php1,812 ▲4154.24 ▲0.0698.17 ▼20.2443.52 ▼8.56
Add Client /wp-admin/post-new.php?post_type=fktr_client3,0854.57100.8758.85
Add New Receipt /wp-admin/post-new.php?post_type=fktr_receipt2,4443.4673.0843.42
Add Provider /wp-admin/post-new.php?post_type=fktr_provider2,8274.3382.6246.28
Dashboard /wp-admin/admin.php?page=fakturo_dashboard1,2582.0024.6832.77
Fakturo News /wp-admin/index.php?page=fakturo-about1,5552.1825.5378.74
Settings /wp-admin/admin.php?page=fakturo-settings-system2,4102.8657.8237.10
Category /wp-admin/edit-tags.php?taxonomy=fktr_category1,7902.2928.7535.03
Extensions /wp-admin/plugins.php?page=fakturo1,4932.1332.8429.87
Add Product /wp-admin/post-new.php?post_type=fktr_product3,1324.9394.0843.78
Receipts /wp-admin/edit.php?post_type=fktr_receipt1,6182.0235.1730.22

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 15 options in the database
    • widget_theysaidso_widget
    • fakturo_info_options_group
    • fktr_db_version
    • fakturo_dashboard_options_group
    • fktr_last_mananger_caps
    • last_receipt_number
    • widget_recent-posts
    • fakturo_redirects
    • theysaidso_admin_options
    • can_compress_scripts
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% 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
The following issues need your attention
  • 164× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameReflower\\Block' not found in wp-content/plugins/fakturo/includes/libs/dompdf/src/FrameReflower/TableCell.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameReflower\\AbstractFrameReflower' not found in wp-content/plugins/fakturo/includes/libs/dompdf/src/FrameReflower/ListBullet.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\BinaryStream' not found in wp-content/plugins/fakturo/includes/libs/dompdf/lib/php-font-lib/src/FontLib/Header.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/fakturo/docs/fktr_sale-help.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/fakturo/docs/edit-fktr_countries-help.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\TrueType\\File' not found in wp-content/plugins/fakturo/includes/libs/dompdf/lib/php-font-lib/src/FontLib/WOFF/File.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/fakturo/docs/fakturo_page_fakturo-settings-help.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Table\\DirectoryEntry' not found in wp-content/plugins/fakturo/includes/libs/dompdf/lib/php-font-lib/src/FontLib/WOFF/TableDirectoryEntry.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/fakturo/includes/libs/dompdf/src/FrameDecorator/Image.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\CSSList\\CSSList' not found in wp-content/plugins/fakturo/includes/libs/dompdf/lib/php-css-parser/lib/Sabberworm/CSS/CSSList/CSSBlockList.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Screenshots: Screenshot #1 (Adding a Product.) image missing
  • Donate link: Invalid URI ("")
  • Tags: There are too many tags (25 tag instead of maximum 10)
The official readme.txt might help

fakturo/fakturo.php Passed 13 tests

This is the main PHP file of "Fakturo" version 1.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
81 characters long description:
Make invoices with products and clients. If you like it, please rate it 5 stars.

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Almost there! Just fix the following issues
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .as - Adobe Flash ActionScript File in Adobe Flash
      • wp-content/plugins/fakturo/assets/js/webcamjs-master/flash/mx/utils/Base64Encoder.as
      • wp-content/plugins/fakturo/assets/js/webcamjs-master/flash/com/adobe/images/BitString.as
      • wp-content/plugins/fakturo/assets/js/webcamjs-master/flash/com/adobe/images/JPGEncoder.as
      • wp-content/plugins/fakturo/assets/js/webcamjs-master/flash/com/adobe/images/PNGEncoder.as
      • wp-content/plugins/fakturo/assets/js/webcamjs-master/flash/Webcam.as
136,483 lines of code in 465 files:
LanguageFilesBlank linesComment linesLines of code
PHP26911,66117,33991,572
JavaScript1165,8874,41533,318
PO File11,3011,6863,268
CSS264461042,979
HTML24192752,451
Markdown1054401,617
ActionScript5154354903
JSON720204
XML322113
YAML28248
SVG1008
Bourne Shell1222

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
It is recommended to fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 652)
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity38.93
▷ Minimum class complexity1.00
▷ Maximum class complexity807.00
Average method complexity4.45
▷ Minimum method complexity1.00
▷ Maximum method complexity652.00
Code structure
Namespaces31
Interfaces5
Traits0
Classes222
▷ Abstract classes125.41%
▷ Concrete classes21094.59%
▷ Final classes00.00%
Methods2,568
▷ Static methods62924.49%
▷ Public methods2,26288.08%
▷ Protected methods2288.88%
▷ Private methods783.04%
Functions51
▷ Named functions3568.63%
▷ Anonymous functions1631.37%
Constants190
▷ Global constants84.21%
▷ Class constants18295.79%
▷ Public constants182100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
12 PNG files occupy 0.62MB with 0.37MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/default_product.png103.13KB35.66KB▼ 65.42%
screenshot-4.png62.23KB24.86KB▼ 60.06%
assets/images/about-header.png11.72KB5.26KB▼ 55.15%
assets/images/demo.png80.45KB28.52KB▼ 64.55%
screenshot-5.png79.07KB37.62KB▼ 52.43%