84% remove-all-attachments

Code Review | Remove all attachments

WordPress plugin Remove all attachments scored84%from 54 tests.

About plugin

  • Plugin page: remove-all-attach...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.2.2
  • WordPress version: 6.3.1
  • First release: Jul 16, 2015
  • Latest release: Jul 17, 2015
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: dubbofeng (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /836 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Remove all attachments
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0039.06 ▼3.71
Dashboard /wp-admin3.31 ▼0.0447.52 ▼18.41
Posts /wp-admin/edit.php3.36 ▲0.0051.05 ▲1.47
Add New Post /wp-admin/post-new.php5.89 ▲0.0097.80 ▼2.84
Media Library /wp-admin/upload.php3.23 ▲0.0036.83 ▲1.80

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Remove all attachments
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.35 ▲0.161.82 ▲0.2738.86 ▼2.21
Dashboard /wp-admin2,195 ▲215.55 ▼0.0992.15 ▼3.7241.97 ▲1.68
Posts /wp-admin/edit.php2,100 ▲32.02 ▲0.0640.50 ▼2.4036.09 ▲1.52
Add New Post /wp-admin/post-new.php1,535 ▲418.07 ▼4.72606.75 ▼66.0863.54 ▲9.31
Media Library /wp-admin/upload.php1,403 ▲64.20 ▲0.0695.78 ▼10.8642.26 ▼2.85

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

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)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/remove-all-attachments/remove-all-attachments.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: Screenshot #1 (http://dubbofeng.com/misc/remove_all_attachment.png) image required
You can take inspiration from this readme.txt

remove-all-attachments/remove-all-attachments.php 92% from 13 tests

The main PHP file in "Remove all attachments" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 241 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin16 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP14916

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.00
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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 files were detected