Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Leaky Paywall Group Accounts Plugin #109

Open
paulness opened this issue Dec 16, 2022 · 0 comments
Open

Issue with Leaky Paywall Group Accounts Plugin #109

paulness opened this issue Dec 16, 2022 · 0 comments

Comments

@paulness
Copy link

paulness commented Dec 16, 2022

Wordpress version
5.9.4
MySQL Version
5.6
Leaky Paywall Group Account Plugin Version
1.4.1

File
web/app/plugins/leaky-paywall-group-accounts/functions.php

Issue
Calls made to get_users with the compare flag of 'EXISTS' for the single item of group_id are resulting in an invalid query being produced that fails with MySQL, there is likely a deep issue with the dynamic query generation in Wordpress in this file wordpress\wp-includes\class-wp-meta-query.php when using EXISTS for single values in some setups. Which results in this invalid query SELECT * FROM artnetnews.wp_usermeta WHERE meta_key = '_leaky_paywall_group_member' AND CAST(meta_value AS CHAR) EXISTS '2228566' ORDER BY CAST(meta_value AS CHAR see line 773 of web/app/plugins/leaky-paywall-group-accounts/functions.php attached

The query has a CAST followed by an EXISTS which is invalid

Recommended action
Since group_id is a single value, I recommend changing the compare flag to = from EXISTS and resolves the problem with our version of Wordpress and MySQL.

image

Attached files
class-wp-meta-query.zip

Image of the issue on the Group Accounts page with the stock plugin
image

Image of the Group Accounts page with the modification (fixed)
image

Other links
https://developer.wordpress.org/reference/classes/wp_meta_query/__construct/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant