84% stock-portfolio

Code Review | Stock Portfolio

WordPress plugin Stock Portfolio scored84%from 54 tests.

About plugin

  • Plugin page: stock-portfolio
  • Plugin version: 1.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0
  • WordPress version: 6.3.1
  • First release: Nov 11, 2017
  • Latest release: Jun 21, 2022
  • Number of updates: 31
  • Update frequency: every 54.3 days
  • Top authors: aguadavid (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,975 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.06MB] [CPU: ▼4.87ms] Passed 4 tests

An overview of server-side resources used by Stock Portfolio
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0739.51 ▲0.44
Dashboard /wp-admin3.37 ▲0.0755.64 ▲5.85
Posts /wp-admin/edit.php3.42 ▲0.0649.79 ▼1.61
Add New Post /wp-admin/post-new.php5.95 ▲0.0686.82 ▼18.76
Media Library /wp-admin/upload.php3.29 ▲0.0634.35 ▲0.44

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_diy_stock_portfolio
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Stock Portfolio
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,900 ▲13913.86 ▼0.499.38 ▲7.8939.74 ▼4.65
Dashboard /wp-admin2,195 ▲185.56 ▼0.1691.45 ▼8.5737.40 ▼7.70
Posts /wp-admin/edit.php2,103 ▲62.01 ▲0.0237.69 ▼0.9233.96 ▲0.83
Add New Post /wp-admin/post-new.php1,526 ▼223.19 ▲0.01613.97 ▼72.3152.93 ▼1.76
Media Library /wp-admin/upload.php1,403 ▲34.21 ▼0.0298.80 ▼15.2144.22 ▼7.02

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_diy_stock_portfolio
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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 fix the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/stock-portfolio/stock-porfolio.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
9 plugin tags: alpha vantage, wall street, investing, stock quotes, diy investor...

stock-portfolio/stock-porfolio.php 92% from 13 tests

This is the main PHP file of "Stock Portfolio" version 1.2.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("stock-portfolio.php" instead of "stock-porfolio.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin363 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP14218222
JavaScript160124
CSS13017

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity44.00
▷ Minimum class complexity44.00
▷ Maximum class complexity44.00
Average method complexity8.17
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods233.33%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected