82% woo-extra-flat-rate

Code Review | Flat Rate Shipping Plugin For WooCommerce

WordPress plugin Flat Rate Shipping Plugin For WooCommerce scored82%from 54 tests.

About plugin

  • Plugin page: woo-extra-flat-rate
  • Plugin version: 4.2.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3
  • WordPress version: 6.3.1
  • First release: Oct 13, 2015
  • Latest release: Aug 22, 2023
  • Number of updates: 1
  • Update frequency: every 365.0 days

Code review

54 tests

User reviews

75 reviews

Install metrics

10,000+ active /293,018 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.01MB] [CPU: ▼3.97ms] Passed 4 tests

Server-side resources used by Flat Rate Shipping Plugin For WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0040.40 ▲1.43
Dashboard /wp-admin3.31 ▼0.0450.09 ▼8.95
Posts /wp-admin/edit.php3.36 ▲0.0045.72 ▲0.20
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.31 ▼6.88
Media Library /wp-admin/upload.php3.23 ▲0.0032.94 ▼0.24

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 343 new files
Database: no new tables, 10 new options
New WordPress options
can_compress_scripts
afrsm_version
db_upgraded
widget_recent-posts
fs_debug_mode
fs_accounts
fs_active_plugins
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Flat Rate Shipping Plugin For WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.34 ▲0.191.83 ▼0.0743.35 ▲2.35
Dashboard /wp-admin2,198 ▲215.62 ▼0.0386.09 ▲1.3240.71 ▲0.96
Posts /wp-admin/edit.php2,097 ▼31.96 ▼0.1232.56 ▼5.6833.55 ▼2.04
Add New Post /wp-admin/post-new.php1,535 ▲918.20 ▼4.92589.16 ▼100.0769.27 ▲16.30
Media Library /wp-admin/upload.php1,400 ▼04.21 ▲0.0392.66 ▼16.1541.98 ▼5.36

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 10 options in the database
    • widget_recent-comments
    • afrsm_version
    • widget_theysaidso_widget
    • fs_debug_mode
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • fs_accounts
    • widget_recent-posts
    • fs_active_plugins

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/woo-extra-flat-rate/admin/partials/header/plugin-footer.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 83% 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
Attributes that need to be fixed: Please take inspiration from this readme.txt

woo-extra-flat-rate/advanced-flat-rate-shipping-for-woocommerce.php 69% from 13 tests

The entry point to "Flat Rate Shipping Plugin For WooCommerce" version 4.2.1 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 258 characters long)
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Requires at least: Required version must match the one declared in readme.txt ("5.0" instead of "3.0")
  • Main file name: The principal plugin file should be the same as the plugin slug ("woo-extra-flat-rate.php" instead of "advanced-flat-rate-shipping-for-woocommerce.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin60,193 lines of code in 196 files:
LanguageFilesBlank linesComment linesLines of code
PHP1479,25919,98144,318
PO File42,3154,4006,614
JavaScript104457954,765
CSS26823672,870
SVG6001,334
XML21316290
Markdown1002

PHP code 0% from 2 tests

Analyzing cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,073)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 142)
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity97.50
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity5.15
▷ Minimum method complexity1.00
▷ Maximum method complexity142.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes62
▷ Abstract classes23.23%
▷ Concrete classes6096.77%
▷ Final classes00.00%
Methods1,472
▷ Static methods22515.29%
▷ Public methods1,06872.55%
▷ Protected methods201.36%
▷ Private methods38426.09%
Functions115
▷ Named functions115100.00%
▷ Anonymous functions00.00%
Constants163
▷ Global constants11268.71%
▷ Class constants5131.29%
▷ Public constants51100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
78 PNG files occupy 3.60MB with 2.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/brand-agency.png8.87KB4.52KB▼ 49.09%
admin/images/wc-conditional-product-fees.png2.98KB1.58KB▼ 47.03%
admin/images/meraki-wp.png1.74KB1.07KB▼ 38.64%
admin/images/thedotstore-images/trash.png1.21KB0.29KB▼ 76.39%
admin/images/thedotstore-images/menu-icon.png2.02KB0.66KB▼ 67.52%