Changeset 3697680
- Timestamp:
- 09/15/2026 08:44:47 PM (8 weeks ago)
- Location:
- ezbizi
- Files:
-
- 6 edited
- 1 copied
-
tags/1.8.0 (copied) (copied from ezbizi/trunk )
-
tags/1.8.0/enquiries.php (modified) (2 diffs)
-
tags/1.8.0/ezbizi.php (modified) (6 diffs)
-
tags/1.8.0/readme.txt (modified) (2 diffs)
-
trunk/enquiries.php (modified) (2 diffs)
-
trunk/ezbizi.php (modified) (6 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ezbizi/tags/1.8.0/enquiries.php
r3697670 r3697680 59 59 * guessing at somebody's colours. 60 60 */ 61 /** 62 * How long EzBizi has been refusing this site, in seconds, or 0 if it is not. 63 * 64 * Its own function because two different things ask: the widgets, which stop 65 * drawing, and the notice that tells an administrator why. 66 */ 67 function ezbizi_refused_for() { 68 $since = (int) get_option(EZBIZI_REFUSED_SINCE, 0); 69 70 return $since > 0 ? max(0, time() - $since) : 0; 71 } 72 61 73 function ezbizi_widget_config($kind) { 74 /* 75 * A site EzBizi has been refusing for a week draws no widgets. 76 * 77 * The deploy desk found the hole: the guard below asks whether a key is 78 * ABSENT, and a site whose token the server rejects still has the last 79 * good payload, key and all. So a pairing that had ended went on showing a 80 * chat box on every page. The values are a different question and keep 81 * publishing — a phone number that is a week stale is still the right 82 * phone number, while a chat box is a promise that somebody is listening. 83 */ 84 if (ezbizi_refused_for() > EZBIZI_REFUSED_MAX) { 85 return array(); 86 } 87 62 88 $payload = ezbizi_payload(); 63 89 … … 269 295 $anchor = ''; 270 296 297 /* 298 * 88px up, not 20. 299 * 300 * Jose photographed the launcher sitting in a-1chimney.com's yellow call 301 * bar. A sticky strip along the bottom — a phone number, a cookie notice, 302 * a book-now bar — is ordinary on the sites this plugin is installed on, 303 * and the one place a bottom-anchored bubble is guaranteed to collide with 304 * something is the bottom. Clearing a typical bar costs a little empty 305 * space on sites that have none. 306 */ 271 307 if ($position === 'bottom-right') { 272 $anchor = 'position:fixed;right:20px;bottom: 20px;z-index:2147483000';308 $anchor = 'position:fixed;right:20px;bottom:88px;z-index:2147483000'; 273 309 } elseif ($position === 'bottom-left') { 274 $anchor = 'position:fixed;left:20px;bottom: 20px;z-index:2147483000';310 $anchor = 'position:fixed;left:20px;bottom:88px;z-index:2147483000'; 275 311 } 276 312 -
ezbizi/tags/1.8.0/ezbizi.php
r3697670 r3697680 4 4 * Plugin URI: https://ezbizi.com 5 5 * Description: Publishes your company details — phone, address, licence, hours — from EzBizi, so one change updates every page of this site. 6 * Version: 1. 7.06 * Version: 1.8.0 7 7 * Requires at least: 6.0 8 8 * Requires PHP: 7.4 … … 47 47 } 48 48 49 const EZBIZI_VERSION = '1. 7.0';49 const EZBIZI_VERSION = '1.8.0'; 50 50 const EZBIZI_CACHE_KEY = 'ezbizi_payload'; 51 51 const EZBIZI_LAST_GOOD = 'ezbizi_last_good'; … … 56 56 const EZBIZI_REFRESHING = 'ezbizi_refreshing'; 57 57 58 /* 59 * When EzBizi started REFUSING this site's token, as distinct from failing to 60 * answer. Cleared by any successful read. 61 * 62 * A 401 or 403 is the server saying it does not recognise this site any more. 63 * A timeout, a 500 or a DNS failure is us having a bad day, and a site must 64 * never hide anything because of that — those keep serving the last good 65 * payload exactly as before. 66 */ 67 const EZBIZI_REFUSED_SINCE = 'ezbizi_refused_since'; 68 69 /* 70 * How long a refusal has to last before the widgets stop drawing. Seven days. 71 * 72 * Not immediately, because rotating a token leaves a real gap while somebody 73 * pastes the new one, and the public key the widgets use is a separate 74 * credential that usually still works through it — blanking a working chat 75 * over a thirty-second gap would be the worse mistake. 76 * 77 * Not never, which is what it was: a site whose pairing has genuinely ended 78 * went on drawing a chat box on every page, and a visitor typing into it is 79 * being promised a conversation nobody is going to receive. 80 */ 81 const EZBIZI_REFUSED_MAX = 604800; 82 58 83 require_once __DIR__ . '/service-account.php'; 59 84 require_once __DIR__ . '/enquiries.php'; … … 180 205 )); 181 206 182 if (is_wp_error($response) || wp_remote_retrieve_response_code($response) !== 200) { 207 $code = is_wp_error($response) ? 0 : (int) wp_remote_retrieve_response_code($response); 208 209 if ($code !== 200) { 210 /* 211 * Refused is not the same as unreachable, and only one of them is 212 * about this site. 401 and 403 are EzBizi saying it does not recognise 213 * the token; anything else is a bad day at our end and must change 214 * nothing here. Stamped once, so the clock measures how long the 215 * refusal has lasted rather than restarting on every page view. 216 */ 217 if (($code === 401 || $code === 403) && ! get_option(EZBIZI_REFUSED_SINCE, false)) { 218 update_option(EZBIZI_REFUSED_SINCE, time(), false); 219 } 220 183 221 /* 184 222 * Cache the FAILURE briefly too. Without this, a site whose token was … … 197 235 return get_option(EZBIZI_LAST_GOOD, $empty); 198 236 } 237 238 // Answered, so whatever was wrong is over. 239 delete_option(EZBIZI_REFUSED_SINCE); 199 240 200 241 // Stamped so ezbizi_payload() can tell "five minutes stale" from "this site … … 353 394 354 395 if ($settings['token'] !== '') { 396 /* 397 * A token that is present and refused is a different sentence from no 398 * token at all, and it has to be SAID: past the ceiling the chat and 399 * the form stop drawing, and a widget that vanishes without explanation 400 * reads as the plugin breaking rather than as the pairing ending. 401 */ 402 $refused = function_exists('ezbizi_refused_for') ? ezbizi_refused_for() : 0; 403 404 if ($refused > EZBIZI_REFUSED_MAX) { 405 printf( 406 '<div class="notice notice-error"><p>%s <a href="%s">%s</a></p></div>', 407 esc_html(sprintf( 408 /* translators: %s: how long, e.g. "8 days". */ 409 __( 410 'EzBizi has been refusing this site\'s token for %s, so the chat and contact form have stopped showing. Your published values are unaffected. Issue a new site token in Web Management and paste it here.', 411 'ezbizi' 412 ), 413 human_time_diff(time() - $refused) 414 )), 415 esc_url(admin_url('admin.php?page=ezbizi')), 416 esc_html__('Open EzBizi settings', 'ezbizi') 417 ); 418 } 419 355 420 return; 356 421 } -
ezbizi/tags/1.8.0/readme.txt
r3697670 r3697680 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1. 7.07 Stable tag: 1.8.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 196 196 == Changelog == 197 197 198 = 1.8.0 = 199 * If EzBizi stops recognising this site's token for a week, the chat and 200 contact form stop showing rather than collecting messages nobody will 201 receive, and an administrator is told why. Your published values keep 202 working — a phone number that is a week old is still your phone number. 203 204 = 1.7.1 = 205 * The chat bubble sits higher, so it no longer lands on a sticky bar along the 206 bottom of the page. 207 198 208 = 1.7.0 = 199 209 * The live chat has been rebuilt. It now opens a proper panel with a coloured -
ezbizi/trunk/enquiries.php
r3697670 r3697680 59 59 * guessing at somebody's colours. 60 60 */ 61 /** 62 * How long EzBizi has been refusing this site, in seconds, or 0 if it is not. 63 * 64 * Its own function because two different things ask: the widgets, which stop 65 * drawing, and the notice that tells an administrator why. 66 */ 67 function ezbizi_refused_for() { 68 $since = (int) get_option(EZBIZI_REFUSED_SINCE, 0); 69 70 return $since > 0 ? max(0, time() - $since) : 0; 71 } 72 61 73 function ezbizi_widget_config($kind) { 74 /* 75 * A site EzBizi has been refusing for a week draws no widgets. 76 * 77 * The deploy desk found the hole: the guard below asks whether a key is 78 * ABSENT, and a site whose token the server rejects still has the last 79 * good payload, key and all. So a pairing that had ended went on showing a 80 * chat box on every page. The values are a different question and keep 81 * publishing — a phone number that is a week stale is still the right 82 * phone number, while a chat box is a promise that somebody is listening. 83 */ 84 if (ezbizi_refused_for() > EZBIZI_REFUSED_MAX) { 85 return array(); 86 } 87 62 88 $payload = ezbizi_payload(); 63 89 … … 269 295 $anchor = ''; 270 296 297 /* 298 * 88px up, not 20. 299 * 300 * Jose photographed the launcher sitting in a-1chimney.com's yellow call 301 * bar. A sticky strip along the bottom — a phone number, a cookie notice, 302 * a book-now bar — is ordinary on the sites this plugin is installed on, 303 * and the one place a bottom-anchored bubble is guaranteed to collide with 304 * something is the bottom. Clearing a typical bar costs a little empty 305 * space on sites that have none. 306 */ 271 307 if ($position === 'bottom-right') { 272 $anchor = 'position:fixed;right:20px;bottom: 20px;z-index:2147483000';308 $anchor = 'position:fixed;right:20px;bottom:88px;z-index:2147483000'; 273 309 } elseif ($position === 'bottom-left') { 274 $anchor = 'position:fixed;left:20px;bottom: 20px;z-index:2147483000';310 $anchor = 'position:fixed;left:20px;bottom:88px;z-index:2147483000'; 275 311 } 276 312 -
ezbizi/trunk/ezbizi.php
r3697670 r3697680 4 4 * Plugin URI: https://ezbizi.com 5 5 * Description: Publishes your company details — phone, address, licence, hours — from EzBizi, so one change updates every page of this site. 6 * Version: 1. 7.06 * Version: 1.8.0 7 7 * Requires at least: 6.0 8 8 * Requires PHP: 7.4 … … 47 47 } 48 48 49 const EZBIZI_VERSION = '1. 7.0';49 const EZBIZI_VERSION = '1.8.0'; 50 50 const EZBIZI_CACHE_KEY = 'ezbizi_payload'; 51 51 const EZBIZI_LAST_GOOD = 'ezbizi_last_good'; … … 56 56 const EZBIZI_REFRESHING = 'ezbizi_refreshing'; 57 57 58 /* 59 * When EzBizi started REFUSING this site's token, as distinct from failing to 60 * answer. Cleared by any successful read. 61 * 62 * A 401 or 403 is the server saying it does not recognise this site any more. 63 * A timeout, a 500 or a DNS failure is us having a bad day, and a site must 64 * never hide anything because of that — those keep serving the last good 65 * payload exactly as before. 66 */ 67 const EZBIZI_REFUSED_SINCE = 'ezbizi_refused_since'; 68 69 /* 70 * How long a refusal has to last before the widgets stop drawing. Seven days. 71 * 72 * Not immediately, because rotating a token leaves a real gap while somebody 73 * pastes the new one, and the public key the widgets use is a separate 74 * credential that usually still works through it — blanking a working chat 75 * over a thirty-second gap would be the worse mistake. 76 * 77 * Not never, which is what it was: a site whose pairing has genuinely ended 78 * went on drawing a chat box on every page, and a visitor typing into it is 79 * being promised a conversation nobody is going to receive. 80 */ 81 const EZBIZI_REFUSED_MAX = 604800; 82 58 83 require_once __DIR__ . '/service-account.php'; 59 84 require_once __DIR__ . '/enquiries.php'; … … 180 205 )); 181 206 182 if (is_wp_error($response) || wp_remote_retrieve_response_code($response) !== 200) { 207 $code = is_wp_error($response) ? 0 : (int) wp_remote_retrieve_response_code($response); 208 209 if ($code !== 200) { 210 /* 211 * Refused is not the same as unreachable, and only one of them is 212 * about this site. 401 and 403 are EzBizi saying it does not recognise 213 * the token; anything else is a bad day at our end and must change 214 * nothing here. Stamped once, so the clock measures how long the 215 * refusal has lasted rather than restarting on every page view. 216 */ 217 if (($code === 401 || $code === 403) && ! get_option(EZBIZI_REFUSED_SINCE, false)) { 218 update_option(EZBIZI_REFUSED_SINCE, time(), false); 219 } 220 183 221 /* 184 222 * Cache the FAILURE briefly too. Without this, a site whose token was … … 197 235 return get_option(EZBIZI_LAST_GOOD, $empty); 198 236 } 237 238 // Answered, so whatever was wrong is over. 239 delete_option(EZBIZI_REFUSED_SINCE); 199 240 200 241 // Stamped so ezbizi_payload() can tell "five minutes stale" from "this site … … 353 394 354 395 if ($settings['token'] !== '') { 396 /* 397 * A token that is present and refused is a different sentence from no 398 * token at all, and it has to be SAID: past the ceiling the chat and 399 * the form stop drawing, and a widget that vanishes without explanation 400 * reads as the plugin breaking rather than as the pairing ending. 401 */ 402 $refused = function_exists('ezbizi_refused_for') ? ezbizi_refused_for() : 0; 403 404 if ($refused > EZBIZI_REFUSED_MAX) { 405 printf( 406 '<div class="notice notice-error"><p>%s <a href="%s">%s</a></p></div>', 407 esc_html(sprintf( 408 /* translators: %s: how long, e.g. "8 days". */ 409 __( 410 'EzBizi has been refusing this site\'s token for %s, so the chat and contact form have stopped showing. Your published values are unaffected. Issue a new site token in Web Management and paste it here.', 411 'ezbizi' 412 ), 413 human_time_diff(time() - $refused) 414 )), 415 esc_url(admin_url('admin.php?page=ezbizi')), 416 esc_html__('Open EzBizi settings', 'ezbizi') 417 ); 418 } 419 355 420 return; 356 421 } -
ezbizi/trunk/readme.txt
r3697670 r3697680 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1. 7.07 Stable tag: 1.8.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 196 196 == Changelog == 197 197 198 = 1.8.0 = 199 * If EzBizi stops recognising this site's token for a week, the chat and 200 contact form stop showing rather than collecting messages nobody will 201 receive, and an administrator is told why. Your published values keep 202 working — a phone number that is a week old is still your phone number. 203 204 = 1.7.1 = 205 * The chat bubble sits higher, so it no longer lands on a sticky bar along the 206 bottom of the page. 207 198 208 = 1.7.0 = 199 209 * The live chat has been rebuilt. It now opens a proper panel with a coloured
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)