79% smartsorting

Code Review | Smart Sorting for WooCommerce

WordPress plugin Smart Sorting for WooCommerce scored79%from 54 tests.

About plugin

  • Plugin page: smartsorting
  • Plugin version: 0.1.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.0.1
  • WordPress version: 6.3.1
  • First release: Aug 17, 2022
  • Latest release: Aug 23, 2022
  • Number of updates: 11
  • Update frequency: every 1.2 days
  • Top authors: alukiko (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,934 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.09MB] [CPU: ▼8.05ms] Passed 4 tests

This is a short check of server-side resources used by Smart Sorting for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1043.60 ▼3.20
Dashboard /wp-admin3.40 ▲0.0652.35 ▼10.72
Posts /wp-admin/edit.php3.51 ▲0.1656.42 ▲4.13
Add New Post /wp-admin/post-new.php6.00 ▲0.1286.52 ▼20.16
Media Library /wp-admin/upload.php3.32 ▲0.1039.65 ▲1.87
Smart-sorting settings /wp-admin/options-general.php?page=smart-sorting_settings3.2933.39

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 23 new files
Database: 1 new table, 7 new options
New tables
wp_smart_sorting_views_table
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
ss_views_delay
theysaidso_admin_options

Browser metrics Passed 4 tests

Smart Sorting for WooCommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,894 ▲14813.96 ▼0.675.77 ▲4.0043.29 ▲0.33
Dashboard /wp-admin2,211 ▲235.79 ▲0.90102.95 ▼5.0939.65 ▼3.04
Posts /wp-admin/edit.php2,079 ▼102.03 ▲0.0235.83 ▼0.7034.92 ▲0.19
Add New Post /wp-admin/post-new.php1,521 ▼723.27 ▲5.02698.95 ▲39.1556.75 ▼11.55
Media Library /wp-admin/upload.php1,399 ▲114.16 ▼0.05114.21 ▲11.7447.29 ▲0.91
Smart-sorting settings /wp-admin/options-general.php?page=smart-sorting_settings7842.0624.4625.17

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% 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
7 plugin tags: smart sort, woocommerce, woocommerce sorting, woocommerce sort, sorting...

smartsorting/smart-sorting.php 77% from 13 tests

The main PHP script in "Smart Sorting for WooCommerce" version 0.1.2 is automatically included on every request by WordPress
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 448 characters long)
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("smartsorting.php" instead of "smart-sorting.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected772 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP12150523684
JavaScript28088
CSS1040

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity6.29
▷ Minimum class complexity1.00
▷ Maximum class complexity19.00
Average method complexity2.06
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods35
▷ Static methods617.14%
▷ Public methods2880.00%
▷ Protected methods00.00%
▷ Private methods720.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
PNG images were not found in this plugin