<?php

namespace CleantalkSP\SpbctWP\VulnerabilityAlarm;

use CleantalkSP\Common\API;

class ResearchApi extends API
{
    public static function methodAnalyzeSiteWpVulnerabilities($api_key, $plugins = [], $themes = [])
    {
        $request = array(
            'auth_key'    => $api_key,
            'method_name' => 'analyze_site_wp_vulnerabilities',
            'details' => [
                'spbct_current_version' => SPBC_VERSION,
                'wp_current_website' => get_bloginfo('url'),
            ],
            'plugins' => $plugins,
            'themes' => $themes,
        );

        return static::sendRequest($request, ['urlencoded_post']);
    }
}
