83% rk-link-preview

Code Review | Description: Get basic website information from any given URL, in JSON format, and creating visual preview for inserting into content

WordPress plugin Description: Get basic website information from any given URL, in JSON format, and creating visual preview for inserting into content scored 83% from 54 tests.

About plugin

  • Plugin page: rk-link-preview
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jul 3, 2021
  • Latest release: Jun 6, 2022
  • Number of updates: 8
  • Update frequency: every 42.3 days
  • Top authors: xxxborland (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 398 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.15ms] Passed 4 tests

This is a short check of server-side resources used by Description: Get basic website information from any given URL, in JSON format, and creating visual preview for inserting into content
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.47 ▼1.76
Dashboard /wp-admin3.34 ▲0.0448.18 ▼2.15
Posts /wp-admin/edit.php3.46 ▲0.1150.59 ▲3.17
Add New Post /wp-admin/post-new.php5.94 ▲0.0597.31 ▼6.60
Media Library /wp-admin/upload.php3.25 ▲0.0237.93 ▲1.92
RK Link Preview /wp-admin/options-general.php?page=rkl-settings3.2735.22

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Description: Get basic website information from any given URL, in JSON format, and creating visual preview for inserting into content
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,953 ▲21814.81 ▲0.381.93 ▲0.3236.76 ▼10.16
Dashboard /wp-admin2,354 ▲1636.48 ▲1.57127.96 ▲27.1449.27 ▲5.65
Posts /wp-admin/edit.php2,277 ▲1883.53 ▲1.5357.50 ▲17.5345.21 ▲9.18
Add New Post /wp-admin/post-new.php1,363 ▼15616.88 ▼6.41517.13 ▼238.7239.72 ▼16.42
Media Library /wp-admin/upload.php1,407 ▲194.16 ▼0.0780.86 ▼27.1246.64 ▼0.31
RK Link Preview /wp-admin/options-general.php?page=rkl-settings1,0483.1043.7237.37

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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
Please fix the following items
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/rk-link-preview/core/controller/rklp_admin.class.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/rk-link-preview/core/controller/rklp_admin.class.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'rklp_controller' not found in wp-content/plugins/rk-link-preview/core/controller/rklp_editor.class.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/rk-link-preview/core/view/options/templates.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/rk-link-preview/core/view/options/general.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'rklp_controller' not found in wp-content/plugins/rk-link-preview/core/controller/rklp_admin.class.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Plugin Name: You should set the name of your plugin on the first line ( === Description: Get basic website information from any given URL, in JSON format, and creating visual preview for inserting into content === )
  • Contributors: Plugin contributors not specified
  • Screenshots: No descriptions were found for these screenshots #3, #4, #5 in rk-link-preview/assets to your readme.txt
The official readme.txt might help

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

The entry point to "Description: Get basic website information from any given URL, in JSON format, and creating visual preview for inserting into content" version 1.0 is a PHP file that has certain tags in its header comment area
120 characters long description:
Get basic website information from any given URL, in JSON format, and creating visual preview for inserting into content

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin24,758 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
JSON30020,478
JavaScript93001311,786
CSS40441,440
LESS105321691
PHP86727362
SVG1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity8.67
▷ Minimum class complexity5.00
▷ Maximum class complexity12.00
Average method complexity2.05
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods22
▷ Static methods00.00%
▷ Public methods1881.82%
▷ Protected methods00.00%
▷ Private methods418.18%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/build/img/facebook.png5.57KB3.52KB▼ 36.74%
assets/build/img/twitter.png13.24KB8.15KB▼ 38.44%
assets/build/img/instagram.png9.17KB9.14KB0.36%