90% upload-files-by-default-when-inserting-media

Code Review | Upload Files by Default When Inserting Media

WordPress plugin Upload Files by Default When Inserting Media scored90%from 54 tests.

About plugin

  • Plugin page: upload-files-by-d...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.0-6.1
  • WordPress version: 6.3.1
  • First release: Sep 24, 2014
  • Latest release: Nov 4, 2022
  • Number of updates: 23
  • Update frequency: every 128.9 days
  • Top authors: numeeja (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,672 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
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼7.60ms] Passed 4 tests

Server-side resources used by Upload Files by Default When Inserting Media
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0053.59 ▲1.99
Dashboard /wp-admin3.31 ▲0.0150.35 ▼4.89
Posts /wp-admin/edit.php3.36 ▲0.0049.88 ▼3.38
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.53 ▼18.37
Media Library /wp-admin/upload.php3.23 ▲0.0035.29 ▼3.76

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Upload Files by Default When Inserting Media
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.23 ▼0.222.14 ▲0.3541.71 ▼2.47
Dashboard /wp-admin2,195 ▲155.62 ▼0.0590.81 ▼6.8039.09 ▼4.29
Posts /wp-admin/edit.php2,097 ▼31.99 ▼0.0333.36 ▼3.8633.51 ▼3.76
Add New Post /wp-admin/post-new.php1,529 ▲322.65 ▼0.41650.75 ▼17.3352.76 ▼4.42
Media Library /wp-admin/upload.php1,400 ▼04.21 ▼0.04102.69 ▲2.7945.09 ▼0.14

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: change, image, page, add, default...

upload-files-by-default-when-inserting-media/upload-files-by-default-when-inserting-media.php Passed 13 tests

The main PHP file in "Upload Files by Default When Inserting Media" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
120 characters long description:
Makes the upload files tab active rather than the Media Library Tab when adding images or other media to a page or post.

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
Everything looks great! No dangerous files found in this plugin29 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1162829

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.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
No PNG files were detected