94% visual-link-preview

Code Review | Visual Link Preview

WordPress plugin Visual Link Preview scored 94% from 54 tests.

About plugin

  • Plugin page: visual-link-preview
  • Plugin version: 2.2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.9
  • WordPress version: 5.9.2
  • First release: May 15, 2017
  • Latest release: Jan 31, 2022
  • Number of updates: 36
  • Update frequency: every 48.0 days
  • Top authors: BrechtVds (100%)

Code review

54 tests

User reviews

19 reviews

Install metrics

10,000+ active / 62,780 total downloads

Benchmarks

Plugin footprint Passed 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.39MB] [CPU: ▼289.82ms] Passed 4 tests

An overview 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.89 ▲0.3854.05 ▲3.56
Dashboard /wp-admin3.80 ▲0.3937.60 ▲3.76
Posts /wp-admin/edit.php4.09 ▲0.4540.93 ▲4.58
Add New Post /wp-admin/post-new.php7.31 ▲0.33106.33 ▼1,171.19
Media Library /wp-admin/upload.php3.75 ▲0.4528.75 ▲4.94
Template Editor /wp-admin/admin.php?page=vlp_template_editor3.7326.29
Visual Link Preview /wp-admin/options-general.php?page=bv_settings_vlp3.7426.60

Server storage [IO: ▲3.69MB] [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, no new options

Browser metrics Passed 4 tests

Visual Link Preview: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,804 ▲8216.70 ▲0.946.00 ▼1.082.15 ▼0.17
Dashboard /wp-admin2,904 ▲507.15 ▲0.95141.72 ▲8.64157.01 ▼6.94
Posts /wp-admin/edit.php2,706 ▲213.76 ▲0.5169.47 ▲2.18136.56 ▼16.93
Add New Post /wp-admin/post-new.php1,744 ▲8322.19 ▲5.19447.13 ▲6.37178.51 ▲21.54
Media Library /wp-admin/upload.php1,710 ▲156.32 ▲0.82132.40 ▼5.02188.00 ▲10.09
Template Editor /wp-admin/admin.php?page=vlp_template_editor1,1164.61158.1397.95
Visual Link Preview /wp-admin/options-general.php?page=bv_settings_vlp1,3299.98252.67149.22

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 25× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/visual-link-preview/includes/public/class-vlp-template-editor.php:27
    • > 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 Fatal error
      require_once(): Failed opening required 'VLP_DIRtemplates/settings/settings.php' (include_path='.:/usr/share/php') in wp-content/plugins/visual-link-preview/includes/public/class-vlp-settings.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/visual-link-preview/includes/admin/modal/class-vlp-modal.php:28
    • > PHP Warning
      Use of undefined constant VLP_DIR - assumed 'VLP_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/visual-link-preview/includes/public/class-vlp-settings.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/visual-link-preview/templates/settings/settings.php:6
    • > 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
    • > 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-url.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/visual-link-preview/templates/admin/support-widget.php:6
    • > 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

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: summary, visual link, snippet, link preview

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

The main file in "Visual Link Preview" v. 2.2.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
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 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin46,578 lines of code in 179 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript868,6156,51241,545
PHP414651,3722,189
CSS6108291,617
Sass1920551,200
SVG270027

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in 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

All PNG images should be compressed to minimize bandwidth usage for end users
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-256x256.png2.01KB2.00KB▼ 0.53%
assets/images/icon-128x128.png1.00KB0.99KB0.49%
assets/images/logo.png109.74KB45.18KB▼ 58.83%
assets/images/banner.png470.22KB202.00KB▼ 57.04%
assets/images/icon-20x20.png0.33KB0.34KB0.00%