77% b2i-investor-tools

Code Review | B2i Investor Tools

WordPress plugin B2i Investor Tools scored77%from 54 tests.

About plugin

  • Plugin page: b2i-investor-tools
  • Plugin version: 1.0.7.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.2.2
  • WordPress version: 6.3.1
  • First release: Sep 12, 2016
  • Latest release: Jul 26, 2023
  • Number of updates: 251
  • Update frequency: every 10.0 days
  • Top authors: b2ijoe (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

300+ active /10,105 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼6.86ms] Passed 4 tests

An overview of server-side resources used by B2i Investor Tools
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0738.21 ▼5.85
Dashboard /wp-admin3.45 ▲0.1151.32 ▼9.61
Posts /wp-admin/edit.php3.50 ▲0.1442.02 ▼3.05
Add New Post /wp-admin/post-new.php5.97 ▲0.0881.70 ▼8.91
Media Library /wp-admin/upload.php3.31 ▲0.0834.46 ▼0.19
B2i Options /wp-admin/options-general.php?page=b2i_options3.7546.31

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 383 new files
Database: no new tables, 8 new options
New WordPress options
b2i_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded
b2i_activation_message
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for B2i Investor Tools
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,884 ▲13813.47 ▼1.098.03 ▲6.3943.63 ▼0.17
Dashboard /wp-admin2,204 ▲275.59 ▲0.0196.20 ▼7.7443.00 ▲0.40
Posts /wp-admin/edit.php2,103 ▼01.98 ▼0.0433.37 ▼0.8534.09 ▼1.81
Add New Post /wp-admin/post-new.php1,534 ▲623.24 ▲0.05655.93 ▲26.4061.03 ▲9.46
Media Library /wp-admin/upload.php1,406 ▲34.24 ▲0.05100.14 ▲2.4843.48 ▼1.16
B2i Options /wp-admin/options-general.php?page=b2i_options4,1972.1329.0642.03

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 8 options
    • can_compress_scripts
    • b2i_options
    • db_upgraded
    • b2i_activation_message
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/b2i-investor-tools/partials/instructions.php
  • 41× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/b2i-investor-tools/vendor/cmb2/includes/types/CMB2_Type_Counter_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/b2i-investor-tools/vendor/cmb2/includes/types/CMB2_Type_Checkbox.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/b2i-investor-tools/vendor/cmb2/includes/types/CMB2_Type_Text_Datetime_Timestamp_Timezone.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/b2i-investor-tools/vendor/cmb2/includes/types/CMB2_Type_File.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Radio' not found in wp-content/plugins/b2i-investor-tools/vendor/cmb2/includes/types/CMB2_Type_Taxonomy_Radio_Hierarchical.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/b2i-investor-tools/vendor/cmb2/includes/types/CMB2_Type_Picker_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/b2i-investor-tools/vendor/cmb2/includes/types/CMB2_Type_Multi_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/b2i-investor-tools/vendor/cmb2/includes/CMB2.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/b2i-investor-tools/vendor/cmb2/includes/types/CMB2_Type_File_List.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller' not found in wp-content/plugins/b2i-investor-tools/vendor/cmb2/includes/rest-api/CMB2_REST_Controller_Boxes.php:17

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

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
8 plugin tags: dividends, sec, emailalerts, pressreleases, news...

b2i-investor-tools/b2i.php 77% from 13 tests

The main PHP file in "B2i Investor Tools" ver. 1.0.7.5 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 144 characters long)
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("b2i-investor-tools.php" instead of "b2i.php")

Code Analysis Passed 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 plugin57,095 lines of code in 224 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP623,0007,22212,748
JavaScript139821,1585,272
CSS142721,2174,927
Sass13238251,149
Markdown22190676

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity27.08
▷ Minimum class complexity1.00
▷ Maximum class complexity555.00
Average method complexity4.02
▷ Minimum method complexity1.00
▷ Maximum method complexity61.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes71
▷ Abstract classes912.68%
▷ Concrete classes6287.32%
▷ Final classes11.61%
Methods616
▷ Static methods9214.94%
▷ Public methods52184.58%
▷ Protected methods9214.94%
▷ Private methods30.49%
Functions47
▷ Named functions4595.74%
▷ Anonymous functions24.26%
Constants10
▷ Global constants330.00%
▷ Class constants770.00%
▷ Public constants7100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
22 PNG files occupy 1.00MB with 0.26MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-3.png142.76KB40.22KB▼ 71.83%
vendor/cmb2/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
vendor/cmb2/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
vendor/cmb2/images/ico-delete.png0.70KB0.72KB0.00%
assets/icon-256x256.png10.88KB5.05KB▼ 53.59%