83% lfecfdi-para-woocommerce

Code Review | LFECFDI para Woocommerce

WordPress plugin LFECFDI para Woocommerce scored83%from 54 tests.

About plugin

  • Plugin page: lfecfdi-para-wooc...
  • Plugin version: 8.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.3-6.2
  • WordPress version: 6.3.1
  • First release: May 9, 2017
  • Latest release: May 31, 2023
  • Number of updates: 477
  • Update frequency: every 4.6 days
  • Top authors: realvirtualmx (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /7,371 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: ▲4.17MB] [CPU: ▲8.83ms] Passed 4 tests

An overview of server-side resources used by LFECFDI para Woocommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /7.84 ▲4.3859.77 ▲10.10
Dashboard /wp-admin7.86 ▲4.5166.77 ▲0.24
Posts /wp-admin/edit.php7.86 ▲4.5067.33 ▲17.34
Add New Post /wp-admin/post-new.php9.15 ▲3.27111.06 ▲7.62
Media Library /wp-admin/upload.php7.86 ▲4.6357.31 ▲21.19

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 48 new files
Database: no new tables, 73 new options
New WordPress options
rvcfdi_observacion
can_compress_scripts
rvcfdi_unidad_medida_shipping
rvcfdi_color_boton
rvcfdi_idioma
widget_recent-posts
rvcfdi_metodo_pago_seleccionar
rvcfdi_mensajeErrorCliente
rvcfdi_color_fondo_formulario
rvcfdi_manejo_impuestos_pedido
...

Browser metrics Passed 4 tests

LFECFDI para Woocommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,901 ▲11513.47 ▼1.048.36 ▲6.1036.13 ▼10.77
Dashboard /wp-admin2,203 ▲235.66 ▲0.0090.93 ▲1.8643.13 ▲1.38
Posts /wp-admin/edit.php2,111 ▲112.03 ▲0.0041.44 ▲3.4536.85 ▼2.01
Add New Post /wp-admin/post-new.php1,537 ▲923.13 ▼0.37631.42 ▼39.1857.49 ▲1.78
Media Library /wp-admin/upload.php1,411 ▲114.25 ▲0.1197.87 ▼10.8741.73 ▼7.90

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
  • The uninstall procedure has failed, leaving 73 options in the database
    • rvcfdi_claveEmisor
    • rvcfdi_informacionGlobal_meses
    • rvcfdi_color_texto_boton_generarcfdi
    • rvcfdi_emailNotificacionErrorAutomatico
    • rvcfdi_color_texto_formulario
    • rvcfdi_observacion
    • rvcfdi_moneda
    • rvcfdi_uso_cfdi
    • rvcfdi_informacionGlobal_año
    • rvcfdi_metodo_pago
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/lfecfdi-para-woocommerce/lasfacturaselectronicas_woocommerce.php:47

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes: Please take inspiration from this readme.txt

lfecfdi-para-woocommerce/lasfacturaselectronicas_woocommerce.php 85% from 13 tests

"LFECFDI para Woocommerce" version 8.1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Domain Path: The domain path folder does not exist ("/languages/")
  • Main file name: Name the main plugin file the same as the plugin slug ("lfecfdi-para-woocommerce.php" instead of "lasfacturaselectronicas_woocommerce.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin26,020 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP123,15359722,614
JavaScript35701192,879
CSS26835527

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 124)
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity53.64
▷ Minimum class complexity3.00
▷ Maximum class complexity396.00
Average method complexity12.35
▷ Minimum method complexity1.00
▷ Maximum method complexity124.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods51
▷ Static methods5098.04%
▷ Public methods51100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions86
▷ Named functions86100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
25 PNG files occupy 0.30MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
imagenes/guia3.png9.17KB4.84KB▼ 47.20%
assets/Logo-RV-16.png2.35KB2.34KB0.21%
assets/realvirtual_woocommerce_envioxml_img.png9.66KB4.44KB▼ 54.08%
(invalid) assets/realvirtual_woocommerce_xml.PNG0.45KB0.00KB▼ 100.00%
assets/realvirtual_woocommerce_excel.png0.62KB0.71KB0.00%