78% enable-svg-webp-ico-upload

Code Review | Enable SVG, WebP & ICO Upload  

WordPress plugin Enable SVG, WebP & ICO Upload   scored 78% from 54 tests.

About plugin

  • Plugin page: enable-svg-webp-i...
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2
  • WordPress version: 6.3.1
  • First release: Apr 7, 2021
  • Latest release: Apr 3, 2023
  • Number of updates: 16
  • Update frequency: every 45.4 days
  • Top authors: ideastocode (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

7,000+ active / 21,223 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼3.09ms] Passed 4 tests

This is a short check of server-side resources used by Enable SVG, WebP & ICO Upload  
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0436.20 ▼3.42
Dashboard /wp-admin3.42 ▲0.1144.97 ▼3.38
Posts /wp-admin/edit.php3.51 ▲0.1648.13 ▼0.78
Add New Post /wp-admin/post-new.php6.13 ▲0.2484.83 ▼4.78
Media Library /wp-admin/upload.php3.36 ▲0.1333.86 ▲2.51

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Enable SVG, WebP & ICO Upload  
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,870 ▲13513.33 ▼1.261.64 ▲0.0239.74 ▼0.80
Dashboard /wp-admin2,255 ▲675.86 ▲1.00105.25 ▲5.8642.64 ▼1.11
Posts /wp-admin/edit.php2,148 ▲592.03 ▼0.1042.84 ▲1.8636.87 ▼0.13
Add New Post /wp-admin/post-new.php1,570 ▲3123.48 ▲0.33583.64 ▼12.2653.28 ▲5.05
Media Library /wp-admin/upload.php1,441 ▲564.25 ▼0.0396.33 ▼4.0642.03 ▼2.66

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
    • widget_recent-comments
    • ideastocode_module_settings
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • itc_svg_upload_settings
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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 fix the following
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/enable-svg-webp-ico-upload/admin/partials/_other_plugins.php
    • > /wp-content/plugins/enable-svg-webp-ico-upload/admin/partials/_about.php
    • > /wp-content/plugins/enable-svg-webp-ico-upload/admin/partials/admin-notice-alert.php
  • 11× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/enable-svg-webp-ico-upload/admin/partials/admin-display.php:8
    • > PHP Warning
      Use of undefined constant ITC_SVG_UPLOAD_PLUGIN_DIR_URL - assumed 'ITC_SVG_UPLOAD_PLUGIN_DIR_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/enable-svg-webp-ico-upload/admin/partials/_about.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'ITC_SVG_Upload_BaseController' not found in wp-content/plugins/enable-svg-webp-ico-upload/includes/class-itc.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/enable-svg-webp-ico-upload/admin/partials/_settings.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'ITC_SVG_Upload_BaseController' not found in wp-content/plugins/enable-svg-webp-ico-upload/public/class-public.php:2
    • > PHP Warning
      Use of undefined constant ITC_SVG_UPLOAD_PLUGIN_DIR_URL - assumed 'ITC_SVG_UPLOAD_PLUGIN_DIR_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/enable-svg-webp-ico-upload/admin/partials/_other_plugins.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function menu_page_url() in wp-content/plugins/enable-svg-webp-ico-upload/admin/partials/admin-notice.php:7
    • > PHP Warning
      Use of undefined constant ITC_SVG_UPLOAD_PLUGIN_DIR_URL - assumed 'ITC_SVG_UPLOAD_PLUGIN_DIR_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/enable-svg-webp-ico-upload/admin/partials/_other_plugins.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'ITC_SVG_Upload_BaseController' not found in wp-content/plugins/enable-svg-webp-ico-upload/includes/class-deactivator.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/enable-svg-webp-ico-upload/admin/class-admin.php:2

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

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
7 plugin tags: ico, formats, webp, svg, image...

enable-svg-webp-ico-upload/itc-svg-upload.php 85% from 13 tests

"Enable SVG, WebP & ICO Upload  " version 1.0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("enable-svg-webp-ico-upload.php" instead of "itc-svg-upload.php")
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected850 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP2012946672
CSS1313147
JavaScript16031

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity5.18
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity1.69
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods68
▷ Static methods00.00%
▷ Public methods6189.71%
▷ Protected methods00.00%
▷ Private methods710.29%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
3 PNG files occupy 0.07MB with 0.06MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/security-header-logo.png18.20KB1.58KB▼ 91.30%
admin/img/disable-email-notification-logo.png30.74KB6.96KB▼ 77.37%
admin/img/ideasToCode.png27.76KB4.21KB▼ 84.83%