83% drenvio-for-woocommerce

Code Review | DrEnvio for WooCommerce

WordPress plugin DrEnvio for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: drenvio-for-wooco...
  • Plugin version: 2.0.2
  • PHP compatiblity: 7.3.21+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7.8-6.3.1
  • WordPress version: 6.3.1
  • First release: Sep 21, 2021
  • Latest release: Sep 27, 2023
  • Number of updates: 72
  • Update frequency: every 10.2 days
  • Top authors: jesusemh (100%)

Code review

54 tests

User reviews

26 reviews

Install metrics

100+ active /4,830 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
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼4.29ms] Passed 4 tests

Analyzing server-side resources used by DrEnvio for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0443.06 ▼0.17
Dashboard /wp-admin3.34 ▲0.0458.36 ▲6.91
Posts /wp-admin/edit.php3.40 ▲0.0451.09 ▼2.71
Add New Post /wp-admin/post-new.php5.93 ▲0.0488.44 ▼10.91
Media Library /wp-admin/upload.php3.27 ▲0.0436.42 ▼3.36

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 64 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for DrEnvio for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲1814.72 ▲0.161.88 ▲0.0943.80 ▲0.40
Dashboard /wp-admin2,207 ▲305.55 ▼0.1187.40 ▼0.7072.66 ▲29.94
Posts /wp-admin/edit.php2,115 ▲181.98 ▼0.0440.85 ▲3.6834.71 ▲0.60
Add New Post /wp-admin/post-new.php1,553 ▲1823.07 ▲4.82757.01 ▲100.6257.88 ▼5.93
Media Library /wp-admin/upload.php1,415 ▲184.21 ▲0.0197.45 ▼12.3073.05 ▲25.94

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/drenvio-for-woocommerce/public/templates/cart-shipping.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/drenvio-for-woocommerce/public/templates/cart-shipping.php on line 3
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/drenvio-for-woocommerce/public/templates/cart-shipping.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_locale() in wp-content/plugins/drenvio-for-woocommerce/drenvio.php:126

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 issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 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
5 plugin tags: drenvio, paqueteras, envos, woocommerce, logstica

drenvio-for-woocommerce/drenvio.php 77% from 13 tests

The main PHP script in "DrEnvio for WooCommerce" version 2.0.2 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("drenvio-for-woocommerce.php" instead of "drenvio.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 156 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin34,788 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
SVG210033,863
PHP513323575
JSON210202
CSS1240107
JavaScript2132041

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity31.50
▷ Minimum class complexity21.00
▷ Maximum class complexity42.00
Average method complexity5.36
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods535.71%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions888.89%
▷ Anonymous functions111.11%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.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.13MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/aexpress.png50.18KB20.20KB▼ 59.75%
public/img/icono.png0.52KB0.63KB0.00%
public/img/scm.png21.98KB9.71KB▼ 55.84%
public/img/icon.png0.63KB0.50KB▼ 21.11%
public/img/interrapidisimo.png32.40KB13.66KB▼ 57.84%