62% stockdio-historical-chart

Code Review | Stockdio Historical Chart

WordPress plugin Stockdio Historical Chart scored62%from 54 tests.

About plugin

  • Plugin page: stockdio-historic...
  • Plugin version: 2.8.11
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-6.3.2
  • WordPress version: 6.3.1
  • First release: Apr 7, 2016
  • Latest release: Nov 1, 2023
  • Number of updates: 105
  • Update frequency: every 26.3 days
  • Top authors: stockdio (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

1,000+ active /32,640 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼0.69MB] [CPU: ▼33.43ms] Passed 4 tests

A check of server-side resources used by Stockdio Historical Chart
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2539.29 ▼1.16
Dashboard /wp-admin3.27 ▼0.0824.67 ▼40.07
Posts /wp-admin/edit.php3.27 ▼0.0927.11 ▼21.93
Add New Post /wp-admin/post-new.php3.27 ▼2.6228.71 ▼62.70
Media Library /wp-admin/upload.php3.27 ▲0.0426.35 ▼9.00
Stockdio Historical Chart /wp-admin/options-general.php?page=stockdio-historical-chart-settings-config3.2725.53

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 24 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_widget_stockdio_historical_chart
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Stockdio Historical Chart
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,884 ▲13816.88 ▲2.232.06 ▲0.3137.24 ▼7.94
Dashboard /wp-admin2,263 ▲827.61 ▲1.89234.18 ▲134.0243.96 ▼1.18
Posts /wp-admin/edit.php2,163 ▲667.26 ▲5.2675.35 ▲36.2833.96 ▼0.76
Add New Post /wp-admin/post-new.php6,388 ▲4,85423.48 ▲5.32757.57 ▲156.2836.90 ▼34.42
Media Library /wp-admin/upload.php1,547 ▲1448.99 ▲4.77123.78 ▲26.1841.89 ▼4.57
Stockdio Historical Chart /wp-admin/options-general.php?page=stockdio-historical-chart-settings-config9326.8668.8726.12

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/stockdio-historical-chart/stockdioplugin.php+114
    Trying to access array offset on value of type bool
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_widget_stockdio_historical_chart

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-historical-chart-settings-config
    • > Notice in wp-content/plugins/stockdio-historical-chart/stockdioplugin.php+38
    Trying to access array offset on value of type bool

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/stockdio-historical-chart/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/stockdio-historical-chart/stockdio_historical_chart_widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/stockdio-historical-chart/activate_plugin_admin.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/stockdio-historical-chart/stockdioplugin.php:12

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 14 tag instead of maximum 10
You can look at the official readme.txt

stockdio-historical-chart/stockdioplugin.php 92% from 13 tests

The main PHP file in "Stockdio Historical Chart" ver. 2.8.11 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("stockdio-historical-chart.php" instead of "stockdioplugin.php")

Code Analysis 97% from 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
Success! There were no dangerous files found in this plugin4,467 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript5197511,870
PHP5235961,478
CSS590281,109
SVG11010

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 153)
Cyclomatic complexity
Average complexity per logical line of code0.66
Average class complexity117.50
▷ Minimum class complexity62.00
▷ Maximum class complexity173.00
Average method complexity7.47
▷ Minimum method complexity1.00
▷ Maximum method complexity153.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%
Functions17
▷ Named functions1588.24%
▷ Anonymous functions211.76%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/stockdio-logo-full-light.png11.00KB5.38KB▼ 51.07%
assets/stockdio_historical_chart_button.png1.31KB1.18KB▼ 9.61%
assets/stockdio-logo-full-dark.png14.07KB5.39KB▼ 61.70%