78% svg-enabler

Code Review | SVG Enabler

WordPress plugin SVG Enabler scored78%from 54 tests.

About plugin

  • Plugin page: svg-enabler
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Jan 27, 2023
  • Latest release: Feb 7, 2023
  • Number of updates: 10
  • Update frequency: every 1.1 days
  • Top authors: Fatih Toprak (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /718 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

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

Server-side resources used by SVG Enabler
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2649.05 ▲1.08
Dashboard /wp-admin3.62 ▲0.3255.17 ▲3.53
Posts /wp-admin/edit.php3.67 ▲0.3254.93 ▲2.83
Add New Post /wp-admin/post-new.php6.14 ▲0.2594.22 ▼4.67
Media Library /wp-admin/upload.php3.48 ▲0.2540.63 ▲0.92

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

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

Browser metrics Passed 4 tests

SVG Enabler: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.34 ▼0.011.71 ▲0.0246.81 ▲2.47
Dashboard /wp-admin2,189 ▲95.56 ▼0.1189.69 ▼8.7539.92 ▼1.95
Posts /wp-admin/edit.php2,100 ▼01.96 ▼0.0335.68 ▼3.9034.61 ▼0.35
Add New Post /wp-admin/post-new.php1,528 ▲223.15 ▼0.53649.27 ▼55.8856.45 ▲2.46
Media Library /wp-admin/upload.php1,403 ▲64.21 ▲0.0199.03 ▼17.4045.16 ▼3.29

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

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)
Everything seems fine, however this is by no means an exhaustive test

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
Please take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/svg-enabler/vendor/enshrined/svg-sanitize/src/svg-scanner.php
  • 104× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/svg-enabler/vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/svg-enabler/vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/svg-enabler/vendor/composer/installers/src/Composer/Installers/AimeosInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/svg-enabler/vendor/composer/installers/src/Composer/Installers/ZendInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/svg-enabler/vendor/composer/installers/src/Composer/Installers/PimcoreInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Interface 'Composer\\Plugin\\PluginInterface' not found in wp-content/plugins/svg-enabler/vendor/composer/installers/src/Composer/Installers/Plugin.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/svg-enabler/vendor/composer/installers/src/Composer/Installers/GravInstaller.php:4
    • > PHP Warning
      array_values() expects parameter 1 to be array, null given in wp-content/plugins/svg-enabler/vendor/enshrined/svg-sanitize/src/svg-scanner.php on line 70
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/svg-enabler/vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/svg-enabler/vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: svg support, svg upload, allow svg upload, svg upload enabler

svg-enabler/index.php 92% from 13 tests

This is the main PHP file of "SVG Enabler" version 1.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("svg-enabler.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin4,382 lines of code in 132 files:
LanguageFilesBlank linesComment linesLines of code
PHP1267311,3613,983
JSON100208
YAML3313123
Markdown253068

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity3.42
▷ Minimum class complexity1.00
▷ Maximum class complexity50.00
Average method complexity2.45
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces7
Interfaces2
Traits0
Classes116
▷ Abstract classes10.86%
▷ Concrete classes11599.14%
▷ Final classes00.00%
Methods206
▷ Static methods2612.62%
▷ Public methods14067.96%
▷ Protected methods5526.70%
▷ Private methods115.34%
Functions11
▷ Named functions218.18%
▷ Anonymous functions981.82%
Constants5
▷ Global constants00.00%
▷ Class constants5100.00%
▷ Public constants5100.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
No PNG images were found in this plugin