public static function get_defaults($contextlevel, $pluginname = '') {
        $classname = \context_helper::get_class_for_level($contextlevel);
        list($purposevar, $categoryvar) = self::var_names_from_context($classname, $pluginname);

        $purposeid = get_config('tool_dataprivacy', $purposevar);
        $categoryid = get_config('tool_dataprivacy', $categoryvar);

        if (!empty($pluginname)) {
            list($purposevar, $categoryvar) = self::var_names_from_context($classname);
            // If the plugin-level doesn't have a default purpose set, try the context level.
            if ($purposeid == false) {
                $purposeid = get_config('tool_dataprivacy', $purposevar);
            }

            // If the plugin-level doesn't have a default category set, try the context level.
            if ($categoryid == false) {
                $categoryid = get_config('tool_dataprivacy', $categoryvar);
            }
        }

        if (empty($purposeid)) {
            $purposeid = context_instance::NOTSET;
        }
        if (empty($categoryid)) {
            $categoryid = context_instance::NOTSET;
        }

        return [$purposeid, $categoryid];
    }