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

Warning when a not existing page is called #155

Open
8ctopus opened this issue May 17, 2022 · 2 comments
Open

Warning when a not existing page is called #155

8ctopus opened this issue May 17, 2022 · 2 comments

Comments

@8ctopus
Copy link

8ctopus commented May 17, 2022

Just found a small issue with the plugin: When a not existing article on the site is being called, wp-postratings generates a warning as shown in the screenshot. I tried a quick fix but without luck.

2022-05-17_151835

@lesterchan
Copy link
Owner

When you activate the plugin, it will create the options automatically. In this case, it fails on your end? https://github.com/lesterchan/wp-postratings/blob/master/includes/postratings-activation.php#L73

@8ctopus
Copy link
Author

8ctopus commented Jan 31, 2023

I've had a look at this issue again today because it keeps popping in our Apache error logs every single day.

The problem occurs when someone tries to load a page that doesn't exist: $postratings_ajax_style = false in this case. While when the page exists, $postratings_ajax_style = ['loading' => 0, 'fading' => 1];.

I'll send you a PR in a few minutes that fixes the problem for me.

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

2 participants