78% svg-vector-icon-plugin

Code Review | WP SVG Icons

WordPress plugin WP SVG Icons scored 78% from 54 tests.

About plugin

  • Plugin page: svg-vector-icon-p...
  • Plugin version: 3.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.9
  • WordPress version: 5.9.2
  • First release: Jul 20, 2013
  • Latest release: Jan 26, 2022
  • Number of updates: 265
  • Update frequency: every 11.9 days
  • Top authors: eherman24 (99.62%)

Code review

54 tests

User reviews

218 reviews

Install metrics

40,000+ active / 489,843 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼336.21ms] Passed 4 tests

Analyzing server-side resources used by WP SVG Icons
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0357.87 ▲0.56
Dashboard /wp-admin3.46 ▲0.0533.62 ▲1.18
Posts /wp-admin/edit.php3.68 ▲0.0442.87 ▼67.70
Add New Post /wp-admin/post-new.php6.92 ▼0.05101.81 ▼1,278.24
Media Library /wp-admin/upload.php3.34 ▲0.0425.72 ▲0.55
Settings /wp-admin/admin.php?page=wp_svg_icons3.3124.37
Custom Icon Set /wp-admin/admin.php?page=wp-svg-icons-custom-set3.4523.96
Upgrade /wp-admin/admin.php?page=wp-svg-icons-upgrade3.3924.05
Default Icon Set /wp-admin/admin.php?page=wp-svg-icons3.6632.44

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 53 new files
Database: no new tables, 1 new option
New WordPress options
wp_svg_icons_activation_date

Browser metrics Passed 4 tests

WP SVG Icons: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,836 ▲8216.11 ▲0.366.56 ▲0.672.45 ▼0.24
Dashboard /wp-admin2,965 ▲1116.83 ▲0.65117.03 ▼15.76175.63 ▲11.23
Posts /wp-admin/edit.php2,733 ▲452.96 ▼0.2768.75 ▲5.14212.12 ▲71.57
Add New Post /wp-admin/post-new.php1,712 ▲118.20 ▼3.07414.29 ▼37.91199.34 ▲22.63
Media Library /wp-admin/upload.php1,766 ▲685.94 ▲0.48153.82 ▲14.18184.92 ▼75.39
Settings /wp-admin/admin.php?page=wp_svg_icons1,2062.86114.28138.51
Custom Icon Set /wp-admin/admin.php?page=wp-svg-icons-custom-set1,2702.8967.87195.11
Upgrade /wp-admin/admin.php?page=wp-svg-icons-upgrade1,3182.8859.70259.46
Default Icon Set /wp-admin/admin.php?page=wp-svg-icons11,8362.9368.34184.66

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/svg-vector-icon-plugin/includes/class-wp-svg-icons-uninstall.php+47
    Non-static method WP_SVG_Icons_Uninstall::wp_svg_icons_delete_entire_directory() should not be called statically

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
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-vector-icon-plugin/admin/partials/wp-svg-icons-views-test.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_current_screen() in wp-content/plugins/svg-vector-icon-plugin/admin/partials/wp-svg-icons-default-icons-page.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
These attributes need your attention:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

svg-vector-icon-plugin/wp-svg-icons.php 85% from 13 tests

The primary PHP file in "WP SVG Icons" version 3.2.3 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("svg-vector-icon-plugin.php" instead of "wp-svg-icons.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin6,739 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP157066213,332
SVG1002,286
CSS1116345909
JavaScript56052212

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity5.11
▷ Minimum class complexity1.00
▷ Maximum class complexity22.00
Average method complexity1.80
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods46
▷ Static methods48.70%
▷ Public methods4086.96%
▷ Protected methods00.00%
▷ Private methods613.04%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
13 PNG files occupy 0.10MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/images/download-icon-small.png1.72KB0.96KB▼ 44.11%
admin/images/svg-icons-front-end-menu.png27.00KB27.45KB0.00%
includes/images/zip-icon-small.png1.69KB1.16KB▼ 31.00%
admin/images/svg-icons-customizer.png26.26KB27.55KB0.00%
includes/images/trash-icon-small.png1.35KB0.48KB▼ 64.43%