84% media-insert-from-themes-dir

Code Review | Media Insert from Themes Dir

WordPress plugin Media Insert from Themes Dir scored84%from 54 tests.

About plugin

  • Plugin page: media-insert-from...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.6
  • WordPress version: 6.3.1
  • First release: Jun 22, 2013
  • Latest release: Aug 7, 2013
  • Number of updates: 11
  • Update frequency: every 27.3 days
  • Top authors: gqevu6bsiz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,210 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼4.04ms] Passed 4 tests

This is a short check of server-side resources used by Media Insert from Themes Dir
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.16 ▼0.23
Dashboard /wp-admin3.35 ▲0.0449.01 ▲0.51
Posts /wp-admin/edit.php3.40 ▲0.0450.44 ▲0.89
Add New Post /wp-admin/post-new.php5.95 ▲0.0683.54 ▼17.34
Media Library /wp-admin/upload.php3.27 ▲0.0437.97 ▲2.91

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Media Insert from Themes Dir
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.26 ▼0.111.63 ▲0.1342.66 ▲3.04
Dashboard /wp-admin2,198 ▲215.62 ▲0.0690.96 ▲2.2537.93 ▼5.09
Posts /wp-admin/edit.php2,100 ▼02.03 ▲0.0238.62 ▼1.8938.98 ▲0.36
Add New Post /wp-admin/post-new.php1,596 ▲7023.50 ▲0.46671.14 ▲17.2266.75 ▲10.87
Media Library /wp-admin/upload.php1,457 ▲544.88 ▲0.66105.63 ▲7.6029.84 ▼13.36

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
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 plugin_dir_path() in wp-content/plugins/media-insert-from-themes-dir/media-insert-from-themes-dir.php:50

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (Additional menu location), #2 (File selection screen), #3 (After selecting the file), #4 (Inserted into the content), #5 (Tags that are inserted)
You can look at the official readme.txt

media-insert-from-themes-dir/media-insert-from-themes-dir.php 92% from 13 tests

The primary PHP file in "Media Insert from Themes Dir" version 1.1 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
Good job! No executable or dangerous file extensions detected810 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript115549323
CSS1335230
PHP17032222
PO File27035

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity22.00
▷ Minimum class complexity22.00
▷ Maximum class complexity22.00
Average method complexity3.33
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.32MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png9.50KB4.78KB▼ 49.65%
screenshot-2.png47.86KB18.13KB▼ 62.11%
screenshot-5.png12.83KB6.43KB▼ 49.86%
screenshot-3.png98.19KB33.62KB▼ 65.76%
images/dir.png1.62KB1.68KB0.00%