84% visual-link-preview

Code Review | Visual Link Preview

WordPress plugin Visual Link Preview scored84%from 54 tests.

About plugin

  • Plugin page: visual-link-preview
  • Plugin version: 2.2.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: May 15, 2017
  • Latest release: Aug 7, 2023
  • Number of updates: 40
  • Update frequency: every 57.0 days
  • Top authors: BrechtVds (100%)

Code review

54 tests

User reviews

29 reviews

Install metrics

10,000+ active /101,103 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.06MB] [CPU: ▼1.94ms] Passed 4 tests

This is a short check of server-side resources used by Visual Link Preview
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0542.24 ▼1.97
Dashboard /wp-admin3.36 ▲0.0650.68 ▼0.18
Posts /wp-admin/edit.php3.48 ▲0.1252.19 ▲1.16
Add New Post /wp-admin/post-new.php5.94 ▲0.0589.49 ▼6.75
Media Library /wp-admin/upload.php3.29 ▲0.0637.87 ▲3.10
Visual Link Preview /wp-admin/options-general.php?page=bv_settings_vlp3.3031.42
Template Editor /wp-admin/admin.php?page=vlp_template_editor3.2737.72

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

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

Browser metrics Passed 4 tests

Visual Link Preview: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5713.82 ▼0.911.66 ▼0.3141.77 ▼20.51
Dashboard /wp-admin2,205 ▲255.55 ▼0.13108.67 ▲8.7943.62 ▲0.31
Posts /wp-admin/edit.php2,117 ▲172.62 ▲0.6143.77 ▲4.9532.48 ▼1.90
Add New Post /wp-admin/post-new.php6,215 ▲4,68419.48 ▼3.15947.76 ▲306.1837.17 ▼18.67
Media Library /wp-admin/upload.php1,414 ▲145.17 ▲1.01107.87 ▲2.9446.01 ▼0.09
Visual Link Preview /wp-admin/options-general.php?page=bv_settings_vlp1,1228.92148.1255.14
Template Editor /wp-admin/admin.php?page=vlp_template_editor9203.85131.5527.44

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 25× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/visual-link-preview/includes/class-vlp-i18n.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'VLP_Dynamic_Template_Block' not found in wp-content/plugins/visual-link-preview/includes/public/dynamic-template/blocks/class-vlp-block-button.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/visual-link-preview/includes/public/class-vlp-shortcode.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/visual-link-preview/vendor/bv-settings/bv-settings.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'VLP_Dynamic_Template_Block' not found in wp-content/plugins/visual-link-preview/includes/public/dynamic-template/blocks/class-vlp-block-title.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/visual-link-preview/includes/admin/class-vlp-assets.php:28
    • > PHP Warning
      require_once(VLP_DIRtemplates/settings/settings.php): failed to open stream: No such file or directory in wp-content/plugins/visual-link-preview/includes/public/class-vlp-settings.php on line 20
    • > PHP Fatal error
      Uncaught Error: Class 'VLP_Settings' not found in wp-content/plugins/visual-link-preview/templates/settings/template-style.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'VLP_Dynamic_Template_Block' not found in wp-content/plugins/visual-link-preview/includes/public/dynamic-template/blocks/class-vlp-block-image.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'VLP_Dynamic_Template_Layout' not found in wp-content/plugins/visual-link-preview/includes/public/dynamic-template/layouts/class-vlp-layout-2-columns.php:20

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, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: snippet, link preview, visual link, summary

visual-link-preview/visual-link-preview.php Passed 13 tests

The principal PHP file in "Visual Link Preview" v. 2.2.6 is loaded by WordPress automatically on each request
83 characters long description:
Display a fully customizable visual link preview for any internal or external link.

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 plugin47,060 lines of code in 179 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript867,1596,88342,027
PHP414651,3722,189
CSS6108291,617
Sass1920551,200
SVG270027

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity9.23
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes30
▷ Abstract classes26.67%
▷ Concrete classes2893.33%
▷ Final classes00.00%
Methods143
▷ Static methods6545.45%
▷ Public methods12889.51%
▷ Protected methods64.20%
▷ Private methods96.29%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.57MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon-20x20.png0.33KB0.34KB0.00%
assets/images/logo.png109.74KB45.18KB▼ 58.83%
assets/images/banner.png470.22KB202.00KB▼ 57.04%
assets/images/icon-128x128.png1.00KB0.99KB0.49%
assets/images/icon-256x256.png2.01KB2.00KB▼ 0.53%