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.12
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4+
  • WordPress version: 5.9.2
  • First release: Feb 5, 2017
  • Latest release: Aug 26, 2021
  • Number of updates: 143
  • Update frequency: every 11.6 days
  • Top authors: tazotodua (50.35%)ttodua (22.38%)itasksoftware (17.48%)puvoxsoftware (11.89%)

Code review

54 tests

User reviews

6 reviews

Install metrics

700+ active / 6,422 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Error in wp-content/plugins/add-hierarchy-parent-to-post/library_default_puvox.php+8103
    Uncaught Error: Class 'WP_Plugins_List_Table' not found in wp-content/plugins/add-hierarchy-parent-to-post/library_default_puvox.php:8103
    Stack trace:
    #0 wp-content/plugins/add-hierarchy-parent-to-post/library_default_puvox.php(8034): Puvox\default_plugin->is_not_bulk_activation()
    #1 wp-includes/class-wp-hook.php(309): Puvox\default_plugin->Puvox\{closure}()
    #2 wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(474): WP_Hook->do_action()
    #4 wp-admin/includes/plugin.php(716): do_action()

Server metrics [RAM: ▲2.31MB] [CPU: ▼280.07ms] Passed 4 tests

Server-side resources used by Add Hierarchy (parent) to post
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.90 ▲2.3872.08 ▲23.19
Dashboard /wp-admin5.92 ▲2.5155.56 ▲21.53
Posts /wp-admin/edit.php5.92 ▲2.2851.37 ▲13.98
Add New Post /wp-admin/post-new.php9.04 ▲2.08112.32 ▼1,158.65
Media Library /wp-admin/upload.php5.92 ▲2.6234.08 ▲2.86
Add Hierarchy (parent) to post /wp-admin/options-general.php?page=add-hierarchy-parent-to-post5.9240.78

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: 1 new table, 1 new option
New tables
wp_add_hierarchy_parent_to_post__errors_log
New WordPress options
add-hierarchy-parent-to-post

Browser metrics Passed 4 tests

Add Hierarchy (parent) to post: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,803 ▲4915.89 ▲0.156.11 ▲0.202.60 ▼0.03
Dashboard /wp-admin2,896 ▲356.14 ▲0.01124.75 ▼14.26157.72 ▼2.16
Posts /wp-admin/edit.php2,779 ▲913.24 ▲0.0064.99 ▼0.66140.25 ▼4.50
Add New Post /wp-admin/post-new.php1,651 ▼6020.57 ▼1.89428.13 ▲9.32145.97 ▼22.67
Media Library /wp-admin/upload.php1,703 ▲55.53 ▲0.05144.63 ▼4.31188.03 ▼6.10
Add Hierarchy (parent) to post /wp-admin/options-general.php?page=add-hierarchy-parent-to-post1,5083.2961.07192.30

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_add_hierarchy_parent_to_post__errors_log
  • Zombie WordPress options detected upon uninstall: 1 option
    • add-hierarchy-parent-to-post

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The SRP test was a success

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 93% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Contributors: Contributors not specified
The official readme.txt might help

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

Analyzing the main PHP file in "Add Hierarchy (parent) to post" version 3.12
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main 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 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected5,125 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP21,4363,3195,125

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 1,007)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity235.86
▷ Minimum class complexity1.00
▷ Maximum class complexity1,007.00
Average method complexity2.95
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces2
Interfaces0
Traits2
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods816
▷ Static methods9011.03%
▷ Public methods81299.51%
▷ Protected methods00.00%
▷ Private methods40.49%
Functions86
▷ Named functions00.00%
▷ Anonymous functions86100.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
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%