84% remove-post-attachment

Code Review | Wordpress Remove Post Attachment

WordPress plugin Wordpress Remove Post Attachment scored84%from 54 tests.

About plugin

  • Plugin page: remove-post-attac...
  • Plugin version: 0.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7.0-3.8.1
  • WordPress version: 6.3.1
  • First release: Jan 27, 2014
  • Latest release: Jan 31, 2014
  • Number of updates: 6
  • Update frequency: every 0.7 days
  • Top authors: romainberger (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /968 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
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.14ms] Passed 4 tests

This is a short check of server-side resources used by Wordpress Remove Post Attachment
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0043.06 ▲0.86
Dashboard /wp-admin3.31 ▲0.0148.45 ▼0.59
Posts /wp-admin/edit.php3.36 ▲0.0051.87 ▼1.68
Add New Post /wp-admin/post-new.php5.91 ▲0.0291.79 ▼7.15
Media Library /wp-admin/upload.php3.23 ▲0.0035.82 ▲1.80

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Wordpress Remove Post Attachment
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲3113.54 ▼1.041.86 ▼0.1744.70 ▲2.24
Dashboard /wp-admin2,211 ▲234.85 ▼0.99109.09 ▲4.8442.33 ▼3.69
Posts /wp-admin/edit.php2,094 ▲22.02 ▲0.0238.94 ▼1.7334.45 ▼2.06
Add New Post /wp-admin/post-new.php1,516 ▼1717.69 ▼5.48673.89 ▲8.0854.16 ▼2.28
Media Library /wp-admin/upload.php1,393 ▲144.22 ▲0.03108.92 ▲0.4047.35 ▲0.18

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • 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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/remove-post-attachment/remove-post-attachment.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Contributors: Contributors not specified
  • Screenshots: Screenshot #1 (Detach an attachment) image required
The official readme.txt is a good inspiration

remove-post-attachment/remove-post-attachment.php Passed 13 tests

The main file in "Wordpress Remove Post Attachment" v. 0.1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
52 characters long description:
Allows detaching medias from a post from the gallery

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
No dangerous file extensions were detected80 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript16932
Markdown214028
PHP151220

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png35.63KB14.05KB▼ 60.57%