63% dancepress-trwa

Code Review | DancePress (TRWA)

WordPress plugin DancePress (TRWA) scored 63% from 54 tests.

About plugin

  • Plugin page: dancepress-trwa
  • Plugin version: 3.1.11
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 9, 2018
  • Latest release: Sep 22, 2023
  • Number of updates: 106
  • Update frequency: every 16.8 days
  • Top authors: benmoreassynt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,874 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲5.40MB] [CPU: ▲37.73ms] 75% from 4 tests

This is a short check of server-side resources used by DancePress (TRWA)
Please fix the following
  • Extra RAM: The extra memory usage must be under 5MB (currently 5.40MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.88 ▲5.4291.85 ▲50.47
Dashboard /wp-admin8.90 ▲5.6090.31 ▲42.50
Posts /wp-admin/edit.php8.91 ▲5.5579.84 ▲30.32
Add New Post /wp-admin/post-new.php10.89 ▲5.01141.69 ▲34.34
Media Library /wp-admin/upload.php8.90 ▲5.6879.63 ▲43.74
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius8.9069.22

Server storage [IO: ▲4.66MB] [DB: ▲0.02MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 301 new files
Database: 16 new tables, 9 new options
New tables
wp_ds_course_recommendations
wp_ds_classes
wp_ds_events
wp_ds_class_students
wp_ds_countries
wp_ds_students
wp_ds_class_categories
wp_ds_event_ticket_sales
wp_ds_class_teachers
wp_ds_parent_group
...
New WordPress options
can_compress_scripts
fs_accounts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
fs_active_plugins
fs_debug_mode
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by DancePress (TRWA)
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,856 ▲12113.69 ▼0.741.77 ▼0.0231.05 ▼12.36
Dashboard /wp-admin2,244 ▲595.36 ▼0.54109.12 ▲5.6598.58 ▲55.48
Posts /wp-admin/edit.php2,115 ▲262.56 ▲0.5537.33 ▼4.3538.65 ▲3.75
Add New Post /wp-admin/post-new.php1,552 ▲3822.88 ▲5.37668.59 ▲4.6436.88 ▼14.74
Media Library /wp-admin/upload.php1,443 ▲584.70 ▲0.49100.54 ▼5.0471.47 ▲27.82
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,1312.3341.6929.18

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/dancepress-trwa/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • Zombie tables were found after uninstall: 16 tables
    • wp_ds_deactivation_history
    • wp_ds_events
    • wp_ds_classes
    • wp_ds_class_students
    • wp_ds_students_history
    • wp_ds_class_teachers
    • wp_ds_course_recommendations
    • wp_ds_parents
    • wp_ds_news
    • wp_ds_students
    • ...
  • Zombie WordPress options were found after uninstall: 9 options
    • fs_accounts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • fs_debug_mode
    • fs_active_plugins
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
Please fix the following items
  • 28× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'DancePressTRWA\\Models\\Model' not found in wp-content/plugins/dancepress-trwa/app/models/Option.class.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'DancePressTRWA\\Models\\Model' not found in wp-content/plugins/dancepress-trwa/app/models/Registration.class.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'DancePressTRWA\\Models\\Model' not found in wp-content/plugins/dancepress-trwa/app/models/Billing.class.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'DancePressTRWA\\Controllers\\Controller' not found in wp-content/plugins/dancepress-trwa/app/controllers/OptionsController.class.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'DancePressTRWA\\Models\\Model' not found in wp-content/plugins/dancepress-trwa/app/models/Currencies.class.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'DancePressTRWA\\Models\\Model' not found in wp-content/plugins/dancepress-trwa/app/models/BillingCustomPayments.class.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'DancePressTRWA\\Controllers\\Controller' not found in wp-content/plugins/dancepress-trwa/app/controllers/ParentPortalController.class.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'DancePressTRWA\\Models\\Model' not found in wp-content/plugins/dancepress-trwa/app/models/ClassVenues.class.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'DancePressTRWA\\Models\\Model' not found in wp-content/plugins/dancepress-trwa/app/models/BillingInstallments.class.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'DancePressTRWA\\Models\\Model' not found in wp-content/plugins/dancepress-trwa/app/models/News.class.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
8 plugin tags: email, crms, contact management, dance school, dancepress...

dancepress-trwa/dance.php 85% from 13 tests

The main PHP script in "DancePress (TRWA)" version 3.1.11 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("dancepress-trwa.php" instead of "dance.php")
  • Description: The description should be shorter than 140 characters (currently 163 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected56,448 lines of code in 232 files:
LanguageFilesBlank linesComment linesLines of code
PHP20110,00118,50648,030
JavaScript111,5716796,322
CSS202491232,096

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
It is recommended to fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity69.61
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.51
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes82
▷ Abstract classes33.66%
▷ Concrete classes7996.34%
▷ Final classes1215.19%
Methods1,632
▷ Static methods20412.50%
▷ Public methods1,18472.55%
▷ Protected methods301.84%
▷ Private methods41825.61%
Functions117
▷ Named functions11699.15%
▷ Anonymous functions10.85%
Constants158
▷ Global constants10868.35%
▷ Class constants5031.65%
▷ Public constants50100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
22 PNG files occupy 0.13MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/chairicon.png0.80KB1.21KB0.00%
css/images/ui-bg_flat_75_ffffff_40x100.png0.20KB0.08KB▼ 58.17%
css/images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%
css/images/ui-icons_cd0a0a_256x240.png4.44KB4.17KB▼ 6.02%
img/dancepress-icon.png1.11KB1.05KB▼ 5.18%