62% stock-quotes-list

Code Review | Stock Quotes List

WordPress plugin Stock Quotes List scored62%from 54 tests.

About plugin

  • Plugin page: stock-quotes-list
  • Plugin version: 2.9.11
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-6.3.2
  • WordPress version: 6.3.1
  • First release: Jun 16, 2016
  • Latest release: Nov 1, 2023
  • Number of updates: 89
  • Update frequency: every 30.3 days
  • Top authors: stockdio (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

1,000+ active /29,440 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.58MB] [CPU: ▼28.10ms] Passed 4 tests

Server-side resources used by Stock Quotes List
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2941.47 ▼1.73
Dashboard /wp-admin3.37 ▲0.0627.86 ▼22.27
Posts /wp-admin/edit.php3.37 ▲0.0128.79 ▼19.26
Add New Post /wp-admin/post-new.php3.37 ▼2.5226.95 ▼63.39
Media Library /wp-admin/upload.php3.37 ▲0.1427.77 ▼7.46
Stock Quotes List /wp-admin/options-general.php?page=stockdio-quotes-board-settings-config3.3726.33

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 23 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_widget_stock_quotes
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Stock Quotes List
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,858 ▲9716.86 ▲2.591.69 ▼0.3341.43 ▼2.51
Dashboard /wp-admin2,259 ▲797.64 ▲1.98230.96 ▲135.9642.72 ▼0.29
Posts /wp-admin/edit.php2,162 ▲627.13 ▲5.1571.93 ▲35.3234.90 ▲0.60
Add New Post /wp-admin/post-new.php6,387 ▲4,85923.38 ▲0.37763.26 ▲122.8833.96 ▼12.96
Media Library /wp-admin/upload.php1,546 ▲1468.98 ▲4.72127.59 ▲31.2040.84 ▼2.99
Stock Quotes List /wp-admin/options-general.php?page=stockdio-quotes-board-settings-config1,1937.5793.3652.53

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/stock-quotes-list/stockdio_quotes_stockdioplugin.php+115
    Trying to access array offset on value of type bool
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_widget_stock_quotes
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=stockdio-quotes-board-settings-config
    • > Notice in wp-content/plugins/stock-quotes-list/stockdio_quotes_stockdioplugin.php+38
    Trying to access array offset on value of type bool

SRP 0% 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
Please fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/stock-quotes-list/stockdio_quotes_activate_plugin_settings.php
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/stock-quotes-list/stockdio_quotes_stockdioplugin.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/stock-quotes-list/stockdio_quotes_widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/stock-quotes-list/stockdio_quotes_activate_plugin_admin.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Tags: There are too many tags (14 tag instead of maximum 10)
You can look at the official readme.txt

stock-quotes-list/stockdio_quotes_stockdioplugin.php 92% from 13 tests

"Stock Quotes List" version 2.9.11's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("stock-quotes-list.php" instead of "stockdio_quotes_stockdioplugin.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin4,638 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript5200511,870
PHP5190961,649
CSS590281,109
SVG11010

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
These items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 124)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity123.50
▷ Minimum class complexity109.00
▷ Maximum class complexity138.00
Average method complexity6.10
▷ Minimum method complexity1.00
▷ Maximum method complexity124.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods48
▷ Static methods510.42%
▷ Public methods48100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions18
▷ Named functions1688.89%
▷ Anonymous functions211.11%
Constants2
▷ Global constants2100.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
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/stockdio-logo-full-dark.png14.07KB5.39KB▼ 61.70%
assets/stockdio-logo-full-light.png11.00KB5.38KB▼ 51.07%