62% bright-link-previews

Code Review | Bright Link Previews

WordPress plugin Bright Link Previews scored62%from 54 tests.

About plugin

  • Plugin page: bright-link-previews
  • Plugin version: 1.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1-6.4
  • WordPress version: 6.3.1
  • First release: Sep 17, 2023
  • Latest release: Nov 25, 2023
  • Number of updates: 68
  • Update frequency: every 1.1 days
  • Top authors: ginoplusio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /226 total downloads

Benchmarks

Plugin footprint 65% 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.43MB] [CPU: ▼3.14ms] Passed 4 tests

Server-side resources used by Bright Link Previews
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.89 ▲0.4338.71 ▲0.14
Dashboard /wp-admin3.80 ▲0.4546.85 ▼12.29
Posts /wp-admin/edit.php3.85 ▲0.4948.51 ▲1.12
Add New Post /wp-admin/post-new.php6.31 ▲0.4391.12 ▼1.54
Media Library /wp-admin/upload.php3.66 ▲0.4338.20 ▲2.89
Bright Links /wp-admin/options-general.php?page=blpwp-plugin3.6036.08

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 41 new files
Database: 2 new tables, 7 new options
New tables
wp_blpwp_links
wp_blpwp_stats
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
blpwp_plugin_options
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Bright Link Previews: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,886 ▲12413.40 ▼0.949.12 ▲7.2537.15 ▼6.04
Dashboard /wp-admin2,199 ▲185.60 ▼0.0892.82 ▼10.3143.81 ▲1.51
Posts /wp-admin/edit.php2,104 ▲41.94 ▼0.0040.16 ▲4.1736.46 ▼2.33
Add New Post /wp-admin/post-new.php1,529 ▼023.37 ▲0.09657.77 ▼1.4349.11 ▼3.69
Media Library /wp-admin/upload.php1,404 ▲74.17 ▲0.00104.93 ▲5.3045.45 ▲5.37
Bright Links /wp-admin/options-general.php?page=blpwp-plugin1,3483.84101.1243.63

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie tables detected upon uninstall: 2 tables
    • wp_blpwp_links
    • wp_blpwp_stats
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • blpwp_plugin_options
    • widget_recent-comments
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=blpwp-plugin
    • > Warning in wp-content/plugins/bright-link-previews/settings-page.php+291
    Division by zero

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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/bright-link-previews/docs/index.php
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bright-link-previews/ajax.php:60
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bright-link-previews/paging.php:40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bright-link-previews/index.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bright-link-previews/settings-page.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === bright-link-previews === )
The official readme.txt might help

bright-link-previews/index.php 92% from 13 tests

The primary PHP file in "Bright Link Previews" version 1.3 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("bright-link-previews.php" instead of "index.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
There were no executable files found in this plugin19,359 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
JSON10016,797
PHP66306232,007
JavaScript47550363
CSS3198167
SVG20024
HTML1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity293.00
▷ Minimum class complexity293.00
▷ Maximum class complexity293.00
Average method complexity6.02
▷ Minimum method complexity1.00
▷ Maximum method complexity79.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods59
▷ Static methods00.00%
▷ Public methods5796.61%
▷ Protected methods00.00%
▷ Private methods23.39%
Functions41
▷ Named functions41100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 0.84MB with 0.55MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
docs/images/image6.png177.63KB48.85KB▼ 72.50%
docs/images/image2.png251.85KB73.67KB▼ 70.75%
docs/images/image7.png86.16KB33.19KB▼ 61.48%
docs/images/image5.png36.74KB14.56KB▼ 60.36%
docs/images/image3.png39.01KB15.26KB▼ 60.88%