Support » Plugin: WP Admin Notification Center - Hide admin notice » Recent update conflict in AJAX

  • Resolved clinton101

    (@clinton101)


    Great plugin, but I had to deactivate it today after the latest update as there was a conflict with other custom plugins immediately after the update. The conflict seems to occur when AJAX fires.

    I noticed the issue after updating the WP Admin Notification Center and then did some deep debugging on one of my custom plugins to try to find where the conflict occurs but could not find and reason in my code. The only way to get my plugins working again is to disable WP Admin Notification Center – which I had to do (unfortunately).

    The error thrown by AJAX is
    parsererror: SyntaxError: Unexpected token ‘<‘, “<br />
    <b>”… is not valid JSON

    There are no <br /><b> tags in my code so it looks like this may be injected somewhere.

    I will appreciate your looking at your recent changes to see if you can identify anything that may account for the AJAX failures or conflicts. Please let me know if you find anything and I will test again.

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author roumi

    (@roumi)

    Hi,

    Thanks you for reporting this error!

    I’ve tried to replicate it but every ajax calls is working fine with me.
    Could you please share with me a screenshot of the ajax return when Wp Notification center is active?

    Here is how to do it via the console, go to Network, check Fetch/XHR, select the request in the listing and the go on the tab preview.

    Regards,

    Thread Starter clinton101

    (@clinton101)

    Hi @roumi,

    Thank you for your quick response, and for your heads up on where to look.
    This approach identified errors in my code. They are ‘soft’ (no doubt bad coding) errors like not checking if an array element exists before using it. The reason that the error started is due to your code enforcing more rigorous error checking.

    Line 15 of your index.php file does this because of the code
    error_reporting(E_ALL);
    If I comment this out then my code works fine with your plugin on.

    This problem has forced me to review my code, which I am doing. However, I think that reporting all errors may have an impact on other plugins. I received an error on a client website today where the PHP started reporting an error in the ‘Wp Limits’ plugin. As ‘WP Admin Notification Center’ was on the site, I swiched it off to check and the error went away. The error in this case was as follows:

    `Notice: Undefined variable: time_limit in /var/www/vhosts/****/clientsite.com/wp-content/plugins/wp-limits/change-wp-limits.php on line 129

    This confirms the impact of the rigorous error checking that is carrying through to other plugins.

    I hope that this helps as there may be other sites that are getting errors for similar reasons. Please consider removing error_reporting(E_ALL); from the live copy of your plugin.

    Once again thank you for the great plugin, I use it on many sites.

    Clinton

    • This reply was modified 3 months, 2 weeks ago by clinton101.
    • This reply was modified 3 months, 2 weeks ago by clinton101.
    • This reply was modified 3 months, 2 weeks ago by clinton101.
    Plugin Author roumi

    (@roumi)

    Hi @clinton101,

    This is my bad!

    While developing I always display errors with these lines and I’ve forgot to remove them.
    I’ve just made a new release without the debug lines so it should now work 🙂

    I’m sorry again and I thanks for the kind words I’m glad that you enjoy the plugin !

    Also if you have any feature/improve request feel ask me.

    Rémi.

    • This reply was modified 3 months, 2 weeks ago by roumi.
    Thread Starter clinton101

    (@clinton101)

    Thanks @roumi for the excellent support.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.