Changeset 3340410
- Timestamp:
- 08/06/2025 01:44:20 PM (8 months ago)
- Location:
- cryptx
- Files:
-
- 8 deleted
- 8 edited
- 1 copied
-
tags/4.0.1 (copied) (copied from cryptx/trunk)
-
tags/4.0.1/classes/Admin/PresentationSettingsTab.php (modified) (1 diff)
-
tags/4.0.1/classes/CryptX.php (modified) (17 diffs)
-
tags/4.0.1/classes/EmailProcessingConfig.php (deleted)
-
tags/4.0.1/cryptx.php (modified) (3 diffs)
-
tags/4.0.1/include (deleted)
-
tags/4.0.1/js/cryptx-admin.js (deleted)
-
tags/4.0.1/js/cryptx-admin.min.js (deleted)
-
tags/4.0.1/readme.txt (modified) (2 diffs)
-
trunk/classes/Admin/PresentationSettingsTab.php (modified) (1 diff)
-
trunk/classes/CryptX.php (modified) (17 diffs)
-
trunk/classes/EmailProcessingConfig.php (deleted)
-
trunk/cryptx.php (modified) (3 diffs)
-
trunk/include (deleted)
-
trunk/js/cryptx-admin.js (deleted)
-
trunk/js/cryptx-admin.min.js (deleted)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cryptx/tags/4.0.1/classes/Admin/PresentationSettingsTab.php
r3339444 r3340410 89 89 'scrambled' => [ 90 90 'value' => 4, 91 'label' => __('Text scrambled by AntiSpamBot ', 'cryptx')91 'label' => __('Text scrambled by AntiSpamBot (Try it and look at your site and check the html source!)', 'cryptx') 92 92 ], 93 93 'pngImage' => [ -
cryptx/tags/4.0.1/classes/CryptX.php
r3339444 r3340410 158 158 { 159 159 return array_merge( 160 $this->config->getAll(),161 [162 'version' => CRYPTX_VERSION,163 'c2i_font' => $this->getDefaultFont()164 ]160 $this->config->getAll(), 161 [ 162 'version' => CRYPTX_VERSION, 163 'c2i_font' => $this->getDefaultFont() 164 ] 165 165 ); 166 166 } … … 174 174 { 175 175 $availableFonts = $this->getFilesInDirectory( 176 CRYPTX_DIR_PATH . 'fonts',177 [self::FONT_EXTENSION]176 CRYPTX_DIR_PATH . 'fonts', 177 [self::FONT_EXTENSION] 178 178 ); 179 179 … … 219 219 220 220 $decodedAttributes = array_map( 221 fn($value) => $this->decodeString($value),222 $attributes221 fn($value) => $this->decodeString($value), 222 $attributes 223 223 ); 224 224 unset($decodedAttributes['encoded']); … … 243 243 if (!empty($attributes)) { 244 244 self::$cryptXOptions = shortcode_atts( 245 $this->loadCryptXOptionsWithDefaults(),246 array_change_key_case($attributes, CASE_LOWER),247 $tag245 $this->loadCryptXOptionsWithDefaults(), 246 array_change_key_case($attributes, CASE_LOWER), 247 $tag 248 248 ); 249 249 } … … 714 714 715 715 $javaHandler = "javascript:secureDecryptAndNavigate('" . 716 $this->escapeJavaScript($encryptedEmail) . "', '" .717 $this->escapeJavaScript($password) . "')";716 $this->escapeJavaScript($encryptedEmail) . "', '" . 717 $this->escapeJavaScript($password) . "')"; 718 718 } catch (\Exception $e) { 719 719 // Fallback to legacy encryption if secure encryption fails … … 732 732 // Fallback to antispambot if JavaScript is not enabled 733 733 $return = str_replace('mailto:' . $emailAddress, 734 antispambot('mailto:' . $emailAddress), $return);734 antispambot('mailto:' . $emailAddress), $return); 735 735 } 736 736 … … 738 738 if (!empty(self::$cryptXOptions['css_id'])) { 739 739 $return = preg_replace('/(<a\s+[^>]*)(>)/i', 740 '$1 id="' . self::$cryptXOptions['css_id'] . '"$2', $return);740 '$1 id="' . self::$cryptXOptions['css_id'] . '"$2', $return); 741 741 } 742 742 743 743 if (!empty(self::$cryptXOptions['css_class'])) { 744 744 $return = preg_replace('/(<a\s+[^>]*)(>)/i', 745 '$1 class="' . self::$cryptXOptions['css_class'] . '"$2', $return);745 '$1 class="' . self::$cryptXOptions['css_class'] . '"$2', $return); 746 746 } 747 747 … … 805 805 $linkPattern = "<a href=\"mailto:\\2\">\\2</a>"; 806 806 $src = [ 807 "/([\\s])($emailPattern)/si",808 "/(>)($emailPattern)(<)/si",809 "/(\\()($emailPattern)(\\))/si",810 "/(>)($emailPattern)([\\s])/si",811 "/([\\s])($emailPattern)(<)/si",812 "/^($emailPattern)/si",813 "/(<a[^>]*>)<a[^>]*>/",814 "/(<\\/A>)<\\/A>/i"807 "/([\\s])($emailPattern)/si", 808 "/(>)($emailPattern)(<)/si", 809 "/(\\()($emailPattern)(\\))/si", 810 "/(>)($emailPattern)([\\s])/si", 811 "/([\\s])($emailPattern)(<)/si", 812 "/^($emailPattern)/si", 813 "/(<a[^>]*>)<a[^>]*>/", 814 "/(<\\/A>)<\\/A>/i" 815 815 ]; 816 816 $tar = [ 817 "\\1$linkPattern",818 "\\1$linkPattern\\6",819 "\\1$linkPattern\\6",820 "\\1$linkPattern\\6",821 "\\1$linkPattern\\6",822 "<a href=\"mailto:\\0\">\\0</a>",823 "\\1",824 "\\1"817 "\\1$linkPattern", 818 "\\1$linkPattern\\6", 819 "\\1$linkPattern\\6", 820 "\\1$linkPattern\\6", 821 "\\1$linkPattern\\6", 822 "<a href=\"mailto:\\0\">\\0</a>", 823 "\\1", 824 "\\1" 825 825 ]; 826 826 … … 1123 1123 $str = htmlentities($str, ENT_QUOTES, 'UTF-8'); 1124 1124 $special = array( 1125 '[' => '[',1126 ']' => ']',1125 '[' => '[', 1126 ']' => ']', 1127 1127 ); 1128 1128 … … 1185 1185 1186 1186 $additional_links = [ 1187 $this->create_settings_link(),1188 $this->create_donation_link()1187 $this->create_settings_link(), 1188 $this->create_donation_link() 1189 1189 ]; 1190 1190 … … 1200 1200 { 1201 1201 return sprintf( 1202 '<a href="options-general.php?page=%s">%s</a>',1203 CRYPTX_BASEFOLDER,1204 __('Settings')1202 '<a href="options-general.php?page=%s">%s</a>', 1203 CRYPTX_BASEFOLDER, 1204 __('Settings') 1205 1205 ); 1206 1206 } … … 1214 1214 { 1215 1215 return sprintf( 1216 '<a href="%s">%s</a>',1217 self::PAYPAL_DONATION_URL,1218 __('Donate', 'cryptx')1216 '<a href="%s">%s</a>', 1217 self::PAYPAL_DONATION_URL, 1218 __('Donate', 'cryptx') 1219 1219 ); 1220 1220 } … … 1314 1314 // Determine which encryption method to use 1315 1315 if ($encryptionMode === 'secure' && 1316 $this->config->isSecureEncryptionEnabled() &&1317 class_exists('CryptX\SecureEncryption')) {1316 $this->config->isSecureEncryptionEnabled() && 1317 class_exists('CryptX\SecureEncryption')) { 1318 1318 1319 1319 // Use modern AES-256-GCM encryption … … 1324 1324 1325 1325 $javaHandler = "javascript:secureDecryptAndNavigate('" . 1326 $this->escapeJavaScript($encryptedEmail) . "', '" .1327 $this->escapeJavaScript($password) . "')";1326 $this->escapeJavaScript($encryptedEmail) . "', '" . 1327 $this->escapeJavaScript($password) . "')"; 1328 1328 } catch (\Exception $e) { 1329 1329 // Fallback to legacy if secure encryption fails … … 1342 1342 // Fallback to antispambot if JavaScript is not enabled 1343 1343 $return = str_replace('mailto:' . $emailAddress, 1344 antispambot('mailto:' . $emailAddress), $return);1344 antispambot('mailto:' . $emailAddress), $return); 1345 1345 } 1346 1346 … … 1348 1348 if (!empty(self::$cryptXOptions['css_id'])) { 1349 1349 $return = preg_replace('/(<a\s+[^>]*)(>)/i', 1350 '$1 id="' . self::$cryptXOptions['css_id'] . '"$2', $return);1350 '$1 id="' . self::$cryptXOptions['css_id'] . '"$2', $return); 1351 1351 } 1352 1352 1353 1353 if (!empty(self::$cryptXOptions['css_class'])) { 1354 1354 $return = preg_replace('/(<a\s+[^>]*)(>)/i', 1355 '$1 class="' . self::$cryptXOptions['css_class'] . '"$2', $return);1355 '$1 class="' . self::$cryptXOptions['css_class'] . '"$2', $return); 1356 1356 } 1357 1357 … … 1368 1368 { 1369 1369 return str_replace( 1370 ['\\', "'", '"', "\n", "\r", "\t"],1371 ['\\\\', "\\'", '\\"', '\\n', '\\r', '\\t'],1372 $string1370 ['\\', "'", '"', "\n", "\r", "\t"], 1371 ['\\\\', "\\'", '\\"', '\\n', '\\r', '\\t'], 1372 $string 1373 1373 ); 1374 1374 } -
cryptx/tags/4.0.1/cryptx.php
r3339444 r3340410 4 4 * Plugin URI: https://wordpress.org/plugins/cryptx/ 5 5 * Description: CryptX encrypts email addresses in your posts, pages, comments, and text widgets to protect them from spam bots while keeping them readable for your visitors. 6 * Version: 4.0. 06 * Version: 4.0.1 7 7 * Requires at least: 6.7 8 8 * Tested up to: 6.8 … … 40 40 41 41 // Plugin constants 42 define('CRYPTX_VERSION', '4.0. 0');42 define('CRYPTX_VERSION', '4.0.1'); 43 43 define('CRYPTX_PLUGIN_FILE', __FILE__); 44 44 define('CRYPTX_PLUGIN_BASENAME', plugin_basename(__FILE__)); … … 165 165 return $links; 166 166 }); 167 168 /** 169 * Encrypts the given content using the CryptX library and wraps it with a shortcode. 170 * 171 * @param string $content The content to be encrypted. 172 * @param array|null $args Optional arguments to customize the encryption process. 173 * 174 * @return string The encrypted content wrapped in the appropriate shortcode. 175 */ 176 if (!function_exists('encryptx')) { 177 function encryptx(string $content, ?array $args = []): string { 178 $cryptXInstance = Cryptx\CryptX::get_instance(); 179 $attributesString = $cryptXInstance->convertArrayToArgumentString($args); 180 $shortcode = '[cryptx' . $attributesString . ']' . $content . '[/cryptx]'; 181 182 return do_shortcode($shortcode); 183 } 184 } -
cryptx/tags/4.0.1/readme.txt
r3339444 r3340410 2 2 Contributors: d3395 3 3 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4026696 4 Tags: antispam, email, mail, addresses, spam protection, email encryption, privacy4 Tags: antispam, mail, spam protection, email encryption, privacy 5 5 Requires at least: 6.7 6 6 Tested up to: 6.8 7 Stable tag: 4.0. 07 Stable tag: 4.0.1 8 8 Requires PHP: 8.1 9 9 License: GPLv2 or later … … 69 69 70 70 == Changelog == 71 71 = 4.0.1 = 72 * The "encryptx" function was mistakenly removed during code cleanup. The function has now been added back. (Thx to Jan: https://wordpress.org/support/topic/version-4-breaks-because-of-undefined-function-encryptx/) 72 73 = 4.0.0 = 73 74 * **Major Update**: Complete code refactoring and modernization -
cryptx/trunk/classes/Admin/PresentationSettingsTab.php
r3339444 r3340410 89 89 'scrambled' => [ 90 90 'value' => 4, 91 'label' => __('Text scrambled by AntiSpamBot ', 'cryptx')91 'label' => __('Text scrambled by AntiSpamBot (Try it and look at your site and check the html source!)', 'cryptx') 92 92 ], 93 93 'pngImage' => [ -
cryptx/trunk/classes/CryptX.php
r3339444 r3340410 158 158 { 159 159 return array_merge( 160 $this->config->getAll(),161 [162 'version' => CRYPTX_VERSION,163 'c2i_font' => $this->getDefaultFont()164 ]160 $this->config->getAll(), 161 [ 162 'version' => CRYPTX_VERSION, 163 'c2i_font' => $this->getDefaultFont() 164 ] 165 165 ); 166 166 } … … 174 174 { 175 175 $availableFonts = $this->getFilesInDirectory( 176 CRYPTX_DIR_PATH . 'fonts',177 [self::FONT_EXTENSION]176 CRYPTX_DIR_PATH . 'fonts', 177 [self::FONT_EXTENSION] 178 178 ); 179 179 … … 219 219 220 220 $decodedAttributes = array_map( 221 fn($value) => $this->decodeString($value),222 $attributes221 fn($value) => $this->decodeString($value), 222 $attributes 223 223 ); 224 224 unset($decodedAttributes['encoded']); … … 243 243 if (!empty($attributes)) { 244 244 self::$cryptXOptions = shortcode_atts( 245 $this->loadCryptXOptionsWithDefaults(),246 array_change_key_case($attributes, CASE_LOWER),247 $tag245 $this->loadCryptXOptionsWithDefaults(), 246 array_change_key_case($attributes, CASE_LOWER), 247 $tag 248 248 ); 249 249 } … … 714 714 715 715 $javaHandler = "javascript:secureDecryptAndNavigate('" . 716 $this->escapeJavaScript($encryptedEmail) . "', '" .717 $this->escapeJavaScript($password) . "')";716 $this->escapeJavaScript($encryptedEmail) . "', '" . 717 $this->escapeJavaScript($password) . "')"; 718 718 } catch (\Exception $e) { 719 719 // Fallback to legacy encryption if secure encryption fails … … 732 732 // Fallback to antispambot if JavaScript is not enabled 733 733 $return = str_replace('mailto:' . $emailAddress, 734 antispambot('mailto:' . $emailAddress), $return);734 antispambot('mailto:' . $emailAddress), $return); 735 735 } 736 736 … … 738 738 if (!empty(self::$cryptXOptions['css_id'])) { 739 739 $return = preg_replace('/(<a\s+[^>]*)(>)/i', 740 '$1 id="' . self::$cryptXOptions['css_id'] . '"$2', $return);740 '$1 id="' . self::$cryptXOptions['css_id'] . '"$2', $return); 741 741 } 742 742 743 743 if (!empty(self::$cryptXOptions['css_class'])) { 744 744 $return = preg_replace('/(<a\s+[^>]*)(>)/i', 745 '$1 class="' . self::$cryptXOptions['css_class'] . '"$2', $return);745 '$1 class="' . self::$cryptXOptions['css_class'] . '"$2', $return); 746 746 } 747 747 … … 805 805 $linkPattern = "<a href=\"mailto:\\2\">\\2</a>"; 806 806 $src = [ 807 "/([\\s])($emailPattern)/si",808 "/(>)($emailPattern)(<)/si",809 "/(\\()($emailPattern)(\\))/si",810 "/(>)($emailPattern)([\\s])/si",811 "/([\\s])($emailPattern)(<)/si",812 "/^($emailPattern)/si",813 "/(<a[^>]*>)<a[^>]*>/",814 "/(<\\/A>)<\\/A>/i"807 "/([\\s])($emailPattern)/si", 808 "/(>)($emailPattern)(<)/si", 809 "/(\\()($emailPattern)(\\))/si", 810 "/(>)($emailPattern)([\\s])/si", 811 "/([\\s])($emailPattern)(<)/si", 812 "/^($emailPattern)/si", 813 "/(<a[^>]*>)<a[^>]*>/", 814 "/(<\\/A>)<\\/A>/i" 815 815 ]; 816 816 $tar = [ 817 "\\1$linkPattern",818 "\\1$linkPattern\\6",819 "\\1$linkPattern\\6",820 "\\1$linkPattern\\6",821 "\\1$linkPattern\\6",822 "<a href=\"mailto:\\0\">\\0</a>",823 "\\1",824 "\\1"817 "\\1$linkPattern", 818 "\\1$linkPattern\\6", 819 "\\1$linkPattern\\6", 820 "\\1$linkPattern\\6", 821 "\\1$linkPattern\\6", 822 "<a href=\"mailto:\\0\">\\0</a>", 823 "\\1", 824 "\\1" 825 825 ]; 826 826 … … 1123 1123 $str = htmlentities($str, ENT_QUOTES, 'UTF-8'); 1124 1124 $special = array( 1125 '[' => '[',1126 ']' => ']',1125 '[' => '[', 1126 ']' => ']', 1127 1127 ); 1128 1128 … … 1185 1185 1186 1186 $additional_links = [ 1187 $this->create_settings_link(),1188 $this->create_donation_link()1187 $this->create_settings_link(), 1188 $this->create_donation_link() 1189 1189 ]; 1190 1190 … … 1200 1200 { 1201 1201 return sprintf( 1202 '<a href="options-general.php?page=%s">%s</a>',1203 CRYPTX_BASEFOLDER,1204 __('Settings')1202 '<a href="options-general.php?page=%s">%s</a>', 1203 CRYPTX_BASEFOLDER, 1204 __('Settings') 1205 1205 ); 1206 1206 } … … 1214 1214 { 1215 1215 return sprintf( 1216 '<a href="%s">%s</a>',1217 self::PAYPAL_DONATION_URL,1218 __('Donate', 'cryptx')1216 '<a href="%s">%s</a>', 1217 self::PAYPAL_DONATION_URL, 1218 __('Donate', 'cryptx') 1219 1219 ); 1220 1220 } … … 1314 1314 // Determine which encryption method to use 1315 1315 if ($encryptionMode === 'secure' && 1316 $this->config->isSecureEncryptionEnabled() &&1317 class_exists('CryptX\SecureEncryption')) {1316 $this->config->isSecureEncryptionEnabled() && 1317 class_exists('CryptX\SecureEncryption')) { 1318 1318 1319 1319 // Use modern AES-256-GCM encryption … … 1324 1324 1325 1325 $javaHandler = "javascript:secureDecryptAndNavigate('" . 1326 $this->escapeJavaScript($encryptedEmail) . "', '" .1327 $this->escapeJavaScript($password) . "')";1326 $this->escapeJavaScript($encryptedEmail) . "', '" . 1327 $this->escapeJavaScript($password) . "')"; 1328 1328 } catch (\Exception $e) { 1329 1329 // Fallback to legacy if secure encryption fails … … 1342 1342 // Fallback to antispambot if JavaScript is not enabled 1343 1343 $return = str_replace('mailto:' . $emailAddress, 1344 antispambot('mailto:' . $emailAddress), $return);1344 antispambot('mailto:' . $emailAddress), $return); 1345 1345 } 1346 1346 … … 1348 1348 if (!empty(self::$cryptXOptions['css_id'])) { 1349 1349 $return = preg_replace('/(<a\s+[^>]*)(>)/i', 1350 '$1 id="' . self::$cryptXOptions['css_id'] . '"$2', $return);1350 '$1 id="' . self::$cryptXOptions['css_id'] . '"$2', $return); 1351 1351 } 1352 1352 1353 1353 if (!empty(self::$cryptXOptions['css_class'])) { 1354 1354 $return = preg_replace('/(<a\s+[^>]*)(>)/i', 1355 '$1 class="' . self::$cryptXOptions['css_class'] . '"$2', $return);1355 '$1 class="' . self::$cryptXOptions['css_class'] . '"$2', $return); 1356 1356 } 1357 1357 … … 1368 1368 { 1369 1369 return str_replace( 1370 ['\\', "'", '"', "\n", "\r", "\t"],1371 ['\\\\', "\\'", '\\"', '\\n', '\\r', '\\t'],1372 $string1370 ['\\', "'", '"', "\n", "\r", "\t"], 1371 ['\\\\', "\\'", '\\"', '\\n', '\\r', '\\t'], 1372 $string 1373 1373 ); 1374 1374 } -
cryptx/trunk/cryptx.php
r3339444 r3340410 4 4 * Plugin URI: https://wordpress.org/plugins/cryptx/ 5 5 * Description: CryptX encrypts email addresses in your posts, pages, comments, and text widgets to protect them from spam bots while keeping them readable for your visitors. 6 * Version: 4.0. 06 * Version: 4.0.1 7 7 * Requires at least: 6.7 8 8 * Tested up to: 6.8 … … 40 40 41 41 // Plugin constants 42 define('CRYPTX_VERSION', '4.0. 0');42 define('CRYPTX_VERSION', '4.0.1'); 43 43 define('CRYPTX_PLUGIN_FILE', __FILE__); 44 44 define('CRYPTX_PLUGIN_BASENAME', plugin_basename(__FILE__)); … … 165 165 return $links; 166 166 }); 167 168 /** 169 * Encrypts the given content using the CryptX library and wraps it with a shortcode. 170 * 171 * @param string $content The content to be encrypted. 172 * @param array|null $args Optional arguments to customize the encryption process. 173 * 174 * @return string The encrypted content wrapped in the appropriate shortcode. 175 */ 176 if (!function_exists('encryptx')) { 177 function encryptx(string $content, ?array $args = []): string { 178 $cryptXInstance = Cryptx\CryptX::get_instance(); 179 $attributesString = $cryptXInstance->convertArrayToArgumentString($args); 180 $shortcode = '[cryptx' . $attributesString . ']' . $content . '[/cryptx]'; 181 182 return do_shortcode($shortcode); 183 } 184 } -
cryptx/trunk/readme.txt
r3339444 r3340410 2 2 Contributors: d3395 3 3 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4026696 4 Tags: antispam, email, mail, addresses, spam protection, email encryption, privacy4 Tags: antispam, mail, spam protection, email encryption, privacy 5 5 Requires at least: 6.7 6 6 Tested up to: 6.8 7 Stable tag: 4.0. 07 Stable tag: 4.0.1 8 8 Requires PHP: 8.1 9 9 License: GPLv2 or later … … 69 69 70 70 == Changelog == 71 71 = 4.0.1 = 72 * The "encryptx" function was mistakenly removed during code cleanup. The function has now been added back. (Thx to Jan: https://wordpress.org/support/topic/version-4-breaks-because-of-undefined-function-encryptx/) 72 73 = 4.0.0 = 73 74 * **Major Update**: Complete code refactoring and modernization
Note: See TracChangeset
for help on using the changeset viewer.