WordPress.org

Ready to get started?Download WordPress

Forums

WP Survey And Quiz Tool
Cannot activate...missing required file Widget.php (39 posts)

  1. stoutdesign
    Member
    Posted 2 years ago #

    I just downloaded and tried to activate this plugin but am receiving a fatal error.

    Fatal error: require_once() [function.require]: Failed opening required '/my_site_path/wp-content/plugins/wp-survey-and-quiz-tool/lib/Wpsqt/Widget.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /my_site_path/wp-content/plugins/wp-survey-and-quiz-tool/lib/Wpsqt/Core.php on line 43

    Core points to Widget.php on this line and the file does not exist in the Wpsgt directory. Was the Widget.php file overlooked on the last commit?

    FYI, I substituted 'my_site_path' instead of using my actual path.

    Thanks

    http://wordpress.org/extend/plugins/wp-survey-and-quiz-tool/

  2. ronbme
    Member
    Posted 2 years ago #

    I got the same error.

    This was on WP 3.1.4 MultiSite.

  3. ronbme
    Member
    Posted 2 years ago #

    I can activate now but I get different errors.

    When I try to edit or delete questions, I get the error: No such Wpsqt_Page_Main_Questionedit_Poll class

    I haven't tried this on WP 3.2.1 or WP 3.2.1 MS.

  4. Ollie Armstrong
    Member
    Plugin Author

    Posted 2 years ago #

    Please download version 2.4 as I have just checked and that definitely contains the widget class.

    Ronbme, are you editing the questions on a poll? If so then I must have just forgotten to commit those classes. If they are quizzes or surveys then there is a big issue somewhere that I am not getting but you are.

    Ollie.

  5. ronbme
    Member
    Posted 2 years ago #

    Ollie, yes it was on a poll. I upgraded to ver. 2.4.1 this morning and it seems to be working now.

    Thanks.

  6. Ollie Armstrong
    Member
    Plugin Author

    Posted 2 years ago #

    Yeah, I was getting those errors too, just forgot to upload the classes. Should be all okay with 2.4.1+.

    Ollie

  7. ronbme
    Member
    Posted 2 years ago #

    I just got a new error. This was in a poll.

    The error is: Warning: Invalid argument supplied for foreach() in \wp-survey-and-quiz-tool\pages\admin\poll\result.php on line 26

    I did an upgrade after installing ver. 2.4.1. and it added a column. Then I took the test poll again and still got the same error.

    I just created a second poll and I'm getting the same error.

  8. Ollie Armstrong
    Member
    Plugin Author

    Posted 2 years ago #

    Sorry I should be more specific, but in future don't use the upgrade pane. Its crap and it doesn't work. Will get round to rewriting it eventually.

    That's a strange error, basically I think its because it wasn't working before and it still hasn't added the data to the session variable. Creating a new poll should fix this. Also I have just pushed another minor update which should fix a couple more bugs in the poll system.

    Ollie

  9. ronbme
    Member
    Posted 2 years ago #

    Thanks. I'll download it and give it a try. I won't use the Upgrade.

  10. Ollie Armstrong
    Member
    Plugin Author

    Posted 2 years ago #

    Okay, let me know. I think I will remove the upgrade tab altogether.

  11. ronbme
    Member
    Posted 2 years ago #

    Ollie, just tried the poll several times. Now I get the same results error but it is on line 31.

    I just found another error on surveys. "Single results" works. "Total results" produces the following error: Warning: Invalid argument supplied for foreach() in \wp-survey-and-quiz-tool\pages\admin\surveys\result.total.php on line 8

    I think you're getting closer. There are a couple of other things but they're mainly cosmetic.

  12. Ollie Armstrong
    Member
    Plugin Author

    Posted 2 years ago #

    Okay, could you add the line
    var_dump($pollName);
    below line 20 and then paste me the output before the warning?

    Ollie

  13. ronbme
    Member
    Posted 2 years ago #

    Ok. Will do.

    It is: string(21) "Favorite Reality Show".

  14. Ollie Armstrong
    Member
    Plugin Author

    Posted 2 years ago #

    Right, that seems okay.

    Can you paste
    echo '<pre>'; var_dump($_SESSION['wpsqt'][$pollName]['sections']); echo '</pre>';
    before line 31 and give me the output?
    Should be quite a lot, you might want to paste it to pastebin.com and share the link here.

    Ollie

  15. ronbme
    Member
    Posted 2 years ago #

    Sorry, I had to help someone upgrade their computer.

    I get a NULL and the same error.

  16. Ollie Armstrong
    Member
    Plugin Author

    Posted 2 years ago #

    No worries.

    For some reason it isn't setting the correct session variable. If it is possible, could you follow these steps just to make sure everything's reset.

    1. Use the backup tab in maintenance to backup all wpsqt tables
    2. Download the backup
    3. Delete the wp-survey-and-quiz-tool directory
    4. Delete all wpsqt tables
    5. Re upload the latest version of the plugin (2.4.2)
    6. Recreate a poll and test it

    Sorry that its such a hit and miss procedure, but something isn't quite working on your install and it is on mine. If you are comfortable in PHP then feel free to have a play and try to debug it. If you can fix it then I will add the fix in.

    Ollie

    EDIT: Just re-read and noticed you are on multisite. I will set up a multisite network and see if I get the same error.

  17. ronbme
    Member
    Posted 2 years ago #

    Thanks Ollie. I suggested that a "Compatible with MultiSite" be added to plugins. It seems MS is causing problems with some other plugins too.

    I'll try your plugin on a WP 3.2.1 single install and see what I get.

    UPDATE
    Just tried the same poll on single install of WP 3.2.1 and got the same error.

  18. Ollie Armstrong
    Member
    Plugin Author

    Posted 2 years ago #

    Right, so its not a MS issue. I have set up multiple fresh copies of WP and it works fine. Do you have any issues with quizzes/surveys?

    Also, can I ask what host you are using or is it local?

  19. ronbme
    Member
    Posted 2 years ago #

    I'm using localhost for testing.

    I'll have to check on quizzes/surveys. I think there was a similar problem on one of them.

  20. Ollie Armstrong
    Member
    Plugin Author

    Posted 2 years ago #

    Right, well I have a feeling it is something on your end then.

    Would like to know if its an issue with your localhost or the install. Could you zip up the entire wordpress directory (don't worry about any security - if everything is localhost then I wouldn't be able to access anyway - but blank them out if you feel safer) and upload it somewhere. Also a dump of all the wordpress tables would be useful. Just so I can check out that everything is working how it should be.

    Cheers
    Ollie

  21. ronbme
    Member
    Posted 2 years ago #

    I just did a quiz on the single install and I didn't get any errors. It is strange that in results, I got a "fail" when the questions were answered correctly and showed 100%.

    BTW, why is it that you have a [wpsqt_quiz name=""] and a [wpsqt_survey name=""], but not [wpsqt_poll name=""]?

    Thanks,
    Ron

  22. Ollie Armstrong
    Member
    Plugin Author

    Posted 2 years ago #

    In reply to the fail, I haven't actually finished that feature yet, wasn't meant to deploy it, must have slipped out....

    The reason that's different is because I'm deprecating [wpsqt_quiz/survey] in favour of [wpsqt type="quiz/survey/poll" name="name"].

    I'm taking a look now.

  23. ronbme
    Member
    Posted 2 years ago #

    Ok. Thanks. I checked out the database and I think the problem might be that the answers aren't being saved. I need to look a little deeper. Maybe I should add more quizzes.

  24. Ollie Armstrong
    Member
    Plugin Author

    Posted 2 years ago #

    If the answers aren't being saved then the issue wouldn't happen because it doesn't try to display the answers if there are none.

    In pages/admin/poll/result.php if you paste echo '<pre>'; var_dump($results); echo '</pre>'; below line 25 it should prove there are results being fetched.

    Ollie

  25. ronbme
    Member
    Posted 2 years ago #

    I ran debug and now I'm getting an undefined index on line 31.
    The index is $pollName which is "Favorite reality show".

    I created another poll and called it "Newpoll". I didn't get the error on results. I also got the output on the var_dump instead of NULL.

    I think the problem could be that "Favorite reality show" was converted to "Favorite Reality Show" and since it didn't match, I got the "undefined error".

    I'll try another poll with at least three words in the title and see if it generates an error.

    UPDATE
    I can confirm what the problem is.

    I created another poll titled "My new poll" with two sections. After taking the poll I looked at results and got the same errors.

    I went back and changed [wpsqt_survey name="My new poll"] to [wpsqt_survey name="My New Poll"] with caps for the first letter of each word, and NO ERRORS.

    I also went back to my WP MultiSite installation and got the same results. So, it wasn't anything caused by multisite.

    Just a suggestion but you might want to have the option to use the poll/quiz/survey id instead of the name. That eliminates the possibility of misspelling, caps, etc. I find it easier to enter the id myself.

    Ron

  26. Ollie Armstrong
    Member
    Plugin Author

    Posted 2 years ago #

    Ron,

    I see the issue now. When it requests the results it capitalises the first letter of each word of the poll name. I thought this was needed because for some reason it stored it into the database with or without capitals sometimes converting them.

    I'll take a look and make sure that it will convert all to lower all the time, therefore eliminating the caps issue.

    Thanks for your help debugging, will get an update out asap.

    Ollie

  27. Ollie Armstrong
    Member
    Plugin Author

    Posted 2 years ago #

    As a side note, as of version 2.5.1 the upgrade script is working. Please use it in future if you are requested to.

    Ollie

  28. ronbme
    Member
    Posted 2 years ago #

    Thanks, Ollie.

    Yes, I usually use the upgrade script unless there are errors and then I do a manual upgrade.

    When I look at "results" I only see the answers to the first question. I set WP_DEBUG to "true" and I get errors. The errors are: "Notice: Undefined index: count in \wp-survey-and-quiz-tool\pages\admin\poll\result.php on line 66."

    I also get the same errors for line 69 and 72. So obviously, "count" is not defined and that is why I can't get the answers for the other questions.

    Ron

  29. Ollie Armstrong
    Member
    Plugin Author

    Posted 2 years ago #

    Latest update should fix it. Do the update then an upgrade if it prompts you to.

    Ollie

  30. ronbme
    Member
    Posted 2 years ago #

    No, the latest update, 2.5.1 didn't do it.

    I also did the upgrade and nothing changed. Tried flushing the cache and nothing changed.

    Ron

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic