62% stock-market-overview

Code Review | Stock Market Overview

WordPress plugin Stock Market Overview scored62%from 54 tests.

About plugin

  • Plugin page: stock-market-over...
  • Plugin version: 1.6.10
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-6.2
  • WordPress version: 6.3.1
  • First release: Mar 22, 2017
  • Latest release: Nov 1, 2023
  • Number of updates: 46
  • Update frequency: every 52.5 days
  • Top authors: stockdio (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

2,000+ active /38,406 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
Installer ran successfully

Server metrics [RAM: ▼0.53MB] [CPU: ▼36.00ms] Passed 4 tests

An overview of server-side resources used by Stock Market Overview
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.3442.23 ▲4.33
Dashboard /wp-admin3.42 ▲0.0726.38 ▼34.47
Posts /wp-admin/edit.php3.42 ▲0.0627.52 ▼23.26
Add New Post /wp-admin/post-new.php3.42 ▼2.4725.71 ▼77.72
Media Library /wp-admin/upload.php3.42 ▲0.1926.41 ▼8.53
Stock Market Overview /wp-admin/options-general.php?page=stockdio-market-overview-settings-config3.4325.41

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 23 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_widget_stockdio_market_overview
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Stock Market Overview
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,859 ▲11317.09 ▲2.741.75 ▼0.0241.43 ▲3.75
Dashboard /wp-admin2,263 ▲887.56 ▲1.78214.73 ▲108.4042.70 ▲3.61
Posts /wp-admin/edit.php2,187 ▲877.22 ▲5.2676.99 ▲36.3334.61 ▲0.78
Add New Post /wp-admin/post-new.php6,388 ▲4,85323.47 ▲5.51854.29 ▲239.9741.39 ▼25.74
Media Library /wp-admin/upload.php1,544 ▲1448.99 ▲4.77123.09 ▲27.6741.31 ▼2.14
Stock Market Overview /wp-admin/options-general.php?page=stockdio-market-overview-settings-config8876.8762.7626.01

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
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/stock-market-overview/stockdio_market_overview_stockdioplugin.php+115
    Trying to access array offset on value of type bool
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_widget_stockdio_market_overview
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=stockdio-market-overview-settings-config
    • > Notice in wp-content/plugins/stock-market-overview/stockdio_market_overview_stockdioplugin.php+38
    Trying to access array offset on value of type bool

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/stock-market-overview/stockdio_market_overview_activate_plugin_settings.php
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/stock-market-overview/stockdio_market_overview_stockdioplugin.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/stock-market-overview/stockdio_market_overview_activate_plugin_admin.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/stock-market-overview/stockdio_market_overview_widget.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

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
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 20 tag instead of maximum 10
You can take inspiration from this readme.txt

stock-market-overview/stockdio_market_overview_stockdioplugin.php 92% from 13 tests

Analyzing the main PHP file in "Stock Market Overview" version 1.6.10
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("stock-market-overview.php" instead of "stockdio_market_overview_stockdioplugin.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin4,933 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP52331001,944
JavaScript5197511,870
CSS590281,109
SVG11010

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 124)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity147.00
▷ Minimum class complexity142.00
▷ Maximum class complexity152.00
Average method complexity5.79
▷ Minimum method complexity1.00
▷ Maximum method complexity124.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods61
▷ Static methods58.20%
▷ Public methods61100.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

Using a strong compression for your PNG files is a great way to speed-up 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-light.png11.00KB5.38KB▼ 51.07%
assets/stockdio-logo-full-dark.png14.07KB5.39KB▼ 61.70%