51% bread-finance

Code Review | Bread Finance

WordPress plugin Bread Finance scored 51% from 54 tests.

About plugin

  • Plugin page: bread-finance
  • Plugin version: 2.0.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.8.1
  • WordPress version: 5.9.2
  • First release: Mar 14, 2019
  • Latest release: Jan 7, 2022
  • Number of updates: 73
  • Update frequency: every 14.1 days
  • Top authors: breadintegrations (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 1,930 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.66MB] [CPU: ▼326.10ms] Passed 4 tests

Analyzing server-side resources used by Bread Finance
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.35 ▲1.8442.25 ▼9.09
Dashboard /wp-admin4.98 ▲1.5834.98 ▼8.08
Posts /wp-admin/edit.php4.98 ▲1.3534.96 ▼8.53
Add New Post /wp-admin/post-new.php4.98 ▼1.9936.76 ▼1,278.69
Media Library /wp-admin/upload.php4.98 ▲1.6930.91 ▲3.57
MWP Task Runner /wp-admin/tools.php?page=mwp-fw-tasks4.9933.42
MWP Framework /wp-admin/options-general.php?page=mwp_framework_settings4.9935.56

Server storage [IO: ▲47.29MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
These are issues you should consider
  • The filesystem usage should be lower than 25MB (currently using 47.29MB)
Filesystem: 3,689 new files
Database: 1 new table, 2 new options
New tables
wp_mwp_queued_tasks
New WordPress options
widget_bread_woocommercegateway_basicwidget
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

This is an overview of browser requirements for Bread Finance
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,650 ▲89616.83 ▲0.520.50 ▼5.9533.78 ▲31.39
Dashboard /wp-admin4,353 ▲1,4737.78 ▲1.28146.16 ▲6.83156.08 ▼5.83
Posts /wp-admin/edit.php45 ▼2,6401.14 ▼2.300.04 ▼63.0347.47 ▼97.02
Add New Post /wp-admin/post-new.php2,858 ▲1,10616.51 ▼5.10443.00 ▼10.64158.74 ▼4.06
Media Library /wp-admin/upload.php2,313 ▲6156.42 ▲0.68135.04 ▼10.87184.77 ▼2.77
MWP Task Runner /wp-admin/tools.php?page=mwp-fw-tasks1,9793.5378.85100.78
MWP Framework /wp-admin/options-general.php?page=mwp_framework_settings1,6583.4574.87122.23

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 25% 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
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5768
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • Zombie tables detected upon uninstall: 1 table
    • wp_mwp_queued_tasks
  • Zombie WordPress options were found after uninstall: 2 options
    • recovery_mode_email_last_sent
    • widget_bread_woocommercegateway_basicwidget

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)
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mwp_framework_settings
    • > User notice in wp-includes/functions.php+5768
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 172× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/bread-finance/framework/classes/CLI/WPUpgraderSkin.php
    • > /wp-content/plugins/bread-finance/framework/templates/form/symfony/button_label.html.php
    • > /wp-content/plugins/bread-finance/framework/annotations/PostPage.php
    • > /wp-content/plugins/bread-finance/framework/templates/views/management/records/table_row.php
    • > /wp-content/plugins/bread-finance/framework/mwp-framework.php
    • > /wp-content/plugins/bread-finance/framework/templates/component/error.php
    • > /wp-content/plugins/bread-finance/classes/Utilities.php
    • > /wp-content/plugins/bread-finance/framework/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_cookie_and_session.php
    • > /wp-content/plugins/bread-finance/framework/templates/admin/settings/text-field.php
    • > /wp-content/plugins/bread-finance/framework/classes/CLI.php
  • 1339× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Polyfill\\Util\\BinaryOnFuncOverload' not found in wp-content/plugins/bread-finance/framework/vendor/symfony/polyfill-util/Binary.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/bread-finance/framework/vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Validator\\Test\\ConstraintValidatorTestCase' not found in wp-content/plugins/bread-finance/framework/vendor/symfony/validator/Tests/Constraints/TypeValidatorTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/bread-finance/framework/vendor/symfony/validator/Tests/ConstraintTest.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Security\\Core\\Authorization\\Voter\\RoleVoter' not found in wp-content/plugins/bread-finance/framework/vendor/symfony/security-core/Authorization/Voter/RoleHierarchyVoter.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Form\\ChoiceList\\Factory\\ChoiceListFactoryInterface' not found in wp-content/plugins/bread-finance/framework/vendor/symfony/form/ChoiceList/Factory/CachingFactoryDecorator.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Console\\Command\\Command' not found in wp-content/plugins/bread-finance/framework/vendor/symfony/form/Command/DebugCommand.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Intl\\DateFormatter\\DateFormat\\Transformer' not found in wp-content/plugins/bread-finance/framework/vendor/symfony/intl/DateFormatter/DateFormat/TimezoneTransformer.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Http\\Discovery\\ClassDiscovery' not found in wp-content/plugins/bread-finance/vendor/php-http/discovery/src/HttpAsyncClientDiscovery.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Security\\Core\\Authentication\\AuthenticationTrustResolverInterface' not found in wp-content/plugins/bread-finance/framework/vendor/symfony/security-core/Authentication/AuthenticationTrustResolver.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 90% 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 your attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === bread-finance === )
The official readme.txt might help

bread-finance/plugin.php 85% from 13 tests

"Bread Finance" version 2.0.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Domain Path: The domain path is invalid: folder "/i18n/languages/" does not exist
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("bread-finance.php" instead of "plugin.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected424,726 lines of code in 3,198 files:
LanguageFilesBlank linesComment linesLines of code
JSON99500259,061
PHP1,92432,34062,123132,492
XML1681061918,994
XSD5117765,133
Markdown662,21804,921
CSS344261,819
JavaScript102883801,722
SVG200291
YAML122014146
Pascal1316159
PO File67037
INI20217
Bourne Shell27015
Qt Linguist10010
make1409

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 155)
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity6.07
▷ Minimum class complexity1.00
▷ Maximum class complexity226.00
Average method complexity1.86
▷ Minimum method complexity1.00
▷ Maximum method complexity155.00
Code structure
Namespaces299
Interfaces175
Traits13
Classes1,617
▷ Abstract classes1026.31%
▷ Concrete classes1,51593.69%
▷ Final classes1439.44%
Methods10,760
▷ Static methods4594.27%
▷ Public methods9,39087.27%
▷ Protected methods8447.84%
▷ Private methods5264.89%
Functions829
▷ Named functions14016.89%
▷ Anonymous functions68983.11%
Constants671
▷ Global constants223.28%
▷ Class constants64996.72%
▷ Public constants64399.08%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/image/logo.png11.96KB6.19KB▼ 48.27%