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

pre_http_request hook will cause PHP Warning #811

Open
devhaozi opened this issue Sep 9, 2023 · 3 comments
Open

pre_http_request hook will cause PHP Warning #811

devhaozi opened this issue Sep 9, 2023 · 3 comments

Comments

@devhaozi
Copy link

devhaozi commented Sep 9, 2023

If the pre_http_request hook is used by some plugin, query-monitor will cause the PHP warning as follows:

image

The earlier query-monitor plugin did not have this problem. It may have been introduced in an update in the last two years.

@devhaozi devhaozi changed the title pre_http_request hook will cause PHP Warning pre_http_request will cause PHP Warning Sep 9, 2023
@devhaozi devhaozi changed the title pre_http_request will cause PHP Warning pre_http_request hook will cause PHP Warning Sep 9, 2023
@johnbillion
Copy link
Owner

Thank you for the report @devhaozi. Can you let me know which plugin is using the pre_http_request hook? If it's not a public plugin, can you let me know what the callback on this hook does please? A link to the code for the callback would be great.

@devhaozi
Copy link
Author

devhaozi commented Sep 11, 2023

Thank you for the report @devhaozi. Can you let me know which plugin is using the pre_http_request hook? If it's not a public plugin, can you let me know what the callback on this hook does please? A link to the code for the callback would be great.

See github.com/litepress/wp-china-yes.

@kkmuffme
Copy link

kkmuffme commented Jul 5, 2024

Another use case is when the external request is blocked by a security plugin (and it returns e.g. a WP_Error on that hook) or if the request is overwritten with partial response data for whatever reason.

Tons of notices:

query-monitor\collectors\http.php on line 335

Undefined array key ...someurl

query-monitor\collectors\http.php on line 340

Undefined array key args

query-monitor\collectors\http.php on line 340

Trying to access array offset on null

query-monitor\collectors\http.php on line 378

Undefined array key args

query-monitor\collectors\http.php on line 382

Undefined array key info

query-monitor\output\html\http.php on line 164

Trying to access array offset on null

query-monitor\output\html\http.php on line 276

Trying to access array offset on null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants