if (!function_exists('plt_get_documented_rate_limit_defaults')) { function plt_get_documented_rate_limit_defaults($resource_name = '', $api_call = '') { $resource = strtolower((string) $resource_name); $call = strtolower((string) $api_call); if ($resource == 'traffic_report' || strpos($call, 'gettrafficreport') !== false) { return array( 'budget' => '100/day (documented default for Sell Analytics traffic_report)', 'limit' => 100, 'window' => '1 day', 'scope' => 'documented_default', 'resource_name' => 'traffic_report', ); } if (strpos($call, 'user_rate_limit') !== false || strpos($call, 'rate_limit') !== false) { return array( 'budget' => '5000/day (documented default for Developer Analytics)', 'limit' => 5000, 'window' => '1 day', 'scope' => 'documented_default', 'resource_name' => 'developer_analytics', ); } return array('budget' => '', 'limit' => 0, 'window' => '', 'scope' => '', 'resource_name' => ''); } } if (!function_exists('plt_log_ebay_api_call')) { function plt_log_ebay_api_call($api_call, $http_code, $success, $context = array()) { if (!class_exists('PLT_Listing_Collection_Trace')) { return; } $context = is_array($context) ? $context : array(); $context['api_call'] = (string) $api_call; $context['http_code'] = (int) $http_code; $context['success'] = $success ? 1 : 0; PLT_Listing_Collection_Trace::log('ebay_api_calls', 'eBay API call recorded.', $context, $success ? 'info' : 'warning'); } }