67% fakturo

Code Review | Fakturo

WordPress plugin Fakturo scored 67% from 54 tests.

About plugin

  • Plugin page: fakturo
  • Plugin version: 0.9.1 Beta...
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.1.1
  • WordPress version: 5.9.2
  • First release: Sep 9, 2016
  • Latest release: Apr 18, 2019
  • Number of updates: 16
  • Update frequency: every 60.7 days
  • Top authors: etruel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,789 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: ▲3.91MB] [CPU: ▼293.96ms] Passed 4 tests

A check of server-side resources used by Fakturo
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /7.43 ▲3.9273.65 ▲23.58
Dashboard /wp-admin7.31 ▲3.9154.98 ▲20.95
Posts /wp-admin/edit.php7.61 ▲3.9758.43 ▲17.67
Add New Post /wp-admin/post-new.php10.84 ▲3.87117.63 ▼1,238.04
Media Library /wp-admin/upload.php7.26 ▲3.9648.93 ▲24.04
Fakturo News /wp-admin/index.php?page=fakturo-about7.2341.00
Settings /wp-admin/admin.php?page=fakturo-settings-system7.2545.86
Dashboard /wp-admin/admin.php?page=fakturo_dashboard7.2440.71
Providers /wp-admin/edit.php?post_type=fktr_provider7.3045.91
Receipts /wp-admin/edit.php?post_type=fktr_receipt7.3143.27
Clients /wp-admin/edit.php?post_type=fktr_client7.3048.23
Products /wp-admin/edit.php?post_type=fktr_product7.3149.90
Add New Receipt /wp-admin/post-new.php?post_type=fktr_receipt7.5688.91
Settings /wp-admin/admin.php?page=fakturo-settings7.2453.75
Invoices /wp-admin/edit.php?post_type=fktr_sale7.3153.45

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 319 new files
Database: no new tables, 9 new options
New WordPress options
fktr_last_mananger_caps
fakturo_redirects
fktr_countries_children
last_receipt_number
fktr_db_version
fakturo_dashboard_options_group
fakturo_system_options_group
fakturo_info_options_group
fktr_last_seller_caps

Browser metrics Passed 4 tests

A check of browser resources used by Fakturo
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,017 ▲26316.01 ▲0.336.77 ▲0.342.54 ▼0.25
Dashboard /wp-admin3,118 ▲2576.19 ▲0.02135.06 ▼2.56158.90 ▼7.30
Posts /wp-admin/edit.php2,872 ▲1783.25 ▲0.0369.14 ▲5.21190.46 ▲46.27
Add New Post /wp-admin/post-new.php1,762 ▲10120.85 ▲4.71505.55 ▲83.46160.62 ▼38.45
Media Library /wp-admin/upload.php1,888 ▲1905.55 ▲0.02148.20 ▲6.68196.84 ▲5.07
Fakturo News /wp-admin/index.php?page=fakturo-about1,3942.3867.39179.29
Settings /wp-admin/admin.php?page=fakturo-settings-system2,8144.1590.50204.20
Dashboard /wp-admin/admin.php?page=fakturo_dashboard1,3832.4957.85176.31
Providers /wp-admin/edit.php?post_type=fktr_provider1,8433.1874.20149.02
Receipts /wp-admin/edit.php?post_type=fktr_receipt1,8953.2067.22117.43
Clients /wp-admin/edit.php?post_type=fktr_client1,8353.1862.92115.82
Products /wp-admin/edit.php?post_type=fktr_product2,0402.9561.62114.63
Add New Receipt /wp-admin/post-new.php?post_type=fktr_receipt3,0244.61115.66191.12
Settings /wp-admin/admin.php?page=fakturo-settings2,2103.7484.01137.41
Invoices /wp-admin/edit.php?post_type=fktr_sale1,9783.21149.84136.92

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 9 options in the database
    • fktr_last_mananger_caps
    • fakturo_info_options_group
    • fktr_db_version
    • fktr_last_seller_caps
    • fakturo_system_options_group
    • last_receipt_number
    • fakturo_dashboard_options_group
    • fakturo_redirects
    • fktr_countries_children

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/fakturo/includes/libs/dompdf/load_font.php
  • 149× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Block_Frame_Reflower' not found in wp-content/plugins/fakturo/includes/libs/dompdf/include/table_cell_frame_reflower.cls.php:15
    • > PHP Warning
      Use of undefined constant DOMPDF_DIR - assumed 'DOMPDF_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/fakturo/includes/libs/dompdf/lib/fonts/dompdf_font_family_cache.dist.php on line 61
    • > PHP Warning
      Use of undefined constant DOMPDF_DIR - assumed 'DOMPDF_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/fakturo/includes/libs/dompdf/lib/fonts/dompdf_font_family_cache.dist.php on line 55
    • > PHP Fatal error
      Uncaught Error: Class 'Frame_Decorator' not found in wp-content/plugins/fakturo/includes/libs/dompdf/include/inline_frame_decorator.cls.php:16
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/fakturo/includes/libs/dompdf/include/stylesheet.cls.php on line 1102
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/fakturo/docs/fktr_email_template-help.php:16
    • > PHP Warning
      require_once(DOMPDF_LIB_DIR/class.pdf.php): failed to open stream: No such file or directory in wp-content/plugins/fakturo/includes/libs/dompdf/include/font_metrics.cls.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'Frame_Reflower' not found in wp-content/plugins/fakturo/includes/libs/dompdf/include/page_frame_reflower.cls.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Abstract_Renderer' not found in wp-content/plugins/fakturo/includes/libs/dompdf/include/list_bullet_renderer.cls.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Positioner' not found in wp-content/plugins/fakturo/includes/libs/dompdf/include/list_bullet_positioner.cls.php:16

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 errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Donate link: Please fix this invalid URI: ""
  • Screenshots: Screenshot #1 (Adding a Product.) image not found
  • Tags: Too many tags (25 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

fakturo/fakturo.php 92% from 13 tests

The main PHP script in "Fakturo" version 0.9.1 Beta... is automatically included on every request by WordPress
It is important to fix the following:
  • Version: The version number should be digits and periods (ex. "1.0.3" instead of "0.9.1 Beta...")

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
These items require your attention
  • 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
85,939 lines of code in 280 files:
LanguageFilesBlank linesComment linesLines of code
PHP1658,69312,27543,836
JavaScript565,8634,33933,392
PO File11,2831,7203,116
CSS25263962,365
HTML21254731,500
ActionScript5154354903
Markdown42960771
JSON22054
Bourne Shell1222

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 653)
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity46.94
▷ Minimum class complexity1.00
▷ Maximum class complexity766.00
Average method complexity4.72
▷ Minimum method complexity1.00
▷ Maximum method complexity653.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes124
▷ Abstract classes43.23%
▷ Concrete classes12096.77%
▷ Final classes00.00%
Methods1,582
▷ Static methods56335.59%
▷ Public methods1,40488.75%
▷ Protected methods1318.28%
▷ Private methods472.97%
Functions86
▷ Named functions86100.00%
▷ Anonymous functions00.00%
Constants95
▷ Global constants1313.68%
▷ Class constants8286.32%
▷ Public constants82100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
9 PNG files occupy 0.44MB with 0.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon-256x256.png9.42KB4.57KB▼ 51.53%
screenshot-2.png77.02KB29.51KB▼ 61.68%
assets/images/etruel-logo.png6.80KB3.87KB▼ 43.07%
includes/libs/dompdf/lib/res/broken_image.png0.60KB0.47KB▼ 22.33%
screenshot-5.png73.63KB27.83KB▼ 62.20%