84% safe-attachment-names

Code Review | Safe Attachment Names

WordPress plugin Safe Attachment Names scored84%from 54 tests.

About plugin

  • Plugin page: safe-attachment-n...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1.1
  • WordPress version: 6.3.1
  • First release: May 4, 2015
  • Latest release: Feb 20, 2023
  • Number of updates: 11
  • Update frequency: every 259.1 days
  • Top authors: nuagelab (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,463 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼6.89ms] Passed 4 tests

An overview of server-side resources used by Safe Attachment Names
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0332.74 ▼3.96
Dashboard /wp-admin3.34 ▲0.0342.26 ▼7.27
Posts /wp-admin/edit.php3.39 ▲0.0344.81 ▲0.89
Add New Post /wp-admin/post-new.php5.92 ▲0.0379.09 ▼17.23
Media Library /wp-admin/upload.php3.26 ▲0.0334.92 ▲2.63

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Safe Attachment Names
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.34 ▼0.222.09 ▲0.4539.39 ▲1.59
Dashboard /wp-admin2,189 ▲95.56 ▼0.1185.81 ▲0.9140.74 ▼2.16
Posts /wp-admin/edit.php2,100 ▼02.01 ▼0.0238.46 ▲1.8138.02 ▲2.32
Add New Post /wp-admin/post-new.php1,529 ▼723.27 ▲5.02623.72 ▲6.8565.84 ▲6.62
Media Library /wp-admin/upload.php1,400 ▲64.18 ▲0.0294.15 ▼0.5945.19 ▲1.26

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Please fix the following
  • 1× 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/safe-attachment-names/safe-attachment-names.php:51

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: attachments, administration, special characters, admin, attachment...

safe-attachment-names/safe-attachment-names.php Passed 13 tests

The principal PHP file in "Safe Attachment Names" v. 1.0.0 is loaded by WordPress automatically on each request
111 characters long description:
Automatically detect and change the name of attachments containing special characters such as accented letters.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin348 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PO File2276913178
PHP16079170

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity26.00
▷ Minimum class complexity26.00
▷ Maximum class complexity26.00
Average method complexity4.12
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods112.50%
▷ Public methods562.50%
▷ Protected methods00.00%
▷ Private methods337.50%
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

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin