63% factura-electronica-cr

Code Review | Facturación Electrónica Costa Rica

WordPress plugin Facturación Electrónica Costa Rica scored 63% from 54 tests.

About plugin

  • Plugin page: factura-electroni...
  • Plugin version: 1.4.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.1
  • WordPress version: 6.3.1
  • First release: Oct 12, 2020
  • Latest release: Sep 20, 2023
  • Number of updates: 37
  • Update frequency: every 29.1 days
  • Top authors: facturadorvirtual (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 1,370 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▼1.17MB] [CPU: ▼47.88ms] Passed 4 tests

An overview of server-side resources used by Facturación Electrónica Costa Rica
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.81 ▼0.659.64 ▼34.43
Dashboard /wp-admin2.84 ▼0.4611.19 ▼36.77
Posts /wp-admin/edit.php2.84 ▼0.529.39 ▼40.90
Add New Post /wp-admin/post-new.php2.84 ▼3.059.42 ▼79.43
Media Library /wp-admin/upload.php2.84 ▼0.399.55 ▼24.25

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 19 new files
Database: 1 new table, 10 new options
New tables
wp_fvcr_logs
New WordPress options
widget_recent-posts
fvcr_emitir_fe
fvcr_db_version
widget_recent-comments
widget_theysaidso_widget
fvcr_afectar_inventario
can_compress_scripts
theysaidso_admin_options
db_upgraded
fvcr_emitir_te

Browser metrics Passed 4 tests

Checking browser requirements for Facturación Electrónica Costa Rica
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.43 ▼0.871.71 ▼0.0138.97 ▼4.54
Dashboard /wp-admin2,229 ▲385.99 ▲0.09101.16 ▲2.3539.23 ▼5.22
Posts /wp-admin/edit.php2,115 ▲232.47 ▲0.4239.79 ▼0.0736.43 ▲0.03
Add New Post /wp-admin/post-new.php1,535 ▲2123.53 ▲5.94679.51 ▼8.5652.83 ▲2.58
Media Library /wp-admin/upload.php1,408 ▲204.44 ▲0.22118.93 ▲10.6042.60 ▼0.91

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_fvcr_logs
  • Zombie WordPress options were found after uninstall: 10 options
    • fvcr_emitir_fe
    • fvcr_emitir_te
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • fvcr_afectar_inventario
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • fvcr_db_version

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function FVCR\\current_user_can() in wp-content/plugins/factura-electronica-cr/admin/log_tecnico.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function FVCR\\current_user_can() in wp-content/plugins/factura-electronica-cr/admin/configuration.php:4
    • > PHP Warning
      require_once(FVCR_PLUGIN_ROUTEhelpers.php): failed to open stream: No such file or directory in wp-content/plugins/factura-electronica-cr/functions.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'FVCR_PLUGIN_ROUTEhelpers.php' (include_path='.:/usr/share/php') in wp-content/plugins/factura-electronica-cr/functions.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/factura-electronica-cr/plugin-facturador-virtual.php:10
    • > PHP Warning
      Use of undefined constant FVCR_PLUGIN_ROUTE - assumed 'FVCR_PLUGIN_ROUTE' (this will throw an Error in a future version of PHP) in wp-content/plugins/factura-electronica-cr/functions.php on line 2

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Requires php: The plugin version is formatted incorrectly
  • Tags: Please reduce the number of tags, currently 21 tag instead of maximum 10
You can look at the official readme.txt

factura-electronica-cr/plugin-facturador-virtual.php 92% from 13 tests

This is the main PHP file of "Facturación Electrónica Costa Rica" version 1.4.6, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("factura-electronica-cr.php" instead of "plugin-facturador-virtual.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected9,401 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP51831494,394
JavaScript28104,088
CSS34412918
SVG1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions29
▷ Named functions2689.66%
▷ Anonymous functions310.34%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.22MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png48.31KB21.30KB▼ 55.91%
assets/fv_logo_horizontal.png154.14KB71.24KB▼ 53.78%
assets/fv_logo.png9.51KB4.97KB▼ 47.73%
assets/fv_logo_horizontal_old.png9.47KB4.75KB▼ 49.86%
assets/icon-128x128.png1.45KB1.17KB▼ 19.60%