83% treggo-shipping

Code Review | Treggo Shipping for WooCommerce

WordPress plugin Treggo Shipping for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: treggo-shipping
  • Plugin version: 2.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.5.1
  • WordPress version: 6.3.1
  • First release: Jul 18, 2020
  • Latest release: Feb 26, 2021
  • Number of updates: 14
  • Update frequency: every 16.0 days
  • Top authors: treggo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /824 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

Analyzing server-side resources used by Treggo Shipping for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.95 ▼1.73
Dashboard /wp-admin3.31 ▲0.0048.24 ▲3.89
Posts /wp-admin/edit.php3.36 ▲0.0047.72 ▲2.78
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.15 ▼5.51
Media Library /wp-admin/upload.php3.23 ▲0.0036.86 ▲0.13

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Treggo Shipping for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.66 ▼0.711.75 ▲0.0244.14 ▼3.95
Dashboard /wp-admin2,206 ▲185.83 ▲0.97122.45 ▲19.1138.36 ▼4.08
Posts /wp-admin/edit.php2,089 ▼32.02 ▼0.1339.22 ▼0.1834.18 ▼3.41
Add New Post /wp-admin/post-new.php1,547 ▲518.13 ▼0.24598.02 ▼15.6666.47 ▲13.39
Media Library /wp-admin/upload.php1,385 ▼64.22 ▲0.00106.01 ▲7.1048.80 ▲7.14

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/treggo-shipping/treggo-woocommerce-shipping.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/treggo-shipping/includes/class-treggo-shipping-method.php:3

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: treggo, argentina, shipping, woocommerce, ecommerce...

treggo-shipping/treggo-woocommerce-shipping.php 77% from 13 tests

"Treggo Shipping for WooCommerce" version 2.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("treggo-shipping.php" instead of "treggo-woocommerce-shipping.php")
  • Domain Path: The domain path points to an invalid folder, "/lang" does not exist
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected647 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP38517572
CSS16264
HTML15011

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity22.00
▷ Minimum class complexity16.00
▷ Maximum class complexity28.00
Average method complexity2.83
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods24
▷ Static methods00.00%
▷ Public methods2395.83%
▷ Protected methods00.00%
▷ Private methods14.17%
Functions4
▷ Named functions250.00%
▷ Anonymous functions250.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/logo.png38.49KB16.69KB▼ 56.65%
assets/blue-bar.png0.38KB0.16KB▼ 57.55%