78% easy-svg

Code Review | Easy SVG Support

WordPress plugin Easy SVG Support scored78%from 54 tests.

About plugin

  • Plugin page: easy-svg
  • Plugin version: 3.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.4
  • WordPress version: 6.3.1
  • First release: Nov 28, 2017
  • Latest release: Nov 5, 2023
  • Number of updates: 46
  • Update frequency: every 47.2 days
  • Top authors: Benjamin_Zekavica (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

20,000+ active /114,613 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.23MB] [CPU: ▼7.58ms] Passed 4 tests

This is a short check of server-side resources used by Easy SVG Support
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2234.77 ▼6.55
Dashboard /wp-admin3.58 ▲0.2846.74 ▼1.15
Posts /wp-admin/edit.php3.63 ▲0.2746.27 ▼2.32
Add New Post /wp-admin/post-new.php6.10 ▲0.2185.71 ▼20.30
Media Library /wp-admin/upload.php3.44 ▲0.2135.87 ▲2.05

Server storage [IO: ▲1.25MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 445 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Easy SVG Support: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲3014.27 ▲0.081.73 ▲0.0340.75 ▼2.56
Dashboard /wp-admin2,200 ▲205.58 ▲0.0084.76 ▼4.9939.06 ▼4.43
Posts /wp-admin/edit.php2,105 ▲22.02 ▲0.0735.24 ▼8.2831.71 ▼1.30
Add New Post /wp-admin/post-new.php1,528 ▲223.62 ▲0.57652.78 ▼29.1158.85 ▲7.18
Media Library /wp-admin/upload.php1,399 ▼44.19 ▲0.1195.89 ▼3.1540.46 ▼1.68

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/easy-svg/vendor/enshrined/svg-sanitize/src/svg-scanner.php
  • 171× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_ChildDef_Required' not found in wp-content/plugins/easy-svg/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Optional.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_AttrDef' not found in wp-content/plugins/easy-svg/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Host.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_HTMLModule' not found in wp-content/plugins/easy-svg/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeEmbed.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_HTMLModule' not found in wp-content/plugins/easy-svg/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Hypertext.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_AttrDef' not found in wp-content/plugins/easy-svg/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_AttrTransform' not found in wp-content/plugins/easy-svg/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Background.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_AttrDef' not found in wp-content/plugins/easy-svg/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_URIFilter_DisableExternal' not found in wp-content/plugins/easy-svg/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/DisableExternalResources.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4' not found in wp-content/plugins/easy-svg/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Strict.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_Definition' not found in wp-content/plugins/easy-svg/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIDefinition.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
  • Screenshots: Please describe screenshot #3 in easy-svg/assets to your readme.txt
The official readme.txt is a good inspiration

easy-svg/easy-svg.php Passed 13 tests

Analyzing the main PHP file in "Easy SVG Support" version 3.5
30 characters long description:
Add SVG Support for WordPress.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin19,762 lines of code in 291 files:
LanguageFilesBlank linesComment linesLines of code
PHP2663,50511,08519,039
PO File159090426
JSON400214
Markdown355073
CSS1316
JavaScript1113
INI1111

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 232)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity13.22
▷ Minimum class complexity1.00
▷ Maximum class complexity539.00
Average method complexity4.73
▷ Minimum method complexity1.00
▷ Maximum method complexity232.00
Code structure
Namespaces6
Interfaces2
Traits0
Classes251
▷ Abstract classes155.98%
▷ Concrete classes23694.02%
▷ Final classes00.00%
Methods851
▷ Static methods738.58%
▷ Public methods66077.56%
▷ Protected methods10612.46%
▷ Private methods859.99%
Functions18
▷ Named functions1266.67%
▷ Anonymous functions633.33%
Constants64
▷ Global constants57.81%
▷ Class constants5992.19%
▷ Public constants59100.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