94% post-attached-media-downloads

Code Review | Post Attached Media Downloads

WordPress plugin Post Attached Media Downloads scored 94% from 54 tests.

About plugin

  • Plugin page: post-attached-med...
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.0-4.9
  • WordPress version: 5.8.1
  • First release: Mar 27, 2014
  • Latest release: Nov 12, 2017
  • Number of updates: 23
  • Update frequency: every 57.7 days
  • Top authors: Clorith (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active / 4,041 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.05MB] [CPU: ▼164.95ms] Passed 4 tests

Server-side resources used by Post Attached Media Downloads
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.0646.65 ▲10.99
Dashboard /wp-admin3.12 ▲0.0554.34 ▼21.26
Posts /wp-admin/edit.php3.21 ▲0.0957.40 ▼14.35
Add New Post /wp-admin/post-new.php5.49 ▲0.05120.63 ▼596.25
Media Library /wp-admin/upload.php3.06 ▲0.0626.92 ▼27.92

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Post Attached Media Downloads
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,671 ▲1915.07 ▼0.2920.43 ▲10.7976.79 ▼61.98
Dashboard /wp-admin2,931 ▲366.00 ▼0.04198.10 ▼46.02174.78 ▼93.04
Posts /wp-admin/edit.php2,744 ▲43.25 ▲0.03103.40 ▼10.37172.50 ▼59.74
Add New Post /wp-admin/post-new.php1,661 ▼1,98518.18 ▼0.15556.67 ▼239.71239.42 ▲47.36
Media Library /wp-admin/upload.php1,746 ▼35.42 ▼0.08288.30 ▲30.29235.37 ▲16.13

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller ran successfully

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 everything seems fine, this is not an exhaustive test

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 take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/post-attached-media-downloads/post-attached-media-downloads.php:42

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: link, download, shortcode, post, media...

post-attached-media-downloads/post-attached-media-downloads.php Passed 13 tests

"Post Attached Media Downloads" version 1.2.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
59 characters long description:
Create simple download lists for use in your posts or theme

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 detected399 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP164290239
JavaScript3230154
CSS1006

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity27.00
▷ Minimum class complexity27.00
▷ Maximum class complexity27.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
resources/images/download.png2.33KB2.36KB0.00%