89% featured-first-then-random-sorting-for-woocommerce

Code Review | Featured First then Random for WooCommerce

WordPress plugin Featured First then Random for WooCommerce scored 89% from 54 tests.

About plugin

  • Plugin page: featured-first-th...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.6.1
  • WordPress version: 6.3.1
  • First release: Dec 11, 2016
  • Latest release: Jan 28, 2017
  • Number of updates: 4
  • Update frequency: every 11.3 days
  • Top authors: KillBill-sbor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,286 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.90ms] Passed 4 tests

This is a short check of server-side resources used by Featured First then Random for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.66 ▲3.49
Dashboard /wp-admin3.31 ▲0.0043.37 ▼7.89
Posts /wp-admin/edit.php3.36 ▲0.0044.43 ▼5.73
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.49 ▼1.46
Media Library /wp-admin/upload.php3.23 ▲0.0036.01 ▲3.49

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Featured First then Random for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.24 ▼1.142.08 ▲0.1543.55 ▼5.87
Dashboard /wp-admin2,206 ▲155.85 ▲0.93107.63 ▲7.7739.46 ▼4.24
Posts /wp-admin/edit.php2,089 ▼02.02 ▲0.0139.69 ▲4.8933.93 ▼3.74
Add New Post /wp-admin/post-new.php1,547 ▲1318.26 ▼4.98637.62 ▼16.8066.61 ▲14.67
Media Library /wp-admin/upload.php1,385 ▼64.24 ▲0.10108.00 ▲12.8346.58 ▲4.68

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests Passed 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 Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: woocommerce, random, sorting, featured

featured-first-then-random-sorting-for-woocommerce/woocommerce-featured-then-random-sorting.php 85% from 13 tests

The main PHP file in "Featured First then Random for WooCommerce" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("featured-first-then-random-sorting-for-woocommerce.php" instead of "woocommerce-featured-then-random-sorting.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected276 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP16981204
PO File1172272

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity25.00
▷ Minimum class complexity25.00
▷ Maximum class complexity25.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods325.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 compressed PNG files occupy 0.33MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png37.87KB38.51KB0.00%
assets/screenshot-1.png299.73KB325.66KB0.00%