83% shiptime-discount-shipping

Code Review | ShipTime: Discounted Shipping Rates

WordPress plugin ShipTime: Discounted Shipping Rates scored 83% from 54 tests.

About plugin

  • Plugin page: shiptime-discount...
  • Plugin version: 1.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.2.2
  • WordPress version: 6.3.1
  • First release: Jan 25, 2023
  • Latest release: Jul 28, 2023
  • Number of updates: 9
  • Update frequency: every 20.4 days
  • Top authors: shiptime (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 392 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.00MB] [CPU: ▼1.98ms] Passed 4 tests

Server-side resources used by ShipTime: Discounted Shipping Rates
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.49 ▼3.42
Dashboard /wp-admin3.31 ▲0.0046.54 ▼3.16
Posts /wp-admin/edit.php3.36 ▲0.0045.90 ▼3.01
Add New Post /wp-admin/post-new.php5.89 ▲0.00102.82 ▲12.27
Media Library /wp-admin/upload.php3.23 ▲0.0035.58 ▲1.66

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for ShipTime: Discounted Shipping Rates
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.21 ▼1.544.36 ▲2.5140.58 ▼1.34
Dashboard /wp-admin2,206 ▲204.87 ▼1.04111.91 ▼5.3544.49 ▼0.94
Posts /wp-admin/edit.php2,089 ▼02.03 ▼0.0239.87 ▼4.9134.14 ▲0.46
Add New Post /wp-admin/post-new.php1,514 ▼2317.61 ▼5.44693.05 ▲100.1256.52 ▲10.96
Media Library /wp-admin/upload.php1,391 ▲34.18 ▼0.0397.48 ▼3.8747.47 ▲2.25

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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 items
  • 28× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Stringable' not found in wp-content/plugins/shiptime-discount-shipping/app/vendor/symfony/polyfill-php80/PhpToken.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotenv\\Repository\\Adapter\\ReaderInterface' not found in wp-content/plugins/shiptime-discount-shipping/app/vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiReader.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'GrahamCampbell\\ResultType\\Result' not found in wp-content/plugins/shiptime-discount-shipping/app/vendor/graham-campbell/result-type/src/Error.php:24
    • > PHP Parse error
      syntax error, unexpected '|', expecting variable (T_VARIABLE) in wp-content/plugins/shiptime-discount-shipping/app/vendor/symfony/polyfill-mbstring/bootstrap80.php on line 15
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotenv\\Repository\\Adapter\\AdapterInterface' not found in wp-content/plugins/shiptime-discount-shipping/app/vendor/vlucas/phpdotenv/src/Repository/Adapter/ServerConstAdapter.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotenv\\Repository\\Adapter\\AdapterInterface' not found in wp-content/plugins/shiptime-discount-shipping/app/vendor/vlucas/phpdotenv/src/Repository/Adapter/ApacheAdapter.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOption\\Option' not found in wp-content/plugins/shiptime-discount-shipping/app/vendor/phpoption/phpoption/src/PhpOption/LazyOption.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotenv\\Exception\\ExceptionInterface' not found in wp-content/plugins/shiptime-discount-shipping/app/vendor/vlucas/phpdotenv/src/Exception/ValidationException.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotenv\\Repository\\Adapter\\ReaderInterface' not found in wp-content/plugins/shiptime-discount-shipping/app/vendor/vlucas/phpdotenv/src/Repository/Adapter/AdapterInterface.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotenv\\Repository\\Adapter\\WriterInterface' not found in wp-content/plugins/shiptime-discount-shipping/app/vendor/vlucas/phpdotenv/src/Repository/Adapter/ImmutableWriter.php:7

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)
There were no browser issues 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: woocommerce plugin, shipping, live shipping rates, discounted shipping, woocommerce live shipping...

shiptime-discount-shipping/shiptime-live-rates.php 77% from 13 tests

"ShipTime: Discounted Shipping Rates" version 1.1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Domain Path: The domain path points to a folder that does not exist ("/lang")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("shiptime-discount-shipping.php" instead of "shiptime-live-rates.php")

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
Success! There were no dangerous files found in this plugin8,226 lines of code in 88 files:
LanguageFilesBlank linesComment linesLines of code
PHP771,1002,6257,418
JSON700729
JavaScript13042
Markdown313037

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity8.78
▷ Minimum class complexity1.00
▷ Maximum class complexity166.00
Average method complexity2.48
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces15
Interfaces9
Traits0
Classes54
▷ Abstract classes23.70%
▷ Concrete classes5296.30%
▷ Final classes4076.92%
Methods362
▷ Static methods12534.53%
▷ Public methods30483.98%
▷ Protected methods10.28%
▷ Private methods5715.75%
Functions180
▷ Named functions12569.44%
▷ Anonymous functions5530.56%
Constants34
▷ Global constants926.47%
▷ Class constants2573.53%
▷ Public constants1352.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin