94% dashboard-for-pressbooks-h5p

Code Review | Dashboard for Pressbooks and H5P

WordPress plugin Dashboard for Pressbooks and H5P scored 94% 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-5.9
  • WordPress version: 5.9.2
  • First release: Jun 16, 2020
  • Latest release: Feb 4, 2022
  • Number of updates: 17
  • Update frequency: every 35.5 days
  • Top authors: figureone (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active / 1,181 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.28MB] [CPU: ▼296.51ms] Passed 4 tests

Analyzing server-side resources used by Dashboard for Pressbooks and H5P
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.87 ▲0.3557.35 ▲6.03
Dashboard /wp-admin3.72 ▲0.3133.88 ▼1.24
Posts /wp-admin/edit.php3.93 ▲0.3036.65 ▲0.09
Add New Post /wp-admin/post-new.php7.18 ▲0.2195.19 ▼1,179.50
Media Library /wp-admin/upload.php3.59 ▲0.2926.25 ▼5.37
Dashboard for Pressbooks and H5P /wp-admin/options-general.php?page=dashboard-for-pressbooks-h5p3.5623.65

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 40 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Dashboard for Pressbooks and H5P
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,819 ▲9716.00 ▲0.227.33 ▲1.253.64 ▲1.45
Dashboard /wp-admin2,912 ▲516.34 ▲0.10122.06 ▼13.30156.36 ▼2.85
Posts /wp-admin/edit.php2,696 ▲23.23 ▼0.0161.05 ▼2.64140.01 ▼2.81
Add New Post /wp-admin/post-new.php1,755 ▲320.98 ▼0.97460.79 ▼6.03160.14 ▲1.24
Media Library /wp-admin/upload.php1,700 ▲25.53 ▲0.02139.52 ▼3.86186.10 ▼14.53
Dashboard for Pressbooks and H5P /wp-admin/options-general.php?page=dashboard-for-pressbooks-h5p1,1852.5055.76128.44

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
  • 9× PHP files trigger server-side errors or warnings when accessed directly:
    • > 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-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-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-save-last-login-user-meta.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-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-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-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-extend-pressbooks-organize.php:17
    • > 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

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% 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
4 plugin tags: widget, pressbooks, dashboard, h5p

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

This is the main PHP file of "Dashboard for Pressbooks and H5P" version 1.1.6, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same 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 check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected1,472 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP112115471,024
JavaScript751123252
Sass43515174
XML13511
JSON1006
CSS5045

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
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%