62% stock-market-ticker

Code Review | Stock Market Ticker

WordPress plugin Stock Market Ticker scored62%from 54 tests.

About plugin

  • Plugin page: stock-market-ticker
  • Plugin version: 1.9.13
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-6.3.2
  • WordPress version: 6.3.1
  • First release: Feb 22, 2017
  • Latest release: Nov 1, 2023
  • Number of updates: 68
  • Update frequency: every 35.9 days
  • Top authors: stockdio (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

4,000+ active /71,946 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
Install script ran successfully

Server metrics [RAM: ▼0.71MB] [CPU: ▼33.64ms] Passed 4 tests

This is a short check of server-side resources used by Stock Market Ticker
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2242.13 ▲0.41
Dashboard /wp-admin3.24 ▼0.1024.47 ▼41.37
Posts /wp-admin/edit.php3.25 ▼0.1226.19 ▼19.38
Add New Post /wp-admin/post-new.php3.24 ▼2.6525.71 ▼64.11
Media Library /wp-admin/upload.php3.25 ▲0.0126.41 ▼9.69
Stock Market Ticker /wp-admin/options-general.php?page=stockdio-ticker-settings-config3.2525.65

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 42 new files
Database: no new tables, 7 new options
New WordPress options
widget_widget_stockdio_ticker
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Stock Market Ticker
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,858 ▲11216.75 ▲2.311.82 ▲0.1242.25 ▼1.08
Dashboard /wp-admin2,259 ▲827.63 ▲1.99228.58 ▲128.0941.95 ▼0.04
Posts /wp-admin/edit.php2,165 ▲687.15 ▲5.1979.55 ▲43.1438.10 ▲5.40
Add New Post /wp-admin/post-new.php6,217 ▲4,69119.38 ▼3.96812.29 ▲134.5038.01 ▼30.25
Media Library /wp-admin/upload.php1,540 ▲1378.95 ▲4.78123.76 ▲26.2248.35 ▲1.67
Stock Market Ticker /wp-admin/options-general.php?page=stockdio-ticker-settings-config8676.8267.1525.74

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/stock-market-ticker/stockdio_ticker_stockdioplugin.php+112
    Trying to access array offset on value of type bool
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • widget_widget_stockdio_ticker
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

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)
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=stockdio-ticker-settings-config
    • > Notice in wp-content/plugins/stock-market-ticker/stockdio_ticker_stockdioplugin.php+35
    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 take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/stock-market-ticker/stockdio_ticker_activate_plugin_settings.php
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/stock-market-ticker/stockdio_ticker_widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/stock-market-ticker/stockdio_ticker_stockdioplugin.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/stock-market-ticker/stockdio_ticker_activate_plugin_admin.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: You are using too many tags: 19 tag instead of maximum 10
  • Screenshots: A description for screenshot #8 is missing in stock-market-ticker/assets to your readme.txt
You can take inspiration from this readme.txt

stock-market-ticker/stockdio_ticker_stockdioplugin.php 92% from 13 tests

Analyzing the main PHP file in "Stock Market Ticker" version 1.9.13
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("stock-market-ticker.php" instead of "stockdio_ticker_stockdioplugin.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin4,424 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript7208661,943
PHP51841041,300
CSS691281,171
SVG11010

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 122)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity97.50
▷ Minimum class complexity62.00
▷ Maximum class complexity133.00
Average method complexity6.36
▷ Minimum method complexity1.00
▷ Maximum method complexity122.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods36
▷ Static methods513.89%
▷ Public methods36100.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
18 PNG files occupy 0.14MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/layout/ticker13-400.png8.92KB4.35KB▼ 51.19%
assets/layout/ticker4-400.png5.14KB2.94KB▼ 42.87%
assets/layout/ticker11-400.png7.79KB4.09KB▼ 47.44%
assets/layout/ticker3-400.png4.90KB2.85KB▼ 41.77%
assets/layout/ticker16-400.png9.62KB4.36KB▼ 54.62%