77% bread-finance

Code Review | Bread Pay

WordPress plugin Bread Pay scored77%from 54 tests.

About plugin

  • Plugin page: bread-finance
  • Plugin version: 3.4.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Mar 14, 2019
  • Latest release: Nov 16, 2023
  • Number of updates: 115
  • Update frequency: every 14.9 days
  • Top authors: breadintegrations (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /7,724 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.67ms] Passed 4 tests

A check of server-side resources used by Bread Pay
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0237.10 ▼4.59
Dashboard /wp-admin3.32 ▲0.0246.04 ▼4.33
Posts /wp-admin/edit.php3.43 ▲0.0845.20 ▲0.01
Add New Post /wp-admin/post-new.php5.90 ▲0.0189.82 ▼13.76
Media Library /wp-admin/upload.php3.24 ▲0.0134.01 ▲1.01

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

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

Browser metrics Passed 4 tests

Bread Pay: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.13 ▼0.581.62 ▼0.0936.42 ▼7.28
Dashboard /wp-admin2,195 ▲185.59 ▲0.0591.12 ▼12.2240.53 ▼4.29
Posts /wp-admin/edit.php2,100 ▼01.94 ▲0.0141.55 ▲2.9536.66 ▲1.93
Add New Post /wp-admin/post-new.php1,526 ▼023.23 ▼0.29616.86 ▼38.5547.71 ▼11.00
Media Library /wp-admin/upload.php1,400 ▲64.13 ▼0.0797.25 ▼4.4241.90 ▼0.78

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/bread-finance/templates/buttons/button_placeholder.php
    • > /wp-content/plugins/bread-finance/bread-finance.php
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'Bread_Finance\\Classes\\Compat\\Bread_Finance_Currency_Abstract' not found in wp-content/plugins/bread-finance/classes/compat/class-bread-finance-currency-woocs.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Bread_Finance\\Classes\\Compat\\Bread_Finance_Currency_Abstract' not found in wp-content/plugins/bread-finance/classes/compat/class-bread-finance-currency-pboc.php:5
    • > PHP Notice
      Undefined variable: title in wp-content/plugins/bread-finance/templates/buttons/button_placeholder.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'Bread_Finance\\Classes\\Bread_Finance_Options_Cart' not found in wp-content/plugins/bread-finance/classes/class-bread-finance-options-checkout.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Bread_Finance\\Classes\\Bread_Finance_Options_Cart' not found in wp-content/plugins/bread-finance/classes/class-bread-finance-options-category.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Bread_Finance\\Classes\\Bread_Finance_Options_Cart' not found in wp-content/plugins/bread-finance/classes/class-bread-finance-options-cart-checkout.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === bread-finance === )
Please take inspiration from this readme.txt

bread-finance/bread-finance.php 77% from 13 tests

The principal PHP file in "Bread Pay" v. 3.4.2 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.9" instead of "3.0.0")
  • Domain Path: The domain path folder was not found ("/i18n/languages/")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected8,945 lines of code in 46 files:
LanguageFilesBlank linesComment linesLines of code
PHP271,2601,6845,710
JavaScript114024492,647
CSS32827246
Markdown1690200
Sass111091
JSON10025
YAML10023
SVG1003

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity38.00
▷ Minimum class complexity1.00
▷ Maximum class complexity263.00
Average method complexity3.84
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes25
▷ Abstract classes14.00%
▷ Concrete classes2496.00%
▷ Final classes00.00%
Methods320
▷ Static methods3811.88%
▷ Public methods24877.50%
▷ Protected methods113.44%
▷ Private methods6119.06%
Functions14
▷ Named functions00.00%
▷ Anonymous functions14100.00%
Constants11
▷ Global constants654.55%
▷ Class constants545.45%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/image/logo.png11.96KB6.19KB▼ 48.27%
assets/image/bread_finance_logo.png7.17KB3.80KB▼ 46.98%