10% bread

Code Review | bread

WordPress plugin bread scored 10% from 54 tests.

About plugin

  • Plugin page: bread
  • Plugin version: 2.6.2
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.8.1
  • WordPress version: 5.8.1
  • First release: Feb 1, 2018
  • Latest release: Nov 2, 2021
  • Number of updates: 96
  • Update frequency: every 14.3 days
  • Top authors: radius314 (62.5%)bmltenabled (33.33%)pjaudiomv (6.25%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active / 6,632 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-includes/class-wp-hook.php+303
    Non-static method Bread::activation() should not be called statically

Server metrics [RAM: ▼0.12MB] [CPU: ▼168.86ms] Passed 4 tests

An overview of server-side resources used by bread
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.7937.49 ▲19.72
Dashboard /wp-admin3.53 ▲0.4726.31 ▼18.95
Posts /wp-admin/edit.php3.53 ▲0.4226.67 ▼17.62
Add New Post /wp-admin/post-new.php3.53 ▼1.9126.41 ▼630.35
Media Library /wp-admin/upload.php3.53 ▲0.5224.73 ▼8.52

Server storage [IO: ▲29.29MB] [DB: ▲0.01MB] 67% from 3 tests

Input-output and database impact of this plugin
Please try to fix the following items
  • Try to limit filesystem usage to 25MB (currently using 29.29MB)
Filesystem: 1,102 new files
Database: no new tables, 1 new option
New WordPress options
bmlt_meeting_list_options

Browser metrics Passed 4 tests

A check of browser resources used by bread
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,723 ▲12715.91 ▲0.3510.94 ▲2.5145.25 ▼2.63
Dashboard /wp-admin2,987 ▲565.88 ▼0.13159.01 ▼11.79111.95 ▼3.51
Posts /wp-admin/edit.php2,759 ▲232.71 ▼0.0268.47 ▲5.6394.11 ▼2.24
Add New Post /wp-admin/post-new.php1,511 ▼16118.94 ▲0.02366.14 ▼24.93109.90 ▲3.39
Media Library /wp-admin/upload.php1,827 ▲175.03 ▲0.00159.41 ▲15.69118.60 ▼12.31

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/bread/bmlt-meeting-list.php+2228
    Undefined index: authors
  • This plugin does not fully uninstall, leaving 1 option in the database
    • bmlt_meeting_list_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
Please fix the following items
  • 14× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/bread/partials/_help_videos.php
    • > /wp-content/plugins/bread/partials/_front_page_setup.php
    • > /wp-content/plugins/bread/bmlt-meeting-list.php
    • > /wp-content/plugins/bread/partials/_meeting_list_setup.php
    • > /wp-content/plugins/bread/partials/_meetings_setup.php
    • > /wp-content/plugins/bread/index.php
    • > /wp-content/plugins/bread/partials/_last_page_setup.php
    • > /wp-content/plugins/bread/partials/_helpers.php
    • > /wp-content/plugins/bread/partials/_custom_section_setup.php
    • > /wp-content/plugins/bread/partials/_backup_restore_setup.php
  • 346× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'setasign\\Fpdi\\PdfParser\\Filter\\FilterInterface' not found in wp-content/plugins/bread/mpdf/vendor/setasign/fpdi/src/PdfParser/Filter/AsciiHex.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Language\\LanguageToFont' not found in wp-content/plugins/bread/mpdf/vendor/mpdf/mpdf/tests/Mpdf/Language/LanguageToFontTestImplimentation.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/bread/mpdf/vendor/mpdf/mpdf/tests/Mpdf/PDFATest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/bread/mpdf/vendor/mpdf/mpdf/tests/Issues/Issue1204Test.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/bread/mpdf/vendor/myclabs/deep-copy/tests/DeepCopyTest/DeepCopyTest.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/bread/mpdf/vendor/mpdf/mpdf/src/Tag/TFoot.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/bread/mpdf/vendor/mpdf/mpdf/src/Tag/InlineTag.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/bread/mpdf/vendor/mpdf/mpdf/src/Tag/FieldSet.php:5
    • > PHP Warning
      require_once(../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/bread/mpdf/vendor/mpdf/mpdf/utils/font_names.php on line 15
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/bread/mpdf/vendor/mpdf/mpdf/src/Tag/Kbd.php:5

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: narcotics anonymous, bmlt, na, meeting list

bread/bmlt-meeting-list.php 92% from 13 tests

The main file in "bread" v. 2.6.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("bread.php" instead of "bmlt-meeting-list.php")

Code Analysis 95% from 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
There were no executable files found in this plugin93,873 lines of code in 612 files:
LanguageFilesBlank linesComment linesLines of code
PHP55513,06612,34485,970
JavaScript114822373,171
CSS8104931,647
Markdown837401,120
SVG50221,057
JSON10440632
XML7220146
HTML30085
YAML22023
Dockerfile14018
Bourne Shell2204

PHP code 0% from 2 tests

An overview of cyclomatic complexity and code structure
The following items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 7,009)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 460)
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity41.47
▷ Minimum class complexity1.00
▷ Maximum class complexity7,009.00
Average method complexity11.14
▷ Minimum method complexity1.00
▷ Maximum method complexity460.00
Code structure
Namespaces64
Interfaces11
Traits6
Classes431
▷ Abstract classes102.32%
▷ Concrete classes42197.68%
▷ Final classes122.85%
Methods1,792
▷ Static methods1407.81%
▷ Public methods1,55286.61%
▷ Protected methods985.47%
▷ Private methods1427.92%
Functions57
▷ Named functions2543.86%
▷ Anonymous functions3256.14%
Constants433
▷ Global constants51.15%
▷ Class constants42898.85%
▷ Public constants428100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
27 PNG files occupy 0.70MB with 0.29MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-icons_fcdd4a_256x240.png4.44KB4.17KB▼ 6.02%
mpdf/vendor/mpdf/qrcode/tests/reference/LOREM-IPSUM-2019-L-250.png183.72KB0.33KB▼ 99.82%
css/chosen-sprite.png0.53KB0.88KB0.00%
css/images/banner_rails.png3.39KB0.14KB▼ 95.97%
css/images/ui-icons_0a82eb_256x240.png4.44KB4.17KB▼ 6.02%