84% apisunat

Code Review | APISUNAT Facturación Electrónica para WooCommerce - SUNAT - PERU

WordPress plugin APISUNAT Facturación Electrónica para WooCommerce - SUNAT - PERU scored84%from 54 tests.

About plugin

  • Plugin page: apisunat
  • Plugin version: 1.3.15
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.3.2
  • WordPress version: 6.3.1
  • First release: Jul 21, 2022
  • Latest release: Oct 16, 2023
  • Number of updates: 13
  • Update frequency: every 34.9 days
  • Top authors: kamilml (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

70+ active /1,045 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼8.74ms] Passed 4 tests

This is a short check of server-side resources used by APISUNAT Facturación Electrónica para WooCommerce - SUNAT - PERU
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.28 ▼3.73
Dashboard /wp-admin3.31 ▼0.0346.39 ▼13.22
Posts /wp-admin/edit.php3.36 ▲0.0146.13 ▼1.54
Add New Post /wp-admin/post-new.php5.89 ▲0.0182.51 ▼16.48
Media Library /wp-admin/upload.php3.23 ▲0.0137.10 ▲3.76

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

APISUNAT Facturación Electrónica para WooCommerce - SUNAT - PERU: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲6614.14 ▼0.512.11 ▲0.4043.57 ▼2.21
Dashboard /wp-admin2,208 ▲285.55 ▼0.11101.81 ▲2.0141.22 ▼0.97
Posts /wp-admin/edit.php2,113 ▲102.11 ▲0.0833.40 ▼7.4034.06 ▼1.71
Add New Post /wp-admin/post-new.php1,539 ▲1323.03 ▲0.07668.92 ▲29.8159.99 ▲5.94
Media Library /wp-admin/upload.php1,410 ▲104.18 ▼0.03109.31 ▲14.7147.49 ▲6.61

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/apisunat/admin/partials/apisunat-admin-display.php:20

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 96% from 29 tests

readme.txt Passed 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
9 plugin tags: cpe, peru, facturacion electronica, wp, factura...

apisunat/apisunat.php 92% from 13 tests

The principal PHP file in "APISUNAT Facturación Electrónica para WooCommerce - SUNAT - PERU" v. 1.3.15 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Text Domain: Please use dashes and lowercase characters for text domains

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin1,450 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP132757301,285
JavaScript22510120
CSS25945

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity14.12
▷ Minimum class complexity1.00
▷ Maximum class complexity86.00
Average method complexity2.82
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods58
▷ Static methods46.90%
▷ Public methods5289.66%
▷ Protected methods00.00%
▷ Private methods610.34%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin