83% directory-index-guard

Code Review | Directory Index Guard

WordPress plugin Directory Index Guard scored83%from 54 tests.

About plugin

  • Plugin page: directory-index-g...
  • Plugin version: 1.2.2
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.7
  • WordPress version: 6.3.1
  • First release: Mar 11, 2021
  • Latest release: Apr 12, 2021
  • Number of updates: 12
  • Update frequency: every 2.6 days
  • Top authors: wpfixservices (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /748 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▼1.07ms] 75% from 4 tests

Analyzing server-side resources used by Directory Index Guard
Please have a look at the following items
  • CPU: The total CPU usage must kept under 500.00ms (currently 1,147.12ms on /wp-admin/tools.php?page=directory-index-guard)
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1242.43 ▲1.20
Dashboard /wp-admin3.45 ▲0.1546.34 ▼6.57
Posts /wp-admin/edit.php3.57 ▲0.2152.82 ▲5.04
Add New Post /wp-admin/post-new.php6.05 ▲0.1693.54 ▲0.30
Media Library /wp-admin/upload.php3.38 ▲0.1437.33 ▲0.81
Directory Index Guard /wp-admin/tools.php?page=directory-index-guard3.481,147.12

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 18 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
directory_index_guard_scan_results
directory_index_guard_configuration
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Directory Index Guard: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,949 ▲21413.48 ▼0.821.64 ▼0.2537.92 ▼5.81
Dashboard /wp-admin2,370 ▲1825.19 ▼0.70108.67 ▲2.9948.15 ▲5.53
Posts /wp-admin/edit.php2,212 ▲1232.59 ▲0.5450.14 ▲13.6144.98 ▲10.20
Add New Post /wp-admin/post-new.php1,567 ▲5318.43 ▲0.76625.71 ▼74.4535.83 ▼24.04
Media Library /wp-admin/upload.php1,543 ▲1524.57 ▲0.26106.34 ▲5.1948.85 ▲0.93
Directory Index Guard /wp-admin/tools.php?page=directory-index-guard6,1682.0235.9471.73

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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 fix the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/directory-index-guard/backup/index.php
    • > /wp-content/plugins/directory-index-guard/index.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
  • License uri: Invalid URI found ("license.txt")
The official readme.txt might help

directory-index-guard/directory-index-guard.php 85% from 13 tests

This is the main PHP file of "Directory Index Guard" version 1.2.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 250 characters long)
  • Requires PHP: Required version must be the same as the one declared in readme.txt ("5.5" instead of "5.2")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin5,035 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript36612482,848
CSS25341,410
PHP5224231777

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity107.00
▷ Minimum class complexity107.00
▷ Maximum class complexity107.00
Average method complexity2.80
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods59
▷ Static methods23.39%
▷ Public methods4576.27%
▷ Protected methods00.00%
▷ Private methods1423.73%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants22
▷ Global constants00.00%
▷ Class constants22100.00%
▷ Public constants22100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin