h5p / h5p-wordpress-plugin

Adds support for H5P Content in WordPress.
https://wordpress.org/plugins/h5p/
70 stars 75 forks source link

Don't join against users table when fetching data for 'results' panel. #178

Closed boonebgorges closed 5 months ago

boonebgorges commented 5 months ago

Previously: #133

In that pull request I missed this instance (or perhaps it was added afterward).

In this specific case, joining against the users table doesn't provide much benefit, given that no u. fields are selected by the query. The only marginal benefit is that joining ensures that records aren't returned in cases where a user has since been deleted from the wp_users table, but I'm guessing this is very much an edge case, since WP marks users as deleted rather than removing their rows from wp_users. As such, I think we can simply remove the JOIN clause.

As in #133, the presence of the JOIN is breaking the functionality altogether in cases where the user table is not kept in the same database as the site's H5P tables.

icc commented 5 months ago

Thank you!