68% mybookprogress

Code Review | MyBookProgress by Stormhill Media

WordPress plugin MyBookProgress by Stormhill Media scored 68% from 54 tests.

About plugin

  • Plugin page: mybookprogress
  • Plugin version: 1.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-5.9
  • WordPress version: 6.3.1
  • First release: Dec 20, 2015
  • Latest release: Feb 11, 2022
  • Number of updates: 20
  • Update frequency: every 114.6 days
  • Top authors: zookatron (85%)stormhill (20%)

Code review

54 tests

User reviews

4 reviews

Install metrics

500+ active / 9,491 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.60MB] [CPU: ▲0.94ms] Passed 4 tests

Analyzing server-side resources used by MyBookProgress by Stormhill Media
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.12 ▲0.6648.31 ▲6.00
Dashboard /wp-admin3.93 ▲0.6348.70 ▼0.82
Posts /wp-admin/edit.php3.98 ▲0.6352.70 ▲7.52
Add New Post /wp-admin/post-new.php6.47 ▲0.5989.11 ▼5.49
Media Library /wp-admin/upload.php3.79 ▲0.5640.49 ▲4.08

Server storage [IO: ▲1.46MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 109 new files
Database: 1 new table, 9 new options
New tables
wp_mbp_progress
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
mbp_settings
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_mbp_widget
mbp_tracking_data

Browser metrics Passed 4 tests

MyBookProgress by Stormhill Media: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,931 ▲19613.62 ▼0.978.13 ▲6.1437.63 ▼14.94
Dashboard /wp-admin2,219 ▲345.88 ▲0.9299.42 ▼16.8238.81 ▼6.60
Posts /wp-admin/edit.php2,107 ▲182.10 ▲0.1040.57 ▲4.7533.32 ▼0.66
Add New Post /wp-admin/post-new.php1,640 ▲10722.97 ▼0.08620.84 ▼33.6858.39 ▲2.79
Media Library /wp-admin/upload.php1,407 ▲194.17 ▼0.0198.84 ▲4.0042.60 ▲1.77

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_mbp_progress
  • The uninstall procedure has failed, leaving 9 options in the database
    • widget_recent-comments
    • mbp_settings
    • widget_recent-posts
    • can_compress_scripts
    • widget_mbp_widget
    • mbp_tracking_data
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

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)
Even though no errors were found, 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
Please fix the following
  • 8× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/mybookprogress/includes/templates/progress_types/percent_display.php
    • > /wp-content/plugins/mybookprogress/includes/templates/progress_types/percent_editor.php
    • > /wp-content/plugins/mybookprogress/includes/templates/book_progress/overview_book.php
    • > /wp-content/plugins/mybookprogress/includes/templates/book_setup/phase_editor.php
    • > /wp-content/plugins/mybookprogress/includes/templates/book_progress/book_tabs.php
    • > /wp-content/plugins/mybookprogress/includes/templates/book_progress/progress_header.php
    • > /wp-content/plugins/mybookprogress/includes/templates/book_progress/book_progress.php
    • > /wp-content/plugins/mybookprogress/includes/templates/book_progress/progress_more.php
  • 49× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/mybookprogress/includes/templates/book_progress/progress_delete_confirm.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/mybookprogress/includes/templates/book_setup/mybooktable_step.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/mybookprogress/includes/templates/help/search.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/mybookprogress/includes/templates/book_setup/display_step.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/mybookprogress/includes/templates/book_setup/phase_details.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mybookprogress/includes/functions.php:355
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/mybookprogress/includes/templates/upgrade_tab/upgrade_tab.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/mybookprogress/includes/templates/book_setup/phase_template.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/mybookprogress/includes/templates/help/enable_tracking_modal.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mybookprogress/includes/functions.php:355

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
The official readme.txt is a good inspiration

mybookprogress/mybookprogress.php 92% from 13 tests

"MyBookProgress by Stormhill Media" version 1.0.7's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 167 characters long)

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
Everything looks great! No dangerous files found in this plugin9,533 lines of code in 75 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript107431935,163
PHP57400783,212
CSS81811001,158

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity4.20
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods120.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions149
▷ Named functions149100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
22 PNG files occupy 0.65MB with 0.28MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/admin/speech2.png36.55KB18.68KB▼ 48.90%
img/upgrade/nudges.png41.62KB13.76KB▼ 66.94%
img/admin/default_avatar.png0.63KB0.48KB▼ 23.22%
img/frontend/nudge_nudged.png1.32KB1.25KB▼ 5.33%
img/upgrade/email-updates.png104.58KB29.64KB▼ 71.66%