56% sd-classes

Code Review | SDROST CLASSES

WordPress plugin SDROST CLASSES scored56%from 54 tests.

About plugin

  • Plugin page: sd-classes
  • Plugin version: 1.2.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.5-5.0
  • WordPress version: 6.3.1
  • First release: May 26, 2018
  • Latest release: Jan 28, 2019
  • Number of updates: 14
  • Update frequency: every 17.7 days
  • Top authors: sdwebdevelopment (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,033 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▼1.06MB] [CPU: ▼41.24ms] Passed 4 tests

Server-side resources used by SDROST CLASSES
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.91 ▼0.5516.00 ▼26.85
Dashboard /wp-admin2.95 ▼0.3519.23 ▼33.82
Posts /wp-admin/edit.php2.95 ▼0.4020.43 ▼29.66
Add New Post /wp-admin/post-new.php2.95 ▼2.9320.31 ▼74.61
Media Library /wp-admin/upload.php2.95 ▼0.2820.41 ▼17.03
SDrost Classes /wp-admin/options-general.php?page=sdrost_classes2.9518.09
Alle Standorte /wp-admin/edit.php?post_type=sdrost_addresses2.9519.16
Alle Trainer /wp-admin/edit.php?post_type=sdrost_trainers2.9515.35
Neuer Standort /wp-admin/post-new.php?post_type=sdrost_addresses2.9516.93
Alle Kurse /wp-admin/edit.php?post_type=sdrost_classes2.9525.01
Neuer Trainer /wp-admin/post-new.php?post_type=sdrost_trainers2.9522.80
Neuer Kurs /wp-admin/post-new.php?post_type=sdrost_classes2.9518.50

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 30 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
sdrost_classes_shortcode_short_weekday
can_compress_scripts
sdrost_classes_shortcode_sort_by_location
sdrost_classes_shortcode_color
db_upgraded
sdrost_classes_shortcode_show_weekend
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for SDROST CLASSES
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,902 ▲15613.29 ▼1.064.80 ▲2.8543.48 ▲1.79
Dashboard /wp-admin2,299 ▲1255.98 ▲0.3093.56 ▲3.0641.73 ▼2.01
Posts /wp-admin/edit.php2,209 ▲1092.29 ▲0.2643.91 ▲5.6235.81 ▲1.28
Add New Post /wp-admin/post-new.php1,612 ▲8423.19 ▲0.10679.44 ▼16.0436.48 ▼18.67
Media Library /wp-admin/upload.php1,498 ▲1014.44 ▲0.28108.10 ▲4.5146.58 ▼0.83
SDrost Classes /wp-admin/options-general.php?page=sdrost_classes1,0872.5644.6728.25
Alle Standorte /wp-admin/edit.php?post_type=sdrost_addresses1,2022.2435.0828.96
Alle Trainer /wp-admin/edit.php?post_type=sdrost_trainers1,1672.2235.7526.71
Neuer Standort /wp-admin/post-new.php?post_type=sdrost_addresses1,6242.7259.9536.28
Alle Kurse /wp-admin/edit.php?post_type=sdrost_classes1,2102.2644.7427.03
Neuer Trainer /wp-admin/post-new.php?post_type=sdrost_trainers1,5752.7755.4831.12
Neuer Kurs /wp-admin/post-new.php?post_type=sdrost_classes2,3393.3861.9183.81

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
  • This plugin cannot be uninstalled
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method SdrostClassPostType::create() should not be called statically
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 0% 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
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=sdrost_classes
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method SdrostClassPostType::create() should not be called statically
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=sdrost_classes
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method SdrostClassAddressPostType::create() should not be called statically
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=sdrost_classes
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method SdrostClassTrainerPostType::create() should not be called statically
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=sdrost_classes
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method SdrostClassesOptionPage::registerSdrostClassesOptionPage() should not be called statically
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=sdrost_classes
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method SdrostClassesOptionPage::registerSdrostClassesSettings() should not be called statically
    • > GET request to /wp-admin/edit.php?post_type=sdrost_addresses
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method SdrostClassAddressPostType::setGridColumnsForSdrostClassAddresses() should not be called statically
    • > GET request to /wp-admin/post-new.php?post_type=sdrost_addresses
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method SdrostClassAddressPostType::addSdrostClassAddressesBox() should not be called statically
    • > GET request to /wp-admin/post-new.php?post_type=sdrost_addresses
    • > Deprecated in wp-admin/includes/template.php+1443
    Non-static method SdrostClassAddressPostType::createSdrostClassAddressesDataBox() should not be called statically
    • > GET request to /wp-admin/edit.php?post_type=sdrost_classes
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method SdrostClassPostType::setGridColumnsForSdrostClass() should not be called statically
    • > GET request to /wp-admin/post-new.php?post_type=sdrost_trainers
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method SdrostClassTrainerPostType::addSdrostClassTrainersBox() should not be called statically
    • > GET request to /wp-admin/post-new.php?post_type=sdrost_trainers
    • > Deprecated in wp-admin/includes/template.php+1443
    Non-static method SdrostClassTrainerPostType::createSdrostClassTrainersDataBox() should not be called statically
    • > GET request to /wp-admin/post-new.php?post_type=sdrost_classes
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method SdrostClassPostType::addSdrostClassesBox() should not be called statically
    • > GET request to /wp-admin/post-new.php?post_type=sdrost_classes
    • > Deprecated in wp-admin/includes/template.php+1443
    Non-static method SdrostClassPostType::createSdrostClassDataBox() should not be called statically

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/sd-classes/sdrost-classes.php
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      require_once(SDROST_CLASSES_SRC_DIR/helper/SdrostClassTrainerRenderer.php): failed to open stream: No such file or directory in wp-content/plugins/sd-classes/src/postType/SdrostClassTrainerPostType.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'SDROST_CLASSES_SRC_DIR/helper/SdrostClassTrainerRenderer.php' (include_path='.:/usr/share/php') in wp-content/plugins/sd-classes/src/postType/SdrostClassTrainerPostType.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'SdrostClassBasePostType' not found in wp-content/plugins/sd-classes/src/postType/SdrostClassPostType.php:8
    • > PHP Fatal error
      require_once(): Failed opening required 'SDROST_CLASSES_SRC_DIR/helper/SdrostClassAddressRenderer.php' (include_path='.:/usr/share/php') in wp-content/plugins/sd-classes/src/postType/SdrostClassAddressPostType.php on line 3
    • > PHP Warning
      require_once(SDROST_CLASSES_SRC_DIR/helper/SdrostClassAddressRenderer.php): failed to open stream: No such file or directory in wp-content/plugins/sd-classes/src/postType/SdrostClassAddressPostType.php on line 3
    • > PHP Warning
      Use of undefined constant SDROST_CLASSES_SRC_DIR - assumed 'SDROST_CLASSES_SRC_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/sd-classes/src/postType/SdrostClassTrainerPostType.php on line 3
    • > PHP Warning
      Use of undefined constant SDROST_CLASSES_SRC_DIR - assumed 'SDROST_CLASSES_SRC_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/sd-classes/src/postType/SdrostClassAddressPostType.php on line 3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=sdrost_trainers
    • > 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: $(...).clockpicker is not a function" "TypeError: $(...).clockpicker is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/sd-classes/assets/js/sdrost-classes.js?ver=6.3.1:5:27)\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
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=sdrost_trainers
    • > 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: $(...).clockpicker is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: timetable, trainer, calendar, timesheet, responsive...

sd-classes/sdrost-classes.php 85% from 13 tests

The main PHP file in "SDROST CLASSES" ver. 1.2.1 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("sd-classes.php" instead of "sdrost-classes.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin1,570 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP142572681,207
SVG100229
CSS651776
JavaScript3141258

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity6.69
▷ Minimum class complexity1.00
▷ Maximum class complexity28.00
Average method complexity1.90
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods80
▷ Static methods2025.00%
▷ Public methods7695.00%
▷ Protected methods00.00%
▷ Private methods45.00%
Functions4
▷ Named functions250.00%
▷ Anonymous functions250.00%
Constants35
▷ Global constants38.57%
▷ Class constants3291.43%
▷ Public constants32100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/add.png1.29KB1.02KB▼ 20.88%
assets/img/round-remove-button.png1.10KB0.84KB▼ 23.34%