62% beautiful-link-preview

Code Review | Beautiful Link Preview

WordPress plugin Beautiful Link Preview scored62%from 54 tests.

About plugin

  • Plugin page: beautiful-link-pr...
  • Plugin version: 1.4.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.7.2
  • WordPress version: 6.3.1
  • First release: Mar 27, 2020
  • Latest release: Jul 7, 2021
  • Number of updates: 49
  • Update frequency: every 9.5 days
  • Top authors: zeitwesentech (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

500+ active /6,465 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.21MB] [CPU: ▼21.10ms] Passed 4 tests

This is a short check of server-side resources used by Beautiful Link Preview
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0341.18 ▼0.28
Dashboard /wp-admin3.10 ▼0.2537.22 ▼31.34
Posts /wp-admin/edit.php3.23 ▼0.1236.30 ▼22.37
Add New Post /wp-admin/post-new.php5.48 ▼0.4081.33 ▼22.55
Media Library /wp-admin/upload.php3.18 ▼0.0533.71 ▼8.14

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 51 new files
Database: 1 new table, 7 new options
New tables
wp_zwt_wp_link_previewer
New WordPress options
can_compress_scripts
widget_recent-posts
zwt_wp_link_previewer_db_version
widget_recent-comments
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Beautiful Link Preview: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,912 ▲14113.49 ▼0.488.30 ▲5.9848.30 ▲1.79
Dashboard /wp-admin2,210 ▲335.62 ▼0.0192.70 ▼6.2838.17 ▼1.41
Posts /wp-admin/edit.php2,118 ▲152.03 ▲0.0838.35 ▼5.9234.25 ▼2.00
Add New Post /wp-admin/post-new.php1,540 ▲1423.11 ▲0.06644.79 ▼43.3754.48 ▲2.80
Media Library /wp-admin/upload.php1,415 ▲154.15 ▼0.16141.50 ▲26.6247.59 ▼2.18
Beautiful Link Preview /wp-admin/beautiful_link_preview-settings.php260.420.4515.82

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie tables were found after uninstall: 1 table
    • wp_zwt_wp_link_previewer
  • Zombie WordPress options detected upon uninstall: 7 options
    • zwt_wp_link_previewer_db_version
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

Smoke tests 25% 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
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/beautiful-link-preview/admin/partials/zwt_wp_linkpreviewer-admin-display.php
    • > /wp-content/plugins/beautiful-link-preview/public/partials/zwt_wp_linkpreviewer-public-display.php
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/beautiful-link-preview/admin/class-zwt_wp_linkpreviewer-linktable.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/beautiful-link-preview/includes/class-zwt_wp_linkpreviewer-rest-controller.php:3
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/beautiful-link-preview/admin/class-zwt_wp_linkpreviewer-linktable.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/beautiful-link-preview/admin/class-zwt_wp_linkpreviewer-linktable.php on line 4

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/beautiful_link_preview-settings.php
    • > Network (severe)
    wp-admin/beautiful_link_preview-settings.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: facebook open graph, preview, twitter cards, link

beautiful-link-preview/zwt_wp_linkpreview.php 77% from 13 tests

The main PHP script in "Beautiful Link Preview" version 1.4.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 177 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("beautiful-link-preview.php" instead of "zwt_wp_linkpreview.php")
  • Text Domain: The text domain should only use lowercase characters and dashes

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 plugin20,682 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
JSON30018,463
PHP222975591,431
JavaScript943147389
Sass230226
HTML113099
CSS491274

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity8.19
▷ Minimum class complexity1.00
▷ Maximum class complexity40.00
Average method complexity1.83
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods138
▷ Static methods1410.14%
▷ Public methods8057.97%
▷ Protected methods00.00%
▷ Private methods5842.03%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants32
▷ Global constants13.12%
▷ Class constants3196.88%
▷ Public constants31100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/layout_compact.png0.83KB0.37KB▼ 55.39%
admin/img/layout_full.png1.21KB0.56KB▼ 54.14%
admin/img/banner-772x250.png40.22KB15.11KB▼ 62.42%