Changeset 2616475
- Timestamp:
- 10/19/2021 12:20:53 PM (4 years ago)
- Location:
- silktide/trunk
- Files:
-
- 2 edited
-
class-silktide.php (modified) (12 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
silktide/trunk/class-silktide.php
r2223463 r2616475 1 1 <?php 2 2 3 /**4 * Class Silktide5 *6 * @package Silktide7 */8 3 class Silktide { 9 4 10 5 /** 11 * Default notification URL .6 * Default notification URL 12 7 */ 13 8 const DEFAULT_NOTIFY_URL = 'https://api.silktide.com/cms/update'; 9 14 10 /** 15 11 * Our minimum WordPress version … … 29 25 private $plugin_version; 30 26 31 /**32 * Silktide constructor.33 */34 27 public function __construct() { 35 28 $this->silktide_notify_url = self::DEFAULT_NOTIFY_URL; … … 55 48 add_action( 'silktide_header', array( $this, 'action_hook_header' ) ); 56 49 add_action( 'wp_head', array( $this, 'action_hook_header' ) ); 57 58 50 } 59 51 … … 62 54 * 63 55 * @param array $links 64 *65 56 * @return array 66 57 */ … … 76 67 77 68 /** 78 * Add our Silktide header. 79 * 80 * Adds the meta header to the post. 81 * 82 * @return void 69 * Add our Silktide meta header. 70 * This tells Silktide what it needs to edit the page later on. 83 71 */ 84 72 public function action_hook_header() { … … 89 77 */ 90 78 global $post; 79 80 /** 81 * 404 pages don't define a $post; we can't edit these, so we ignore them 82 */ 83 if (!isset($post) || !$post) { 84 return; 85 } 86 91 87 $key = get_option( 'silktide_api_key', '' ); 92 88 if ( 32 !== strlen( $key ) ) { … … 105 101 106 102 $ivlen = openssl_cipher_iv_length( 'AES-256-CBC' ); 103 107 104 /** 108 105 * We don't check the cryptographically strong flag as it's not vitally important. … … 112 109 return; 113 110 } 111 114 112 $ciphertext_raw = openssl_encrypt( 115 113 wp_json_encode( array( 'editorUrl' => $edit_link ) ), … … 120 118 $hmac = hash_hmac( 'sha256', $ciphertext_raw, $key, true ); 121 119 $ciphertext = base64_encode( $iv . $hmac . $ciphertext_raw ); 120 122 121 echo '<meta name="silktide-cms" content="' . esc_attr( $ciphertext ) . '" />' . PHP_EOL; 123 122 } 124 123 125 124 /** 126 * Fire a callback .125 * Fire a callback. 127 126 * 128 127 * @param string $new_status New post status. … … 275 274 * 276 275 * @param string $input The api key as entered. 277 *278 276 * @return string 279 277 */ … … 322 320 ) 323 321 ), 324 esc_url( 'https:// monitor.support.silktide.com/guides/cms-integrations/how-to-integrate-silktide-with-wordpress/' ),322 esc_url( 'https://support.silktide.com/guides/cms-integrations/how-to-integrate-silktide-with-wordpress/' ), 325 323 esc_url( 'https://silktide.com/' ) 326 324 ); … … 458 456 } 459 457 } 460 461 462 458 } -
silktide/trunk/readme.txt
r2564217 r2616475 3 3 Tags: silktide, site validation, site verification 4 4 Requires at least: 4.9.8 5 Tested up to: 5. 7.25 Tested up to: 5.8.1 6 6 Stable tag: 1.0.8 7 7 Requires PHP: 5.3 … … 24 24 1) Install the plugin 25 25 2) Go to the Settings -> Silktide section of the WordPress dashboard 26 3) Provide [your Silktide API key](https:// monitor.support.silktide.com/guides/cms-integrations/how-to-integrate-silktide-with-wordpress/)26 3) Provide [your Silktide API key](https://support.silktide.com/guides/cms-integrations/how-to-integrate-silktide-with-wordpress/) 27 27 28 28 == Changelog == 29 29 30 1.0.8 - Oct 2021 - Fix for 404 pages without $post; updated documentation URL 30 31 1.0.7 - Jan 2020 - Updated documentation and text. 31 32 1.0.6 - Feb 2019 - Update documentation link.
Note: See TracChangeset
for help on using the changeset viewer.