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

PHP warning #3803

Open
viliusle opened this issue Feb 14, 2024 · 0 comments
Open

PHP warning #3803

viliusle opened this issue Feb 14, 2024 · 0 comments

Comments

@viliusle
Copy link

Summary

Plugin is defining few constants: RED_DEFAULT_PER_PAGE & RED_MAX_PER_PAGE in admin section, but using in other sections too. This is not problem usually, but in some cases error below will be thrown.

PHP Warning: Use of undefined constant RED_DEFAULT_PER_PAGE in /wp-content/plugins/redirection/models/redirect/redirect.php on line 946
p.s. same with RED_MAX_PER_PAGE

Steps to reproduce

If other plugin wants to get redirects, like:

$Red_Item = new Red_Item([]);
$redirects = $Red_Item->get_filtered([]); //method works nice outside of plugin, but error will be thrown here

Environment

WP: 6.4.3
Plugin: 5.4.2

p.s. no need to reply, I already fixed it by editing plugin and moving these constants to main plugin file. But I might need to update plugin, other people may have same issue.
p.s.s. plugin is amazing, thank you.

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