Skip to content

Commit

Permalink
Merge pull request #435 from CleanTalk/exclusion_domains_upd.ag
Browse files Browse the repository at this point in the history
Frontend scanner. Exclusion domains list updated.
  • Loading branch information
alexandergull authored Oct 28, 2024
2 parents 70f2258 + 4643065 commit 51cd6f1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/CleantalkSP/SpbctWP/State.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ class State extends \CleantalkSP\Common\State
// Frontend scanner
'scanner__frontend_analysis' => 0,
'scanner__frontend_analysis__csrf' => 0,
'scanner__frontend_analysis__domains_exclusions_view' => "twitter.com\nyoutube.com\nyoutube-nocookie.com\nimg.youtube.com\nmail.ru\nok.ru\nvk.com\nrutube.ru\ndailymotion.com\nyandex.ru\nflikr.com\nfacebook.com\nvimeo.com\nmetacafe.com\nyahoo.com\nmailchimp.com\ngoogletagmanager.com\ngoogle.com\n",
'scanner__frontend_analysis__domains_exclusions' => "twitter.com\nyoutube.com\nyoutube-nocookie.com\nimg.youtube.com\nmail.ru\nok.ru\nvk.com\nrutube.ru\ndailymotion.com\nyandex.ru\nflikr.com\nfacebook.com\nvimeo.com\nmetacafe.com\nyahoo.com\nmailchimp.com\ngoogletagmanager.com\ngoogle.com\n",
'scanner__frontend_analysis__domains_exclusions_view' => "twitter.com\nyoutube.com\nyoutube-nocookie.com\nimg.youtube.com\nvk.com\ndailymotion.com\nflikr.com\nfacebook.com\nvimeo.com\nmetacafe.com\nyahoo.com\nmailchimp.com\ngoogletagmanager.com\ngoogle.com\nwidgets.wp.com\n",
'scanner__frontend_analysis__domains_exclusions' => "twitter.com\nyoutube.com\nyoutube-nocookie.com\nimg.youtube.com\nvk.com\ndailymotion.com\nflikr.com\nfacebook.com\nvimeo.com\nmetacafe.com\nyahoo.com\nmailchimp.com\ngoogletagmanager.com\ngoogle.com\nwidgets.wp.com\n",

// Web Application Firewall
'secfw__enabled' => 1,
Expand Down
32 changes: 32 additions & 0 deletions lib/CleantalkSP/Updater/UpdaterScripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -1371,4 +1371,36 @@ public static function updateTo_2_141_0() //phpcs:ignore PSR1.Methods.CamelCapsM
'ALTER TABLE ' . SPBC_TBL_SECURITY_LOG . ' MODIFY event VARCHAR(16) NOT NULL;';
DB::getInstance()->execute($sql_change_event_length);
}

public static function updateTo_2_144_1() //phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
{
global $spbc;

$new_domains = implode(
"\n",
array(
'googletagmanager.com',
'google.com',
'twitter.com',
'youtube.com',
'youtube-nocookie.com',
'img.youtube.com',
'dailymotion.com',
'flikr.com',
'facebook',
'vimeo.com',
'metacafe.com',
'yahoo.com',
'mailchimp.com',
'vk.com',
'widgets.wp.com'
)
);

// New domain exceptions
$spbc->settings['scanner__frontend_analysis__domains_exclusions'] = $new_domains;
$spbc->settings['scanner__frontend_analysis__domains_exclusions_view'] = $new_domains;

$spbc->save('settings');
}
}

0 comments on commit 51cd6f1

Please sign in to comment.