78% bg-forreaders

Code Review | Bg forReaders

WordPress plugin Bg forReaders scored78%from 54 tests.

About plugin

  • Plugin page: bg-forreaders
  • Plugin version: 3.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.0
  • WordPress version: 6.3.1
  • First release: Apr 20, 2016
  • Latest release: May 23, 2022
  • Number of updates: 52
  • Update frequency: every 42.8 days
  • Top authors: VBog (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

90+ active /5,632 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.36MB] [CPU: ▼3.69ms] Passed 4 tests

Server-side resources used by Bg forReaders
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.15 ▲0.4149.44 ▲3.52
Dashboard /wp-admin3.97 ▲0.4155.58 ▲0.99
Posts /wp-admin/edit.php4.02 ▲0.3454.85 ▲1.98
Add New Post /wp-admin/post-new.php6.51 ▲0.3688.77 ▼21.24
Media Library /wp-admin/upload.php3.83 ▲0.3444.00 ▲5.40
For Readers /wp-admin/options-general.php?page=bg-forreaders/bg-forreaders.php3.8339.39

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 681 new files
Database: no new tables, 55 new options
New WordPress options
bg_forreaders_top_offset
bg_forreaders_add_author
bg_forreaders_cover_year
bg_forreaders_while_saved
bg_forreaders_separator
bg_forreaders_before
bg_forreaders_offline_query
bg_forreaders_cats
bg_forreaders_after
bg_forreaders_text_color
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Bg forReaders
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,803 ▲4214.21 ▼0.171.89 ▲0.2745.36 ▲1.61
Dashboard /wp-admin2,204 ▲275.68 ▲0.0388.64 ▼2.1342.32 ▼3.22
Posts /wp-admin/edit.php2,109 ▲62.04 ▲0.0336.49 ▼8.7433.47 ▼5.23
Add New Post /wp-admin/post-new.php1,544 ▼120.55 ▼2.75640.80 ▼101.0954.34 ▼1.74
Media Library /wp-admin/upload.php1,412 ▲124.28 ▲0.0397.29 ▼4.6844.79 ▼1.27
For Readers /wp-admin/options-general.php?page=bg-forreaders/bg-forreaders.php1,0662.0523.1143.98

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% 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
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/bg-forreaders/includes/lib/phpMobi/index.php
    • > /wp-content/plugins/bg-forreaders/bg-forreaders.php
  • 244× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Barcode\\AbstractBarcode' not found in wp-content/plugins/bg-forreaders/includes/lib/mpdf80/vendor/mpdf/mpdf/src/Barcode/Codabar.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/bg-forreaders/includes/lib/mpdf80/vendor/mpdf/mpdf/src/Tag/Div.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'DeepCopy\\Filter\\Filter' not found in wp-content/plugins/bg-forreaders/includes/lib/mpdf80/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/bg-forreaders/includes/lib/mpdf80/vendor/mpdf/mpdf/src/Tag/Kbd.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/bg-forreaders/includes/lib/mpdf80/vendor/mpdf/mpdf/src/Tag/TextCircle.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\SetHtmlPageFooter' not found in wp-content/plugins/bg-forreaders/includes/lib/mpdf80/vendor/mpdf/mpdf/src/Tag/SetPageFooter.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/bg-forreaders/includes/lib/mpdf80/vendor/setasign/fpdi/src/PdfParser/Type/PdfToken.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Psr\\Log\\AbstractLogger' not found in wp-content/plugins/bg-forreaders/includes/lib/mpdf80/vendor/psr/log/Psr/Log/Test/TestLogger.php:57
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Log\\LoggerAwareInterface' not found in wp-content/plugins/bg-forreaders/includes/lib/mpdf80/vendor/mpdf/mpdf/src/Writer/ResourceWriter.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/bg-forreaders/includes/lib/mpdf80/vendor/mpdf/mpdf/src/Tag/Strong.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration Passed 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
10 plugin tags: e-book, fb2, mobi, pdf, opds...

bg-forreaders/bg-forreaders.php Passed 13 tests

"Bg forReaders" version 3.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
97 characters long description:
Convert post content to most popular e-book formats for readers and displays a form for download.

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected87,694 lines of code in 504 files:
LanguageFilesBlank linesComment linesLines of code
PHP45412,94216,31983,995
Markdown1548801,354
JSON1600793
CSS48219579
PO File1143172351
HTML230318
YAML7584196
XML310075
JavaScript10030
Bourne Shell1203

PHP code 0% from 2 tests

An overview of cyclomatic complexity and code structure
It is recommended to fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 7,024)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 460)
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity51.06
▷ Minimum class complexity1.00
▷ Maximum class complexity7,024.00
Average method complexity10.76
▷ Minimum method complexity1.00
▷ Maximum method complexity460.00
Code structure
Namespaces49
Interfaces25
Traits6
Classes343
▷ Abstract classes123.50%
▷ Concrete classes33196.50%
▷ Final classes144.23%
Methods2,002
▷ Static methods1758.74%
▷ Public methods1,76388.06%
▷ Protected methods773.85%
▷ Private methods1628.09%
Functions84
▷ Named functions4553.57%
▷ Anonymous functions3946.43%
Constants630
▷ Global constants406.35%
▷ Class constants59093.65%
▷ Public constants590100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/document-epub.png3.97KB3.23KB▼ 18.63%
css/document-fb2.png3.81KB3.01KB▼ 21.16%
css/document-pdf.png3.78KB3.00KB▼ 20.71%
css/document-mobi.png3.98KB3.20KB▼ 19.65%