10% lesson-scheduler

Code Review | Lesson Scheduler

WordPress plugin Lesson Scheduler scored10%from 54 tests.

About plugin

  • Plugin page: lesson-scheduler
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0+
  • WordPress version: 6.3.1
  • First release: Jul 22, 2013
  • Latest release: Feb 13, 2019
  • Number of updates: 70
  • Update frequency: every 29.0 days
  • Top authors: Teruo Morimoto (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /3,369 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • Install procedure had errors
    • > User notice in wp-includes/functions.php+5905
    Function add_shortcode was called incorrectly. Invalid shortcode name: lesson scheduler. Do not use spaces or reserved characters: & / < > [ ] = Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.)

Server metrics [RAM: ▼1.66MB] [CPU: ▼54.71ms] Passed 4 tests

An overview of server-side resources used by Lesson Scheduler
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.32 ▼1.146.06 ▼33.54
Dashboard /wp-admin2.34 ▼0.967.54 ▼45.15
Posts /wp-admin/edit.php2.35 ▼1.0110.45 ▼46.40
Add New Post /wp-admin/post-new.php2.34 ▼3.547.44 ▼93.74
Media Library /wp-admin/upload.php2.34 ▼0.887.12 ▼29.92
lesson schedules /wp-admin/edit.php?post_type=lesson_schedules2.357.10
Lesson Scheduler /wp-admin/options-general.php?page=lesson-scheduler/lesson_scheduler_options.php2.356.73
Add New /wp-admin/post-new.php?post_type=lesson_schedules2.357.44

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

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

Browser metrics Passed 4 tests

Lesson Scheduler: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,872 ▲11113.93 ▼0.663.24 ▲1.6443.10 ▼3.72
Dashboard /wp-admin2,238 ▲615.69 ▲0.0594.17 ▲5.2440.08 ▼6.52
Posts /wp-admin/edit.php2,143 ▲432.66 ▲0.6245.37 ▲4.3637.03 ▲1.90
Add New Post /wp-admin/post-new.php1,569 ▲4118.21 ▼4.91674.10 ▼2.8880.77 ▲23.59
Media Library /wp-admin/upload.php1,443 ▲405.21 ▲0.95102.93 ▲7.8742.80 ▲2.68
lesson schedules /wp-admin/edit.php?post_type=lesson_schedules1,1162.6139.1327.33
Lesson Scheduler /wp-admin/options-general.php?page=lesson-scheduler/lesson_scheduler_options.php1,6242.3131.3242.82
Add New /wp-admin/post-new.php?post_type=lesson_schedules1,5033.5553.0731.42

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function add_shortcode was called incorrectly. Invalid shortcode name: lesson scheduler. Do not use spaces or reserved characters: & / < > [ ] = Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.)
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=lesson_schedules
    • > User notice in wp-includes/functions.php+5905
    Function add_shortcode was called incorrectly. Invalid shortcode name: lesson scheduler. Do not use spaces or reserved characters: & / < > [ ] = Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.)
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=lesson_schedules
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=lesson-scheduler/lesson_scheduler_options.php
    • > Warning in wp-content/plugins/lesson-scheduler/lesson_scheduler_options.php+185
    Use of undefined constant wp_get_user_contact_methods - assumed 'wp_get_user_contact_methods' (this will throw an Error in a future version of PHP)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=lesson-scheduler/lesson_scheduler_options.php
    • > Warning in wp-content/plugins/lesson-scheduler/lesson_scheduler_options.php+145
    Use of undefined constant get_cimyFields - assumed 'get_cimyFields' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=lesson-scheduler/lesson_scheduler_options.php
    • > Notice in wp-content/plugins/lesson-scheduler/lesson_scheduler_options.php+86
    Undefined variable: str
    • > GET request to /wp-admin/post-new.php?post_type=lesson_schedules
    • > Notice in wp-content/plugins/lesson-scheduler/lesson_scheduler.php+159
    Undefined index: lesson_schedule_meta_nonce

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
Please fix the following
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lesson-scheduler/lesson_scheduler_options.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lesson-scheduler/lesson_scheduler_options.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/lesson-scheduler/lesson_scheduler_mobile.php:175
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/lesson-scheduler/template-lessonscheduler.php:9

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 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Setting Lesson Place.), #2 (Setting Lesson Time.), #3 (Setting oprion, display column and sort type.), #4 (Add new post Lesson Schedule.), #5 (Setting shortcode for a page.), #6 (Setting template for a page.), #7 (A page sample for TwentySixteen by short code.), #8 (A page sample for TwentySixteen by template.)
  • Tested up to: Version not formatted correctly
You can take inspiration from this readme.txt

lesson-scheduler/lesson_scheduler.php 92% from 13 tests

The primary PHP file in "Lesson Scheduler" version 1.2.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("lesson-scheduler.php" instead of "lesson_scheduler.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected1,337 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP43012451,153
PO File126465
CSS18661
JavaScript27058

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions33
▷ Named functions33100.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

Using a strong compression for your PNG files is a great way to speed-up your plugin
8 PNG files occupy 1.35MB with 0.87MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png209.58KB70.42KB▼ 66.40%
screenshot-6.png224.69KB77.13KB▼ 65.67%
screenshot-1.png113.79KB38.45KB▼ 66.21%
screenshot-7.png293.01KB102.64KB▼ 64.97%
screenshot-2.png23.35KB9.00KB▼ 61.46%