84% dd-attachments

Code Review | DD Attachments

WordPress plugin DD Attachments scored 84% from 54 tests.

About plugin

  • Plugin page: dd-attachments
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.9.8
  • WordPress version: 6.3.1
  • First release: Sep 23, 2018
  • Latest release: Sep 23, 2018
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: Mosterd3d (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 590 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 gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼0.33ms] Passed 4 tests

A check of server-side resources used by DD Attachments
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0638.44 ▲1.75
Dashboard /wp-admin3.36 ▲0.0646.28 ▼1.05
Posts /wp-admin/edit.php3.41 ▲0.0550.92 ▲2.04
Add New Post /wp-admin/post-new.php5.96 ▲0.0796.19 ▼4.08
Media Library /wp-admin/upload.php3.28 ▲0.0535.96 ▲2.97

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for DD Attachments
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,798 ▲6313.30 ▼1.071.63 ▼0.5240.73 ▼5.72
Dashboard /wp-admin2,201 ▲165.00 ▼0.8696.85 ▼1.4140.31 ▼6.74
Posts /wp-admin/edit.php2,094 ▲52.28 ▲0.2737.79 ▼3.9435.10 ▼3.83
Add New Post /wp-admin/post-new.php6,552 ▲5,03820.60 ▲2.93881.86 ▲232.9745.69 ▼3.24
Media Library /wp-admin/upload.php1,405 ▲144.33 ▲0.0299.32 ▲4.3942.43 ▲0.58

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 2× 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/dd-attachments/dd-attachments.php:39
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/dd-attachments/dd_templates/metabox-attachments.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% 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
Please fix the following attributes:
  • Screenshots: Please add an image for screenshot #2 (screenshot-2.png)
The official readme.txt is a good inspiration

dd-attachments/dd-attachments.php Passed 13 tests

The entry point to "DD Attachments" version 1.0 is a PHP file that has certain tags in its header comment area
37 characters long description:
A plug-in to add and edit attachments

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin702 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP25827295
CSS182212
JavaScript14911148
SVG20047

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity18.00
▷ Minimum class complexity18.00
▷ Maximum class complexity18.00
Average method complexity1.85
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.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
No PNG images were found in this plugin