57% classdex

Code Review | ClassDex

WordPress plugin ClassDex scored57%from 54 tests.

About plugin

  • Plugin page: classdex
  • Plugin version: 1.2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.0
  • WordPress version: 6.3.1
  • First release: Aug 20, 2013
  • Latest release: Nov 10, 2014
  • Number of updates: 23
  • Update frequency: every 19.4 days
  • Top authors: johndaskovsky (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /3,758 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.31MB] [CPU: ▲1.41ms] Passed 4 tests

An overview of server-side resources used by ClassDex
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2245.41 ▲3.32
Dashboard /wp-admin3.62 ▲0.3250.53 ▲1.31
Posts /wp-admin/edit.php3.78 ▲0.4350.48 ▲3.34
Add New Post /wp-admin/post-new.php6.25 ▲0.3693.98 ▼2.33
Media Library /wp-admin/upload.php3.59 ▲0.3644.30 ▲8.05
Clear Table /wp-admin/admin.php?page=classdex_clear_table3.5634.39
Print/Email Z-Out /wp-admin/admin.php?page=classdex_print_email_z_out3.5635.63
Create Cart66 Product /wp-admin/admin.php?page=classdex_create_cart66_product3.5635.25
Create Class /wp-admin/admin.php?page=classdex_create_class3.5834.78
Partial Payment /wp-admin/admin.php?page=classdex_partial_payment3.5733.14
Student List /wp-admin/admin.php?page=classdex_student_list3.5636.44
Import Table /wp-admin/admin.php?page=classdex_import_table3.5630.33
Classes /wp-admin/admin.php?page=classdex_classes3.5732.64
Clone Class /wp-admin/admin.php?page=classdex_clone_class3.5629.56
ClassDex /wp-admin/admin.php?page=classdex_home3.5634.21

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 63 new files
Database: 4 new tables, 6 new options
New tables
wp_classdex_payments
wp_classdex_classes
wp_classdex_customers
wp_classdex_registrations
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for ClassDex
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,908 ▲14714.28 ▼0.091.83 ▲0.2544.95 ▲1.59
Dashboard /wp-admin2,312 ▲1355.65 ▲0.08100.89 ▲7.4847.36 ▲6.59
Posts /wp-admin/edit.php2,131 ▲312.03 ▲0.0434.05 ▼2.6037.74 ▼1.07
Add New Post /wp-admin/post-new.php1,561 ▲3323.13 ▲0.03669.70 ▲20.5651.80 ▼4.69
Media Library /wp-admin/upload.php1,428 ▲284.17 ▼0.0396.18 ▼11.9947.64 ▲0.89
Clear Table /wp-admin/admin.php?page=classdex_clear_table8021.7419.5233.06
Print/Email Z-Out /wp-admin/admin.php?page=classdex_print_email_z_out8021.7817.8620.52
Create Cart66 Product /wp-admin/admin.php?page=classdex_create_cart66_product8862.2229.3020.21
Create Class /wp-admin/admin.php?page=classdex_create_class8021.7614.6519.76
Partial Payment /wp-admin/admin.php?page=classdex_partial_payment8681.9214.9830.64
Student List /wp-admin/admin.php?page=classdex_student_list8681.7715.0622.85
Import Table /wp-admin/admin.php?page=classdex_import_table8021.9314.5820.22
Classes /wp-admin/admin.php?page=classdex_classes9901.9521.1831.36
Clone Class /wp-admin/admin.php?page=classdex_clone_class7971.9315.0620.07
ClassDex /wp-admin/admin.php?page=classdex_home9761.9621.8931.54

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
You still need to fix the following
  • Zombie tables detected upon uninstall: 4 tables
    • wp_classdex_registrations
    • wp_classdex_payments
    • wp_classdex_classes
    • wp_classdex_customers
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=classdex_clone_class
    • > Warning in wp-includes/pluggable.php+1438
    Cannot modify header information - headers already sent by (output started at wp-includes/script-loader.php:2838)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=classdex_home
    • > Notice in wp-content/plugins/classdex/includes/functions.php+68
    date_default_timezone_set(): Timezone ID '' is invalid

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/classdex/create_cart66_product.php
    • > /wp-content/plugins/classdex/includes/header_print.php
    • > /wp-content/plugins/classdex/includes/footer.php
  • 110× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/classdex/new_customer.php:6
    • > PHP Notice
      Undefined variable: edit in wp-content/plugins/classdex/includes/class_form.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function check_admin_referer() in wp-content/plugins/classdex/create_class.php:1
    • > PHP Warning
      require_once(CLASSDEX_PATH/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/classdex/classes.php on line 1
    • > PHP Warning
      require_once(CLASSDEX_PATH/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/classdex/edit_customer.php on line 2
    • > PHP Warning
      include(CLASSDEX_PATH/includes/header.php): failed to open stream: No such file or directory in wp-content/plugins/classdex/settings.php on line 1
    • > PHP Notice
      Undefined variable: edit in wp-content/plugins/classdex/includes/class_form.php on line 18
    • > PHP Warning
      require_once(CLASSDEX_PATH/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/classdex/search.php on line 2
    • > PHP Warning
      Use of undefined constant CLASSDEX_PATH - assumed 'CLASSDEX_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/classdex/registration.php on line 2
    • > PHP Notice
      Undefined variable: edit in wp-content/plugins/classdex/includes/class_form.php on line 26

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=classdex_classes
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=classdex_classes 187:27 Uncaught TypeError: jQuery(...).dataTable is not a function
    • > GET request to /wp-admin/admin.php?page=classdex_home
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=classdex_home 178:27 Uncaught TypeError: jQuery(...).dataTable is not a function

Optimizations

Plugin configuration 97% 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
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Add a new class complete with class information, teacher, date, time, fee, picture, class size limit, etc.), #2 (Manage all of your students contact information. View the student's current registration, class history, and payment history.), #3 (Easily search the database for a student.), #4 (Display a detailed view of your upcoming classes on your website with a simple shortcode.), #5 (An alternate class view for your website in a more condensed list format. Also embedded with a simple shortcode.)
The official readme.txt might help

classdex/classdex.php Passed 13 tests

"ClassDex" version 1.2.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
53 characters long description:
A class and customer management system for Wordpress.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected17,125 lines of code in 53 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript41,7716,1886,460
CSS41,005556,332
PHP456561,8304,333

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity21.00
▷ Minimum class complexity21.00
▷ Maximum class complexity21.00
Average method complexity1.20
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods100
▷ Static methods00.00%
▷ Public methods100100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions87
▷ Named functions87100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
4 compressed PNG files occupy 0.02MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/img/inset_line.png0.10KB0.11KB0.00%
img/glyphicons-halflings-white.png8.57KB9.20KB0.00%
css/img/th.png0.34KB0.41KB0.00%
img/glyphicons-halflings.png12.50KB10.35KB▼ 17.19%