Changeset 3272725
- Timestamp:
- 04/14/2025 06:36:48 PM (10 months ago)
- Location:
- intercom
- Files:
-
- 8 edited
- 1 copied
-
tags/3.0.1 (copied) (copied from intercom/trunk)
-
tags/3.0.1/bootstrap.php (modified) (3 diffs)
-
tags/3.0.1/readme.txt (modified) (3 diffs)
-
tags/3.0.1/test/SnippetSettingsTest.php (modified) (3 diffs)
-
tags/3.0.1/test/SnippetTest.php (modified) (1 diff)
-
trunk/bootstrap.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/test/SnippetSettingsTest.php (modified) (3 diffs)
-
trunk/test/SnippetTest.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
intercom/tags/3.0.1/bootstrap.php
r3272615 r3272725 6 6 Author: Intercom 7 7 Author URI: https://www.intercom.io 8 Version: 3.0. 08 Version: 3.0.1 9 9 */ 10 11 define('INTERCOM_PLUGIN_VERSION', '3.0.1'); 10 12 11 13 require_once __DIR__ . '/vendor/autoload.php'; … … 405 407 $result = $this->mergeConstants(apply_filters("intercom_settings", $settings)); 406 408 $result['installation_type'] = 'wordpress'; 409 $result['integration_version'] = INTERCOM_PLUGIN_VERSION; 407 410 return $result; 408 411 } … … 587 590 588 591 if (getenv('INTERCOM_PLUGIN_TEST') != '1') { 589 add_action('wp_footer', 'add_intercom_snippet');590 592 add_action('admin_menu', 'add_intercom_settings_page'); 591 593 add_action('network_admin_menu', 'add_intercom_settings_page'); 592 594 add_action('admin_init', 'intercom_settings'); 593 } 595 // Add in priority to load the snippet last 596 add_action('wp_footer', 'add_intercom_snippet', 999); 597 } -
intercom/tags/3.0.1/readme.txt
r3272649 r3272725 6 6 Requires PHP: 7.2 7 7 License: Apache 2.0 8 Stable tag: 3.0. 08 Stable tag: 3.0.1 9 9 10 10 Official Intercom WordPress plugin: Engage visitors in real time, power growth with AI, and convert leads into loyal customers. … … 33 33 3. Intercom widget used by customers to communicate with the business widget.png 34 34 == Changelog == 35 = 3.0.1 = 35 36 36 = 3.0 = 37 https://github.com/intercom/intercom-wordpress/pull/130 38 * Added version tracking to help Intercom provide better support by identifying which plugin version is in use. 39 40 https://github.com/intercom/intercom-wordpress/pull/88 41 * Loads Intercom messenger last to ensure JQuery is present. 42 43 = 3.0.0 = 44 45 https://github.com/intercom/intercom-wordpress/pull/127 37 46 * Replaced user_hash with intercom_user_jwt https://www.intercom.com/help/en/articles/10589769-authenticating-users-in-the-messenger-with-json-web-tokens-jwts. 38 47 * Updated readme to follow guidelines. … … 41 50 == Upgrade Notice == 42 51 43 = 3.0 = 52 = 3.0.1 = 53 Help Intercom provide better support by sharing the plugin version is in use. 54 55 = 3.0.0 = 44 56 Upgrade the security of your messenger with the introduction of JWT - https://www.intercom.com/help/en/articles/10589769-authenticating-users-in-the-messenger-with-json-web-tokens-jwts -
intercom/tags/3.0.1/test/SnippetSettingsTest.php
r3272615 r3272725 27 27 { 28 28 $snippet_settings = new IntercomSnippetSettings(array("app_id" => "bar")); 29 $this->assertEquals("{\"app_id\":\"bar\",\"installation_type\":\"wordpress\" }", $snippet_settings->json());29 $this->assertEquals("{\"app_id\":\"bar\",\"installation_type\":\"wordpress\",\"integration_version\":\"" . INTERCOM_PLUGIN_VERSION . "\"}", $snippet_settings->json()); 30 30 } 31 31 public function testJSONRenderingWithIdentityVerification() … … 38 38 ); 39 39 $jwt = JWT::encode($jwt_data, "s3cre7", 'HS256'); 40 $this->assertEquals('{"app_id":"bar","intercom_user_jwt":"'.$jwt.'","installation_type":"wordpress" }', $snippet_settings->json());40 $this->assertEquals('{"app_id":"bar","intercom_user_jwt":"'.$jwt.'","installation_type":"wordpress","integration_version":"' . INTERCOM_PLUGIN_VERSION . '"}', $snippet_settings->json()); 41 41 } 42 42 public function testJSONRenderingWithIdentityVerificationAndNoSecret() 43 43 { 44 44 $snippet_settings = new IntercomSnippetSettings(array("app_id" => "bar"), NULL, new FakeWordPressUserForSnippetTest()); 45 $this->assertEquals("{\"app_id\":\"bar\",\"email\":\"[email protected]\",\"installation_type\":\"wordpress\" }", $snippet_settings->json());45 $this->assertEquals("{\"app_id\":\"bar\",\"email\":\"[email protected]\",\"installation_type\":\"wordpress\",\"integration_version\":\"" . INTERCOM_PLUGIN_VERSION . "\"}", $snippet_settings->json()); 46 46 } 47 47 public function testInstallationType() 48 48 { 49 49 $snippet_settings = new IntercomSnippetSettings(array("app_id" => "bar")); 50 $this->assertEquals("{\"app_id\":\"bar\",\"installation_type\":\"wordpress\" }", $snippet_settings->json());50 $this->assertEquals("{\"app_id\":\"bar\",\"installation_type\":\"wordpress\",\"integration_version\":\"" . INTERCOM_PLUGIN_VERSION . "\"}", $snippet_settings->json()); 51 51 } 52 52 public function testIclLanguageConstant() … … 54 54 define('ICL_LANGUAGE_CODE', 'fr'); 55 55 $snippet_settings = new IntercomSnippetSettings(array("app_id" => "bar")); 56 $this->assertEquals("{\"app_id\":\"bar\",\"language_override\":\"fr\",\"installation_type\":\"wordpress\" }", $snippet_settings->json());56 $this->assertEquals("{\"app_id\":\"bar\",\"language_override\":\"fr\",\"installation_type\":\"wordpress\",\"integration_version\":\"" . INTERCOM_PLUGIN_VERSION . "\"}", $snippet_settings->json()); 57 57 } 58 58 -
intercom/tags/3.0.1/test/SnippetTest.php
r3272615 r3272725 25 25 </script> 26 26 <script data-cfasync="false"> 27 window.intercomSettings = {"app_id":"foo","name":"Nikola Tesla","installation_type":"wordpress" };27 window.intercomSettings = {"app_id":"foo","name":"Nikola Tesla","installation_type":"wordpress","integration_version":"3.0.1"}; 28 28 </script> 29 29 <script data-cfasync="false">(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/foo';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s, x);};if(document.readyState==='complete'){l();}else if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()</script> -
intercom/trunk/bootstrap.php
r3272615 r3272725 6 6 Author: Intercom 7 7 Author URI: https://www.intercom.io 8 Version: 3.0. 08 Version: 3.0.1 9 9 */ 10 11 define('INTERCOM_PLUGIN_VERSION', '3.0.1'); 10 12 11 13 require_once __DIR__ . '/vendor/autoload.php'; … … 405 407 $result = $this->mergeConstants(apply_filters("intercom_settings", $settings)); 406 408 $result['installation_type'] = 'wordpress'; 409 $result['integration_version'] = INTERCOM_PLUGIN_VERSION; 407 410 return $result; 408 411 } … … 587 590 588 591 if (getenv('INTERCOM_PLUGIN_TEST') != '1') { 589 add_action('wp_footer', 'add_intercom_snippet');590 592 add_action('admin_menu', 'add_intercom_settings_page'); 591 593 add_action('network_admin_menu', 'add_intercom_settings_page'); 592 594 add_action('admin_init', 'intercom_settings'); 593 } 595 // Add in priority to load the snippet last 596 add_action('wp_footer', 'add_intercom_snippet', 999); 597 } -
intercom/trunk/readme.txt
r3272649 r3272725 6 6 Requires PHP: 7.2 7 7 License: Apache 2.0 8 Stable tag: 3.0. 08 Stable tag: 3.0.1 9 9 10 10 Official Intercom WordPress plugin: Engage visitors in real time, power growth with AI, and convert leads into loyal customers. … … 33 33 3. Intercom widget used by customers to communicate with the business widget.png 34 34 == Changelog == 35 = 3.0.1 = 35 36 36 = 3.0 = 37 https://github.com/intercom/intercom-wordpress/pull/130 38 * Added version tracking to help Intercom provide better support by identifying which plugin version is in use. 39 40 https://github.com/intercom/intercom-wordpress/pull/88 41 * Loads Intercom messenger last to ensure JQuery is present. 42 43 = 3.0.0 = 44 45 https://github.com/intercom/intercom-wordpress/pull/127 37 46 * Replaced user_hash with intercom_user_jwt https://www.intercom.com/help/en/articles/10589769-authenticating-users-in-the-messenger-with-json-web-tokens-jwts. 38 47 * Updated readme to follow guidelines. … … 41 50 == Upgrade Notice == 42 51 43 = 3.0 = 52 = 3.0.1 = 53 Help Intercom provide better support by sharing the plugin version is in use. 54 55 = 3.0.0 = 44 56 Upgrade the security of your messenger with the introduction of JWT - https://www.intercom.com/help/en/articles/10589769-authenticating-users-in-the-messenger-with-json-web-tokens-jwts -
intercom/trunk/test/SnippetSettingsTest.php
r3272615 r3272725 27 27 { 28 28 $snippet_settings = new IntercomSnippetSettings(array("app_id" => "bar")); 29 $this->assertEquals("{\"app_id\":\"bar\",\"installation_type\":\"wordpress\" }", $snippet_settings->json());29 $this->assertEquals("{\"app_id\":\"bar\",\"installation_type\":\"wordpress\",\"integration_version\":\"" . INTERCOM_PLUGIN_VERSION . "\"}", $snippet_settings->json()); 30 30 } 31 31 public function testJSONRenderingWithIdentityVerification() … … 38 38 ); 39 39 $jwt = JWT::encode($jwt_data, "s3cre7", 'HS256'); 40 $this->assertEquals('{"app_id":"bar","intercom_user_jwt":"'.$jwt.'","installation_type":"wordpress" }', $snippet_settings->json());40 $this->assertEquals('{"app_id":"bar","intercom_user_jwt":"'.$jwt.'","installation_type":"wordpress","integration_version":"' . INTERCOM_PLUGIN_VERSION . '"}', $snippet_settings->json()); 41 41 } 42 42 public function testJSONRenderingWithIdentityVerificationAndNoSecret() 43 43 { 44 44 $snippet_settings = new IntercomSnippetSettings(array("app_id" => "bar"), NULL, new FakeWordPressUserForSnippetTest()); 45 $this->assertEquals("{\"app_id\":\"bar\",\"email\":\"[email protected]\",\"installation_type\":\"wordpress\" }", $snippet_settings->json());45 $this->assertEquals("{\"app_id\":\"bar\",\"email\":\"[email protected]\",\"installation_type\":\"wordpress\",\"integration_version\":\"" . INTERCOM_PLUGIN_VERSION . "\"}", $snippet_settings->json()); 46 46 } 47 47 public function testInstallationType() 48 48 { 49 49 $snippet_settings = new IntercomSnippetSettings(array("app_id" => "bar")); 50 $this->assertEquals("{\"app_id\":\"bar\",\"installation_type\":\"wordpress\" }", $snippet_settings->json());50 $this->assertEquals("{\"app_id\":\"bar\",\"installation_type\":\"wordpress\",\"integration_version\":\"" . INTERCOM_PLUGIN_VERSION . "\"}", $snippet_settings->json()); 51 51 } 52 52 public function testIclLanguageConstant() … … 54 54 define('ICL_LANGUAGE_CODE', 'fr'); 55 55 $snippet_settings = new IntercomSnippetSettings(array("app_id" => "bar")); 56 $this->assertEquals("{\"app_id\":\"bar\",\"language_override\":\"fr\",\"installation_type\":\"wordpress\" }", $snippet_settings->json());56 $this->assertEquals("{\"app_id\":\"bar\",\"language_override\":\"fr\",\"installation_type\":\"wordpress\",\"integration_version\":\"" . INTERCOM_PLUGIN_VERSION . "\"}", $snippet_settings->json()); 57 57 } 58 58 -
intercom/trunk/test/SnippetTest.php
r3272615 r3272725 25 25 </script> 26 26 <script data-cfasync="false"> 27 window.intercomSettings = {"app_id":"foo","name":"Nikola Tesla","installation_type":"wordpress" };27 window.intercomSettings = {"app_id":"foo","name":"Nikola Tesla","installation_type":"wordpress","integration_version":"3.0.1"}; 28 28 </script> 29 29 <script data-cfasync="false">(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/foo';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s, x);};if(document.readyState==='complete'){l();}else if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()</script>
Note: See TracChangeset
for help on using the changeset viewer.