62% jih-schedular

Code Review | Jih Schedular

WordPress plugin Jih Schedular scored62%from 54 tests.

About plugin

  • Plugin page: jih-schedular
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.4-4.9
  • WordPress version: 6.3.1
  • First release: Aug 21, 2015
  • Latest release: Nov 23, 2017
  • Number of updates: 27
  • Update frequency: every 30.7 days
  • Top authors: joelharkes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /935 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼3.08ms] Passed 4 tests

Analyzing server-side resources used by Jih Schedular
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0737.83 ▼1.87
Dashboard /wp-admin3.36 ▲0.0147.04 ▼9.73
Posts /wp-admin/edit.php3.47 ▲0.1250.42 ▲0.05
Add New Post /wp-admin/post-new.php5.96 ▲0.0795.44 ▼0.78
Media Library /wp-admin/upload.php3.28 ▲0.0538.78 ▲6.88
Calendars /wp-admin/admin.php?page=jih-calendars3.3832.85
Settings /wp-admin/admin.php?page=jih-Settings3.2233.35
Events /wp-admin/admin.php?page=jih-Events3.2231.14
Add Calendar /wp-admin/admin.php?page=jih-CalendarForm3.6638.71
Add Event /wp-admin/admin.php?page=jih-EventForm3.2239.02

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 256 new files
Database: 2 new tables, 11 new options
New tables
wp_jih_event
wp_jih_calendar
New WordPress options
widget_theysaidso_widget
jih-option-Calendar request
jih-schedular-style
can_compress_scripts
widget_recent-posts
jih-schedular-showCalendar
jih-option-Calendars
jih-schedular-plugin-version
theysaidso_admin_options
db_upgraded
...

Browser metrics Passed 4 tests

A check of browser resources used by Jih Schedular
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,018 ▲27215.07 ▲0.5222.17 ▲20.4647.90 ▲7.69
Dashboard /wp-admin2,257 ▲665.28 ▲0.3798.73 ▼1.6635.35 ▼5.77
Posts /wp-admin/edit.php2,127 ▲352.53 ▲0.5141.45 ▲1.3935.86 ▼1.08
Add New Post /wp-admin/post-new.php1,561 ▲4223.29 ▼0.06605.93 ▼21.0628.54 ▼20.57
Media Library /wp-admin/upload.php1,441 ▲564.52 ▲0.3298.98 ▲5.0942.26 ▲0.67
Calendars /wp-admin/admin.php?page=jih-calendars8701.9128.6326.67
Settings /wp-admin/admin.php?page=jih-Settings9652.1228.3326.22
Events /wp-admin/admin.php?page=jih-Events8791.9327.2526.46
Add Calendar /wp-admin/admin.php?page=jih-CalendarForm1,5846.99126.7754.27
Add Event /wp-admin/admin.php?page=jih-EventForm1,4352.7540.6025.20

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_jih_calendar
    • wp_jih_event
  • Zombie WordPress options detected upon uninstall: 9 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • jih-schedular-showCalendar
    • jih-schedular-plugin-version
    • widget_recent-posts
    • jih-schedular-style
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=jih-EventForm
    • > Warning in wp-content/plugins/jih-schedular/models/Calendar.php+24
    Declaration of models\Calendar::CreateTableQuery() should be compatible with db\AWPModel::CreateTableQuery($columnSql)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=jih-EventForm
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
    • > GET request to /wp-admin/admin.php?page=jih-Events
    • > Warning in wp-content/plugins/jih-schedular/models/Event.php+30
    Declaration of models\Event::CreateTableQuery() should be compatible with db\AWPModel::CreateTableQuery($columnSql)

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
Almost there! Just fix the following items
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/jih-schedular/recaptcha/example-captcha.php
    • > /wp-content/plugins/jih-schedular/recaptcha/example-mailhide.php
    • > /wp-content/plugins/jih-schedular/views/default-template.php
  • 153× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig_NodeInterface' not found in wp-content/plugins/jih-schedular/Twig/Twig/Node.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/jih-schedular/Twig/Twig/Node/Expression/Binary/Or.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Unary' not found in wp-content/plugins/jih-schedular/Twig/Twig/Node/Expression/Unary/Neg.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Filter' not found in wp-content/plugins/jih-schedular/Twig/Twig/Filter/Method.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_TokenParser' not found in wp-content/plugins/jih-schedular/Twig/Twig/TokenParser/Filter.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_TokenParser' not found in wp-content/plugins/jih-schedular/Twig/Twig/TokenParser/Extends.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'db\\AWPModel' not found in wp-content/plugins/jih-schedular/models/Calendar.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig_TokenParserInterface' not found in wp-content/plugins/jih-schedular/Twig/Twig/TokenParser.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/jih-schedular/Twig/Twig/Node/ForLoop.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'controllers\\Controller' not found in wp-content/plugins/jih-schedular/controllers/AdminController.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% 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
Please fix the following attributes:
  • Plugin Name: You should set the name of your plugin on the first line ( === jih-schedular === )
  • Screenshots: These screenshots do not have images: #1 (Screenshot of the main windows plugin, this is how your schedule looks like), #2 (The plugin works in all types of themes, but the themes should use bootstrap.), #3 (The plugin uses intuitive popups to show forms for people to fill.), #4 (The add event pop-up when not logged in, can only add event with recaptcha (anti bots, spam!))
The official readme.txt is a good inspiration

jih-schedular/jih-schedular.php Passed 13 tests

The main PHP script in "Jih Schedular" version 1.3.0 is automatically included on every request by WordPress
108 characters long description:
A plugin that adds a page where you can show timetables, and people can schedule themselves in these tables.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin31,503 lines of code in 242 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript131,8521,15213,949
PHP2092,2785,5079,466
CSS756557,098
Twig107814661
SVG100229
PO File1313273
YAML12127

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity6.17
▷ Minimum class complexity1.00
▷ Maximum class complexity116.00
Average method complexity2.26
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces6
Interfaces20
Traits0
Classes188
▷ Abstract classes147.45%
▷ Concrete classes17492.55%
▷ Final classes00.00%
Methods917
▷ Static methods323.49%
▷ Public methods81989.31%
▷ Protected methods909.81%
▷ Private methods80.87%
Functions61
▷ Named functions6098.36%
▷ Anonymous functions11.64%
Constants43
▷ Global constants716.28%
▷ Class constants3683.72%
▷ Public constants36100.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
4 PNG files occupy 0.17MB with 0.10MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-4.png60.73KB24.02KB▼ 60.45%
assets/screenshot-1.png41.33KB18.52KB▼ 55.20%
assets/screenshot-2.png60.79KB22.85KB▼ 62.41%
assets/screenshot-3.png12.28KB5.88KB▼ 52.16%