84% auto-delete-unattached-media

Code Review | Auto Delete Unattached Media

WordPress plugin Auto Delete Unattached Media scored84%from 54 tests.

About plugin

  • Plugin page: auto-delete-unatt...
  • Plugin version: 1.0
  • PHP compatiblity: 5.6 or later+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.9
  • WordPress version: 6.3.1
  • First release: Feb 3, 2022
  • Latest release: Feb 3, 2022
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: wongsiongkiat (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /1,885 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: ▼3.81ms] Passed 4 tests

A check of server-side resources used by Auto Delete Unattached Media
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.99 ▼7.89
Dashboard /wp-admin3.32 ▲0.0144.70 ▼5.03
Posts /wp-admin/edit.php3.37 ▲0.0146.68 ▲1.04
Add New Post /wp-admin/post-new.php5.90 ▲0.0191.22 ▲3.51
Media Library /wp-admin/upload.php3.24 ▲0.0133.01 ▼3.36

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Auto Delete Unattached Media
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.55 ▼0.831.67 ▼0.1838.90 ▼5.10
Dashboard /wp-admin2,206 ▲154.86 ▼0.95106.78 ▼1.6039.29 ▲0.49
Posts /wp-admin/edit.php2,089 ▼02.05 ▼0.0141.42 ▲4.9736.29 ▼0.20
Add New Post /wp-admin/post-new.php1,528 ▲818.41 ▼4.68610.45 ▼94.5756.13 ▲0.82
Media Library /wp-admin/upload.php1,388 ▼04.25 ▲0.0696.99 ▼2.0341.24 ▼0.64

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

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
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
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/auto-delete-unattached-media/auto-delete-unattached-media.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Requires php: Invalid plugin version format
The official readme.txt might help

auto-delete-unattached-media/auto-delete-unattached-media.php 92% from 13 tests

The primary PHP file in "Auto Delete Unattached Media" version 1.0 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Requires PHP: Required version number formatted incorrectly (ex. "7.0" instead of "5.6 or later")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin319 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
Markdown1580281
PHP1112338

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin