84% wp-attachment-download

Code Review | WP Attachment Download

WordPress plugin WP Attachment Download scored84%from 54 tests.

About plugin

  • Plugin page: wp-attachment-dow...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.4.1
  • WordPress version: 6.3.1
  • First release: Apr 23, 2019
  • Latest release: Apr 30, 2020
  • Number of updates: 12
  • Update frequency: every 40.0 days
  • Top authors: rybnitom (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /677 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▼4.76ms] Passed 4 tests

Analyzing server-side resources used by WP Attachment Download
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1041.82 ▲2.39
Dashboard /wp-admin3.40 ▲0.0548.78 ▼13.57
Posts /wp-admin/edit.php3.51 ▲0.1554.42 ▲5.95
Add New Post /wp-admin/post-new.php5.98 ▲0.0984.78 ▼13.81
Media Library /wp-admin/upload.php3.32 ▲0.0945.15 ▲11.23
Attachments /wp-admin/tools.php?page=wp-attachment-download3.3431.33

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

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

Browser metrics Passed 4 tests

A check of browser resources used by WP Attachment Download
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲5813.31 ▼1.072.01 ▼0.0738.37 ▼5.40
Dashboard /wp-admin2,210 ▲225.88 ▲1.02107.54 ▲0.5635.78 ▼2.59
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0440.88 ▲3.1135.69 ▲2.14
Add New Post /wp-admin/post-new.php1,517 ▼217.43 ▼5.75673.35 ▼45.5459.24 ▼6.25
Media Library /wp-admin/upload.php1,395 ▲104.13 ▼0.05113.65 ▲12.7746.22 ▼2.00
Attachments /wp-admin/tools.php?page=wp-attachment-download7811.8832.9026.51

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/wp-attachment-download/admin/partials/wp-attachment-download-admin-display.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: zip, media, downloads, attachments

wp-attachment-download/wp-attachment-download.php Passed 13 tests

The main PHP file in "WP Attachment Download" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this plugin
103 characters long description:
Plugin adds functionality to download posts attachments build with ACF file fields from administration.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin742 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP10157581481
PO File14349163
JavaScript2123568
CSS24430

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity6.17
▷ Minimum class complexity1.00
▷ Maximum class complexity28.00
Average method complexity1.84
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods37
▷ Static methods25.41%
▷ Public methods3389.19%
▷ Protected methods00.00%
▷ Private methods410.81%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
2 PNG files occupy 0.10MB with 0.05MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png46.46KB25.34KB▼ 45.44%
assets/screenshot-2.png57.11KB27.53KB▼ 51.80%