72% equibles-stocks

Code Review | Equibles Stocks

WordPress plugin Equibles Stocks scored72%from 54 tests.

About plugin

  • Plugin page: equibles-stocks
  • Plugin version: 1.7.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.0
  • WordPress version: 6.3.1
  • First release: Jun 22, 2022
  • Latest release: Jun 22, 2022
  • Number of updates: 7
  • Update frequency: every 0.7 days
  • Top authors: equibles (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /500 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲1.41MB] [CPU: ▲5.35ms] Passed 4 tests

This is a short check of server-side resources used by Equibles Stocks
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.88 ▲1.4148.15 ▲9.23
Dashboard /wp-admin4.72 ▲1.4257.37 ▲6.87
Posts /wp-admin/edit.php4.77 ▲1.4258.82 ▲14.92
Add New Post /wp-admin/post-new.php7.32 ▲1.4399.55 ▲0.05
Media Library /wp-admin/upload.php4.62 ▲1.3943.36 ▲5.23

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 891 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Equibles Stocks
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,078 ▲33218.58 ▲3.921.76 ▼0.0439.71 ▼7.50
Dashboard /wp-admin2,481 ▲2909.15 ▲3.25196.14 ▲89.3843.14 ▲1.37
Posts /wp-admin/edit.php2,393 ▲3046.12 ▲4.0976.48 ▲34.9532.72 ▼5.49
Add New Post /wp-admin/post-new.php1,598 ▲6519.89 ▼3.36699.03 ▲25.6844.88 ▼21.55
Media Library /wp-admin/upload.php1,529 ▲1446.59 ▲2.44108.48 ▲2.1441.43 ▼2.22
Equibles Stocks /wp-admin/crb_carbon_fields_container_equibles_stocks.php260.440.1013.73

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/equibles-stocks/vendor/htmlburger/carbon-fields/templates/Exception/incorrect-syntax.php
  • 306× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\MimeTypeDetection\\MimeTypeDetector' not found in wp-content/plugins/equibles-stocks/vendor/league/mime-type-detection/src/ExtensionMimeTypeDetector.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Datastore\\Datastore' not found in wp-content/plugins/equibles-stocks/vendor/htmlburger/carbon-fields/core/Datastore/Empty_Datastore.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'League\\Flysystem\\Plugin\\AbstractPlugin' not found in wp-content/plugins/equibles-stocks/vendor/league/flysystem/src/Plugin/ForcedRename.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Select_Field' not found in wp-content/plugins/equibles-stocks/vendor/htmlburger/carbon-fields/core/Field/Sidebar_Field.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Event\\PersistentListener' not found in wp-content/plugins/equibles-stocks/vendor/htmlburger/carbon-fields/core/Event/SingleEventListener.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\UploadedFileInterface' not found in wp-content/plugins/equibles-stocks/vendor/guzzlehttp/psr7/src/UploadedFile.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Service\\Service' not found in wp-content/plugins/equibles-stocks/vendor/htmlburger/carbon-fields/core/Service/Revisions_Service.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Fulfillable\\Translator\\Array_Translator' not found in wp-content/plugins/equibles-stocks/vendor/htmlburger/carbon-fields/core/Container/Fulfillable/Translator/Json_Translator.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'EquiblesStocks\\Models\\ModelInterface' not found in wp-content/plugins/equibles-stocks/vendor/equibles/stocks-php/lib/Models/StockProfile.php:42
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Cache\\CacheItemInterface' not found in wp-content/plugins/equibles-stocks/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheItem.php:18

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
    • > GET request to /wp-admin/crb_carbon_fields_container_equibles_stocks.php
    • > Network (severe)
    wp-admin/crb_carbon_fields_container_equibles_stocks.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: stocks api, equibles, stocks, stock quotes, stock prices

equibles-stocks/hello.php 77% from 13 tests

The main PHP script in "Equibles Stocks" version 1.7.2 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Git Repository: Please remove the Git repository from this plugin
  • Description: Keep the plugin description shorter than 140 characters (currently 295 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("equibles-stocks.php" instead of "hello.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin84,160 lines of code in 827 files:
LanguageFilesBlank linesComment linesLines of code
PHP4709,81232,26857,618
JavaScript1715,1888,45912,933
Markdown781,82605,703
PO File268191,0202,202
JSON17002,095
Sass4833901,769
CSS73251,1391,662
YAML6223101
Bourne Shell114838
XML11020
Dockerfile18010
make1409

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity11.11
▷ Minimum class complexity1.00
▷ Maximum class complexity203.00
Average method complexity2.01
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces49
Interfaces39
Traits9
Classes374
▷ Abstract classes164.28%
▷ Concrete classes35895.72%
▷ Final classes308.38%
Methods4,208
▷ Static methods58914.00%
▷ Public methods3,78289.88%
▷ Protected methods2656.30%
▷ Private methods1613.83%
Functions349
▷ Named functions10128.94%
▷ Anonymous functions24871.06%
Constants304
▷ Global constants8126.64%
▷ Class constants22373.36%
▷ Public constants22199.10%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin