84% post-categories-tree

Code Review | Display Categories Tree

WordPress plugin Display Categories Tree scored84%from 54 tests.

About plugin

  • Plugin page: post-categories-tree
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-5.4.1
  • WordPress version: 6.3.1
  • First release: Jun 3, 2020
  • Latest release: Jun 3, 2020
  • Number of updates: 9
  • Update frequency: N/A
  • Top authors: aoulmderat (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /2,440 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 gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.12ms] Passed 4 tests

This is a short check of server-side resources used by Display Categories Tree
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.35 ▼0.58
Dashboard /wp-admin3.32 ▲0.0247.02 ▼0.89
Posts /wp-admin/edit.php3.37 ▲0.0147.51 ▲0.45
Add New Post /wp-admin/post-new.php5.90 ▲0.0179.41 ▼15.47
Media Library /wp-admin/upload.php3.24 ▲0.0136.13 ▲4.34

Server storage [IO: ▲0.05MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 22 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_art-categories
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Display Categories Tree
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.26 ▼1.501.94 ▼0.1643.62 ▼2.54
Dashboard /wp-admin2,203 ▲265.81 ▲0.94103.59 ▼0.3241.95 ▼3.51
Posts /wp-admin/edit.php2,086 ▼32.00 ▲0.0136.13 ▼2.2834.40 ▼3.25
Add New Post /wp-admin/post-new.php1,514 ▼017.82 ▲0.10591.83 ▼99.8443.98 ▼20.75
Media Library /wp-admin/upload.php1,385 ▼34.16 ▼0.07101.19 ▲8.4342.96 ▲1.94

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_art-categories
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/post-categories-tree/widgets/class-art-widget-categories.php:16

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 Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: tree, style css child, category, hierarchy child, categories

post-categories-tree/art-post-categories-tree.php 85% from 13 tests

The main PHP file in "Display Categories Tree" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("post-categories-tree.php" instead of "art-post-categories-tree.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin313 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP12149632311
CSS1001
JavaScript1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity5.00
▷ Minimum class complexity1.00
▷ Maximum class complexity20.00
Average method complexity2.16
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods31
▷ Static methods26.45%
▷ Public methods2787.10%
▷ Protected methods00.00%
▷ Private methods412.90%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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 were not PNG files found in your plugin