84% wp-grid-sorter

Code Review | WP Grid Sorter

WordPress plugin WP Grid Sorter scored84%from 54 tests.

About plugin

  • Plugin page: wp-grid-sorter
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-3.9.1
  • WordPress version: 6.3.1
  • First release: Jun 1, 2014
  • Latest release: Jun 1, 2014
  • Number of updates: 8
  • Update frequency: every 5.5 days
  • Top authors: vutran (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /974 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼8.71ms] Passed 4 tests

Server-side resources used by WP Grid Sorter
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0641.28 ▼6.19
Dashboard /wp-admin3.36 ▲0.0550.24 ▼5.11
Posts /wp-admin/edit.php3.47 ▲0.1151.06 ▼0.35
Add New Post /wp-admin/post-new.php5.94 ▲0.0591.67 ▼23.19
Media Library /wp-admin/upload.php3.28 ▲0.0540.88 ▲4.39

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

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

Browser metrics Passed 4 tests

Checking browser requirements for WP Grid Sorter
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,848 ▲8714.38 ▲0.021.83 ▼0.1241.46 ▼3.13
Dashboard /wp-admin2,217 ▲495.81 ▲0.1291.28 ▼5.9644.47 ▲0.20
Posts /wp-admin/edit.php2,138 ▲382.37 ▲0.4434.63 ▼2.7034.84 ▼2.87
Add New Post /wp-admin/post-new.php1,543 ▲1522.89 ▼0.12638.66 ▼49.9280.60 ▲30.95
Media Library /wp-admin/upload.php1,434 ▲344.35 ▲0.22107.00 ▼11.8445.12 ▼5.37

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 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
Please take a closer look at the following
  • 6× 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/wp-grid-sorter/inc/hooks.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function hasKeys() on null in wp-content/plugins/wp-grid-sorter/pages/general.php:15
    • > PHP Notice
      Trying to get property 'mappings' of non-object in wp-content/plugins/wp-grid-sorter/pages/general.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/wp-grid-sorter/pages/edit/item.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-grid-sorter/pages/edit.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-grid-sorter/wp-grid-sorter.php:127

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 Passed 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
5 plugin tags: grid, order, curate, sort, masonry

wp-grid-sorter/wp-grid-sorter.php Passed 13 tests

"WP Grid Sorter" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
14 characters long description:
Sort your grid

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
There were no executable files found in this plugin582 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP969239354
JavaScript424140143
Markdown113049
CSS15036

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity6.75
▷ Minimum class complexity2.00
▷ Maximum class complexity18.00
Average method complexity2.28
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods1477.78%
▷ Protected methods00.00%
▷ Private methods422.22%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin