78% dynamic-svg-icons

Code Review | Dynamic SVG Icons

WordPress plugin Dynamic SVG Icons scored78%from 54 tests.

About plugin

  • Plugin page: dynamic-svg-icons
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.1.1
  • WordPress version: 6.3.1
  • First release: Apr 23, 2019
  • Latest release: Apr 29, 2019
  • Number of updates: 3
  • Update frequency: every 2.0 days
  • Top authors: philkurth (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /565 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
Install script ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼6.05ms] Passed 4 tests

Server-side resources used by Dynamic SVG Icons
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1039.31 ▲0.17
Dashboard /wp-admin3.37 ▲0.0346.54 ▼15.31
Posts /wp-admin/edit.php3.49 ▲0.1351.63 ▲2.56
Add New Post /wp-admin/post-new.php5.95 ▲0.0791.76 ▼5.97
Media Library /wp-admin/upload.php3.30 ▲0.0735.22 ▼3.09

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

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

Browser metrics Passed 4 tests

Dynamic SVG Icons: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,871 ▲8513.45 ▼1.178.08 ▲6.3537.45 ▼4.88
Dashboard /wp-admin2,195 ▲185.63 ▲0.0290.24 ▲5.0339.77 ▼3.83
Posts /wp-admin/edit.php2,100 ▼32.08 ▲0.0437.48 ▲1.2135.38 ▲2.72
Add New Post /wp-admin/post-new.php1,526 ▼223.36 ▲0.21604.87 ▼99.7451.36 ▼8.99
Media Library /wp-admin/upload.php1,403 ▼04.19 ▲0.0494.22 ▼15.6639.26 ▼12.25

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

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
The following issues need your attention
  • 788× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/dynamic-svg-icons/templates/icons/battery-three-quarters.php
    • > /wp-content/plugins/dynamic-svg-icons/templates/icons/window-maximize.php
    • > /wp-content/plugins/dynamic-svg-icons/templates/icons/tag.php
    • > /wp-content/plugins/dynamic-svg-icons/templates/icons/building-o.php
    • > /wp-content/plugins/dynamic-svg-icons/templates/icons/magnet.php
    • > /wp-content/plugins/dynamic-svg-icons/templates/icons/cube.php
    • > /wp-content/plugins/dynamic-svg-icons/templates/icons/caret-left.php
    • > /wp-content/plugins/dynamic-svg-icons/templates/icons/bar-chart.php
    • > /wp-content/plugins/dynamic-svg-icons/templates/icons/hourglass-3.php
    • > /wp-content/plugins/dynamic-svg-icons/templates/icons/music.php
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'DsvgIcons\\Framework\\View\\ViewBase' not found in wp-content/plugins/dynamic-svg-icons/app/View/View.php:13
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/dynamic-svg-icons/templates/icon-wrapper.php on line 1
    • > PHP Fatal error
      Uncaught Error: Interface 'DsvgIcons\\Framework\\Contracts\\Initable' not found in wp-content/plugins/dynamic-svg-icons/app/Components/RenderIconMarkup.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'DsvgIcons\\Framework\\View\\ViewRenderer' not found in wp-content/plugins/dynamic-svg-icons/framework/View/ViewBase.php:18
    • > PHP Notice
      Undefined variable: icon in wp-content/plugins/dynamic-svg-icons/templates/icon-wrapper.php on line 1
    • > PHP Notice
      Undefined variable: content in wp-content/plugins/dynamic-svg-icons/templates/template-script.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
2 plugin tags: icons, svg

dynamic-svg-icons/dynamic-svg-icons.php 92% from 13 tests

The primary PHP file in "Dynamic SVG Icons" version 1.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

Code Analysis Passed 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
No dangerous file extensions were detected2,501 lines of code in 693 files:
LanguageFilesBlank linesComment linesLines of code
PHP6902302762,391
JavaScript22652106
JSON1004

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity3.45
▷ Minimum class complexity1.00
▷ Maximum class complexity9.00
Average method complexity1.68
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces9
Interfaces1
Traits2
Classes8
▷ Abstract classes112.50%
▷ Concrete classes787.50%
▷ Final classes00.00%
Methods44
▷ Static methods49.09%
▷ Public methods2761.36%
▷ Protected methods49.09%
▷ Private methods1329.55%
Functions3
▷ Named functions00.00%
▷ Anonymous functions3100.00%
Constants6
▷ Global constants6100.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
There are no PNG files in this plugin