84% featured-product-by-category-name

Code Review | Featured product by category name

WordPress plugin Featured product by category name scored 84% from 54 tests.

About plugin

  • Plugin page: featured-product-...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.5.3
  • WordPress version: 6.3.1
  • First release: Aug 7, 2016
  • Latest release: Aug 26, 2016
  • Number of updates: 11
  • Update frequency: every 4.3 days
  • Top authors: kepyinfotech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,397 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.57ms] Passed 4 tests

Analyzing server-side resources used by Featured product by category name
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.33 ▼4.80
Dashboard /wp-admin3.31 ▲0.0050.83 ▲4.94
Posts /wp-admin/edit.php3.36 ▲0.0044.18 ▼6.67
Add New Post /wp-admin/post-new.php5.89 ▲0.0095.27 ▼5.74
Media Library /wp-admin/upload.php3.23 ▲0.0035.40 ▲2.93

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Featured product by category name
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.31 ▼1.041.84 ▼0.0340.92 ▼2.35
Dashboard /wp-admin2,206 ▲185.80 ▼0.08100.99 ▼3.7439.31 ▼4.94
Posts /wp-admin/edit.php2,089 ▼32.01 ▼0.0533.06 ▼7.4933.63 ▼4.69
Add New Post /wp-admin/post-new.php1,547 ▲1418.15 ▼4.96617.04 ▼19.7163.33 ▲9.44
Media Library /wp-admin/upload.php1,388 ▼04.30 ▲0.0798.01 ▼9.5243.45 ▲0.32

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/featured-product-by-category-name/featured-product-by-categories-kepy.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Featured product by category look), #2 (How to add shortcode)
Please take inspiration from this readme.txt

featured-product-by-category-name/featured-product-by-categories-kepy.php 92% from 13 tests

The main PHP file in "Featured product by category name" ver. 1.1 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("featured-product-by-category-name.php" instead of "featured-product-by-categories-kepy.php")

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
No dangerous file extensions were detected60 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1291360

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.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
PNG images were not found in this plugin