99% add-svg-support-for-media-uploader-inventivo

Code Review | Add SVG Support for Media Uploader | inventivo

WordPress plugin Add SVG Support for Media Uploader | inventivo scored 99% from 54 tests.

About plugin

  • Plugin page: add-svg-support-f...
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.7.1
  • WordPress version: 5.9.2
  • First release: Oct 5, 2018
  • Latest release: Apr 30, 2021
  • Number of updates: 31
  • Update frequency: every 30.3 days
  • Top authors: inventivode (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 929 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼298.64ms] Passed 4 tests

A check of server-side resources used by Add SVG Support for Media Uploader | inventivo
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.22 ▲0.4755.68 ▲27.92
Dashboard /wp-admin4.06 ▲0.0249.08 ▲8.21
Posts /wp-admin/edit.php4.34 ▲0.0248.70 ▲3.93
Add New Post /wp-admin/post-new.php7.59 ▼0.0195.74 ▼1,163.19
Media Library /wp-admin/upload.php4.00 ▲0.0131.90 ▼43.49

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Add SVG Support for Media Uploader | inventivo
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,836 ▲8215.55 ▼0.069.32 ▲2.542.14 ▼0.56
Dashboard /wp-admin2,960 ▲1036.19 ▲0.02118.33 ▼12.10198.18 ▲27.97
Posts /wp-admin/edit.php2,759 ▲683.23 ▼0.0166.05 ▲1.50305.18 ▲160.73
Add New Post /wp-admin/post-new.php1,802 ▲5021.39 ▼0.20441.44 ▼40.38275.06 ▲109.62
Media Library /wp-admin/upload.php1,759 ▲615.55 ▲0.03128.55 ▼25.53228.79 ▲37.96

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstall script ran successfully

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)
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: svg, upload svg, svg media uploader

add-svg-support-for-media-uploader-inventivo/inventivo-addsvgsupport.php 77% from 13 tests

Analyzing the main PHP file in "Add SVG Support for Media Uploader | inventivo" version 1.0.5
It is important to fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("add-svg-support-for-media-uploader-inventivo.php" instead of "inventivo-addsvgsupport.php")

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
Everything looks great! No dangerous files found in this plugin108 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP1112768
Markdown125029
Sass11010
CSS1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.33
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.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

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/images/icon-256x256-1.png33.55KB11.45KB▼ 65.87%