78% sv-media-library

Code Review | SV Media Library

WordPress plugin SV Media Library scored78%from 54 tests.

About plugin

  • Plugin page: sv-media-library
  • Plugin version: 2.0.00
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Jul 24, 2019
  • Latest release: May 24, 2023
  • Number of updates: 16
  • Update frequency: every 87.6 days
  • Top authors: Matthias Reuter (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /925 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: ▲1.28MB] [CPU: ▼3.38ms] Passed 4 tests

An overview of server-side resources used by SV Media Library
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.72 ▲1.2646.61 ▲7.18
Dashboard /wp-admin4.60 ▲1.2650.08 ▼9.03
Posts /wp-admin/edit.php4.65 ▲1.3050.58 ▲1.45
Add New Post /wp-admin/post-new.php7.20 ▲1.3287.89 ▼13.11
Media Library /wp-admin/upload.php4.52 ▲1.3046.66 ▲14.08
Info /wp-admin/admin.php?page=straightvisions4.5243.23
SV Media Library /wp-admin/admin.php?page=sv_media_library4.4743.08

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 165 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
db_upgraded
sv_media_library_scripts_settings_flush_css_cache
sv_media_library_scripts_settings_sv_core_color_picker_attached
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by SV Media Library
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,934 ▲18814.75 ▲0.381.72 ▲0.1441.33 ▼0.53
Dashboard /wp-admin2,341 ▲1505.86 ▼0.0498.43 ▼0.2480.37 ▲39.26
Posts /wp-admin/edit.php2,224 ▲1532.04 ▲0.0133.74 ▼2.8734.94 ▼0.53
Add New Post /wp-admin/post-new.php1,666 ▲15223.60 ▲6.00723.96 ▲74.8036.03 ▼15.44
Media Library /wp-admin/upload.php1,514 ▲1264.30 ▲0.0998.91 ▲5.2944.35 ▲3.85
Info /wp-admin/admin.php?page=straightvisions1,64410.59205.34153.21
SV Media Library /wp-admin/admin.php?page=sv_media_library1,46510.6173.58116.17

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 8 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • sv_media_library_scripts_settings_flush_css_cache
    • sv_media_library_scripts_settings_sv_core_color_picker_attached
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 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)
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× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/sv-media-library/lib/core_plugin/core/settings/tpl/setting_checkbox_field.php
  • 236× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: props in wp-content/plugins/sv-media-library/lib/core_plugin/core/settings/tpl/setting_email.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/sv-media-library/lib/core_plugin/core/info/backend/tpl/about.php:2
    • > PHP Notice
      Undefined variable: props in wp-content/plugins/sv-media-library/lib/core_plugin/core/settings/tpl/setting_box_shadow_tpl/vertical_length.php on line 1
    • > PHP Notice
      Undefined variable: props in wp-content/plugins/sv-media-library/lib/core_plugin/core/settings/tpl/setting_text.php on line 6
    • > PHP Notice
      Undefined variable: props in wp-content/plugins/sv-media-library/lib/core_plugin/core/settings/tpl/setting_box_shadow_tpl/horizontal_length.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/sv-media-library/lib/core_plugin/core/settings/tpl/setting_password.php:9
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/sv-media-library/lib/core_plugin/core/settings/tpl/setting_border.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_textarea() in wp-content/plugins/sv-media-library/lib/core_plugin/core/settings/tpl/setting_textarea.php:11
    • > PHP Notice
      Undefined variable: props in wp-content/plugins/sv-media-library/lib/core_plugin/core/settings/tpl/setting_upload.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/sv-media-library/lib/core_plugin/core/settings/tpl/setting_checkbox_field.php on line 20

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 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention: The official readme.txt might help

sv-media-library/sv_media_library.php 85% from 13 tests

The entry point to "SV Media Library" version 2.0.00 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("sv-media-library.php" instead of "sv_media_library.php")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

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
Success! There were no dangerous files found in this plugin9,436 lines of code in 139 files:
LanguageFilesBlank linesComment linesLines of code
PHP921,0061,3234,845
CSS28288892,837
JavaScript1318685681
SVG200585
PO File2272384486
Markdown2002

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity18.81
▷ Minimum class complexity1.00
▷ Maximum class complexity145.00
Average method complexity2.45
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes37
▷ Abstract classes12.70%
▷ Concrete classes3697.30%
▷ Final classes00.00%
Methods429
▷ Static methods81.86%
▷ Public methods38188.81%
▷ Protected methods266.06%
▷ Private methods225.13%
Functions20
▷ Named functions00.00%
▷ Anonymous functions20100.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin