78% sensei-lesson-timer

Code Review | Element Lesson Timer for Sensei

WordPress plugin Element Lesson Timer for Sensei scored 78% from 54 tests.

About plugin

  • Plugin page: sensei-lesson-timer
  • Plugin version: 2.0.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-5.8.1
  • WordPress version: 5.8.1
  • First release: Mar 14, 2015
  • Latest release: Oct 18, 2021
  • Number of updates: 45
  • Update frequency: every 53.6 days
  • Top authors: skinnycat (75.56%)jtsternberg (26.67%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active / 4,985 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: ▼1.71MB] [CPU: ▼197.05ms] Passed 4 tests

A check of server-side resources used by Element Lesson Timer for Sensei
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /1.92 ▼0.9111.48 ▼22.41
Dashboard /wp-admin1.94 ▼1.128.03 ▼39.54
Posts /wp-admin/edit.php1.94 ▼1.1710.62 ▼40.70
Add New Post /wp-admin/post-new.php1.94 ▼3.497.17 ▼685.56
Media Library /wp-admin/upload.php1.94 ▼1.0611.24 ▼21.00

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 129 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Element Lesson Timer for Sensei
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10716.25 ▲0.3210.96 ▲1.3647.42 ▼4.33
Dashboard /wp-admin2,967 ▲335.96 ▼0.04156.10 ▲4.37122.36 ▼1.98
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0171.10 ▼3.2285.71 ▼10.95
Add New Post /wp-admin/post-new.php1,615 ▲2121.32 ▲2.54296.07 ▼131.32115.10 ▼14.84
Media Library /wp-admin/upload.php1,807 ▼05.02 ▼0.02153.09 ▼10.68127.15 ▲1.47

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
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > User warning in wp-content/plugins/sensei-lesson-timer/sensei-lesson-timer.php+602
    Sensei Lesson Timer requires the Sensei plugin! Please install and activate Sensei (https://github.com/Automattic/sensei).

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Please take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/sensei-lesson-timer/src/index.php
  • 101× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/sensei-lesson-timer/vendor/composer/installers/src/Composer/Installers/ItopInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/sensei-lesson-timer/vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/sensei-lesson-timer/vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/sensei-lesson-timer/vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/sensei-lesson-timer/vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/sensei-lesson-timer/vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/sensei-lesson-timer/vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/sensei-lesson-timer/vendor/composer/installers/src/Composer/Installers/ZikulaInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/sensei-lesson-timer/vendor/composer/installers/src/Composer/Installers/AimeosInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/sensei-lesson-timer/vendor/composer/installers/src/Composer/Installers/MakoInstaller.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Plugin Name: You should set the name of your plugin on the first line ( === sensei-lesson-timer === )
Please take inspiration from this readme.txt

sensei-lesson-timer/sensei-lesson-timer.php 92% from 13 tests

This is the main PHP file of "Element Lesson Timer for Sensei" version 2.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin3,840 lines of code in 124 files:
LanguageFilesBlank linesComment linesLines of code
PHP1155879213,122
JSON200282
JavaScript27613273
YAML3313123
CSS26040

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 problems
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity3.27
▷ Minimum class complexity1.00
▷ Maximum class complexity54.00
Average method complexity2.70
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes107
▷ Abstract classes10.93%
▷ Concrete classes10699.07%
▷ Final classes00.00%
Methods148
▷ Static methods2013.51%
▷ Public methods10570.95%
▷ Protected methods3422.97%
▷ Private methods96.08%
Functions10
▷ Named functions220.00%
▷ Anonymous functions880.00%
Constants11
▷ Global constants763.64%
▷ Class constants436.36%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin