83% products-rearrange-woocommerce

Code Review | Product Rearrange for WooCommerce

WordPress plugin Product Rearrange for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: products-rearrang...
  • Plugin version: 1.2.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 7.0.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Jan 27, 2023
  • Latest release: Sep 5, 2023
  • Number of updates: 20
  • Update frequency: every 11.2 days
  • Top authors: haywoodtech (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /1,041 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.24ms] Passed 4 tests

This is a short check of server-side resources used by Product Rearrange for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0240.96 ▼1.19
Dashboard /wp-admin3.37 ▲0.0251.61 ▼3.89
Posts /wp-admin/edit.php3.48 ▲0.0849.89 ▼6.19
Add New Post /wp-admin/post-new.php5.95 ▲0.0285.85 ▼13.68
Media Library /wp-admin/upload.php3.29 ▲0.0240.97 ▲3.18

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Product Rearrange for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.42 ▲0.051.85 ▲0.1344.58 ▲2.77
Dashboard /wp-admin2,204 ▲245.61 ▼0.0394.12 ▲5.6345.25 ▲3.41
Posts /wp-admin/edit.php2,107 ▲72.02 ▲0.0133.78 ▼7.7633.05 ▼5.55
Add New Post /wp-admin/post-new.php1,532 ▼323.06 ▲4.58659.09 ▼7.4953.90 ▼23.78
Media Library /wp-admin/upload.php1,406 ▲64.26 ▲0.06113.88 ▲8.4247.31 ▼0.36

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • wcprdeactivation
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/products-rearrange-woocommerce/admin/partials/wcpr-admin-display.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/products-rearrange-woocommerce/admin/partials/wcpr-admin-settings.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% 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
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (Screenshot for the drag and drop UI in the admin end.), #2 (Working DEMO of the plugin and rearranging the products.), #3 (Working DEMO of Selecting the WooCommerce Product Category and rearranging the products.)
The official readme.txt is a good inspiration

products-rearrange-woocommerce/wcpr.php 77% from 13 tests

The principal PHP file in "Product Rearrange for WooCommerce" v. 1.2.1 is loaded by WordPress automatically on each request
The following require your attention:
  • 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
  • Requires at least: The required version number did not match the one declared in readme.txt ("6.0" instead of "7.0.0")
  • Main file name: Name the main plugin file the same as the plugin slug ("products-rearrange-woocommerce.php" instead of "wcpr.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
Everything looks great! No dangerous files found in this plugin521 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP1198515363
JavaScript31931134
CSS11024

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity3.67
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods32
▷ Static methods26.25%
▷ Public methods2784.38%
▷ Protected methods00.00%
▷ Private methods515.62%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.40MB with 0.22MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/wcpr_reorder.png38.59KB11.39KB▼ 70.48%
admin/img/wcpr_api.png56.22KB17.33KB▼ 69.17%
screenshot-1.png257.36KB70.93KB▼ 72.44%
admin/img/wcpr_permalinks.png51.72KB18.16KB▼ 64.88%
admin/img/wcpr_noimage.png4.14KB3.96KB▼ 4.36%