10% sort-custom-postspages-by-parent

Code Review | Sort dashboard posts/pages by parent

WordPress plugin Sort dashboard posts/pages by parent scored10%from 54 tests.

About plugin

  • Plugin page: sort-custom-posts...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4+
  • WordPress version: 6.3.1
  • First release: Jul 20, 2017
  • Latest release: Aug 1, 2022
  • Number of updates: 9
  • Update frequency: every 204.3 days
  • Top authors: ttodua (88.89%)tazotodua (22.22%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /684 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Error in wp-content/plugins/sort-custom-postspages-by-parent/library_wp.php+2677
    Uncaught Error: Class 'WP_Plugins_List_Table' not found in wp-content/plugins/sort-custom-postspages-by-parent/library_wp.php:2677
    Stack trace:
    #0 wp-content/plugins/sort-custom-postspages-by-parent/library_wp.php(2611): Puvox\wp_plugin->is_not_bulk_activation()
    #1 wp-includes/class-wp-hook.php(312): Puvox\wp_plugin->Puvox\{closure}()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/includes/plugin.php(720): do_action()

Server metrics [RAM: ▲2.19MB] [CPU: ▲12.94ms] Passed 4 tests

A check of server-side resources used by Sort dashboard posts/pages by parent
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.69 ▲2.2359.84 ▲13.53
Dashboard /wp-admin5.52 ▲2.2261.58 ▲10.06
Posts /wp-admin/edit.php5.58 ▲2.2263.22 ▲13.70
Add New Post /wp-admin/post-new.php8.04 ▲2.16114.37 ▲14.48
Media Library /wp-admin/upload.php5.38 ▲2.1657.36 ▲20.57
Sort by parent /wp-admin/options-general.php?page=sort-custom-postspages-by-parent5.3552.91

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 6 new files
Database: 1 new table, 7 new options
New tables
wp_sort_custom_postspages_by_parent__errors_log
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
sort-custom-postspages-by-parent
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Sort dashboard posts/pages by parent
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲1014.36 ▲0.022.17 ▼0.1438.49 ▼7.33
Dashboard /wp-admin2,202 ▲255.61 ▲0.0282.45 ▼9.8838.57 ▼4.24
Posts /wp-admin/edit.php2,136 ▲391.98 ▼0.0234.52 ▲1.0733.57 ▼4.58
Add New Post /wp-admin/post-new.php1,541 ▲618.26 ▲0.16643.45 ▼34.8469.75 ▼9.78
Media Library /wp-admin/upload.php1,407 ▲74.21 ▲0.0296.61 ▼8.3041.13 ▼5.45
Sort by parent /wp-admin/options-general.php?page=sort-custom-postspages-by-parent9632.1432.2657.14

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_sort_custom_postspages_by_parent__errors_log
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • sort-custom-postspages-by-parent
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however 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
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'Puvox\\library' not found in wp-content/plugins/sort-custom-postspages-by-parent/library_wp.php:25

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)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Contributors: Plugin contributors not specified
Please take inspiration from this readme.txt

sort-custom-postspages-by-parent/index.php 92% from 13 tests

The primary PHP file in "Sort dashboard posts/pages by parent" version 1.2 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sort-custom-postspages-by-parent.php" instead of "index.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected3,549 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP31,2495,0963,549

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 1,076)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity346.60
▷ Minimum class complexity10.00
▷ Maximum class complexity1,076.00
Average method complexity2.96
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods852
▷ Static methods10211.97%
▷ Public methods84599.18%
▷ Protected methods00.00%
▷ Private methods70.82%
Functions89
▷ Named functions00.00%
▷ Anonymous functions89100.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin