Skip to content

Commit

Permalink
v0.2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
ve3 committed May 23, 2024
1 parent 081f2ee commit 1c2237d
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 41 deletions.
4 changes: 4 additions & 0 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,12 @@
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed"></exclude>
<exclude name="Generic.WhiteSpace.ScopeIndent.Incorrect"></exclude>
<exclude name="Generic.WhiteSpace.ScopeIndent.IncorrectExact"></exclude>
<exclude name="NormalizedArrays.Arrays.ArrayBraceSpacing.SpaceAfterArrayOpenerSingleLine"></exclude>
<exclude name="NormalizedArrays.Arrays.ArrayBraceSpacing.SpaceBeforeArrayCloserSingleLine"></exclude>
<exclude name="PEAR"></exclude>
<exclude name="PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.Changed"></exclude>
<exclude name="PHPCompatibility.Variables.ForbiddenGlobalVariableVariable.NonBareVariableFound"></exclude>
<exclude name="PSR2.Classes.ClassDeclaration.CloseBraceAfterBody"></exclude>
<exclude name="PSR2.Namespaces.NamespaceDeclaration.BlankLineAfter"></exclude>
<exclude name="Squiz.Commenting.ClassComment.Missing"></exclude>
<exclude name="Squiz.Commenting.ClosingDeclarationComment.Incorrect"></exclude>
Expand All @@ -67,6 +70,7 @@
<exclude name="Squiz.Commenting.VariableComment.Missing"></exclude>
<exclude name="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"></exclude>
<exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterOpen"></exclude>
<exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingBeforeClose"></exclude>
<exclude name="Squiz.PHP.CommentedOutCode.Found"></exclude>
<exclude name="Squiz.PHP.EmbeddedPhp.ContentAfterEnd"></exclude>
<exclude name="Squiz.PHP.NonExecutableCode.ReturnNotRequired"></exclude>
Expand Down
2 changes: 1 addition & 1 deletion RdCookieNotice/Autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,4 @@ protected function requireFile($file)
}
return false;
}
}
}
2 changes: 1 addition & 1 deletion RdCookieNotice/ClientScripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function adminEnqueueScripts(string $hook_suffix)
'cookie-notice-admin',
'cnArgs',
[
'resetToDefaults' => __('Are you sure you want to reset these settings to defaults?', 'rd-cookie-notice')
'resetToDefaults' => __('Are you sure you want to reset these settings to defaults?', 'rd-cookie-notice'),
]
);

Expand Down
10 changes: 5 additions & 5 deletions RdCookieNotice/HTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function displayCookieNotice()
'see_more_opt' => $this->RdCookieNotice->options['general']['see_more_opt'],
'link_target' => $this->RdCookieNotice->options['general']['link_target'],
'link_position' => $this->RdCookieNotice->options['general']['link_position'],
'aria_label' => __('Rd Cookie Notice', 'rd-cookie-notice')
'aria_label' => __('Rd Cookie Notice', 'rd-cookie-notice'),
]);

// check legacy parameters
Expand Down Expand Up @@ -161,19 +161,19 @@ public function getAllowedHTML(): array
'type' => [],
'src' => [],
'charset' => [],
'async' => []
'async' => [],
],
'noscript' => [],
'style' => [
'type' => []
'type' => [],
],
'iframe' => [
'src' => [],
'height' => [],
'width' => [],
'frameborder' => [],
'allowfullscreen' => []
]
'allowfullscreen' => [],
],
]
)
);
Expand Down
22 changes: 11 additions & 11 deletions RdCookieNotice/RdCookieNotice.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ class RdCookieNotice
'colors' => [
'text' => '#ffffff',
'bar' => '#000000',
'bar_opacity' => 100
'bar_opacity' => 100,
],
'see_more_opt' => [
'text' => '',
'link_type' => 'page',
'id' => 0,
'link' => '',
'sync' => false
'sync' => false,
],
'script_placement' => 'header',
'translate' => true,
Expand Down Expand Up @@ -164,7 +164,7 @@ public function __construct()
// merge old options with new ones
$ArrayHelper = new \RdCookieNotice\Libraries\ArrayHelper();
$this->options = [
'general' => $ArrayHelper->multiArrayMerge($this->defaults['general'], $options)
'general' => $ArrayHelper->multiArrayMerge($this->defaults['general'], $options),
];
unset($ArrayHelper);

Expand Down Expand Up @@ -217,33 +217,33 @@ public function loadDefaults()
{
$this->positions = [
'top' => __('Top', 'rd-cookie-notice'),
'bottom' => __('Bottom', 'rd-cookie-notice')
'bottom' => __('Bottom', 'rd-cookie-notice'),
];

$this->styles = [
'none' => __('None', 'rd-cookie-notice'),
'wp-default' => __('Light', 'rd-cookie-notice'),
'bootstrap' => __('Dark', 'rd-cookie-notice')
'bootstrap' => __('Dark', 'rd-cookie-notice'),
];

$this->revoke_opts = [
'automatic' => __('Automatic', 'rd-cookie-notice'),
'manual' => __('Manual', 'rd-cookie-notice')
'manual' => __('Manual', 'rd-cookie-notice'),
];

$this->links = [
'page' => __('Page link', 'rd-cookie-notice'),
'custom' => __('Custom link', 'rd-cookie-notice')
'custom' => __('Custom link', 'rd-cookie-notice'),
];

$this->link_targets = [
'_blank',
'_self'
'_self',
];

$this->link_positions = [
'banner' => __('Banner', 'rd-cookie-notice'),
'message' => __('Message', 'rd-cookie-notice')
'message' => __('Message', 'rd-cookie-notice'),
];

$this->colors = [
Expand All @@ -260,14 +260,14 @@ public function loadDefaults()
'3months' => [__('3 months', 'rd-cookie-notice'), 7862400],
'6months' => [__('6 months', 'rd-cookie-notice'), 15811200],
'year' => [__('1 year', 'rd-cookie-notice'), 31536000],
'infinity' => [__('infinity', 'rd-cookie-notice'), 2147483647]
'infinity' => [__('infinity', 'rd-cookie-notice'), 2147483647],
]
);

$this->effects = [
'none' => __('None', 'rd-cookie-notice'),
'fade' => __('Fade', 'rd-cookie-notice'),
'slide' => __('Slide', 'rd-cookie-notice')
'slide' => __('Slide', 'rd-cookie-notice'),
];

$this->script_placements = [
Expand Down
2 changes: 1 addition & 1 deletion RdCookieNotice/Shortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function cookiesRevokeShortcode($args, $content): string
// defaults
$defaults = [
'title' => $options['revoke_text'],
'class' => $options['css_class']
'class' => $options['css_class'],
];

// combine shortcode arguments
Expand Down
2 changes: 1 addition & 1 deletion RdCookieNotice/WPML.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function registerStrings()
'Revoke message text' => $this->RdCookieNotice->options['general']['revoke_message_text'],
'Revoke button text' => $this->RdCookieNotice->options['general']['revoke_text'],
'Privacy policy text' => $this->RdCookieNotice->options['general']['see_more_opt']['text'],
'Custom link' => $this->RdCookieNotice->options['general']['see_more_opt']['link']
'Custom link' => $this->RdCookieNotice->options['general']['see_more_opt']['link'],
];

// get query results
Expand Down
18 changes: 18 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@
---

## V0.x
### 0.2.7
2023-01-24

* Fix CSS & JS did not load in admin.
* Update new line to Unix style on all files.
* Add old class name `\RdCookieNotice()` to keep backward compatible but show warning.

### 0.2.5
2022-03-19

* Remove `UserAgent` class because it won't work with W3TC plugin.

### 0.2.4
2022-03-18

* Add [`data-nosnippet="data-nosnippet"`](https://developers.google.com/search/blog/2019/09/more-controls-on-search#using-the-new-data-nosnippet-html-attribute) to prevent search engine collect cookie notice text in `HTML` class.
* Add `UserAgent` class to detect search engine bot and do not display cookie notice text when detected that user is bots.

### 0.2.3
2022-01-12

Expand Down
2 changes: 1 addition & 1 deletion includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ function rdcn_cookiesSet()
$RdCookieNotice = \RdCookieNotice\RdCookieNotice::instance();
return (bool) $RdCookieNotice->cookies_set();
}// rdcn_cookiesSet
}// endif;
}// endif;
22 changes: 2 additions & 20 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
=== Rundiz Cookie Notice ===
Contributors: okvee
Tags: cookie consent
Tested up to: 6.2
Stable tag: 0.2.7
Tested up to: 6.6
Stable tag: 0.2.8
License: MIT
License URI: https://opensource.org/licenses/MIT
Requires at least: 4.0
Expand Down Expand Up @@ -66,21 +66,3 @@ Go to the admin plugins page, click the 'Add New' button, then click the 'Upload
2024-05-23

* Fix link to settings page from plugins page.

= 0.2.7 =
2023-01-24

* Fix CSS & JS did not load in admin.
* Update new line to Unix style on all files.
* Add old class name `\RdCookieNotice()` to keep backward compatible but show warning.

= 0.2.5 =
2022-03-19

* Remove `UserAgent` class because it won't work with W3TC plugin.

= 0.2.4 =
2022-03-18

* Add [`data-nosnippet="data-nosnippet"`](https://developers.google.com/search/blog/2019/09/more-controls-on-search#using-the-new-data-nosnippet-html-attribute) to prevent search engine collect cookie notice text in `HTML` class.
* Add `UserAgent` class to detect search engine bot and do not display cookie notice text when detected that user is bots.

0 comments on commit 1c2237d

Please sign in to comment.