84% in-stock-widget

Code Review | in stock products filter widget

WordPress plugin in stock products filter widget scored84%from 54 tests.

About plugin

  • Plugin page: in-stock-widget
  • Plugin version: 1.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-5.5.3
  • WordPress version: 6.3.1
  • First release: Oct 2, 2020
  • Latest release: Dec 6, 2020
  • Number of updates: 11
  • Update frequency: every 5.9 days
  • Top authors: movahedian1 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /486 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.03MB] [CPU: ▼8.58ms] Passed 4 tests

Analyzing server-side resources used by in stock products filter widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0535.97 ▼6.23
Dashboard /wp-admin3.35 ▲0.0045.06 ▼18.03
Posts /wp-admin/edit.php3.40 ▲0.0447.95 ▲5.91
Add New Post /wp-admin/post-new.php5.93 ▲0.0484.22 ▼8.77
Media Library /wp-admin/upload.php3.27 ▲0.0433.81 ▼1.29

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_instockwidget

Browser metrics Passed 4 tests

This is an overview of browser requirements for in stock products filter widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,899 ▲16413.60 ▼0.674.69 ▲2.8639.81 ▼3.83
Dashboard /wp-admin2,225 ▲375.85 ▲0.8298.51 ▼12.6139.72 ▲0.74
Posts /wp-admin/edit.php2,105 ▲162.14 ▲0.1340.33 ▼1.6935.52 ▼2.31
Add New Post /wp-admin/post-new.php1,555 ▲2718.10 ▲0.06611.72 ▼38.4349.33 ▼16.28
Media Library /wp-admin/upload.php1,407 ▲194.25 ▲0.0396.79 ▼8.4442.31 ▲0.23

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
These items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_instockwidget
    • widget_recent-posts

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)
Good news, no errors were detected

SRP 50% 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 trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/in-stock-widget/page.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
1 plugin tags: in stock products filter widget

in-stock-widget/page.php 92% from 13 tests

Analyzing the main PHP file in "in stock products filter widget" version 1.3.1
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("in-stock-widget.php" instead of "page.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
There were no executable files found in this plugin211 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP16912159
CSS18150
JavaScript1502

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity2.67
▷ Minimum method complexity2.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions888.89%
▷ Anonymous functions111.11%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected