84% dashboard-for-pressbooks-h5p

Code Review | Dashboard for Pressbooks and H5P

WordPress plugin Dashboard for Pressbooks and H5P scored 84% from 54 tests.

About plugin

  • Plugin page: dashboard-for-pre...
  • Plugin version: 1.1.6
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.2
  • WordPress version: 6.3.1
  • First release: Jun 16, 2020
  • Latest release: Apr 25, 2023
  • Number of updates: 20
  • Update frequency: every 52.4 days
  • Top authors: figureone (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active / 1,921 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼1.65ms] Passed 4 tests

This is a short check of server-side resources used by Dashboard for Pressbooks and H5P
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0441.78 ▼0.95
Dashboard /wp-admin3.35 ▲0.0447.39 ▼0.65
Posts /wp-admin/edit.php3.46 ▲0.1048.75 ▲3.04
Add New Post /wp-admin/post-new.php5.92 ▲0.0481.69 ▼8.03
Media Library /wp-admin/upload.php3.27 ▲0.0436.97 ▲4.36
Dashboard for Pressbooks and H5P /wp-admin/options-general.php?page=dashboard-for-pressbooks-h5p3.2334.01

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 40 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Dashboard for Pressbooks and H5P
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲8413.35 ▼1.031.82 ▲0.0741.53 ▼8.41
Dashboard /wp-admin2,228 ▲405.93 ▲0.9994.51 ▼25.2737.73 ▼7.74
Posts /wp-admin/edit.php2,093 ▲42.00 ▼0.0033.76 ▼0.5334.51 ▲1.16
Add New Post /wp-admin/post-new.php1,533 ▲1122.84 ▼0.27638.58 ▼27.5458.27 ▲5.22
Media Library /wp-admin/upload.php1,392 ▲44.17 ▼0.0794.69 ▼14.3544.42 ▼3.63
Dashboard for Pressbooks and H5P /wp-admin/options-general.php?page=dashboard-for-pressbooks-h5p9302.1825.4229.93

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 9× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'Dashboard_For_Pressbooks_H5P\\Singleton' not found in wp-content/plugins/dashboard-for-pressbooks-h5p/src/class-save-last-login-user-meta.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Dashboard_For_Pressbooks_H5P\\register_activation_hook() in wp-content/plugins/dashboard-for-pressbooks-h5p/src/class-plugin.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Dashboard_For_Pressbooks_H5P\\Singleton' not found in wp-content/plugins/dashboard-for-pressbooks-h5p/src/class-hide-h5p-for-anonymous-users.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Dashboard_For_Pressbooks_H5P\\Singleton' not found in wp-content/plugins/dashboard-for-pressbooks-h5p/src/class-dashboard-widget.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Dashboard_For_Pressbooks_H5P\\Singleton' not found in wp-content/plugins/dashboard-for-pressbooks-h5p/src/class-data.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Dashboard_For_Pressbooks_H5P\\Singleton' not found in wp-content/plugins/dashboard-for-pressbooks-h5p/src/class-extend-pressbooks-toc.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Dashboard_For_Pressbooks_H5P\\Singleton' not found in wp-content/plugins/dashboard-for-pressbooks-h5p/src/class-settings.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Dashboard_For_Pressbooks_H5P\\Singleton' not found in wp-content/plugins/dashboard-for-pressbooks-h5p/src/class-plugin.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Dashboard_For_Pressbooks_H5P\\Singleton' not found in wp-content/plugins/dashboard-for-pressbooks-h5p/src/class-extend-pressbooks-organize.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
4 plugin tags: pressbooks, h5p, widget, dashboard

dashboard-for-pressbooks-h5p/pressbooks-h5p-dashboard.php 92% from 13 tests

The primary PHP file in "Dashboard for Pressbooks and H5P" version 1.1.6 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("dashboard-for-pressbooks-h5p.php" instead of "pressbooks-h5p-dashboard.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin1,472 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP112115471,024
JavaScript751123252
Sass43515174
XML13511
JSON1006
CSS5045

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity12.10
▷ Minimum class complexity1.00
▷ Maximum class complexity58.00
Average method complexity3.19
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes10
▷ Abstract classes220.00%
▷ Concrete classes880.00%
▷ Final classes00.00%
Methods45
▷ Static methods24.44%
▷ Public methods4191.11%
▷ Protected methods12.22%
▷ Private methods36.67%
Functions7
▷ Named functions228.57%
▷ Anonymous functions571.43%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/banner-1544x500.png60.65KB36.61KB▼ 39.64%