67% baggage-freight

Code Review | Baggage Freight Shipping Australia

WordPress plugin Baggage Freight Shipping Australia scored67%from 54 tests.

About plugin

  • Plugin page: baggage-freight
  • Plugin version: 0.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.6.1
  • WordPress version: 6.3.1
  • First release: Nov 22, 2013
  • Latest release: Sep 18, 2014
  • Number of updates: 25
  • Update frequency: every 12.1 days
  • Top authors: Shipster (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /1,692 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.93MB] [CPU: ▼29.31ms] Passed 4 tests

Analyzing server-side resources used by Baggage Freight Shipping Australia
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0437.11 ▼5.04
Dashboard /wp-admin3.02 ▼0.2924.82 ▼18.79
Posts /wp-admin/edit.php3.02 ▼0.3424.01 ▼17.18
Add New Post /wp-admin/post-new.php3.02 ▼2.8723.27 ▼71.67
Media Library /wp-admin/upload.php3.02 ▼0.2122.23 ▼9.59
Baggagefreight Shipping /wp-admin/admin.php?page=baggage-freight/baggage_shipping.php3.0223.93
Registration /wp-admin/admin.php?page=store_owner3.0222.14
Product Freight Values /wp-admin/admin.php?page=upload_package3.0220.96
Payment Options /wp-admin/admin.php?page=payment_option3.0221.50
Shipping Label /wp-admin/admin.php?page=bf_label3.0221.27
Settings /wp-admin/admin.php?page=store_settings3.0221.33
Default Freight Settings /wp-admin/admin.php?page=freight_settings3.0223.39

Server storage [IO: ▲0.95MB] [DB: ▲0.08MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 30 new files
Database: 5 new tables, 7 new options
New tables
baggage_settings
baggage_excel
baggage_storeowner
baggage_order
baggage_dimensions
New WordPress options
widget_theysaidso_widget
recovery_mode_email_last_sent
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Baggage Freight Shipping Australia: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,847 ▲11213.21 ▼1.171.77 ▼0.0037.96 ▼7.81
Dashboard /wp-admin2,253 ▲644.89 ▼0.05111.18 ▼5.4541.22 ▼2.93
Posts /wp-admin/edit.php2,136 ▲472.00 ▼0.0240.20 ▼2.4935.31 ▼2.08
Add New Post /wp-admin/post-new.php1,579 ▲5118.34 ▼0.21594.00 ▼23.3554.34 ▼3.72
Media Library /wp-admin/upload.php1,429 ▲414.26 ▲0.12100.94 ▲0.2240.93 ▼1.95
Baggagefreight Shipping /wp-admin/admin.php?page=baggage-freight/baggage_shipping.php7091.147.0020.76
Registration /wp-admin/admin.php?page=store_owner7091.146.6120.03
Product Freight Values /wp-admin/admin.php?page=upload_package7091.146.6114.13
Payment Options /wp-admin/admin.php?page=payment_option7091.536.8320.61
Shipping Label /wp-admin/admin.php?page=bf_label8422.0123.7825.50
Settings /wp-admin/admin.php?page=store_settings7091.147.6015.64
Default Freight Settings /wp-admin/admin.php?page=freight_settings9012.0625.5725.90

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • recovery_mode_email_last_sent
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 119 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=freight_settings
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/admin.php?page=baggage-freight/baggage_shipping.php
    • > Error in wp-content/plugins/baggage-freight/dashboard.php+5
    Uncaught Error: Call to undefined function mysql_query() in wp-content/plugins/baggage-freight/dashboard.php:5
    Stack trace:
    #0 wp-content/plugins/baggage-freight/baggage_shipping.php(164): include()
    #1 wp-includes/class-wp-hook.php(310): pro_admin_dashboard()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=store_owner
    • > Error in wp-content/plugins/baggage-freight/store-owner.php+5
    Uncaught Error: Call to undefined function mysql_query() in wp-content/plugins/baggage-freight/store-owner.php:5
    Stack trace:
    #0 wp-content/plugins/baggage-freight/baggage_shipping.php(170): include()
    #1 wp-includes/class-wp-hook.php(310): pro_admin_store_owner()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=upload_package
    • > Parse error in wp-content/plugins/baggage-freight/freader/reader.php+101
    syntax error, unexpected 'new' (T_NEW)
    • > GET request to /wp-admin/admin.php?page=payment_option
    • > Error in wp-content/plugins/baggage-freight/bf_payment.php+7
    Uncaught Error: Call to undefined function mysql_query() in wp-content/plugins/baggage-freight/bf_payment.php:7
    Stack trace:
    #0 wp-content/plugins/baggage-freight/baggage_shipping.php(203): include()
    #1 wp-includes/class-wp-hook.php(310): pro_payment_option()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=bf_label
    • > Notice in wp-content/plugins/baggage-freight/bf_label.php+21
    Trying to get property 'Email' of non-object
    • > GET request to /wp-admin/admin.php?page=bf_label
    • > Notice in wp-content/plugins/baggage-freight/bf_label.php+22
    Trying to get property 'Password' of non-object
    • > GET request to /wp-admin/admin.php?page=store_settings
    • > Error in wp-content/plugins/baggage-freight/bf_settings.php+7
    Uncaught Error: Call to undefined function mysql_query() in wp-content/plugins/baggage-freight/bf_settings.php:7
    Stack trace:
    #0 wp-content/plugins/baggage-freight/baggage_shipping.php(193): include()
    #1 wp-includes/class-wp-hook.php(310): pro_admin_bf_settings()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=freight_settings
    • > Notice in wp-content/plugins/baggage-freight/bf_freightsettings.php+7
    Trying to get property 'height' of non-object
    • > GET request to /wp-admin/admin.php?page=freight_settings
    • > Notice in wp-content/plugins/baggage-freight/bf_freightsettings.php+8
    Trying to get property 'width' of non-object
    • > GET request to /wp-admin/admin.php?page=freight_settings
    • > Notice in wp-content/plugins/baggage-freight/bf_freightsettings.php+9
    Trying to get property 'length' of non-object
    • > GET request to /wp-admin/admin.php?page=freight_settings
    • > Notice in wp-content/plugins/baggage-freight/bf_freightsettings.php+43
    Undefined variable: msg

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
  • 16× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined index: action in wp-content/plugins/baggage-freight/packed_items.php on line 180
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mysql_query() in wp-content/plugins/baggage-freight/store-owner.php:5
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_row() on null in wp-content/plugins/baggage-freight/bf_freightsettings.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mysql_query() in wp-content/plugins/baggage-freight/bf_settings.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mysql_query() in wp-content/plugins/baggage-freight/dashboard.php:5
    • > PHP Parse error
      syntax error, unexpected 'new' (T_NEW) in wp-content/plugins/baggage-freight/freader/reader.php on line 101
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_row() on null in wp-content/plugins/baggage-freight/packed_items.php:203
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/baggage-freight/class-wc-baggagefreight.php:565
    • > PHP Notice
      Undefined index: action_s in wp-content/plugins/baggage-freight/packed_items.php on line 157
    • > PHP Notice
      Undefined index: updatep in wp-content/plugins/baggage-freight/packed_items.php on line 2

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 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
  • Donate link: Invalid url: "N.A"
You can look at the official readme.txt

baggage-freight/baggage_shipping.php 92% from 13 tests

The principal PHP file in "Baggage Freight Shipping Australia" v. 0.1.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("baggage-freight.php" instead of "baggage_shipping.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected4,145 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP132,575833,156
JavaScript113597989

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.24
Average class complexity76.00
▷ Minimum class complexity34.00
▷ Maximum class complexity118.00
Average method complexity7.82
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods22
▷ Static methods00.00%
▷ Public methods22100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants40
▷ Global constants40100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
10 PNG files occupy 0.71MB with 0.40MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/registration.png42.62KB13.98KB▼ 67.20%
images/Settings.png68.24KB26.53KB▼ 61.12%
screenshot/1.png175.01KB62.44KB▼ 64.32%
images/logo_bf.png16.69KB12.54KB▼ 24.87%
screenshot/2.png88.80KB34.25KB▼ 61.43%