62% facto-facturacioacuten-electroacutenica

Code Review | FACTO - Facturación Electrónica

WordPress plugin FACTO - Facturación Electrónica scored62%from 54 tests.

About plugin

  • Plugin page: facto-facturacioa...
  • Plugin version: 2.4.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.4
  • WordPress version: 6.3.1
  • First release: Mar 6, 2018
  • Latest release: Nov 20, 2023
  • Number of updates: 124
  • Update frequency: every 16.9 days
  • Top authors: factocl (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

500+ active /11,500 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.26MB] [CPU: ▲1.98ms] Passed 4 tests

Server-side resources used by FACTO - Facturación Electrónica
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2638.92 ▼5.47
Dashboard /wp-admin3.57 ▲0.2652.99 ▲2.67
Posts /wp-admin/edit.php3.69 ▲0.3253.17 ▲6.72
Add New Post /wp-admin/post-new.php6.15 ▲0.2696.23 ▲5.97
Media Library /wp-admin/upload.php3.49 ▲0.2637.88 ▲4.74
FACTO /wp-admin/admin.php?page=facto_settings3.4434.93

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 27 new files
Database: 2 new tables, 7 new options
New tables
wp_facto_order_mp
wp_facto_log
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded
facto_webservice_mode
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for FACTO - Facturación Electrónica
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4214.72 ▲0.361.60 ▼0.0135.75 ▼7.98
Dashboard /wp-admin2,212 ▲355.63 ▲0.0295.17 ▲2.1542.77 ▼3.24
Posts /wp-admin/edit.php2,115 ▲122.15 ▲0.1940.73 ▲4.6537.23 ▲6.85
Add New Post /wp-admin/post-new.php1,540 ▲1423.58 ▲0.32606.96 ▲2.3750.25 ▼6.25
Media Library /wp-admin/upload.php1,408 ▲54.18 ▼0.1097.47 ▲1.5345.07 ▲2.24
FACTO /wp-admin/admin.php?page=facto_settings9242.1426.2327.98

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie tables detected upon uninstall: 2 tables
    • wp_facto_order_mp
    • wp_facto_log
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • facto_webservice_mode
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=facto_settings
    • > Notice in wp-content/plugins/facto-facturacioacuten-electroacutenica/factofacturacionelectronica_admin.php+768
    Undefined index: tab

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'nusoap_base' not found in wp-content/plugins/facto-facturacioacuten-electroacutenica/nusoap/class.soap_server.php:16
    • > PHP Fatal error
      require_once(): Failed opening required 'Mail/mimeDecode.php' (include_path='.:/usr/share/php') in wp-content/plugins/facto-facturacioacuten-electroacutenica/nusoap/nusoapmime.php on line 42
    • > PHP Fatal error
      Uncaught Error: Class 'nusoap_base' not found in wp-content/plugins/facto-facturacioacuten-electroacutenica/nusoap/class.soapclient.php:26
    • > PHP Warning
      require_once(Mail/mimeDecode.php): failed to open stream: No such file or directory in wp-content/plugins/facto-facturacioacuten-electroacutenica/nusoap/nusoapmime.php on line 42
    • > PHP Fatal error
      Uncaught Error: Class 'nusoap_base' not found in wp-content/plugins/facto-facturacioacuten-electroacutenica/nusoap/class.soap_parser.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'nusoap_base' not found in wp-content/plugins/facto-facturacioacuten-electroacutenica/nusoap/class.soap_fault.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'nusoap_base' not found in wp-content/plugins/facto-facturacioacuten-electroacutenica/nusoap/class.xmlschema.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'nusoap_base' not found in wp-content/plugins/facto-facturacioacuten-electroacutenica/nusoap/class.soap_transport_http.php:15

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=facto_settings
    • > Javascript (severe) in unknown
    /wp-content/plugins/facto-facturacioacuten-electroacutenica/js/factofacturacionelectronica_admin.js?ver=6.3.1 19:53 Uncaught TypeError: Cannot set properties of null (setting 'onclick')

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 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
These attributes need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === facto-facturacioacuten-electroacutenica === )
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3, #4, #5, #6, #7, #8 in facto-facturacioacuten-electroacutenica/assets to your readme.txt
You can look at the official readme.txt

facto-facturacioacuten-electroacutenica/factofacturacionelectronica.php 92% from 13 tests

The primary PHP file in "FACTO - Facturación Electrónica" version 2.4.3 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("facto-facturacioacuten-electroacutenica.php" instead of "factofacturacionelectronica.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin11,693 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP161,6205,47911,458
JavaScript385235233
Markdown1002

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity69.03
▷ Minimum class complexity1.00
▷ Maximum class complexity387.00
Average method complexity8.38
▷ Minimum method complexity1.00
▷ Maximum method complexity82.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes33
▷ Abstract classes00.00%
▷ Concrete classes33100.00%
▷ Final classes00.00%
Methods304
▷ Static methods113.62%
▷ Public methods30299.34%
▷ Protected methods20.66%
▷ Private methods00.00%
Functions37
▷ Named functions37100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.29MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/config_imp_especificos.png106.76KB41.14KB▼ 61.47%
images/facto-isotipo.png30.37KB13.81KB▼ 54.54%
images/admin_facto.png111.01KB40.45KB▼ 63.56%
images/facto-logo.png12.98KB6.42KB▼ 50.55%
images/config_imp_especificos_detalle.png39.68KB19.10KB▼ 51.88%