83% products-viewed

Code Review | LBK Products Viewed

WordPress plugin LBK Products Viewed scored 83% from 54 tests.

About plugin

  • Plugin page: products-viewed
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 1.0.0-5.7
  • WordPress version: 5.9.2
  • First release: Jul 12, 2021
  • Latest release: Jul 12, 2021
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: serviceslbk (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 99 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼299.37ms] Passed 4 tests

An overview of server-side resources used by LBK Products Viewed
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.0961.87 ▼0.32
Dashboard /wp-admin3.46 ▲0.0641.02 ▲4.68
Posts /wp-admin/edit.php3.70 ▲0.0638.13 ▲1.04
Add New Post /wp-admin/post-new.php6.94 ▼0.03101.66 ▼1,196.83
Media Library /wp-admin/upload.php3.35 ▲0.0629.42 ▼1.37

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 1 new option
New WordPress options
widget_product_viewed

Browser metrics Passed 4 tests

This is an overview of browser requirements for LBK Products Viewed
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,801 ▲4716.26 ▲0.596.49 ▲0.172.62 ▼0.42
Dashboard /wp-admin2,907 ▲536.09 ▼0.05135.01 ▼7.98185.21 ▼16.07
Posts /wp-admin/edit.php2,687 ▼33.35 ▲0.0064.76 ▼2.37147.94 ▼27.10
Add New Post /wp-admin/post-new.php1,663 ▲2821.09 ▲2.09396.09 ▼80.76191.56 ▲42.77
Media Library /wp-admin/upload.php1,700 ▲25.46 ▼0.01149.37 ▲10.29273.17 ▲84.40

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • widget_product_viewed

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/products-viewed/products_viewed.php

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 86% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (The General section of the settings.) image required
The official readme.txt is a good inspiration

products-viewed/products_viewed.php 77% from 13 tests

This is the main PHP file of "LBK Products Viewed" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("products-viewed.php" instead of "products_viewed.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Domain Path: The domain path points to a folder that does not exist ("/languages/")

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
Good job! No executable or dangerous file extensions detected305 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP14644245
CSS16044
JavaScript12116

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity54.00
▷ Minimum class complexity54.00
▷ Maximum class complexity54.00
Average method complexity11.60
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods120.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG files were detected