78% fivepost

Code Review | 5Post - Shipping for WooCommerce

WordPress plugin 5Post - Shipping for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: fivepost
  • Plugin version: 1.0.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.9.3
  • WordPress version: 6.3.1
  • First release: May 7, 2022
  • Latest release: Nov 30, 2022
  • Number of updates: 11
  • Update frequency: every 18.8 days
  • Top authors: ipol (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /408 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: ▼7.84ms] Passed 4 tests

An overview of server-side resources used by 5Post - Shipping for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.94 ▼5.04
Dashboard /wp-admin3.31 ▲0.0042.79 ▼8.49
Posts /wp-admin/edit.php3.36 ▲0.0043.81 ▼1.01
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.26 ▼16.80
Media Library /wp-admin/upload.php3.23 ▲0.0034.02 ▲0.18

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 225 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for 5Post - Shipping for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.48 ▲0.191.74 ▼0.1446.13 ▼5.27
Dashboard /wp-admin2,209 ▲184.84 ▼0.03106.22 ▼7.8240.48 ▼5.87
Posts /wp-admin/edit.php2,089 ▼02.02 ▲0.0134.24 ▼3.3235.26 ▲2.08
Add New Post /wp-admin/post-new.php1,514 ▼517.50 ▼5.77675.37 ▼15.3655.47 ▲3.25
Media Library /wp-admin/upload.php1,391 ▲34.19 ▲0.0897.82 ▼14.7941.11 ▼7.29

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
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% 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)
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Please take a closer look at the following
  • 7× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/fivepost/lib/Api/Entity/AbstractEntity.php
    • > /wp-content/plugins/fivepost/lib/Api/Entity/Response/AbstractResponse.php
    • > /wp-content/plugins/fivepost/lib/Api/Adapter/AdapterInterface.php
    • > /wp-content/plugins/fivepost/lib/Api/Entity/Request/AbstractRequest.php
    • > /wp-content/plugins/fivepost/lib/Api/Client/ClientInterface.php
    • > /wp-content/plugins/fivepost/lib/Api/Entity/AbstractCollection.php
    • > /wp-content/plugins/fivepost/lib/Fivepost/Handler/Enumerations.php
  • 140× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Ipol\\Fivepost\\Api\\Entity\\Request\\AbstractRequest' not found in wp-content/plugins/fivepost/lib/Api/Entity/Request/OrdersMake.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Ipol\\Fivepost\\Api\\Entity\\AbstractEntity' not found in wp-content/plugins/fivepost/lib/Api/Entity/Request/Part/CreateOrder/Cargo.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Ipol\\Fivepost\\Api\\Entity\\AbstractEntity' not found in wp-content/plugins/fivepost/lib/Api/Entity/Request/Part/CreateOrder/Barcode.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Ipol\\Fivepost\\Api\\Entity\\Request\\AbstractRequest' not found in wp-content/plugins/fivepost/lib/Api/Entity/Request/CancelOrderById.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Ipol\\Fivepost\\Api\\Entity\\AbstractEntity' not found in wp-content/plugins/fivepost/lib/Api/Entity/Response/Part/PickupPoint/Rate.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Ipol\\Fivepost\\Api\\Logger\\Route' not found in wp-content/plugins/fivepost/lib/Api/Logger/InlineRoute.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Ipol\\Fivepost\\Fivepost\\Entity\\AbstractResult' not found in wp-content/plugins/fivepost/lib/Fivepost/Entity/CancelOrderByNumberResult.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Ipol\\Fivepost\\Api\\Entity\\AbstractCollection' not found in wp-content/plugins/fivepost/lib/Api/Entity/Response/Part/OrdersMake/CargoList.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Ipol\\Fivepost\\Api\\Entity\\AbstractCollection' not found in wp-content/plugins/fivepost/lib/Api/Entity/Response/Part/OrdersMake/ErrorList.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Ipol\\Fivepost\\Api\\Entity\\AbstractEntity' not found in wp-content/plugins/fivepost/lib/Api/Entity/UniversalPart/WorkingTime.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Screenshots: Screenshot #1 (/assets/screenshot/screenshot-4.jpg) image required
You can look at the official readme.txt

fivepost/fivepost.php 85% from 13 tests

The principal PHP file in "5Post - Shipping for WooCommerce" v. 1.0.4 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • 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
  • Description: Keep the plugin description shorter than 140 characters (currently 432 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin13,981 lines of code in 198 files:
LanguageFilesBlank linesComment linesLines of code
PHP1892,8266,83212,209
JavaScript37129666
PO File125614540
CSS2581455
Markdown236085
JSON11026

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity6.92
▷ Minimum class complexity1.00
▷ Maximum class complexity440.00
Average method complexity1.88
▷ Minimum method complexity1.00
▷ Maximum method complexity73.00
Code structure
Namespaces38
Interfaces6
Traits2
Classes171
▷ Abstract classes74.09%
▷ Concrete classes16495.91%
▷ Final classes00.00%
Methods1,225
▷ Static methods262.12%
▷ Public methods1,18196.41%
▷ Protected methods221.80%
▷ Private methods221.80%
Functions4
▷ Named functions00.00%
▷ Anonymous functions4100.00%
Constants25
▷ Global constants312.00%
▷ Class constants2288.00%
▷ Public constants22100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
12 PNG files occupy 0.28MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/png/POSTAMAT_inactive_orig1.png35.17KB14.40KB▼ 59.07%
assets/images/png/POSTAMAT_inactive.png6.02KB2.71KB▼ 54.94%
assets/images/png/POSTAMAT_inactive_orig.png35.86KB14.02KB▼ 60.90%
assets/images/png/TOBACCO_inactive.png8.34KB3.34KB▼ 59.90%
assets/images/png/TOBACCO_inactive_orig1.png34.80KB12.83KB▼ 63.14%