72% xonja-woocommerce-product-reorder

Code Review | WooCommerce Product Reorder

WordPress plugin WooCommerce Product Reorder scored72%from 54 tests.

About plugin

  • Plugin page: xonja-woocommerce...
  • Plugin version: 1.00
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8
  • WordPress version: 6.3.1
  • First release: Aug 7, 2017
  • Latest release: Aug 7, 2017
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: xonja (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /723 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.45ms] Passed 4 tests

Server-side resources used by WooCommerce Product Reorder
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0344.09 ▲2.50
Dashboard /wp-admin3.34 ▲0.0350.19 ▼2.02
Posts /wp-admin/edit.php3.39 ▲0.0349.44 ▼1.14
Add New Post /wp-admin/post-new.php5.94 ▲0.0585.58 ▼13.13
Media Library /wp-admin/upload.php3.26 ▲0.0339.69 ▲5.58
Reorder Products /wp-admin/admin.php?page=xonja_wc_reorder3.2031.84

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
recovery_mode_email_last_sent
db_upgraded
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Product Reorder
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,988 ▲22713.38 ▼1.212.31 ▲0.4044.64 ▼12.75
Dashboard /wp-admin2,369 ▲1896.08 ▲0.4199.53 ▲3.7040.70 ▲4.42
Posts /wp-admin/edit.php2,280 ▲1802.58 ▲0.5744.89 ▲6.4935.48 ▼0.30
Add New Post /wp-admin/post-new.php1,542 ▲1623.32 ▲0.24682.29 ▼27.2141.01 ▼16.41
Media Library /wp-admin/upload.php1,574 ▲1774.73 ▲0.56116.40 ▲18.2648.87 ▲4.60
Reorder Products /wp-admin/admin.php?page=xonja_wc_reorder6781.516.9014.13

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • recovery_mode_email_last_sent
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=xonja_wc_reorder
    • > Error in wp-content/plugins/xonja-woocommerce-product-reorder/index.php+24
    Uncaught Error: Call to undefined function woocommerce_get_page_id() in wp-content/plugins/xonja-woocommerce-product-reorder/index.php:24
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): xonja_wc_reorder_do_page()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 {main}
    thrown

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/xonja-woocommerce-product-reorder/index.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/xonja-woocommerce-product-reorder/classes/Class_Xonja_Reorder_Handler.php:69

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Add images for these screenshots: #1 (Description of screenshot-1.jpg), #2 (Description of screenshot-2.jpg)
The official readme.txt is a good inspiration

xonja-woocommerce-product-reorder/index.php 85% from 13 tests

The main PHP file in "WooCommerce Product Reorder" ver. 1.00 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("xonja-woocommerce-product-reorder.php" instead of "index.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
Good job! No executable or dangerous file extensions detected575 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript411893344
PHP21917111
CSS110094
PO File16026

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.40
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods120.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin