78% wp-svg-images

Code Review | WP SVG Images

WordPress plugin WP SVG Images scored78%from 54 tests.

About plugin

  • Plugin page: wp-svg-images
  • Plugin version: 4.2
  • PHP compatiblity: 5.6.40+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3
  • WordPress version: 6.3.1
  • First release: Aug 26, 2016
  • Latest release: Aug 5, 2023
  • Number of updates: 84
  • Update frequency: every 30.2 days
  • Top authors: kubiq (86.9%)ShortPixel (8.33%)petredobrescu (7.14%)

Code review

54 tests

User reviews

12 reviews

Install metrics

30,000+ active /200,777 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼9.92ms] Passed 4 tests

Analyzing server-side resources used by WP SVG Images
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0738.39 ▼2.60
Dashboard /wp-admin3.43 ▲0.1340.72 ▼5.85
Posts /wp-admin/edit.php3.53 ▲0.1844.58 ▼6.63
Add New Post /wp-admin/post-new.php6.13 ▲0.2475.60 ▼24.58
Media Library /wp-admin/upload.php3.37 ▲0.1534.75 ▲1.43

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 18 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by WP SVG Images
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲3814.35 ▼0.001.79 ▲0.2038.05 ▼4.68
Dashboard /wp-admin2,202 ▲255.63 ▲0.0288.04 ▼3.0334.57 ▼7.01
Posts /wp-admin/edit.php2,108 ▲82.00 ▼0.0035.71 ▼2.4037.33 ▲6.40
Add New Post /wp-admin/post-new.php1,544 ▲1818.17 ▼4.90601.76 ▼16.0067.53 ▲6.45
Media Library /wp-admin/upload.php1,438 ▲384.21 ▲0.01108.48 ▲2.5045.91 ▼1.47
SVG images /wp-admin/wp-svg-images.php260.420.1314.39

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • 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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Interface 'enshrined\\svgSanitize\\data\\TagInterface' not found in wp-content/plugins/wp-svg-images/svg-sanitizer/data/AllowedTags.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-svg-images/upsell.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'enshrined\\svgSanitize\\data\\AttributeInterface' not found in wp-content/plugins/wp-svg-images/svg-sanitizer/data/AllowedAttributes.php:9

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/wp-svg-images.php
    • > Network (severe)
    wp-admin/wp-svg-images.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
4 plugin tags: svg, svg upload, svg support, sanitization

wp-svg-images/wp-svg-images.php 92% from 13 tests

The main file in "WP SVG Images" v. 4.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • 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

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin1,500 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP132114641,478
JavaScript12020
CSS1001
SVG1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity11.86
▷ Minimum class complexity1.00
▷ Maximum class complexity66.00
Average method complexity2.79
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces4
Interfaces2
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods89
▷ Static methods910.11%
▷ Public methods6876.40%
▷ Protected methods2123.60%
▷ Private methods00.00%
Functions3
▷ Named functions00.00%
▷ Anonymous functions3100.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected