67% shopbox

Code Review | Shopbox

WordPress plugin Shopbox scored67%from 54 tests.

About plugin

  • Plugin page: shopbox
  • Plugin version: 1.17.97
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 25, 2020
  • Latest release: Nov 1, 2023
  • Number of updates: 85
  • Update frequency: every 13.7 days
  • Top authors: shopboxaps (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /2,410 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.92MB] [CPU: ▼5.50ms] Passed 4 tests

Analyzing server-side resources used by Shopbox
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.39 ▲0.9243.50 ▲5.26
Dashboard /wp-admin4.24 ▲0.8949.37 ▼14.98
Posts /wp-admin/edit.php4.29 ▲0.9357.54 ▲4.87
Add New Post /wp-admin/post-new.php6.84 ▲0.9585.80 ▼17.16
Media Library /wp-admin/upload.php4.16 ▲0.9347.88 ▲14.74
Shopbox /wp-admin/admin.php?page=shopbox4.0835.53
Exception Logs /wp-admin/admin.php?page=shopbox_exception_logs4.0735.89
Export Products /wp-admin/admin.php?page=shopbox_export_products4.1638.77
Import Products /wp-admin/admin.php?page=shopbox_import_products4.53435.72
Settings /wp-admin/admin.php?page=shopbox_settings4.1336.82

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 323 new files
Database: 1 new table, 7 new options
New tables
wp_sb_orders_synch
New WordPress options
widget_recent-posts
recovery_mode_email_last_sent
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Shopbox
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲8214.38 ▼0.341.68 ▲0.0637.02 ▼2.80
Dashboard /wp-admin2,234 ▲545.61 ▲0.0496.34 ▲2.7541.20 ▲0.98
Posts /wp-admin/edit.php2,139 ▲392.04 ▲0.0235.40 ▼4.7031.29 ▼3.78
Add New Post /wp-admin/post-new.php1,560 ▲3423.54 ▲0.43675.16 ▲58.6453.62 ▲5.48
Media Library /wp-admin/upload.php1,442 ▲454.25 ▲0.0895.55 ▲0.8643.00 ▲0.42
Shopbox /wp-admin/admin.php?page=shopbox8612.2026.9026.24
Exception Logs /wp-admin/admin.php?page=shopbox_exception_logs8071.6923.8722.83
Export Products /wp-admin/admin.php?page=shopbox_export_products1,1192.0224.7225.33
Import Products /wp-admin/admin.php?page=shopbox_import_products1,1562.0223.8829.40
Settings /wp-admin/admin.php?page=shopbox_settings1,1381.9927.2026.39

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie tables detected upon uninstall: 1 table
    • wp_sb_orders_synch
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • recovery_mode_email_last_sent
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=shopbox_settings
    • > Notice in wp-content/plugins/shopbox/ShopBox/Admin/partials/general-settings.php+84
    Undefined variable: paymentTypes
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=shopbox_settings
    • > Warning in wp-content/plugins/shopbox/ShopBox/Admin/partials/general-settings.php+84
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/admin.php?page=shopbox_import_products
    • > Error in wp-content/plugins/shopbox/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php+113
    Uncaught GuzzleHttp\Exception\ClientException: Client error: `GET https://api.shopbox.com/api/v3/tags` resulted in a `401 Unauthorized` response:
    {"error":{"name":"Unauthorized","message":"Your request was made with invalid credentials.","code":0,"status":401}}
    in wp-content/plugins/shopbox/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113
    Stack trace:
    #0 wp-content/plugins/shopbox/vendor/guzzlehttp/guzzle/src/Middleware.php(69): GuzzleHttp\Exception\RequestException::create()
    #1 wp-content/plugins/shopbox/vendor/guzzlehttp/promises/src/Promise.php(204): GuzzleHttp\Middleware::GuzzleHttp\{closure}()
    #2 wp-content/plugins/shopbox/vendor/guzzlehttp/promises/src/Promise.php(153): GuzzleHttp\Promise\Promise::callHandler()
    #3 wp-content/plugins/shopbox/vendor/guzzlehttp/promises/src/TaskQueue.php(48): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}()
    #4 wp-content/plugins/shopbo

SRP 50% 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 fix the following items
  • 57× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/shopbox/ShopBox/Admin/partials/header.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/shopbox/vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\ClientInterface' not found in wp-content/plugins/shopbox/vendor/guzzlehttp/guzzle/src/Client.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/shopbox/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/shopbox/ShopBox/Admin/partials/header.php:2
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/shopbox/vendor/guzzlehttp/psr7/src/NoSeekStream.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/shopbox/vendor/guzzlehttp/psr7/src/DroppingStream.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/shopbox/vendor/guzzlehttp/psr7/src/MultipartStream.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/shopbox/ShopBox/Admin/partials/header.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\BadResponseException' not found in wp-content/plugins/shopbox/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Requires php: The plugin version is formatted incorrectly
  • Requires at least: The plugin version is formatted incorrectly
  • Screenshots: These screenshots do not have images: #1 (Settings needed to connect woocommerce to shopbox), #2 (Export products to shopbox)
The official readme.txt might help

shopbox/shopbox.php 92% from 13 tests

This is the main PHP file of "Shopbox" version 1.17.97, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

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
No dangerous file extensions were detected19,497 lines of code in 303 files:
LanguageFilesBlank linesComment linesLines of code
PHP1462,6036,02111,263
JavaScript1274361,0453,746
Markdown141,21803,606
JSON1300866
make1409
YAML1007
CSS1040

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity13.43
▷ Minimum class complexity1.00
▷ Maximum class complexity88.00
Average method complexity2.68
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces17
Interfaces26
Traits3
Classes94
▷ Abstract classes22.13%
▷ Concrete classes9297.87%
▷ Final classes3436.96%
Methods894
▷ Static methods13715.32%
▷ Public methods74683.45%
▷ Protected methods384.25%
▷ Private methods11012.30%
Functions129
▷ Named functions3627.91%
▷ Anonymous functions9372.09%
Constants63
▷ Global constants00.00%
▷ Class constants63100.00%
▷ Public constants5282.54%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin