68% svs-shortlink-analytics

Code Review | ShortLink Analytics by SVS-Websoft

WordPress plugin ShortLink Analytics by SVS-Websoft scored 68% from 54 tests.

About plugin

  • Plugin page: svs-shortlink-ana...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.3.0
  • WordPress version: 6.3.1
  • First release: Mar 15, 2015
  • Latest release: Sep 14, 2015
  • Number of updates: 12
  • Update frequency: every 15.3 days
  • Top authors: svs-websoft (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

30+ active / 1,773 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

Analyzing server-side resources used by ShortLink Analytics by SVS-Websoft
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0641.68 ▼5.41
Dashboard /wp-admin3.37 ▲0.0643.84 ▼5.69
Posts /wp-admin/edit.php3.48 ▲0.1247.06 ▼4.45
Add New Post /wp-admin/post-new.php5.95 ▲0.0685.18 ▼20.29
Media Library /wp-admin/upload.php3.29 ▲0.0636.25 ▲0.94

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

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

Browser metrics Passed 4 tests

A check of browser resources used by ShortLink Analytics by SVS-Websoft
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲5914.47 ▲0.091.65 ▼0.3343.15 ▼2.32
Dashboard /wp-admin2,216 ▲285.80 ▲0.9099.86 ▼8.4937.27 ▼2.49
Posts /wp-admin/edit.php2,105 ▲162.00 ▼0.0234.95 ▼5.0431.16 ▼6.09
Add New Post /wp-admin/post-new.php1,533 ▼023.26 ▲0.15620.69 ▼64.6450.74 ▼4.17
Media Library /wp-admin/upload.php1,407 ▲194.19 ▼0.0594.00 ▼8.6642.20 ▼0.55

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_svs_shortlinks
    • wp_svs_statistics
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/svs-shortlink-analytics/views/_footer.php
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/svs-shortlink-analytics/views/_header.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/svs-shortlink-analytics/views/_header.php:4
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/svs-shortlink-analytics/views/statistics.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/svs-shortlink-analytics/ShortlinkAnalyticsMain.php:66
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/svs-shortlink-analytics/views/_header.php:4
    • > PHP Notice
      Undefined variable: _data in wp-content/plugins/svs-shortlink-analytics/views/statistics.php on line 14

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Tags: Too many tags (57 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

svs-shortlink-analytics/ShortlinkAnalyticsMain.php 92% from 13 tests

This is the main PHP file of "ShortLink Analytics by SVS-Websoft" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("svs-shortlink-analytics.php" instead of "ShortlinkAnalyticsMain.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected776 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP77864677
CSS11099

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity28.00
▷ Minimum class complexity21.00
▷ Maximum class complexity35.00
Average method complexity4.60
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods1493.33%
▷ Protected methods00.00%
▷ Private methods16.67%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
5 PNG files occupy 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/back.png4.42KB1.50KB▼ 66.14%
images/add.png5.71KB2.19KB▼ 61.57%
images/reset.png3.53KB1.19KB▼ 66.28%
images/show_statistics.png7.78KB2.55KB▼ 67.18%
images/delete.png3.44KB0.98KB▼ 71.59%