-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
I have a PULL request that addresses this issue, and will link it shortly.
(This ticket is to supply the background information).
I was seeing errors on my site generated from /wp-cron , related to wp-help.
The error was actually occurring in a different plugin (wp-optimise), however the cause of the error is able to be isolated to wp-help. This is illustrated in lines 6 & 7 in the trace below.
The error is thrown during CWS_WP_Help_Plugin::api_slurp() , when updating posts (i.e. slurped from another URL).
Currently, when CWS_WP_Help_Plugin::api_slurp() is called, it never registers the wp-help post type.
Reasons why I think the post type should be registered as part of api_slurp:
- It's a one-line code fix to solve.
- For someone encountering the error, it's not necessarily easy to diagnose.
- Given we're in the context of WP hooks...etc. it is perfectly reasonable for other plugins to expect that this post type be registered, prior to wp_update_post() being called.
TRACE is as follows:
ERROR: PHP E_NOTICE (#8): Trying to get property of non-object
# 0: /htdocs/wp-content/plugins/wp-optimize/cache/class-wpo-cache-rules.php (106): MyCustomErrorHandler()
# 1: /htdocs/wp-includes/class-wp-hook.php (289): WPO_Cache_Rules::purge_post_on_update()
# 2: /htdocs/wp-includes/class-wp-hook.php (311): WP_Hook::apply_filters()
# 3: /htdocs/wp-includes/plugin.php (478): WP_Hook::do_action()
# 4: /htdocs/wp-includes/post.php (4260): do_action()
# 5: /htdocs/wp-includes/post.php (4354): wp_insert_post()
# 6: /htdocs/wp-content/plugins/wp-help/classes/plugin.php (362): wp_update_post()
# 7: /htdocs/wp-includes/class-wp-hook.php (287): CWS_WP_Help_Plugin::api_slurp()
# 8: /htdocs/wp-includes/class-wp-hook.php (311): WP_Hook::apply_filters()
# 9: /htdocs/wp-includes/plugin.php (544): WP_Hook::do_action()
#10: /htdocs/wp-cron.php (138): do_action_ref_array()
Metadata
Metadata
Assignees
Labels
No labels