$page, 'perPage' => $limit, ], $import_api); WPI_Logger::log("Calling API: {$url}"); return wp_remote_get(self::api_url($url), [ 'timeout' => 30, 'headers' => [ 'Accept' => 'application/json', 'Authorization' => 'Bearer ' . $authen_key, ], ]); } public static function categories() { $url = WPI_Config_Model::get_config('categories_api'); $authen_key = WPI_Config_Model::get_config('authen_key'); if (!$url || !$authen_key) { WPI_Logger::log('Missing API config'); return; } return wp_remote_get(self::api_url($url), [ 'timeout' => 30, 'headers' => [ 'Accept' => 'application/json', 'Authorization' => 'Bearer ' . $authen_key, ], ]); } }