Cookies and Content Security Policy

Be fully GDPR and CCPA compliant through Content Security Policy. Blocks cookies and unwanted external content.

v2.40Johan Jonk StenströmUpdated Added 10k+ installs98% rating0% support resolved
35
Score
261
Errors
412
Warnings
+0
Change

Category Scores

Security0
Repo89
Performance100
Maintainability59

Issues to Review

Prioritized issue groups from the latest Plugin Check scan

673 findings

Security

462

9 issue groups

Maintainability

164

9 issue groups

I18n

45

7 issue groups

ERRORSecurityOutput Not EscapedAll output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$cacsp_option_banner_class'.194
Category
Security
Occurrences
194
Severity
error

Sample message

All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$cacsp_option_banner_class'.

WARNINGMaintainabilityNon Prefixed Variable FoundGlobal variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$can_change_all".137
Category
Maintainability
Occurrences
137
Severity
warning

Sample message

Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$can_change_all".

WARNINGSecurityMissing Unslash$_COOKIE['cookies_and_content_security_policy'] not unslashed before sanitization. Use wp_unslash() or similar77
Category
Security
Occurrences
77
Severity
warning

Sample message

$_COOKIE['cookies_and_content_security_policy'] not unslashed before sanitization. Use wp_unslash() or similar

WARNINGSecurityInput Not ValidatedDetected usage of a possibly undefined superglobal array index: $_POST['accepted_cookies']. Check that the array index exists before using it.76
Category
Security
Occurrences
76
Severity
warning

Sample message

Detected usage of a possibly undefined superglobal array index: $_POST['accepted_cookies']. Check that the array index exists before using it.

WARNINGSecurityInput Not SanitizedDetected usage of a non-sanitized input variable: $_COOKIE['cookies_and_content_security_policy']53
Category
Security
Occurrences
53
Severity
warning

Sample message

Detected usage of a non-sanitized input variable: $_COOKIE['cookies_and_content_security_policy']

WARNINGSecurityMissingProcessing form data without nonce verification.33
Category
Security
Occurrences
33
Severity
warning

Sample message

Processing form data without nonce verification.

ERRORI18nToo Many Function ArgsToo many parameters passed to function "__()". Expected: 2 parameters, received: 324
Category
I18n
Occurrences
24
Severity
error

Sample message

Too many parameters passed to function "__()". Expected: 2 parameters, received: 3

ERRORSecurityUnsafe Printing FunctionAll output should be run through an escaping function (like esc_html_e() or esc_attr_e()), found '_e'.14
Category
Security
Occurrences
14
Severity
error

Sample message

All output should be run through an escaping function (like esc_html_e() or esc_attr_e()), found '_e'.

WARNINGSecurityRecommendedProcessing form data without nonce verification.9
Category
Security
Occurrences
9
Severity
warning

Sample message

Processing form data without nonce verification.

WARNINGMaintainabilityNon Prefixed Function FoundFunctions declared in the global namespace by a theme/plugin should start with the theme/plugin prefix. Found: "body_class_cacsp_front".7
Category
Maintainability
Occurrences
7
Severity
warning

Sample message

Functions declared in the global namespace by a theme/plugin should start with the theme/plugin prefix. Found: "body_class_cacsp_front".

Show 15 more
WARNINGMaintainabilityDirect Query6
Category
Maintainability
Occurrences
6
Severity
warning

Sample message

Use of a direct database call is discouraged.

WARNINGMaintainabilityNo Caching5
Category
Maintainability
Occurrences
5
Severity
warning

Sample message

Direct database call without caching detected. Consider using wp_cache_get() / wp_cache_set() or wp_cache_delete().

ERRORI18nNon Singular String Literal Text5
Category
I18n
Occurrences
5
Severity
error

Sample message

The $text parameter must be a single text string literal. Found: get_cacsp_options( 'cacsp_not_allowed_button', true, __( 'Contact the administrator', 'cookies-and-content-security-policy' ), true )

ERRORI18nText Domain Mismatch5
Category
I18n
Occurrences
5
Severity
error

Sample message

Mismatched text domain. Expected 'cookies-and-content-security-policy' but got 'cacspMessages'.

ERRORI18nMissing Translators Comment4
Category
I18n
Occurrences
4
Severity
error

Sample message

A function call to __() with texts containing placeholders was found, but was not accompanied by a "translators:" comment on the line above to clarify the meaning of the placeholders.

ERRORI18nUnordered Placeholders Text4
Category
I18n
Occurrences
4
Severity
error

Sample message

Multiple placeholders in translatable strings should be ordered. Expected "%1$20d, %2$3F", but got "%20d, %3F" in 'https://wordpress.org/plugins/cookies-and-content-security-policy/#how%20do%20i%20translate%20in%20polylang%3F'.

ERRORMaintainabilitymissing direct file access protection4
Category
Maintainability
Occurrences
4
Severity
error

Sample message

PHP file should prevent direct access. Add a check like: if ( ! defined( 'ABSPATH' ) ) exit;

WARNINGSecurityUnescaped DBParameter3
Category
Security
Occurrences
3
Severity
warning

Sample message

Unescaped parameter $table used in $wpdb->get_results()\n$table assigned unsafely at line 131.

WARNINGSecurityInterpolated Not Prepared3
Category
Security
Occurrences
3
Severity
warning

Sample message

Use placeholders and $wpdb->prepare(); found interpolated variable {$table_name} at "DELETE FROM {$table_name} WHERE time >= %s AND time <= %s"

WARNINGMaintainabilityNon Prefixed Hookname Found2
Category
Maintainability
Occurrences
2
Severity
warning

Sample message

Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "active_plugins".

ERRORI18nMissing Arg Domain2
Category
I18n
Occurrences
2
Severity
error

Sample message

Missing $domain parameter in function call to __().

WARNINGI18nload plugin textdomain Found1
Category
I18n
Occurrences
1
Severity
warning

Sample message

load_plugin_textdomain() has been discouraged since WordPress version 4.6. When your plugin is hosted on WordPress.org, you no longer need to manually include this function call for translations under your plugin slug. WordPress will automatically load the translations for you as needed.

ERRORMaintainabilityfile system operations fclose1
Category
Maintainability
Occurrences
1
Severity
error

Sample message

File operations should use WP_Filesystem methods instead of direct PHP filesystem calls. Found: fclose().

ERRORMaintainabilityfile system operations fopen1
Category
Maintainability
Occurrences
1
Severity
error

Sample message

File operations should use WP_Filesystem methods instead of direct PHP filesystem calls. Found: fopen().

ERRORMaintainabilityfile system operations fwrite1
Category
Maintainability
Occurrences
1
Severity
error

Sample message

File operations should use WP_Filesystem methods instead of direct PHP filesystem calls. Found: fwrite().

Score History

First score snapshot

v2.40

35

Latest

Findings
673
Errors
261
Warnings
412
Check
2.0.0

Related Plugins

Disable Emojis (GDPR friendly)

60k+ active installs

100
consentmanager Cookie Banner

5k+ active installs

98
Flexible Cookies

3k+ active installs

97
96