72% unitimetable

Code Review | UniTimetable

WordPress plugin UniTimetable scored72%from 54 tests.

About plugin

  • Plugin page: unitimetable
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.3
  • WordPress version: 6.3.1
  • First release: Aug 23, 2015
  • Latest release: Oct 26, 2015
  • Number of updates: 25
  • Update frequency: every 2.6 days
  • Top authors: antrouss (56%)kokkoras (48%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active /4,324 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.49MB] [CPU: ▼2.59ms] Passed 4 tests

An overview of server-side resources used by UniTimetable
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.94 ▲0.4843.76 ▼5.86
Dashboard /wp-admin3.80 ▲0.5049.62 ▼1.29
Posts /wp-admin/edit.php3.91 ▲0.5648.80 ▲1.61
Add New Post /wp-admin/post-new.php6.38 ▲0.4987.68 ▼3.81
Media Library /wp-admin/upload.php3.72 ▲0.4936.29 ▲0.62
Periods /wp-admin/admin.php?page=unitimetable/UniTimetable.php_periods3.6733.53
UniTimeTable /wp-admin/admin.php?page=unitimetable/UniTimetable.php3.6938.35
Events /wp-admin/admin.php?page=unitimetable/UniTimetable.php_events3.7033.48
Teachers /wp-admin/admin.php?page=unitimetable/UniTimetable.php_teachers3.6732.62
Lectures /wp-admin/admin.php?page=unitimetable/UniTimetable.php_lectures3.7034.42
Subjects /wp-admin/admin.php?page=unitimetable/UniTimetable.php_subjects3.6736.08
Groups /wp-admin/admin.php?page=unitimetable/UniTimetable.php_groups3.6732.71
Classrooms /wp-admin/admin.php?page=unitimetable/UniTimetable.php_classrooms3.6733.46
Holidays /wp-admin/admin.php?page=unitimetable/UniTimetable.php_holidays3.6932.37

Server storage [IO: ▲1.72MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 112 new files
Database: 8 new tables, 6 new options
New tables
wp_utt_events
wp_utt_classrooms
wp_utt_teachers
wp_utt_lectures
wp_utt_subjects
wp_utt_holidays
wp_utt_groups
wp_utt_periods
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

UniTimetable: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,857 ▲12213.55 ▼0.821.65 ▼0.1644.03 ▼8.53
Dashboard /wp-admin2,263 ▲754.85 ▲0.02102.62 ▼13.8240.26 ▼5.58
Posts /wp-admin/edit.php2,146 ▲572.05 ▲0.0133.20 ▼4.8435.54 ▼0.84
Add New Post /wp-admin/post-new.php1,574 ▲4123.25 ▲0.02676.88 ▼11.5260.69 ▲9.04
Media Library /wp-admin/upload.php1,442 ▲544.28 ▲0.1198.45 ▼6.8844.14 ▼1.64
Periods /wp-admin/admin.php?page=unitimetable/UniTimetable.php_periods8261.567.8421.21
UniTimeTable /wp-admin/admin.php?page=unitimetable/UniTimetable.php8872.0223.2228.36
Events /wp-admin/admin.php?page=unitimetable/UniTimetable.php_events1,1382.4044.8025.10
Teachers /wp-admin/admin.php?page=unitimetable/UniTimetable.php_teachers8061.389.1021.13
Lectures /wp-admin/admin.php?page=unitimetable/UniTimetable.php_lectures1,3553.0653.9425.29
Subjects /wp-admin/admin.php?page=unitimetable/UniTimetable.php_subjects9761.599.4326.35
Groups /wp-admin/admin.php?page=unitimetable/UniTimetable.php_groups1,1191.577.7722.30
Classrooms /wp-admin/admin.php?page=unitimetable/UniTimetable.php_classrooms8311.387.7721.57
Holidays /wp-admin/admin.php?page=unitimetable/UniTimetable.php_holidays9381.9828.6423.96

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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 has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=unitimetable/UniTimetable.php_groups
    • > Notice in wp-content/plugins/unitimetable/groupsFunctions.php+200
    Undefined variable: periodID

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 20× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/unitimetable/teachersFunctions.php:56
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/unitimetable/UniTimetable.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/unitimetable/trunk/holidaysFunctions.php:71
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/unitimetable/trunk/teachersFunctions.php:56
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/unitimetable/trunk/lecturesFunctions.php:204
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/unitimetable/trunk/groupsFunctions.php:171
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/unitimetable/calendarShortcode.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/unitimetable/trunk/calendarShortcode.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/unitimetable/trunk/subjectsFunctions.php:91
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/unitimetable/groupsFunctions.php:171

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=unitimetable/UniTimetable.php_lectures
    • > Javascript (severe) in unknown
    /wp-content/plugins/unitimetable/js/fullcalendar.js?ver=6.3.1 14:18 Uncaught ReferenceError: moment is not defined
    • > GET request to /wp-admin/admin.php?page=unitimetable/UniTimetable.php_lectures
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).fullCalendar is not a function" "TypeError: $(...).fullCalendar is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/unitimetable/js/lectureScripts.js?ver=6.3.1:201:22)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=unitimetable/UniTimetable.php_lectures
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).fullCalendar is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Donate link: Invalid url: "-"
You can take inspiration from this readme.txt

unitimetable/UniTimetable.php 92% from 13 tests

"UniTimetable" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("unitimetable.php" instead of "UniTimetable.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin15,473 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript172,8152,18010,443
PHP121123142,540
CSS42671781,983
PO File1261503507

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.16
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%
Functions106
▷ Named functions106100.00%
▷ Anonymous functions00.00%
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
34 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
trunk/css/images/ui-bg_flat_0_aaaaaa_40x100.png0.21KB0.08KB▼ 58.96%
trunk/css/images/ui-bg_glass_55_fbf9ee_1x400.png0.33KB0.12KB▼ 62.09%
css/images/ui-bg_glass_75_dadada_1x400.png0.26KB0.16KB▼ 38.93%
css/images/ui-icons_888888_256x240.png6.83KB4.17KB▼ 38.92%
css/images/ui-icons_2e83ff_256x240.png4.44KB4.17KB▼ 6.02%