62% automatically-empty-trash

Code Review | Automatically Empty Trash

WordPress plugin Automatically Empty Trash scored62%from 54 tests.

About plugin

  • Plugin page: automatically-emp...
  • Plugin version: 2.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.6
  • WordPress version: 6.3.1
  • First release: Jun 20, 2016
  • Latest release: Jan 5, 2021
  • Number of updates: 18
  • Update frequency: every 92.4 days
  • Top authors: pawaryogesh1989 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /6,197 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.94MB] [CPU: ▼29.17ms] Passed 4 tests

An overview of server-side resources used by Automatically Empty Trash
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0135.29 ▼4.63
Dashboard /wp-admin3.01 ▼0.3028.50 ▼18.68
Posts /wp-admin/edit.php3.01 ▼0.3522.92 ▼23.81
Add New Post /wp-admin/post-new.php3.01 ▼2.8924.48 ▼61.27
Media Library /wp-admin/upload.php3.01 ▼0.2321.98 ▼12.92
Empty Trash Settings /wp-admin/options-general.php?page=empty-trash-settings3.0124.84

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Automatically Empty Trash
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.35 ▼0.192.00 ▲0.4237.45 ▼4.78
Dashboard /wp-admin2,199 ▲195.63 ▼0.0190.61 ▲5.2537.96 ▼0.63
Posts /wp-admin/edit.php2,107 ▲71.97 ▼0.0142.38 ▲6.6636.12 ▼0.13
Add New Post /wp-admin/post-new.php1,533 ▼223.53 ▲5.07667.17 ▲45.6463.06 ▼6.14
Media Library /wp-admin/upload.php1,398 ▲44.17 ▼0.0196.05 ▲0.0144.74 ▼0.96
Empty Trash Settings /wp-admin/options-general.php?page=empty-trash-settings7962.0026.8228.16

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=empty-trash-settings
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/automatically-empty-trash/automatically-empty-trash.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/automatically-empty-trash/views/empty-trash-settings.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
  • Screenshots: A description for screenshot #2 is missing in automatically-empty-trash/assets to your readme.txt
The official readme.txt is a good inspiration

automatically-empty-trash/automatically-empty-trash.php 92% from 13 tests

"Automatically Empty Trash" version 2.2.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Text Domain: Please use dashes and lowercase characters for text domains

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 plugin58 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3172658

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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 are no PNG files in this plugin