Changeset 3349431
- Timestamp:
- 08/25/2025 04:26:14 AM (7 months ago)
- Location:
- cookie-optimizer
- Files:
-
- 13 deleted
- 5 edited
- 47 copied
-
tags/1.0.8 (copied) (copied from cookie-optimizer/trunk)
-
tags/1.0.8/app/Includes/CookieOptBanner.php (copied) (copied from cookie-optimizer/trunk/app/Includes/CookieOptBanner.php) (7 diffs)
-
tags/1.0.8/app/Includes/CookieOptBannerPreview.php (copied) (copied from cookie-optimizer/trunk/app/Includes/CookieOptBannerPreview.php)
-
tags/1.0.8/app/Includes/CookieOptBaseInc.php (copied) (copied from cookie-optimizer/trunk/app/Includes/CookieOptBaseInc.php)
-
tags/1.0.8/app/Includes/CookieOptCookiePolicy.php (copied) (copied from cookie-optimizer/trunk/app/Includes/CookieOptCookiePolicy.php)
-
tags/1.0.8/app/Includes/CookieOptDashboard.php (copied) (copied from cookie-optimizer/trunk/app/Includes/CookieOptDashboard.php)
-
tags/1.0.8/app/Includes/CookieOptLanguages.php (copied) (copied from cookie-optimizer/trunk/app/Includes/CookieOptLanguages.php)
-
tags/1.0.8/app/Includes/CookieOptOther.php (copied) (copied from cookie-optimizer/trunk/app/Includes/CookieOptOther.php)
-
tags/1.0.8/app/Includes/CookieOptPermission.php (copied) (copied from cookie-optimizer/trunk/app/Includes/CookieOptPermission.php)
-
tags/1.0.8/app/Includes/CookieOptPublishSettings.php (copied) (copied from cookie-optimizer/trunk/app/Includes/CookieOptPublishSettings.php)
-
tags/1.0.8/app/Includes/CookieOptTagManagement.php (copied) (copied from cookie-optimizer/trunk/app/Includes/CookieOptTagManagement.php)
-
tags/1.0.8/app/Includes/FeatureManager/FeatureUser/CookieIOptPackageBase.php (copied) (copied from cookie-optimizer/trunk/app/Includes/FeatureManager/FeatureUser/CookieIOptPackageBase.php)
-
tags/1.0.8/app/Includes/FeatureManager/FeatureUser/CookieOptBasic.php (copied) (copied from cookie-optimizer/trunk/app/Includes/FeatureManager/FeatureUser/CookieOptBasic.php)
-
tags/1.0.8/app/Includes/FeatureManager/FeatureUser/CookieOptFree.php (copied) (copied from cookie-optimizer/trunk/app/Includes/FeatureManager/FeatureUser/CookieOptFree.php)
-
tags/1.0.8/app/Includes/FeatureManager/FeatureUser/CookieOptManager.php (copied) (copied from cookie-optimizer/trunk/app/Includes/FeatureManager/FeatureUser/CookieOptManager.php)
-
tags/1.0.8/app/Includes/FeatureManager/FeatureUser/CookieOptPro.php (copied) (copied from cookie-optimizer/trunk/app/Includes/FeatureManager/FeatureUser/CookieOptPro.php)
-
tags/1.0.8/app/Services/CookieOptBannerService.php (copied) (copied from cookie-optimizer/trunk/app/Services/CookieOptBannerService.php)
-
tags/1.0.8/app/Services/CookieOptDashboardService.php (copied) (copied from cookie-optimizer/trunk/app/Services/CookieOptDashboardService.php)
-
tags/1.0.8/app/Services/CookieOptPolicyServices.php (copied) (copied from cookie-optimizer/trunk/app/Services/CookieOptPolicyServices.php)
-
tags/1.0.8/app/Services/CookieOptPublishSettingsService.php (copied) (copied from cookie-optimizer/trunk/app/Services/CookieOptPublishSettingsService.php)
-
tags/1.0.8/app/Services/CookiePermissionService.php (copied) (copied from cookie-optimizer/trunk/app/Services/CookiePermissionService.php)
-
tags/1.0.8/app/Services/ViewHelper/CookieOptBannerView.php (deleted)
-
tags/1.0.8/constants.php (copied) (copied from cookie-optimizer/trunk/constants.php) (1 diff)
-
tags/1.0.8/cookie-opt.php (copied) (copied from cookie-optimizer/trunk/cookie-opt.php) (3 diffs)
-
tags/1.0.8/functions.php (copied) (copied from cookie-optimizer/trunk/functions.php)
-
tags/1.0.8/languages/cookie-opt-ja.mo (copied) (copied from cookie-optimizer/trunk/languages/cookie-opt-ja.mo)
-
tags/1.0.8/languages/cookie-opt-ja.po (copied) (copied from cookie-optimizer/trunk/languages/cookie-opt-ja.po)
-
tags/1.0.8/languages/cookie-opt.pot (copied) (copied from cookie-optimizer/trunk/languages/cookie-opt.pot)
-
tags/1.0.8/languages/cookie-optimizer-ja.mo (deleted)
-
tags/1.0.8/languages/cookie-optimizer-ja.po (deleted)
-
tags/1.0.8/languages/cookie-optimizer.mo (deleted)
-
tags/1.0.8/languages/cookie-optimizer.pot (deleted)
-
tags/1.0.8/package.json (deleted)
-
tags/1.0.8/public/assets/css/banner.css (deleted)
-
tags/1.0.8/public/assets/css/cookie_permission_custom.css (deleted)
-
tags/1.0.8/public/assets/css/dashboard.css (deleted)
-
tags/1.0.8/public/assets/css/page_policy_render.css (copied) (copied from cookie-optimizer/trunk/public/assets/css/page_policy_render.css)
-
tags/1.0.8/public/assets/css/policy.css (deleted)
-
tags/1.0.8/public/assets/css/publish_setting.css (deleted)
-
tags/1.0.8/public/assets/css/tag_management.css (deleted)
-
tags/1.0.8/public/build/assets/css/app.css (copied) (copied from cookie-optimizer/trunk/public/build/assets/css/app.css)
-
tags/1.0.8/public/build/assets/css/banner.css (copied) (copied from cookie-optimizer/trunk/public/build/assets/css/banner.css)
-
tags/1.0.8/public/build/assets/js/banner.js (copied) (copied from cookie-optimizer/trunk/public/build/assets/js/banner.js)
-
tags/1.0.8/public/build/assets/js/cookie-policy.js (copied) (copied from cookie-optimizer/trunk/public/build/assets/js/cookie-policy.js)
-
tags/1.0.8/public/build/assets/js/cookie-scan.js (copied) (copied from cookie-optimizer/trunk/public/build/assets/js/cookie-scan.js)
-
tags/1.0.8/public/build/assets/js/cookie_startup.js (copied) (copied from cookie-optimizer/trunk/public/build/assets/js/cookie_startup.js)
-
tags/1.0.8/public/build/manifest.json (copied) (copied from cookie-optimizer/trunk/public/build/manifest.json)
-
tags/1.0.8/readme.txt (copied) (copied from cookie-optimizer/trunk/readme.txt) (2 diffs)
-
tags/1.0.8/table/create_table.php (copied) (copied from cookie-optimizer/trunk/table/create_table.php)
-
tags/1.0.8/templates/banner/banner_main.php (copied) (copied from cookie-optimizer/trunk/templates/banner/banner_main.php)
-
tags/1.0.8/templates/banner/banner_preview.php (copied) (copied from cookie-optimizer/trunk/templates/banner/banner_preview.php)
-
tags/1.0.8/templates/cookie_permissions/cookie_permission_banner.php (deleted)
-
tags/1.0.8/templates/cookie_permissions/partials/cookie_opt_setting_data_setup.php (copied) (copied from cookie-optimizer/trunk/templates/cookie_permissions/partials/cookie_opt_setting_data_setup.php)
-
tags/1.0.8/templates/cookie_policy/cookie-policy-page-for-render.php (copied) (copied from cookie-optimizer/trunk/templates/cookie_policy/cookie-policy-page-for-render.php)
-
tags/1.0.8/templates/module/notice.php (copied) (copied from cookie-optimizer/trunk/templates/module/notice.php)
-
tags/1.0.8/templates/module/notice_up_plan.php (copied) (copied from cookie-optimizer/trunk/templates/module/notice_up_plan.php)
-
tags/1.0.8/templates/publish_setting/index.php (copied) (copied from cookie-optimizer/trunk/templates/publish_setting/index.php)
-
tags/1.0.8/uninstall.php (copied) (copied from cookie-optimizer/trunk/uninstall.php) (1 diff)
-
tags/1.0.8/vendor/composer/autoload_classmap.php (copied) (copied from cookie-optimizer/trunk/vendor/composer/autoload_classmap.php)
-
tags/1.0.8/vendor/composer/autoload_static.php (copied) (copied from cookie-optimizer/trunk/vendor/composer/autoload_static.php)
-
trunk/app/Includes/CookieOptBanner.php (modified) (7 diffs)
-
trunk/constants.php (modified) (1 diff)
-
trunk/cookie-opt.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cookie-optimizer/tags/1.0.8/app/Includes/CookieOptBanner.php
r3348569 r3349431 17 17 public $CookieOptBanner_service; 18 18 public $server_dashboard; 19 private $is_banner_display = false; 19 20 public function __construct() 20 21 { … … 27 28 if ($package_user !== 'LOCK' && !$package->checkLimitPackage()) { 28 29 add_action('wp_enqueue_scripts', [$this, 'register_enqueue_script']); 29 if (function_exists('wp_body_open')) { 30 add_action('wp_body_open', [$this, 'my_banner_in_content'], 10); 31 } else { 32 add_action('wp_footer', [$this, 'my_banner_in_content'], 10); 33 } 30 add_action('send_headers', [$this, 'set_cookie']); 31 add_action('wp_head', [$this, 'my_banner_in_content'], 10); 32 add_action('wp_body_open', [$this, 'my_banner_in_content'], 10); 33 add_action('wp_footer', [$this, 'my_banner_in_content'], 10); 34 34 } 35 35 } … … 47 47 add_action('wp_ajax_nopriv_set_cookie_opt_server', [$this, 'handle_set_cookie_opt_server']); 48 48 } 49 } 50 51 public function set_cookie() 52 { 53 $is_banner_active = get_option('cookie_opt_banner_active'); 54 if ($is_banner_active != 1) { 55 return; 56 } 57 58 if (isset($_COOKIE[COOKIE_OPT_NAME])) { 59 return; 60 } 61 62 $banner = $this->CookiePermissionService->getDataBannerToShow(); 63 64 // default cookie values 65 $data_cookie = [ 66 'action' => 0, 67 'type' => $banner['regulation'] === 'ja' ? '1' : '', 68 'necessary' => 1, 69 'functional' => 0, 70 'socialmedia' => 0, 71 'performance' => 0, 72 ]; 73 74 $options = [ 75 'expires' => $banner['regulation'] === 'ja' ? time() + 31556926 : 0, 76 'path' => '/', 77 //'domain' => '', 78 'secure' => false, 79 'httponly' => false, 80 //'samesite' => 'Lax', 81 ]; 82 83 setcookie(COOKIE_OPT_NAME, wp_json_encode($data_cookie), $options); 84 85 $_COOKIE[COOKIE_OPT_NAME] = wp_json_encode($data_cookie); 49 86 } 50 87 public function handle_view_banner() … … 109 146 'expires' => $expires, 110 147 'path' => '/', 111 'domain' => '',148 // 'domain' => '', 112 149 'secure' => false, 113 150 'httponly' => false, 114 'samesite' => 'Lax',151 // 'samesite' => 'Lax', 115 152 ]; 116 153 … … 166 203 public function my_banner_in_content() 167 204 { 205 if ($this->is_banner_display == true) { 206 return; 207 } 208 209 $this->is_banner_display = true; 210 168 211 $is_banner_active = get_option('cookie_opt_banner_active'); 169 212 if ($is_banner_active != 1) 170 213 return null; 171 214 172 $banner = $this->CookiePermissionService->getDataBannerToShow();173 215 174 216 $cookie_raw = $_COOKIE[COOKIE_OPT_NAME] ?? null; 175 $data_cookie = null; 176 177 if ($cookie_raw) { 178 $decoded = urldecode(wp_unslash($cookie_raw)); 179 $data_cookie = json_decode($decoded, true); 180 } 181 182 if (!is_array($data_cookie) || !isset($data_cookie['action'])) { 183 $data_cookie = [ 184 'action' => 0, 185 'type' => $banner['regulation'] === 'ja' ? '1' : '', 186 'necessary' => 1, 187 'functional' => 0, 188 'socialmedia' => 0, 189 'performance' => 0, 190 ]; 191 192 $options = [ 193 'expires' => $banner['regulation'] === 'ja' ? time() + 31556926 : 0, 194 'path' => '/', 195 'domain' => '', 196 'secure' => false, 197 'httponly' => false, 198 'samesite' => 'Lax', 199 ]; 200 201 setcookie(COOKIE_OPT_NAME, wp_json_encode($data_cookie), $options); 202 } 203 204 if ($data_cookie['action'] == 1) { 205 return; 206 } else { 217 218 if (!$cookie_raw) { 219 return; 220 } 221 222 $decoded = urldecode(wp_unslash($cookie_raw)); 223 $data_cookie = json_decode($decoded, true); 224 225 if (!isset($data_cookie['action'])) { 226 return; 227 } 228 229 if ($data_cookie['action'] === 1) { 230 return; 231 } 232 233 if ($data_cookie['action'] === 0) { 234 235 $banner = $this->CookiePermissionService->getDataBannerToShow(); 207 236 $condition_status = (bool)($banner['conditional']['status'] ?? false); 208 237 $rules_show = $banner['conditional']['rules']['show'] ?? []; … … 232 261 } 233 262 } 263 234 264 return; 235 265 } … … 242 272 243 273 echo $html; 244 return; 274 245 275 } 246 276 } -
cookie-optimizer/tags/1.0.8/constants.php
r3348569 r3349431 2 2 3 3 // Plugin version and mode 4 define('VERSION', '1.0. 7');4 define('VERSION', '1.0.8'); 5 5 6 6 // Plugin directory details -
cookie-optimizer/tags/1.0.8/cookie-opt.php
r3348569 r3349431 12 12 * Plugin URI: https://manage.medipartner.jp 13 13 * Description: Cookieをユーザーに見える化し、各法律にする準拠バナー同意ソリューション 14 * Version: 1.0. 714 * Version: 1.0.8 15 15 * Requires at least: 5.3 16 16 * Requires PHP: 7.3 … … 51 51 * 52 52 * @class CookieOpt 53 * @version 1.0. 753 * @version 1.0.8 54 54 */ 55 55 class CookieOpt … … 76 76 */ 77 77 public $defaults = [ 78 'version' => '1.0. 7',78 'version' => '1.0.8', 79 79 ]; 80 80 -
cookie-optimizer/tags/1.0.8/readme.txt
r3348569 r3349431 5 5 Requires PHP: 7.3 6 6 Tested up to: 6.7 7 Stable tag: 1.0. 77 Stable tag: 1.0.8 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 65 65 == Changelog == 66 66 67 = 1.0. 7=67 = 1.0.8 = 68 68 Initial release 69 69 -
cookie-optimizer/tags/1.0.8/uninstall.php
r3348569 r3349431 19 19 * 20 20 * @link https://cookieoptimizer.net 21 * @since 1.0. 721 * @since 1.0.8 22 22 * 23 23 * @package Cookie Optimizer -
cookie-optimizer/trunk/app/Includes/CookieOptBanner.php
r3348569 r3349431 17 17 public $CookieOptBanner_service; 18 18 public $server_dashboard; 19 private $is_banner_display = false; 19 20 public function __construct() 20 21 { … … 27 28 if ($package_user !== 'LOCK' && !$package->checkLimitPackage()) { 28 29 add_action('wp_enqueue_scripts', [$this, 'register_enqueue_script']); 29 if (function_exists('wp_body_open')) { 30 add_action('wp_body_open', [$this, 'my_banner_in_content'], 10); 31 } else { 32 add_action('wp_footer', [$this, 'my_banner_in_content'], 10); 33 } 30 add_action('send_headers', [$this, 'set_cookie']); 31 add_action('wp_head', [$this, 'my_banner_in_content'], 10); 32 add_action('wp_body_open', [$this, 'my_banner_in_content'], 10); 33 add_action('wp_footer', [$this, 'my_banner_in_content'], 10); 34 34 } 35 35 } … … 47 47 add_action('wp_ajax_nopriv_set_cookie_opt_server', [$this, 'handle_set_cookie_opt_server']); 48 48 } 49 } 50 51 public function set_cookie() 52 { 53 $is_banner_active = get_option('cookie_opt_banner_active'); 54 if ($is_banner_active != 1) { 55 return; 56 } 57 58 if (isset($_COOKIE[COOKIE_OPT_NAME])) { 59 return; 60 } 61 62 $banner = $this->CookiePermissionService->getDataBannerToShow(); 63 64 // default cookie values 65 $data_cookie = [ 66 'action' => 0, 67 'type' => $banner['regulation'] === 'ja' ? '1' : '', 68 'necessary' => 1, 69 'functional' => 0, 70 'socialmedia' => 0, 71 'performance' => 0, 72 ]; 73 74 $options = [ 75 'expires' => $banner['regulation'] === 'ja' ? time() + 31556926 : 0, 76 'path' => '/', 77 //'domain' => '', 78 'secure' => false, 79 'httponly' => false, 80 //'samesite' => 'Lax', 81 ]; 82 83 setcookie(COOKIE_OPT_NAME, wp_json_encode($data_cookie), $options); 84 85 $_COOKIE[COOKIE_OPT_NAME] = wp_json_encode($data_cookie); 49 86 } 50 87 public function handle_view_banner() … … 109 146 'expires' => $expires, 110 147 'path' => '/', 111 'domain' => '',148 // 'domain' => '', 112 149 'secure' => false, 113 150 'httponly' => false, 114 'samesite' => 'Lax',151 // 'samesite' => 'Lax', 115 152 ]; 116 153 … … 166 203 public function my_banner_in_content() 167 204 { 205 if ($this->is_banner_display == true) { 206 return; 207 } 208 209 $this->is_banner_display = true; 210 168 211 $is_banner_active = get_option('cookie_opt_banner_active'); 169 212 if ($is_banner_active != 1) 170 213 return null; 171 214 172 $banner = $this->CookiePermissionService->getDataBannerToShow();173 215 174 216 $cookie_raw = $_COOKIE[COOKIE_OPT_NAME] ?? null; 175 $data_cookie = null; 176 177 if ($cookie_raw) { 178 $decoded = urldecode(wp_unslash($cookie_raw)); 179 $data_cookie = json_decode($decoded, true); 180 } 181 182 if (!is_array($data_cookie) || !isset($data_cookie['action'])) { 183 $data_cookie = [ 184 'action' => 0, 185 'type' => $banner['regulation'] === 'ja' ? '1' : '', 186 'necessary' => 1, 187 'functional' => 0, 188 'socialmedia' => 0, 189 'performance' => 0, 190 ]; 191 192 $options = [ 193 'expires' => $banner['regulation'] === 'ja' ? time() + 31556926 : 0, 194 'path' => '/', 195 'domain' => '', 196 'secure' => false, 197 'httponly' => false, 198 'samesite' => 'Lax', 199 ]; 200 201 setcookie(COOKIE_OPT_NAME, wp_json_encode($data_cookie), $options); 202 } 203 204 if ($data_cookie['action'] == 1) { 205 return; 206 } else { 217 218 if (!$cookie_raw) { 219 return; 220 } 221 222 $decoded = urldecode(wp_unslash($cookie_raw)); 223 $data_cookie = json_decode($decoded, true); 224 225 if (!isset($data_cookie['action'])) { 226 return; 227 } 228 229 if ($data_cookie['action'] === 1) { 230 return; 231 } 232 233 if ($data_cookie['action'] === 0) { 234 235 $banner = $this->CookiePermissionService->getDataBannerToShow(); 207 236 $condition_status = (bool)($banner['conditional']['status'] ?? false); 208 237 $rules_show = $banner['conditional']['rules']['show'] ?? []; … … 232 261 } 233 262 } 263 234 264 return; 235 265 } … … 242 272 243 273 echo $html; 244 return; 274 245 275 } 246 276 } -
cookie-optimizer/trunk/constants.php
r3348569 r3349431 2 2 3 3 // Plugin version and mode 4 define('VERSION', '1.0. 7');4 define('VERSION', '1.0.8'); 5 5 6 6 // Plugin directory details -
cookie-optimizer/trunk/cookie-opt.php
r3348569 r3349431 12 12 * Plugin URI: https://manage.medipartner.jp 13 13 * Description: Cookieをユーザーに見える化し、各法律にする準拠バナー同意ソリューション 14 * Version: 1.0. 714 * Version: 1.0.8 15 15 * Requires at least: 5.3 16 16 * Requires PHP: 7.3 … … 51 51 * 52 52 * @class CookieOpt 53 * @version 1.0. 753 * @version 1.0.8 54 54 */ 55 55 class CookieOpt … … 76 76 */ 77 77 public $defaults = [ 78 'version' => '1.0. 7',78 'version' => '1.0.8', 79 79 ]; 80 80 -
cookie-optimizer/trunk/readme.txt
r3348569 r3349431 5 5 Requires PHP: 7.3 6 6 Tested up to: 6.7 7 Stable tag: 1.0. 77 Stable tag: 1.0.8 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 65 65 == Changelog == 66 66 67 = 1.0. 7=67 = 1.0.8 = 68 68 Initial release 69 69 -
cookie-optimizer/trunk/uninstall.php
r3348569 r3349431 19 19 * 20 20 * @link https://cookieoptimizer.net 21 * @since 1.0. 721 * @since 1.0.8 22 22 * 23 23 * @package Cookie Optimizer
Note: See TracChangeset
for help on using the changeset viewer.