• Resolved fransjansen

    (@fransjansen)


    I am preparing my football pool website for the upcoming World Championship in November. For testing purposes I changed the date of the first 2 matches and I added some predictions for a participant. With those predictions the user earned 6 points as you can see here.
    Unfortunately those 6 points are not appearing in the ranking: https://wk2022pool.nl/ranking/.

    What am I overlooking? I didn’t figure out what I did wrong. When I calculate scores the following message shows up (in Dutch):

    Er is al berekening van de stand bezig. Wacht a.u.b. tot deze is ge?indigd voor een nieuwe wordt gestart.
    Als deze mededeling – voor welke reden dan ook – onjuist is, kijk dan op de helppagina voor tips om een berekening te forceren.

    I checked the help page and added define( 'FOOTBALLPOOL_FORCE_CALCULATION' , true ); to the WP-config file, but without any result.

    Last year I used to have a similar website (ek2021ppol.nl) and the calculation was quite fast (couple of seconds) even with 100+ users. Now it is only one user which did preditions. I hope you can help me. Thanks in advance.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author AntoineH

    (@antoineh)

    Looks like you don’t have any data in the scorehistory table. Did you successfully finish a calculation after you added the FOOTBALLPOOL_FORCE_CALCULATION constant to your wp-config?

    Thread Starter fransjansen

    (@fransjansen)

    I tried to do a calculation but it keeps saying the calculation is already running. Please find the screenshot here.

    As you can see in this screenshot I have added the constand to wp-config. Do you see anything wrong here?

    Plugin Author AntoineH

    (@antoineh)

    The only thing that I can imagine, is that you’ve put the constant below the /* That's all, stop editing! Happy blogging. */ part. I always put my changes above that line, although I do not know if that makes any difference.

    I’ve also created a small plugin that resets the calculation. You can also try to download and activate that one and then do a calculation. Please remove the constant from the wp-config otherwise it may cause problems in the future.

    • This reply was modified 2 years, 4 months ago by AntoineH.
    Thread Starter fransjansen

    (@fransjansen)

    I changed the position of the constant now, so it is now above the line /* That’s all, stop editing! Happy blogging. */, but without result.

    I also installed the mentioned plugin, but it doesn’t help either. After the reset via the plugin I get an error first.

    Here you will find a copy of the debug file. I hope this will make clear what causes the issue. https://wk2022pool.nl/wp-content/uploads/2022/07/debug.log

    Plugin Author AntoineH

    (@antoineh)

    After the reset via the plugin I get an error first.

    What is the error that you get? Because the debug file contains no references to my plugin, so unfortunately it isn’t any help right now. I only see that you defined FORCE_SSL_ADMIN more than once in your wp-config and some Paytium notices. Both are unrelated to this problem.

    What really puzzles me, is that the “message that a calculation is already in progress” is triggered by only one variable in the database and this is ignored when you use the constant, but this didn’t work. And when I reset the value via the helper plugin, this also doesn’t work. Unless the helper plugin didn’t work because of the error message, of course.
    Can you post the result of the following query? *

    SELECT option_value FROM wp_options WHERE option_name = 'footballpool_plugin_options'

    *) if you don’t have the standard db prefix, then change the table name to the correct one for your install.

    Thread Starter fransjansen

    (@fransjansen)

    Now it is getting more complicated for me. I know how to work in the backend of WordPress but when it is about queries I start to feel uncomfortable. Correct me if I am wrong but I assume I have to get the result from the database via phpMyAdmin.
    I went there and pasted the above mentioned snippet under the SQL tab and pressed go. The result you can find here.
    When I press ‘copy’ I get the following result: https://ibb.co/X7kLLSy.

    If this is not what you where looking for I hope you don’t mind to guide me in more details through the process of getting the result of the query. It is really appreciated.

    Plugin Author AntoineH

    (@antoineh)

    You’re doing great ?? This is what I was looking for. I can see that the value in the database is wrong. Which means the helper plugin did not reset the value.

    Can you try to enable that plugin once more? If there is no error message, I am curious what the result of the query is afterwards. If there is an error, then of course the details of the error would be appreciated.

    Thread Starter fransjansen

    (@fransjansen)

    – I went to plugins and clicked ‘Activeren’ under the Football Poll Reset Calculation’
    – Then I went to Football Pool – Wedstrijden and clicked ‘Wijzingen opslaan’
    – The error as show in this screenshot appears.
    – I went to phpMyAdmin and pasted the snippet SELECT option_value FROM wp_options WHERE option_name = 'footballpool_plugin_options' once again and clicked Go
    – Please find the result here

    FYI: when I clicked again on ‘Wijzigingen opslaan’ in WordPress backend the Error doesn’t show up and once again this message appears.

    Not sure if it brings you any further, but fingers crossed…

    • This reply was modified 2 years, 4 months ago by fransjansen.
    • This reply was modified 2 years, 4 months ago by fransjansen.
    Plugin Author AntoineH

    (@antoineh)

    This shows me that the helper plugin is in fact working perfectly. It resets the value in the database and then you start a calculation via the matches screen. I didn’t get from your previous messages that the error you received was after saving the matches (which in fact starts a calculation because you have the automatic calculations turned on). I thought the error message appeared when you activated the helper plugin.

    Anyway, now that I have this information, we can try to debug the calculation. Since this is a bit complicated to explain on this forum and it also might come in handy in the future, I decided to document the steps in this document.

    Hope this helps.

    Thread Starter fransjansen

    (@fransjansen)

    I get three messages from 3 different calls:

    {
        "colorbox_html": "<h2>Score and ranking calculation<\/h2><p>There is already a calculation in progress. Please wait for it to finish before starting a new one.<\/p><p>If - for some reason - this message is wrong, see the <a href=\"?page=footballpool-help#calculation-already-running\">help page<\/a> for tips on how to force a calculation start.<\/p><p class=\"submit\"><input type=\"button\" onclick=\"jQuery.colorbox.close();\" \r\n\t\t\t\t\t\t\t\t\tclass=\"button button-primary\" value=\"OK\" js-button\/><\/p>",
        "error": false,
        "calc_start_time": "2022-07-11 14:30:32",
        "fp_recalc_nonce": "a845ad4bd7",
        "force_calculation": 0,
        "completed": 1,
        "iteration": 1,
        "sub_iteration": 0,
        "total_iterations": 0,
        "calculation_step": "stop_message",
        "user": 0,
        "ranking": 0,
        "match": 0,
        "question": 0,
        "prev_total_score": 0,
        "score_order": 0,
        "sub_iterations": "1,1,1,1",
        "message_type": "info",
        "message": "step 'stop_message': user 0, match 0, question 0, ranking 0, iteration 0 of 0"
    }
    {
        "colorbox_html": "<h2>Score and ranking calculation<\/h2><p>There is already a calculation in progress. Please wait for it to finish before starting a new one.<\/p><p>If - for some reason - this message is wrong, see the <a href=\"?page=footballpool-help#calculation-already-running\">help page<\/a> for tips on how to force a calculation start.<\/p><p class=\"submit\"><input type=\"button\" onclick=\"jQuery.colorbox.close();\" \r\n\t\t\t\t\t\t\t\t\tclass=\"button button-primary\" value=\"OK\" js-button\/><\/p>",
        "error": false,
        "calc_start_time": "2022-07-11 14:30:32",
        "fp_recalc_nonce": "a845ad4bd7",
        "force_calculation": 0,
        "completed": 1,
        "iteration": 2,
        "sub_iteration": 0,
        "total_iterations": 0,
        "calculation_step": "stop_message",
        "user": 0,
        "ranking": 0,
        "match": 0,
        "question": 0,
        "prev_total_score": 0,
        "score_order": 0,
        "sub_iterations": "1,1,1,1",
        "message_type": "info",
        "message": "step 'stop_message': user 0, match 0, question 0, ranking 0, iteration 1 of 0"
    }
    {
        "colorbox_html": "<h2>Score and ranking calculation<\/h2>",
        "error": false,
        "calc_start_time": "2022-07-11 14:30:35",
        "fp_recalc_nonce": "a845ad4bd7",
        "force_calculation": 0,
        "completed": 0,
        "iteration": 2,
        "sub_iteration": 0,
        "total_iterations": 0,
        "calculation_step": "cancel_calculation",
        "user": 0,
        "ranking": 0,
        "match": 0,
        "question": 0,
        "prev_total_score": 0,
        "score_order": 0,
        "sub_iterations": "1,1,1,1",
        "message_type": "info",
        "message": "step 'cancel_calculation': user 0, match 0, question 0, ranking 0, iteration 1 of 0"
    }
    Plugin Author AntoineH

    (@antoineh)

    You didn’t save your matches in between, did you? You shouldn’t. Because I miss the call with the error message.

    Thread Starter fransjansen

    (@fransjansen)

    When I click Recalculate scores I first get the error again. And in the developer tol nothing is visible. See screenshot.

    After clicking ok in the dialog woindow of the error another line of ‘Admin-ajax.php’ appears. Please see the message in the response tab (but I do not think thius is helping as I understood this is not related to the football pool) in this screenshot.

    Hope this is helping, but I have my doubts ;-(

    Plugin Author AntoineH

    (@antoineh)

    To be honest, I am a bit in the dark on what is going on right here. But debugging is often like looking for the needle in the haystack and/or ruling out other possible problems (if you clear every straw in the haystack you will eventually also find the needle ??). The biggest problem is that I need information to work with and so far we haven’t been lucky with what the system tells us.

    In the first screenshot the admin-ajax call is red which indicates a server error. Can you click that one again to see on the Headers tab what the status code was? If it was one in the 500 range, I would expect something in the debug log.

    And was the Response tab really empty for this call?

    Thread Starter fransjansen

    (@fransjansen)

    Hi Antoine,

    First of all thank you for your patience. I can see that it is a 500 error. See screenshot. The response tab was empty as you can see here (this was before I clicked on the ok-button in the dialog window).

    Please find my debug.log here: https://file.io/sqjisLxcuDme

    In the log I find this line: PHP Fatal error: Default ranking with ID 1 is missing in the pool_wp_rankings table in /home/u66886p92937/domains/wk2022pool.nl/public_html/wp-content/plugins/football-pool/admin/class-football-pool-admin-score-calculation.php on line 1080

    Can it be that this has something to do with the calculation not working correctly?

    Plugin Author AntoineH

    (@antoineh)

    Bingo! ??

    For some (for me unknown) reason the ranking table misses the default ranking. This can be easily fixed by executing the following query on the database*.

    INSERT INTO pool_wp_rankings (id, name, user_defined, calculate)
    VALUES (1, 'default ranking', 0, 1);

    *) Change the name of the ranking “default ranking” to whatever you want before you execute the query (“standaard stand” is the translation for Dutch), or directly in the database via phpMyAdmin.

    When this is done, reset the calculation again with the helper plugin and after that you should be good to go.

    • This reply was modified 2 years, 4 months ago by AntoineH. Reason: vertaling
Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Ranking not showing up’ is closed to new replies.