77% weekly-class-schedule

Code Review | Weekly Class Schedule

WordPress plugin Weekly Class Schedule scored 77% from 54 tests.

About plugin

  • Plugin page: weekly-class-sche...
  • Plugin version: 3.19
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.7
  • WordPress version: 6.3.1
  • First release: Sep 16, 2011
  • Latest release: Dec 10, 2016
  • Number of updates: 138
  • Update frequency: every 13.9 days
  • Top authors: ty_pwd (100%)

Code review

54 tests

User reviews

18 reviews

Install metrics

1,000+ active / 72,899 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.33MB] [CPU: ▼2.48ms] Passed 4 tests

An overview of server-side resources used by Weekly Class Schedule
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.3132.89 ▼8.02
Dashboard /wp-admin3.64 ▲0.3351.97 ▲2.69
Posts /wp-admin/edit.php3.75 ▲0.3948.90 ▲3.74
Add New Post /wp-admin/post-new.php6.24 ▲0.3595.25 ▼6.67
Media Library /wp-admin/upload.php3.56 ▲0.3336.54 ▲2.07
Options /wp-admin/admin.php?page=wcs3-standard-options3.5334.03
Schedule /wp-admin/admin.php?page=wcs3-schedule3.51201.51
Import/Update /wp-admin/admin.php?page=wcs3-import-update3.5330.03
Add New /wp-admin/post-new.php?post_type=wcs3_class3.6749.01
Classes /wp-admin/edit.php?post_type=wcs3_class3.6036.77
Add New /wp-admin/post-new.php?post_type=wcs3_location3.6748.11
Add New /wp-admin/post-new.php?post_type=wcs3_instructor3.6750.30
Instructors /wp-admin/edit.php?post_type=wcs3_instructor3.6036.66
Locations /wp-admin/edit.php?post_type=wcs3_location3.6033.75

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 69 new files
Database: 1 new table, 10 new options
New tables
wp_wcs3_schedule
New WordPress options
wcs3_settings
widget_recent-posts
widget_wcs3_today_classes_widget
wcs3_version
widget_theysaidso_widget
can_compress_scripts
wcs3_db_version
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Weekly Class Schedule
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,934 ▲19913.33 ▼1.251.78 ▲0.0046.33 ▼0.53
Dashboard /wp-admin2,332 ▲1474.90 ▼0.95100.25 ▼13.2946.70 ▲3.42
Posts /wp-admin/edit.php2,212 ▲1232.06 ▲0.0335.92 ▼7.4633.77 ▼1.64
Add New Post /wp-admin/post-new.php1,623 ▲8123.34 ▲5.06586.65 ▼66.5356.56 ▲4.72
Media Library /wp-admin/upload.php1,514 ▲1294.21 ▼0.0394.46 ▼5.9241.23 ▼0.70
Options /wp-admin/admin.php?page=wcs3-standard-options1,8202.0035.7937.13
Schedule /wp-admin/admin.php?page=wcs3-schedule1,4541.8523.2630.69
Import/Update /wp-admin/admin.php?page=wcs3-import-update9101.7223.5423.03
Add New /wp-admin/post-new.php?post_type=wcs3_class2,2627.58180.4259.53
Classes /wp-admin/edit.php?post_type=wcs3_class1,1852.0133.8331.18
Add New /wp-admin/post-new.php?post_type=wcs3_location2,2637.69160.0152.04
Add New /wp-admin/post-new.php?post_type=wcs3_instructor2,2637.54159.4453.30
Instructors /wp-admin/edit.php?post_type=wcs3_instructor1,1822.0132.7430.86
Locations /wp-admin/edit.php?post_type=wcs3_location1,1852.0531.6027.34

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_wcs3_today_classes_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=wcs3-schedule
    • > Warning in wp-content/plugins/weekly-class-schedule/includes/wcs3_admin.php+118
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
    • > GET request to /wp-admin/admin.php?page=wcs3-schedule
    • > Warning in wp-content/plugins/weekly-class-schedule/includes/wcs3_admin.php+118
    file_get_contents(http://pulsarwebdesign.com/top3.json): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known
    • > GET request to /wp-admin/admin.php?page=wcs3-schedule
    • > Notice in wp-content/plugins/weekly-class-schedule/includes/wcs3_admin.php+127
    Undefined variable: top3

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
The following issues need your attention
  • 10× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/weekly-class-schedule/wcs.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/weekly-class-schedule/includes/wcs3_settings.php:284
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/weekly-class-schedule/includes/wcs3_css.php:60
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/weekly-class-schedule/includes/wcs3_widgets.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/weekly-class-schedule/includes/wcs3_admin.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/weekly-class-schedule/includes/wcs3_ajax.php:242
    • > PHP Fatal error
      require_once(): Failed opening required 'WCS3_PLUGIN_DIR/includes/wcs3_db.php' (include_path='.:/usr/share/php') in wp-content/plugins/weekly-class-schedule/wcs3_modules.php on line 5
    • > PHP Warning
      require_once(WCS3_PLUGIN_DIR/includes/wcs3_db.php): failed to open stream: No such file or directory in wp-content/plugins/weekly-class-schedule/wcs3_modules.php on line 5
    • > PHP Warning
      Use of undefined constant WCS3_PLUGIN_DIR - assumed 'WCS3_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/weekly-class-schedule/wcs3_modules.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/weekly-class-schedule/includes/wcs3_output.php:80

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: Add an image for screenshot #1 (List Layout)
You can take inspiration from this readme.txt

weekly-class-schedule/wcs.php 77% from 13 tests

The primary PHP file in "Weekly Class Schedule" version 3.19 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 177 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("weekly-class-schedule.php" instead of "wcs.php")
  • 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 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin5,063 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript124614612,575
PHP133813911,640
CSS79269848

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions65
▷ Named functions65100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
22 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
plugins/colorpicker/images/colorpicker_hsb_b.png0.95KB0.76KB▼ 19.48%
plugins/colorpicker/images/custom_rgb_g.png1.04KB0.80KB▼ 23.67%
plugins/colorpicker/images/select2.png0.51KB0.33KB▼ 34.94%
plugins/colorpicker/images/colorpicker_rgb_r.png1.04KB0.77KB▼ 26.17%
plugins/colorpicker/images/colorpicker_rgb_b.png0.95KB0.76KB▼ 19.48%