PluginProbe
Simple Analytics / 1.110
Simple Analytics v1.110
1.110 1.109 1.108 1.107 1.106 1.73 1.74 1.75 1.76 1.77 1.78 1.79 1.8 1.80 1.81 1.82 1.83 1.84 1.85 1.86 1.87 1.88 1.89 1.9 1.90 All 99 releases
← All changes | src/ScriptRegistry.php +13 -3 1.1061.110 View file →
@@ -70,11 +70,21 @@
70 70
71 71 protected function removeIdsFilter($tag, $handle): string
72 72 {
73 73 foreach ($this->scripts as $script) {
74 - if ($script instanceof HideScriptId && $script->handle() === $handle) {
75 - // Remove the id attribute from the script tag
76 - return preg_replace('/ id=([\'"])[^\'"]*\\1/', '', $tag);
74 + if ($script->handle() === $handle) {
75 + $updatedTag = $tag;
76 +
77 + if ($script instanceof HideScriptId) {
78 + // Remove the id attribute from the script tag
79 + $updatedTag = preg_replace('/ id=([\'"])[^\'"]*\\1/', '', $updatedTag);
80 + }
81 +
82 + if ($handle === 'simpleanalytics') {
83 + return "<!-- Simple Analytics - 100% privacy-first analytics (official WordPress plugin) -->\n" . $updatedTag;
84 + }
85 +
86 + return $updatedTag;
77 87 }
78 88 }
79 89
80 90 return $tag;