68% attach-files-widget

Code Review | Attach Files Widget

WordPress plugin Attach Files Widget scored68%from 54 tests.

About plugin

  • Plugin page: attach-files-widget
  • Plugin version: 2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-4.0
  • WordPress version: 6.3.1
  • First release: Mar 17, 2013
  • Latest release: Oct 28, 2014
  • Number of updates: 12
  • Update frequency: every 49.2 days
  • Top authors: VeXell (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

300+ active /9,874 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.62MB] [CPU: ▼45.10ms] Passed 4 tests

This is a short check of server-side resources used by Attach Files Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.38 ▼1.0910.34 ▼36.03
Dashboard /wp-admin2.39 ▼0.9117.56 ▼31.35
Posts /wp-admin/edit.php2.39 ▼0.9712.30 ▼33.36
Add New Post /wp-admin/post-new.php2.39 ▼3.5011.00 ▼79.67
Media Library /wp-admin/upload.php2.39 ▼0.8411.54 ▼22.79

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 21 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_widget_ex_attachments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Attach Files Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,952 ▲20614.63 ▲0.231.83 ▲0.2044.23 ▲4.88
Dashboard /wp-admin2,353 ▲1656.32 ▲0.26136.19 ▲29.0541.38 ▼3.20
Posts /wp-admin/edit.php2,270 ▲1843.40 ▲1.3949.39 ▲10.9131.11 ▼3.90
Add New Post /wp-admin/post-new.php1,535 ▲223.16 ▼0.10686.69 ▲39.8837.54 ▼17.64
Media Library /wp-admin/upload.php1,400 ▲154.29 ▲0.0088.66 ▼6.8442.49 ▲1.58

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/attach-files-widget/WidgetExAttachments.php+7
    Methods with the same name as their class will not be constructors in a future version of PHP; WidgetExAttachments has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_widget_ex_attachments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/attach-files-widget/widgetattachments.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/attach-files-widget/WidgetExAttachments.php:7

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 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
7 plugin tags: admin, files, sidebar, enqueue media, upload...

attach-files-widget/widgetattachments.php 92% from 13 tests

The principal PHP file in "Attach Files Widget" v. 2.4 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("attach-files-widget.php" instead of "widgetattachments.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin450 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP27927273
CSS27074
JavaScript121258
PO File1131545

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity22.00
▷ Minimum class complexity22.00
▷ Maximum class complexity22.00
Average method complexity4.50
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
12 PNG files occupy 0.29MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png35.54KB13.59KB▼ 61.77%
assets/images/pdf.png2.91KB1.94KB▼ 33.36%
assets/images/text.png1.76KB2.71KB0.00%
assets/images/video.png2.79KB1.87KB▼ 33.06%
assets/images/compressed.png3.40KB2.01KB▼ 41.03%