74% superstore

Code Review | Superstore

WordPress plugin Superstore scored74%from 54 tests.

About plugin

  • Plugin page: superstore
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.0
  • WordPress version: 6.3.1
  • First release: Oct 26, 2022
  • Latest release: Oct 27, 2022
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: binarithm (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /297 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.08MB] [CPU: ▼2.96ms] Passed 4 tests

Server-side resources used by Superstore
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0943.47 ▲0.80
Dashboard /wp-admin3.38 ▲0.0849.92 ▼1.46
Posts /wp-admin/edit.php3.49 ▲0.1446.57 ▼14.59
Add New Post /wp-admin/post-new.php5.96 ▲0.07105.81 ▲14.01
Media Library /wp-admin/upload.php3.30 ▲0.0739.21 ▲3.42

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 113 new files
Database: 2 new tables, 14 new options
New tables
wp_superstore_payments
wp_superstore_payment_statements
New WordPress options
widget_recent-comments
widget_superstore-featured-products
widget_theysaidso_widget
superstore_pages_created
widget_superstore-best-selling-products
superstore_seller-account_page_id
superstore_pages
widget_superstore-top-rated-products
widget_recent-posts
theysaidso_admin_options
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Superstore
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲3514.74 ▲0.521.69 ▼0.0443.97 ▼2.89
Dashboard /wp-admin2,202 ▲225.61 ▼0.0689.00 ▲3.8241.80 ▲0.69
Posts /wp-admin/edit.php2,107 ▲71.97 ▼0.0236.17 ▼3.0637.64 ▲1.66
Add New Post /wp-admin/post-new.php1,533 ▼323.65 ▲5.46689.25 ▲30.8053.89 ▼24.29
Media Library /wp-admin/upload.php1,410 ▲104.25 ▲0.09100.84 ▼8.2446.19 ▲1.69

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie tables were found after uninstall: 2 tables
    • wp_superstore_payment_statements
    • wp_superstore_payments
  • This plugin did not uninstall successfully, leaving 14 options in the database
    • widget_superstore-top-rated-products
    • superstore_stores_page_id
    • superstore_pages_created
    • widget_recent-posts
    • can_compress_scripts
    • widget_superstore-latest-products
    • theysaidso_admin_options
    • widget_superstore-best-selling-products
    • widget_theysaidso_widget
    • widget_superstore-featured-products
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 34× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Email' not found in wp-content/plugins/superstore/includes/Email/ProductPublished.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/superstore/includes/RESTAPI/Seller.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/superstore/includes/RESTAPI/Report.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Binarithm\\Superstore\\Abstracts\\AbstractData' not found in wp-content/plugins/superstore/includes/Payment/PaymentStatement.php:12
    • > PHP Notice
      Undefined variable: r in wp-content/plugins/superstore/templates/widgets/product.php on line 11
    • > PHP Fatal error
      Trait 'Binarithm\\Superstore\\Traits\\Container' not found in wp-content/plugins/superstore/includes/Widgets/Controller.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/superstore/includes/RESTAPI/Payment.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/superstore/includes/Widgets/LatestProducts.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/superstore/templates/global/product-tab.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Email' not found in wp-content/plugins/superstore/includes/Email/UpdatePayment.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
10 plugin tags: woocommerce multivendor marketplace, woocommerce mutivendor, multi vendor marketplace, commission, vendor...

superstore/superstore.php 92% from 13 tests

This is the main PHP file of "Superstore" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("5.4" instead of "3.0.0")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected17,073 lines of code in 107 files:
LanguageFilesBlank linesComment linesLines of code
PHP982,9295,48116,571
JavaScript421,479493
JSON1005
CSS40164

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 107)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity22.69
▷ Minimum class complexity1.00
▷ Maximum class complexity254.00
Average method complexity3.12
▷ Minimum method complexity1.00
▷ Maximum method complexity107.00
Code structure
Namespaces18
Interfaces1
Traits1
Classes72
▷ Abstract classes34.17%
▷ Concrete classes6995.83%
▷ Final classes11.45%
Methods767
▷ Static methods314.04%
▷ Public methods70992.44%
▷ Protected methods466.00%
▷ Private methods121.56%
Functions27
▷ Named functions2592.59%
▷ Anonymous functions27.41%
Constants10
▷ Global constants10100.00%
▷ Class constants00.00%
▷ Public constants00.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
3 PNG files occupy 0.08MB with 0.04MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/superstore-logo-white.png29.63KB15.88KB▼ 46.39%
assets/images/default-store-banner.png19.59KB6.63KB▼ 66.13%
assets/images/superstore-logo-black.png29.65KB15.88KB▼ 46.44%