wppaste
WordPress

wp_xmlrpc_server::pingback_ping( array $args ): string|IXR_Error

Since
1.5.0
Source
wp-includes/class-wp-xmlrpc-server.php:6913
Retrieves a pingback and registers it.

Compatibility

WordPress
since 1.5.0
PHP
7.4–8.6-dev
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.

Parameters

$argsarray
Method arguments. Note: arguments must be ordered as documented.
  • $0string

    URL of page linked from.
  • $1string

    URL of page linked to.

Return value

string|IXR_Error

Performance profile

How much work a call to wp_xmlrpc_server::pingback_ping() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.

Cost class
Expensive

Reaches an outbound HTTP request via wp_safe_remote_get().

Scaling
Scales with input

The body loops, so the work grows with what you pass in.

Instructions
61–330

Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 452.

Plugin surface
5 hooks

Third-party callbacks on 'xmlrpc_call', 'pingback_ping_source_uri', 'http_headers_useragent' run inside this call, and their cost is not bounded by anything here.

Called by
0

Nothing in core calls this; the cost is only what you spend yourself.

What it touches

  • hookthird-party callbacksdo_action()called directly
  • optionoption read or writeget_option()called directly
  • querycontent queryget_post()called directly
  • httpoutbound HTTP requestwp_safe_remote_get()called directly
  • sqldatabase query->get_results()called directly
  • cacheobject cachewp_cache_get()one call below wp_xmlrpc_server::pingback_ping()
  • serializeserialisationmaybe_unserialize()one call below wp_xmlrpc_server::pingback_ping()

Further down the call graph this can also reach transient. That is the worst case, several calls deep and usually down an error path, not what a normal call pays.

What one call costs · 86 distinct outcomes

One number would be a lie: the work depends on which branch runs. These are every distinct cost wp_xmlrpc_server::pingback_ping() can have, taken from its control-flow graph on PHP 8.5.

WhenInstructionsCalls it makes
!isset($urltest)61do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), __(), ->pingback_error()
always62–79do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), get_post(), __(), ->pingback_error()
$post_id === false67–84do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), get_post(), url_to_postid(), __(), ->pingback_error()
!preg_match()68do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), __(), ->pingback_error()
$post_id !== false && !pings_open()71–88do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), get_post(), url_to_postid(), pings_open(), __(), ->pingback_error()
!preg_match()75do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), preg_match(), __(), ->pingback_error()
!preg_match()82–86do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), get_post(), __(), ->pingback_error()
preg_match()83do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), explode(), get_post(), __(), ->pingback_error()
$post_id !== false && pings_open() && ->get_results()84–101do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), __(), ->pingback_error()
always85do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), ->prepare(), ->get_var(), ->pingback_error()
!preg_match() && $post_id === false87–91do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), get_post(), url_to_postid(), __(), ->pingback_error()
preg_match() && $post_id === false88do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), explode(), get_post(), url_to_postid(), __(), ->pingback_error()
74 further outcomes, up to 330 instructions
isset($urltest) && !preg_match()91do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), preg_match(), get_post(), __(), ->pingback_error()
!preg_match() && $post_id !== false && !pings_open()91–95do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), get_post(), url_to_postid(), pings_open(), __(), ->pingback_error()
!preg_match()92do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), ->prepare(), ->get_var(), ->pingback_error()
preg_match() && $post_id !== false && !pings_open()92do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), explode(), get_post(), url_to_postid(), pings_open(), __(), ->pingback_error()
always95do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), ->prepare(), ->get_var(), get_post(), __(), ->pingback_error()
isset($urltest) && !preg_match() && $post_id === false96do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), preg_match(), get_post(), url_to_postid(), __(), ->pingback_error()
$post_id === false100do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), ->prepare(), ->get_var(), get_post(), url_to_postid(), __(), ->pingback_error()
isset($urltest) && !preg_match() && $post_id !== false && !pings_open()100do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), preg_match(), get_post(), url_to_postid(), pings_open(), __(), ->pingback_error()
!preg_match()102do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), ->prepare(), ->get_var(), get_post(), __(), ->pingback_error()
$post_id !== false && !pings_open()104do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), __(), ->pingback_error()
!preg_match() && $post_id !== false && pings_open() && ->get_results()104–108do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), __(), ->pingback_error()
preg_match() && $post_id !== false && pings_open() && ->get_results()105do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), explode(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), __(), ->pingback_error()
!preg_match() && $post_id === false107do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), ->prepare(), ->get_var(), get_post(), url_to_postid(), __(), ->pingback_error()
!preg_match() && $post_id !== false && !pings_open()111do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), __(), ->pingback_error()
isset($urltest) && !preg_match() && $post_id !== false && pings_open() && ->get_results()113do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), preg_match(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), __(), ->pingback_error()
$post_id !== false && pings_open() && ->get_results()117do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), __(), ->pingback_error()
!preg_match() && $post_id !== false && pings_open() && ->get_results()124do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), __(), ->pingback_error()
$post_id !== false && pings_open() && !->get_results()128–145do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), __(), ->pingback_error()
isset($urltest) && !preg_match() && $post_id !== false && pings_open() && ->get_results()131do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), preg_match(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), __(), ->pingback_error()
!preg_match() && $post_id !== false && pings_open() && !->get_results()148–152do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), __(), ->pingback_error()
preg_match() && $post_id !== false && pings_open() && !->get_results()149do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), explode(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), __(), ->pingback_error()
$post_id !== false && pings_open() && !->get_results() && empty($title)154–172do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), __(), ->pingback_error()
isset($urltest) && !preg_match() && $post_id !== false && pings_open() && !->get_results()157do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), preg_match(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), __(), ->pingback_error()
$post_id !== false && pings_open() && !->get_results()161do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), __(), ->pingback_error()
!preg_match() && $post_id !== false && pings_open() && !->get_results()168do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), __(), ->pingback_error()
!preg_match() && $post_id !== false && pings_open() && !->get_results() && empty($title)174–179do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), __(), ->pingback_error()
preg_match() && $post_id !== false && pings_open() && !->get_results() && empty($title)175–176do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), explode(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), __(), ->pingback_error()
isset($urltest) && !preg_match() && $post_id !== false && pings_open() && !->get_results()175do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), preg_match(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), __(), ->pingback_error()
$post_id !== false && pings_open() && !->get_results() && !empty($title) && empty($context)176–195do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), __(), ->pingback_error()
isset($urltest) && !preg_match() && $post_id !== false && pings_open() && !->get_results() && empty($title)183–184do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), preg_match(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), __(), ->pingback_error()
$post_id !== false && pings_open() && !->get_results() && empty($title)187–188do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), __(), ->pingback_error()
!preg_match() && $post_id !== false && pings_open() && !->get_results() && empty($title)194–195do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), __(), ->pingback_error()
!preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && empty($context)196–202do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), __(), ->pingback_error()
preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && empty($context)197–199do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), explode(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), __(), ->pingback_error()
isset($urltest) && !preg_match() && $post_id !== false && pings_open() && !->get_results() && empty($title)201–202do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), preg_match(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), __(), ->pingback_error()
isset($urltest) && !preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && empty($context)205–207do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), preg_match(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), __(), ->pingback_error()
$post_id !== false && pings_open() && !->get_results() && !empty($title) && empty($context)209–211do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), __(), ->pingback_error()
!preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && empty($context)216–218do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), __(), ->pingback_error()
$post_id !== false && pings_open() && !->get_results() && !empty($title) && !empty($context) && is_wp_error()221–240do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), ->get_error_message(), ->pingback_error()
isset($urltest) && !preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && empty($context)223–225do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), preg_match(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), __(), ->pingback_error()
$post_id !== false && pings_open() && !->get_results() && !empty($title) && !$p && $para225–249do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), preg_match(), strip_tags(), preg_quote(), strip_tags(), __(), ->pingback_error()
$post_id !== false && pings_open() && !->get_results() && !empty($title) && !empty($context) && !is_wp_error()227–246do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), do_action(), __(), sprintf()
!preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && !empty($context) && is_wp_error()241–247do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), ->get_error_message(), ->pingback_error()
preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && !empty($context) && is_wp_error()242–244do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), explode(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), ->get_error_message(), ->pingback_error()
!preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && !$p && $para245–256do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), preg_match(), strip_tags(), preg_quote(), strip_tags(), __(), ->pingback_error()
preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && !$p && $para246–253do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), explode(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), preg_match(), strip_tags(), preg_quote(), strip_tags(), __(), ->pingback_error()
!preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && !empty($context) && !is_wp_error()247–253do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), do_action(), __(), sprintf()
preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && !empty($context) && !is_wp_error()248–250do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), explode(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), do_action(), __(), sprintf()
isset($urltest) && !preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && !empty($context) && is_wp_error()250–252do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), preg_match(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), ->get_error_message(), ->pingback_error()
isset($urltest) && !preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && !$p && $para254–261do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), preg_match(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), preg_match(), strip_tags(), preg_quote(), strip_tags(), __(), ->pingback_error()
$post_id !== false && pings_open() && !->get_results() && !empty($title) && !empty($context) && is_wp_error()254–256do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), ->get_error_message(), ->pingback_error()
isset($urltest) && !preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && !empty($context) && !is_wp_error()256–258do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), preg_match(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), do_action(), __(), sprintf()
$post_id !== false && pings_open() && !->get_results() && !empty($title) && !$p && $para258–265do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), preg_match(), strip_tags(), preg_quote(), strip_tags(), __(), ->pingback_error()
$post_id !== false && pings_open() && !->get_results() && !empty($title) && !empty($context) && !is_wp_error()260–262do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), do_action(), __(), sprintf()
!preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && !empty($context) && is_wp_error()261–263do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), ->get_error_message(), ->pingback_error()
!preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && !$p && $para265–272do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), preg_match(), strip_tags(), preg_quote(), strip_tags(), __(), ->pingback_error()
!preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && !empty($context) && !is_wp_error()267–269do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), do_action(), __(), sprintf()
isset($urltest) && !preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && !empty($context) && is_wp_error()268–270do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), preg_match(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), ->get_error_message(), ->pingback_error()
$post_id !== false && pings_open() && !->get_results() && !empty($title) && !$p && $para && !empty($context) && is_wp_error()270–294do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), preg_match(), strip_tags(), preg_quote(), strip_tags(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), ->get_error_message(), ->pingback_error()
isset($urltest) && !preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && !$p && $para272–279do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), preg_match(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), preg_match(), strip_tags(), preg_quote(), strip_tags(), __(), ->pingback_error()
isset($urltest) && !preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && !empty($context) && !is_wp_error()274–276do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), preg_match(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), do_action(), __(), sprintf()
$post_id !== false && pings_open() && !->get_results() && !empty($title) && !$p && $para && !empty($context) && !is_wp_error()276–300do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), preg_match(), strip_tags(), preg_quote(), strip_tags(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), do_action(), __(), sprintf()
!preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && !$p && $para && !empty($context) && is_wp_error()290–301do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), preg_match(), strip_tags(), preg_quote(), strip_tags(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), ->get_error_message(), ->pingback_error()
preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && !$p && $para && !empty($context) && is_wp_error()291–298do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), explode(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), preg_match(), strip_tags(), preg_quote(), strip_tags(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), ->get_error_message(), ->pingback_error()
!preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && !$p && $para && !empty($context) && !is_wp_error()296–307do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), preg_match(), strip_tags(), preg_quote(), strip_tags(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), do_action(), __(), sprintf()
preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && !$p && $para && !empty($context) && !is_wp_error()297–304do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), explode(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), preg_match(), strip_tags(), preg_quote(), strip_tags(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), do_action(), __(), sprintf()
isset($urltest) && !preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && !$p && $para && !empty($context) && is_wp_error()299–306do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), preg_match(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), preg_match(), strip_tags(), preg_quote(), strip_tags(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), ->get_error_message(), ->pingback_error()
$post_id !== false && pings_open() && !->get_results() && !empty($title) && !$p && $para && !empty($context) && is_wp_error()303–310do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), preg_match(), strip_tags(), preg_quote(), strip_tags(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), ->get_error_message(), ->pingback_error()
isset($urltest) && !preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && !$p && $para && !empty($context) && !is_wp_error()305–312do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), preg_match(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), preg_match(), strip_tags(), preg_quote(), strip_tags(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), do_action(), __(), sprintf()
$post_id !== false && pings_open() && !->get_results() && !empty($title) && !$p && $para && !empty($context) && !is_wp_error()309–316do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), preg_match(), strip_tags(), preg_quote(), strip_tags(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), do_action(), __(), sprintf()
!preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && !$p && $para && !empty($context) && is_wp_error()310–317do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), preg_match(), strip_tags(), preg_quote(), strip_tags(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), ->get_error_message(), ->pingback_error()
!preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && !$p && $para && !empty($context) && !is_wp_error()316–323do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), preg_match(), strip_tags(), preg_quote(), strip_tags(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), do_action(), __(), sprintf()
isset($urltest) && !preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && !$p && $para && !empty($context) && is_wp_error()317–324do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), preg_match(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), preg_match(), strip_tags(), preg_quote(), strip_tags(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), ->get_error_message(), ->pingback_error()
isset($urltest) && !preg_match() && $post_id !== false && pings_open() && !->get_results() && !empty($title) && !$p && $para && !empty($context) && !is_wp_error()323–330do_action(), ->escape(), apply_filters(), get_option(), parse_url(), url_to_postid(), preg_match(), preg_match(), ->prepare(), ->get_var(), get_post(), url_to_postid(), pings_open(), ->prepare(), ->get_results(), sleep(), get_bloginfo(), get_bloginfo(), apply_filters(), wp_safe_remote_get(), wp_remote_retrieve_body(), apply_filters(), preg_match(), strip_tags(), explode(), preg_quote(), preg_match(), strip_tags(), preg_quote(), strip_tags(), esc_html(), ->escape(), ->escape(), ->escape(), compact(), wp_new_comment(), is_wp_error(), do_action(), __(), sprintf()

This body has more branch combinations than are worth enumerating, so the table covers the outcomes found first rather than every one that exists.

Across PHP versions

PHPCompiledExecutedBranchesNotes
8.6-dev45261–33026
8.545261–33026
8.445261–3302659 fewer instructions than PHP 8.3
8.351176–38626
8.251176–38626
8.151176–386261 fewer instruction than PHP 7.4
7.451276–38726

An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.

Hooks and filters fired · 5

5 hooks fire while wp_xmlrpc_server::pingback_ping() runs, in this order:

  1. do_action( xmlrpc_call )actionline 6917 (+4 into the body)

    Fires after the XML-RPC user has been authenticated but before the rest of the method logic begins.

  2. apply_filters( pingback_ping_source_uri )filterline 6933 (+20 into the body)

    Filters the pingback source URI.

  3. apply_filters( http_headers_useragent )filterline 7025 (+112 into the body)

    Filters the user agent value sent with an HTTP request.

  4. apply_filters( pre_remote_source )filterline 7054 (+141 into the body)

    Filters the pingback remote source.

  5. do_action( pingback_post )actionline 7152 (+239 into the body)

    Fires after a post pingback has been sent.

Uses · 16

Show all 16

Source code

	public function pingback_ping( $args ) {		global $wpdb; 		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */		do_action( 'xmlrpc_call', 'pingback.ping', $args, $this ); 		$this->escape( $args ); 		$pagelinkedfrom = str_replace( '&', '&', $args[0] );		$pagelinkedto   = str_replace( '&', '&', $args[1] );		$pagelinkedto   = str_replace( '&', '&', $pagelinkedto ); 		/**		 * Filters the pingback source URI.		 *		 * @since 3.6.0		 *		 * @param string $pagelinkedfrom URI of the page linked from.		 * @param string $pagelinkedto   URI of the page linked to.		 */		$pagelinkedfrom = apply_filters( 'pingback_ping_source_uri', $pagelinkedfrom, $pagelinkedto ); 		if ( ! $pagelinkedfrom ) {			return $this->pingback_error( 0, __( 'A valid URL was not provided.' ) );		} 		// Check if the page linked to is on our site.		$pos1 = strpos( $pagelinkedto, str_replace( array( 'http://www.', 'http://', 'https://www.', 'https://' ), '', get_option( 'home' ) ) );		if ( ! $pos1 ) {			return $this->pingback_error( 0, __( 'Is there no link to us?' ) );		} 		/*		 * Let's find which post is linked to.		 * FIXME: Does url_to_postid() cover all these cases already?		 * If so, then let's use it and drop the old code.		 */		$urltest = parse_url( $pagelinkedto );		$post_id = url_to_postid( $pagelinkedto ); 		if ( $post_id ) {			// $way		} elseif ( isset( $urltest['path'] ) && preg_match( '#p/[0-9]{1,}#', $urltest['path'], $match ) ) {			// The path defines the post_ID (archives/p/XXXX).			$blah    = explode( '/', $match[0] );			$post_id = (int) $blah[1];		} elseif ( isset( $urltest['query'] ) && preg_match( '#p=[0-9]{1,}#', $urltest['query'], $match ) ) {			// The query string defines the post_ID (?p=XXXX).			$blah    = explode( '=', $match[0] );			$post_id = (int) $blah[1];		} elseif ( isset( $urltest['fragment'] ) ) {			// An #anchor is there, it's either...			if ( (int) $urltest['fragment'] ) {				// ...an integer #XXXX (simplest case),				$post_id = (int) $urltest['fragment'];			} elseif ( preg_match( '/post-[0-9]+/', $urltest['fragment'] ) ) {				// ...a post ID in the form 'post-###',				$post_id = preg_replace( '/[^0-9]+/', '', $urltest['fragment'] );			} elseif ( is_string( $urltest['fragment'] ) ) {				// ...or a string #title, a little more complicated.				$title   = preg_replace( '/[^a-z0-9]/i', '.', $urltest['fragment'] );				$sql     = $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_title RLIKE %s", $title );				$post_id = $wpdb->get_var( $sql );				if ( ! $post_id ) {					// Returning unknown error '0' is better than die()'ing.					return $this->pingback_error( 0, '' );				}			}		} else {			// TODO: Attempt to extract a post ID from the given URL.			return $this->pingback_error( 33, __( 'The specified target URL cannot be used as a target. It either does not exist, or it is not a pingback-enabled resource.' ) );		} 		$post_id = (int) $post_id;		$post    = get_post( $post_id ); 		if ( ! $post ) { // Post not found.			return $this->pingback_error( 33, __( 'The specified target URL cannot be used as a target. It either does not exist, or it is not a pingback-enabled resource.' ) );		}

Changelog

Introduced in 1.5.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.9.7 tag, from src/wp-includes/class-wp-xmlrpc-server.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.