10up/10up-experience

PHP Warning on admin-ajax.php

Closed this issue · 8 comments

E_WARNING: Invalid argument supplied for foreach()
in remove_menu_page called at wp-content/plugins/10up-experience/includes/plugins.php (32)

I believe this is due to admin_init hook on https://github.com/10up/10up-experience/blob/develop/includes/plugins.php#L31

helen commented

@rickalee I haven't been able to reproduce this - could you give me some specific steps I could follow so I can make sure my imagined fix will work? I 100% believe you, looking at the code, and I believe changing to the admin_menu hook instead would fix it.

@helen Found this in New Relic reports. Not replicated elsewhere. Will reach out to you via Slack with links due to confidentiality concerns.

helen commented

Just making a note that the admin_menu hook doesn't fix this because of the way custom menu pages are added. Will have to look into another solution.

@rickalee @helen I'm also seeing this in New Relic. I'm happy to help debug and submit a PR.

helen commented

@ivanlopez Yes please! cc @tlovett1

I've created a merge request that addresses this issue at #40

Can we close this issue now the PR has been merged?

cc @tlovett1 @ivanlopez

Closing as this was fixed