68% mooberry-book-manager

Code Review | Mooberry Book Manager

WordPress plugin Mooberry Book Manager scored68%from 54 tests.

About plugin

  • Plugin page: mooberry-book-man...
  • Plugin version: 4.15.11
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.0-6.2
  • WordPress version: 6.3.1
  • First release: Mar 27, 2015
  • Latest release: Nov 23, 2023
  • Number of updates: 433
  • Update frequency: every 7.3 days
  • Top authors: mooberrydreams (100%)

Code review

54 tests

User reviews

45 reviews

Install metrics

1,000+ active /159,207 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲4.05MB] [CPU: ▲32.10ms] Passed 4 tests

An overview of server-side resources used by Mooberry Book Manager
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /6.97 ▲3.5064.62 ▲22.17
Dashboard /wp-admin7.55 ▲4.2489.18 ▲40.37
Posts /wp-admin/edit.php7.59 ▲4.2391.83 ▲40.74
Add New Post /wp-admin/post-new.php10.24 ▲4.34126.73 ▲28.65
Media Library /wp-admin/upload.php7.48 ▲4.2570.67 ▲37.20
Editors /wp-admin/edit-tags.php?taxonomy=mbdb_editor&post_type=mbdb_book7.9076.45
Add New /wp-admin/post-new.php?post_type=mbdb_publisher8.0095.49
All Books /wp-admin/edit.php?post_type=mbdb_book7.5568.58
Retailers /wp-admin/admin.php?page=mbdb_retailers_options9.0886.09
E-book Formats /wp-admin/admin.php?page=mbdb_formats_options7.9679.26
Add New /wp-admin/post-new.php?post_type=mbdb_book_grid8.2887.51
Genres /wp-admin/edit-tags.php?taxonomy=mbdb_genre&post_type=mbdb_book7.8973.12
Cover Artists /wp-admin/edit-tags.php?taxonomy=mbdb_cover_artist&post_type=mbdb_book7.9078.10
Book Grid /wp-admin/admin.php?page=mbdb_grid_options7.9366.88
Translators /wp-admin/edit-tags.php?taxonomy=mbdb_translator&post_type=mbdb_book7.4864.97

Server storage [IO: ▲5.71MB] [DB: ▲0.03MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 587 new files
Database: 1 new table, 12 new options
New tables
wp_mbdb_books
New WordPress options
widget_mbdb_book_widget2
theysaidso_admin_options
widget_theysaidso_widget
mbdb_options
mbdb_version
mbdb_import_books
widget_recent-comments
can_compress_scripts
widget_recent-posts
mbdb_admin_notice_manager
...

Browser metrics Passed 4 tests

An overview of browser requirements for Mooberry Book Manager
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,107 ▲34513.98 ▼0.455.23 ▲3.3740.25 ▼0.53
Dashboard /wp-admin2,416 ▲2365.88 ▲0.2298.72 ▲4.6543.48 ▼0.24
Posts /wp-admin/edit.php2,325 ▲2252.34 ▲0.3339.26 ▼1.1937.19 ▼1.18
Add New Post /wp-admin/post-new.php1,722 ▲19622.55 ▼0.85704.26 ▲37.4336.66 ▼16.86
Media Library /wp-admin/upload.php1,635 ▲2324.75 ▲0.53105.50 ▲3.2346.61 ▲4.60
Editors /wp-admin/edit-tags.php?taxonomy=mbdb_editor&post_type=mbdb_book2,5418.58183.1076.84
Add New /wp-admin/post-new.php?post_type=mbdb_publisher1,8934.0480.8834.37
All Books /wp-admin/edit.php?post_type=mbdb_book1,4392.2938.6030.41
Retailers /wp-admin/admin.php?page=mbdb_retailers_options7,4174.81210.00131.98
E-book Formats /wp-admin/admin.php?page=mbdb_formats_options1,5963.7849.8085.91
Add New /wp-admin/post-new.php?post_type=mbdb_book_grid3,2563.2071.7575.64
Genres /wp-admin/edit-tags.php?taxonomy=mbdb_genre&post_type=mbdb_book2,5148.48182.8061.09
Cover Artists /wp-admin/edit-tags.php?taxonomy=mbdb_cover_artist&post_type=mbdb_book2,5418.52185.9861.75
Book Grid /wp-admin/admin.php?page=mbdb_grid_options1,4072.1733.5930.02
Translators /wp-admin/edit-tags.php?taxonomy=mbdb_translator&post_type=mbdb_book1,4792.1138.9633.67

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie tables were found after uninstall: 1 table
    • wp_mbdb_books
  • This plugin did not uninstall successfully, leaving 12 options in the database
    • mbdb_admin_notice_manager
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_mbdb_book_widget2
    • mbdb_version
    • widget_recent-posts
    • mbdb_import_books
    • widget_recent-comments
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/mooberry-book-manager/includes/admin/views/reserved_terms.php
  • 114× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/mooberry-book-manager/includes/CMB2/types/CMB2_Type_Taxonomy_Select.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Mooberry_Book_Manager_Book_Grid' not found in wp-content/plugins/mooberry-book-manager/includes/class-mbm-tax-grid.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/mooberry-book-manager/includes/CMB2/includes/CMB2_hookup.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Background_Process' not found in wp-content/plugins/mooberry-book-manager/includes/admin/class-mbm-import-process.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/mooberry-book-manager/includes/CMB2/includes/types/CMB2_Type_Multi_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Background_Process' not found in wp-content/plugins/mooberry-book-manager/includes/admin/class-book-content-update-fix-process.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/mooberry-book-manager/includes/admin/views/admin-about-mooberry.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/mooberry-book-manager/includes/CMB2/types/CMB2_Type_Checkbox.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Counter_Base' not found in wp-content/plugins/mooberry-book-manager/includes/CMB2/types/CMB2_Type_Textarea.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/mooberry-book-manager/includes/CMB2/includes/types/CMB2_Type_Radio.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 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: author website management, library, book store, author, writing...

mooberry-book-manager/mooberry-book-manager.php 77% from 13 tests

This is the main PHP file of "Mooberry Book Manager" version 4.15.11, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Domain Path: The domain path should be prefixed with a forward slash character ("/languages")
  • Domain Path: The domain path should use only dashes and lowercase characters ("languages")
  • Description: Please keep the plugin description shorter than 140 characters (currently 146 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin88,238 lines of code in 342 files:
LanguageFilesBlank linesComment linesLines of code
PO File13220,93127,17346,829
PHP1457,67913,64824,620
JSON3006,620
CSS194951,3415,229
JavaScript176367962,189
Sass17306291,411
Markdown745101,272
HTML214068

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity22.31
▷ Minimum class complexity1.00
▷ Maximum class complexity288.00
Average method complexity3.29
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes194
▷ Abstract classes3216.49%
▷ Concrete classes16283.51%
▷ Final classes10.62%
Methods1,839
▷ Static methods19210.44%
▷ Public methods1,49281.13%
▷ Protected methods32617.73%
▷ Private methods211.14%
Functions170
▷ Named functions16898.82%
▷ Anonymous functions21.18%
Constants27
▷ Global constants1244.44%
▷ Class constants1555.56%
▷ Public constants15100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
49 compressed PNG files occupy 0.30MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/admin/views/images/logo.png23.30KB11.39KB▼ 51.12%
includes/assets/createspace.png4.29KB4.20KB▼ 2.21%
includes/assets/goodreads_logo.png2.28KB2.08KB▼ 8.58%
includes/CMB2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
includes/CMB2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%