Skip to content

Udp.Code.Links to research reports - #715

Open
alexander-b-clean wants to merge 4 commits into
devfrom
links-to-reports.ab
Open

Udp.Code.Links to research reports#715
alexander-b-clean wants to merge 4 commits into
devfrom
links-to-reports.ab

Conversation

@alexander-b-clean

Copy link
Copy Markdown
Contributor

@alexander-b-clean
alexander-b-clean requested a lite review from Copilot August 17, 2026 12:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@alexander-b-clean
alexander-b-clean requested a lite review from Copilot August 17, 2026 17:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@AntonV1211
AntonV1211 requested a lite review from Copilot August 18, 2026 06:18
@alexander-b-clean alexander-b-clean changed the title Links to research reports Udp.Code.Links to research reports Aug 18, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (3)

lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/VulnerabilityAlarmView.php:535

  • In this method you mostly use short array syntax ([]), but this branch introduces array(). Using [] here keeps the style consistent within the function.
        $psc_certificates = ! empty($psc_modules) ? static::getPscCertificatesMap() : array();

lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/VulnerabilityAlarmView.php:354

  • The new URL-building behavior (search URL when a CVE/PSC id exists vs app fallback with optional anchor) is not covered by existing tests for this class. Adding a small unit test for getTabCriticalUpdatesData()/getResearchReportUrl() would help prevent regressions in link formats.
    private static function getResearchReportUrl($module_slug, $certificate_id, $module_id = '')

lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/VulnerabilityAlarmView.php:382

  • This new helper returns an empty array via an if/else block and uses inconsistent spacing compared to surrounding code (e.g., if ( empty(...) )). Consider simplifying to a single return and using the same spacing/short-array style for readability.

This issue also appears on line 535 of the same file.

        if (is_array($certificates)) {
            return $certificates;
        } else {
            return array();
        }

private static function getResearchReportUrl($module_slug, $certificate_id, $module_id = '')
{
if ( empty($module_slug) ) {
return static::RESEARCH_SITE_URL . '/reports/';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any links should be implemented via LinkConstructor.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

*/
private static function getPscCertificatesMap()
{
$certificates = get_transient(static::PSC_CERTIFICATES_MAP_TRANSIENT);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this transient is here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rewrote the function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants