10% add-hierarchy-parent-to-post

Code Review | Add Hierarchy (parent) to post

WordPress plugin Add Hierarchy (parent) to post scored 10% from 54 tests.

About plugin

  • Plugin page: add-hierarchy-par...
  • Plugin version: 3.13
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4+
  • WordPress version: 6.3.1
  • First release: Feb 5, 2017
  • Latest release: Jul 30, 2022
  • Number of updates: 145
  • Update frequency: every 13.8 days
  • Top authors: tazotodua (49.66%)ttodua (23.45%)itasksoftware (17.24%)puvoxsoftware (11.72%)

Code review

54 tests

User reviews

6 reviews

Install metrics

800+ active / 8,462 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Error in wp-content/plugins/add-hierarchy-parent-to-post/library_wp.php+2677
    Uncaught Error: Class 'WP_Plugins_List_Table' not found in wp-content/plugins/add-hierarchy-parent-to-post/library_wp.php:2677
    Stack trace:
    #0 wp-content/plugins/add-hierarchy-parent-to-post/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.25MB] [CPU: ▲13.48ms] Passed 4 tests

Server-side resources used by Add Hierarchy (parent) to post
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.75 ▲2.2859.19 ▲18.63
Dashboard /wp-admin5.59 ▲2.2860.18 ▲10.61
Posts /wp-admin/edit.php5.64 ▲2.2865.25 ▲18.90
Add New Post /wp-admin/post-new.php8.11 ▲2.22104.43 ▲5.78
Media Library /wp-admin/upload.php5.45 ▲2.2157.87 ▲19.89
Add Hierarchy (parent) to post /wp-admin/options-general.php?page=add-hierarchy-parent-to-post5.4255.28

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 6 new files
Database: 1 new table, 7 new options
New tables
wp_add_hierarchy_parent_to_post__errors_log
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
add-hierarchy-parent-to-post

Browser metrics Passed 4 tests

An overview of browser requirements for Add Hierarchy (parent) to post
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲7513.17 ▼1.135.29 ▲3.2442.83 ▼4.46
Dashboard /wp-admin2,213 ▲255.90 ▲1.00107.40 ▼5.0638.86 ▼7.08
Posts /wp-admin/edit.php2,162 ▲732.02 ▲0.0335.19 ▼7.2733.41 ▼3.74
Add New Post /wp-admin/post-new.php1,562 ▲4818.33 ▲0.59635.27 ▲10.0580.39 ▲22.18
Media Library /wp-admin/upload.php1,395 ▲74.21 ▼0.10100.35 ▼4.2043.93 ▼1.53
Add Hierarchy (parent) to post /wp-admin/options-general.php?page=add-hierarchy-parent-to-post1,1322.2932.6073.06

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie tables detected upon uninstall: 1 table
    • wp_add_hierarchy_parent_to_post__errors_log
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • add-hierarchy-parent-to-post

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Puvox\\library' not found in wp-content/plugins/add-hierarchy-parent-to-post/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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Contributors: The plugin contributors field is missing
Please take inspiration from this readme.txt

add-hierarchy-parent-to-post/index.php 92% from 13 tests

"Add Hierarchy (parent) to post" version 3.13's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("add-hierarchy-parent-to-post.php" instead of "index.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin3,813 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP31,3545,1903,813

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 1,076)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity352.60
▷ Minimum class complexity21.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%
Methods866
▷ Static methods10211.78%
▷ Public methods85999.19%
▷ Protected methods00.00%
▷ Private methods70.81%
Functions92
▷ Named functions00.00%
▷ Anonymous functions92100.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/media/parent-choose.png6.55KB4.30KB▼ 34.29%