78% link-preview

Code Review | URL Preview

WordPress plugin URL Preview scored 78% from 54 tests.

About plugin

  • Plugin page: link-preview
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.0
  • WordPress version: 6.3.1
  • First release: Oct 3, 2014
  • Latest release: Oct 22, 2014
  • Number of updates: 14
  • Update frequency: every 1.4 days
  • Top authors: abhisheksaha11 (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

100+ active / 4,882 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.99ms] Passed 4 tests

This is a short check of server-side resources used by URL Preview
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.96 ▼2.80
Dashboard /wp-admin3.32 ▲0.0246.12 ▼6.53
Posts /wp-admin/edit.php3.37 ▲0.0246.09 ▲5.44
Add New Post /wp-admin/post-new.php5.90 ▲0.0284.56 ▼10.86
Media Library /wp-admin/upload.php3.24 ▲0.0134.70 ▲0.23
Preview /wp-admin/options-general.php?page=hello-world3.2129.38

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
preview_css
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for URL Preview
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7113.21 ▼1.011.70 ▼0.2447.35 ▲0.50
Dashboard /wp-admin2,207 ▲194.81 ▼0.1298.95 ▼12.2538.97 ▼0.28
Posts /wp-admin/edit.php2,096 ▲72.00 ▼0.0241.40 ▲0.1935.64 ▼0.61
Add New Post /wp-admin/post-new.php1,531 ▼1123.20 ▲5.12660.49 ▲52.2159.17 ▲7.30
Media Library /wp-admin/upload.php1,386 ▼24.18 ▲0.0298.39 ▲3.1342.71 ▲1.79
Preview /wp-admin/options-general.php?page=hello-world7922.0323.8025.09

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% 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 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/link-preview/class.linkpreview.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/link-preview/preview.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Contributors: The plugin contributors field is not present
You can look at the official readme.txt

link-preview/preview.php 92% from 13 tests

"URL Preview" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("link-preview.php" instead of "preview.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin217 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP26924189
JavaScript19528

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity4.20
▷ Minimum method complexity2.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
button.png4.30KB3.33KB▼ 22.55%