Plugin Directory

Changeset 3340410


Ignore:
Timestamp:
08/06/2025 01:44:20 PM (8 months ago)
Author:
d3395
Message:

tagged version 4.0.1

Location:
cryptx
Files:
8 deleted
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • cryptx/tags/4.0.1/classes/Admin/PresentationSettingsTab.php

    r3339444 r3340410  
    8989                'scrambled' => [
    9090                    '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')
    9292                ],
    9393                'pngImage' => [
  • cryptx/tags/4.0.1/classes/CryptX.php

    r3339444 r3340410  
    158158    {
    159159        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                ]
    165165        );
    166166    }
     
    174174    {
    175175        $availableFonts = $this->getFilesInDirectory(
    176             CRYPTX_DIR_PATH . 'fonts',
    177             [self::FONT_EXTENSION]
     176                CRYPTX_DIR_PATH . 'fonts',
     177                [self::FONT_EXTENSION]
    178178        );
    179179
     
    219219
    220220        $decodedAttributes = array_map(
    221             fn($value) => $this->decodeString($value),
    222             $attributes
     221                fn($value) => $this->decodeString($value),
     222                $attributes
    223223        );
    224224        unset($decodedAttributes['encoded']);
     
    243243        if (!empty($attributes)) {
    244244            self::$cryptXOptions = shortcode_atts(
    245                 $this->loadCryptXOptionsWithDefaults(),
    246                 array_change_key_case($attributes, CASE_LOWER),
    247                 $tag
     245                    $this->loadCryptXOptionsWithDefaults(),
     246                    array_change_key_case($attributes, CASE_LOWER),
     247                    $tag
    248248            );
    249249        }
     
    714714
    715715                    $javaHandler = "javascript:secureDecryptAndNavigate('" .
    716                         $this->escapeJavaScript($encryptedEmail) . "', '" .
    717                         $this->escapeJavaScript($password) . "')";
     716                            $this->escapeJavaScript($encryptedEmail) . "', '" .
     717                            $this->escapeJavaScript($password) . "')";
    718718                } catch (\Exception $e) {
    719719                    // Fallback to legacy encryption if secure encryption fails
     
    732732            // Fallback to antispambot if JavaScript is not enabled
    733733            $return = str_replace('mailto:' . $emailAddress,
    734                 antispambot('mailto:' . $emailAddress), $return);
     734                    antispambot('mailto:' . $emailAddress), $return);
    735735        }
    736736
     
    738738        if (!empty(self::$cryptXOptions['css_id'])) {
    739739            $return = preg_replace('/(<a\s+[^>]*)(>)/i',
    740                 '$1 id="' . self::$cryptXOptions['css_id'] . '"$2', $return);
     740                    '$1 id="' . self::$cryptXOptions['css_id'] . '"$2', $return);
    741741        }
    742742
    743743        if (!empty(self::$cryptXOptions['css_class'])) {
    744744            $return = preg_replace('/(<a\s+[^>]*)(>)/i',
    745                 '$1 class="' . self::$cryptXOptions['css_class'] . '"$2', $return);
     745                    '$1 class="' . self::$cryptXOptions['css_class'] . '"$2', $return);
    746746        }
    747747
     
    805805        $linkPattern = "<a href=\"mailto:\\2\">\\2</a>";
    806806        $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"
    815815        ];
    816816        $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"
    825825        ];
    826826
     
    11231123        $str = htmlentities($str, ENT_QUOTES, 'UTF-8');
    11241124        $special = array(
    1125             '[' => '&#91;',
    1126             ']' => '&#93;',
     1125                '[' => '&#91;',
     1126                ']' => '&#93;',
    11271127        );
    11281128
     
    11851185
    11861186        $additional_links = [
    1187             $this->create_settings_link(),
    1188             $this->create_donation_link()
     1187                $this->create_settings_link(),
     1188                $this->create_donation_link()
    11891189        ];
    11901190
     
    12001200    {
    12011201        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')
    12051205        );
    12061206    }
     
    12141214    {
    12151215        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')
    12191219        );
    12201220    }
     
    13141314            // Determine which encryption method to use
    13151315            if ($encryptionMode === 'secure' &&
    1316                 $this->config->isSecureEncryptionEnabled() &&
    1317                 class_exists('CryptX\SecureEncryption')) {
     1316                    $this->config->isSecureEncryptionEnabled() &&
     1317                    class_exists('CryptX\SecureEncryption')) {
    13181318
    13191319                // Use modern AES-256-GCM encryption
     
    13241324
    13251325                    $javaHandler = "javascript:secureDecryptAndNavigate('" .
    1326                         $this->escapeJavaScript($encryptedEmail) . "', '" .
    1327                         $this->escapeJavaScript($password) . "')";
     1326                            $this->escapeJavaScript($encryptedEmail) . "', '" .
     1327                            $this->escapeJavaScript($password) . "')";
    13281328                } catch (\Exception $e) {
    13291329                    // Fallback to legacy if secure encryption fails
     
    13421342            // Fallback to antispambot if JavaScript is not enabled
    13431343            $return = str_replace('mailto:' . $emailAddress,
    1344                 antispambot('mailto:' . $emailAddress), $return);
     1344                    antispambot('mailto:' . $emailAddress), $return);
    13451345        }
    13461346
     
    13481348        if (!empty(self::$cryptXOptions['css_id'])) {
    13491349            $return = preg_replace('/(<a\s+[^>]*)(>)/i',
    1350                 '$1 id="' . self::$cryptXOptions['css_id'] . '"$2', $return);
     1350                    '$1 id="' . self::$cryptXOptions['css_id'] . '"$2', $return);
    13511351        }
    13521352
    13531353        if (!empty(self::$cryptXOptions['css_class'])) {
    13541354            $return = preg_replace('/(<a\s+[^>]*)(>)/i',
    1355                 '$1 class="' . self::$cryptXOptions['css_class'] . '"$2', $return);
     1355                    '$1 class="' . self::$cryptXOptions['css_class'] . '"$2', $return);
    13561356        }
    13571357
     
    13681368    {
    13691369        return str_replace(
    1370             ['\\', "'", '"', "\n", "\r", "\t"],
    1371             ['\\\\', "\\'", '\\"', '\\n', '\\r', '\\t'],
    1372             $string
     1370                ['\\', "'", '"', "\n", "\r", "\t"],
     1371                ['\\\\', "\\'", '\\"', '\\n', '\\r', '\\t'],
     1372                $string
    13731373        );
    13741374    }
  • cryptx/tags/4.0.1/cryptx.php

    r3339444 r3340410  
    44 * Plugin URI:        https://wordpress.org/plugins/cryptx/
    55 * 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.0
     6 * Version:           4.0.1
    77 * Requires at least: 6.7
    88 * Tested up to:      6.8
     
    4040
    4141// Plugin constants
    42 define('CRYPTX_VERSION', '4.0.0');
     42define('CRYPTX_VERSION', '4.0.1');
    4343define('CRYPTX_PLUGIN_FILE', __FILE__);
    4444define('CRYPTX_PLUGIN_BASENAME', plugin_basename(__FILE__));
     
    165165    return $links;
    166166});
     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 */
     176if (!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  
    22Contributors: d3395
    33Donate 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, privacy
     4Tags: antispam, mail, spam protection, email encryption, privacy
    55Requires at least: 6.7
    66Tested up to: 6.8
    7 Stable tag: 4.0.0
     7Stable tag: 4.0.1
    88Requires PHP: 8.1
    99License: GPLv2 or later
     
    6969
    7070== 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/)
    7273= 4.0.0 =
    7374* **Major Update**: Complete code refactoring and modernization
  • cryptx/trunk/classes/Admin/PresentationSettingsTab.php

    r3339444 r3340410  
    8989                'scrambled' => [
    9090                    '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')
    9292                ],
    9393                'pngImage' => [
  • cryptx/trunk/classes/CryptX.php

    r3339444 r3340410  
    158158    {
    159159        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                ]
    165165        );
    166166    }
     
    174174    {
    175175        $availableFonts = $this->getFilesInDirectory(
    176             CRYPTX_DIR_PATH . 'fonts',
    177             [self::FONT_EXTENSION]
     176                CRYPTX_DIR_PATH . 'fonts',
     177                [self::FONT_EXTENSION]
    178178        );
    179179
     
    219219
    220220        $decodedAttributes = array_map(
    221             fn($value) => $this->decodeString($value),
    222             $attributes
     221                fn($value) => $this->decodeString($value),
     222                $attributes
    223223        );
    224224        unset($decodedAttributes['encoded']);
     
    243243        if (!empty($attributes)) {
    244244            self::$cryptXOptions = shortcode_atts(
    245                 $this->loadCryptXOptionsWithDefaults(),
    246                 array_change_key_case($attributes, CASE_LOWER),
    247                 $tag
     245                    $this->loadCryptXOptionsWithDefaults(),
     246                    array_change_key_case($attributes, CASE_LOWER),
     247                    $tag
    248248            );
    249249        }
     
    714714
    715715                    $javaHandler = "javascript:secureDecryptAndNavigate('" .
    716                         $this->escapeJavaScript($encryptedEmail) . "', '" .
    717                         $this->escapeJavaScript($password) . "')";
     716                            $this->escapeJavaScript($encryptedEmail) . "', '" .
     717                            $this->escapeJavaScript($password) . "')";
    718718                } catch (\Exception $e) {
    719719                    // Fallback to legacy encryption if secure encryption fails
     
    732732            // Fallback to antispambot if JavaScript is not enabled
    733733            $return = str_replace('mailto:' . $emailAddress,
    734                 antispambot('mailto:' . $emailAddress), $return);
     734                    antispambot('mailto:' . $emailAddress), $return);
    735735        }
    736736
     
    738738        if (!empty(self::$cryptXOptions['css_id'])) {
    739739            $return = preg_replace('/(<a\s+[^>]*)(>)/i',
    740                 '$1 id="' . self::$cryptXOptions['css_id'] . '"$2', $return);
     740                    '$1 id="' . self::$cryptXOptions['css_id'] . '"$2', $return);
    741741        }
    742742
    743743        if (!empty(self::$cryptXOptions['css_class'])) {
    744744            $return = preg_replace('/(<a\s+[^>]*)(>)/i',
    745                 '$1 class="' . self::$cryptXOptions['css_class'] . '"$2', $return);
     745                    '$1 class="' . self::$cryptXOptions['css_class'] . '"$2', $return);
    746746        }
    747747
     
    805805        $linkPattern = "<a href=\"mailto:\\2\">\\2</a>";
    806806        $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"
    815815        ];
    816816        $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"
    825825        ];
    826826
     
    11231123        $str = htmlentities($str, ENT_QUOTES, 'UTF-8');
    11241124        $special = array(
    1125             '[' => '&#91;',
    1126             ']' => '&#93;',
     1125                '[' => '&#91;',
     1126                ']' => '&#93;',
    11271127        );
    11281128
     
    11851185
    11861186        $additional_links = [
    1187             $this->create_settings_link(),
    1188             $this->create_donation_link()
     1187                $this->create_settings_link(),
     1188                $this->create_donation_link()
    11891189        ];
    11901190
     
    12001200    {
    12011201        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')
    12051205        );
    12061206    }
     
    12141214    {
    12151215        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')
    12191219        );
    12201220    }
     
    13141314            // Determine which encryption method to use
    13151315            if ($encryptionMode === 'secure' &&
    1316                 $this->config->isSecureEncryptionEnabled() &&
    1317                 class_exists('CryptX\SecureEncryption')) {
     1316                    $this->config->isSecureEncryptionEnabled() &&
     1317                    class_exists('CryptX\SecureEncryption')) {
    13181318
    13191319                // Use modern AES-256-GCM encryption
     
    13241324
    13251325                    $javaHandler = "javascript:secureDecryptAndNavigate('" .
    1326                         $this->escapeJavaScript($encryptedEmail) . "', '" .
    1327                         $this->escapeJavaScript($password) . "')";
     1326                            $this->escapeJavaScript($encryptedEmail) . "', '" .
     1327                            $this->escapeJavaScript($password) . "')";
    13281328                } catch (\Exception $e) {
    13291329                    // Fallback to legacy if secure encryption fails
     
    13421342            // Fallback to antispambot if JavaScript is not enabled
    13431343            $return = str_replace('mailto:' . $emailAddress,
    1344                 antispambot('mailto:' . $emailAddress), $return);
     1344                    antispambot('mailto:' . $emailAddress), $return);
    13451345        }
    13461346
     
    13481348        if (!empty(self::$cryptXOptions['css_id'])) {
    13491349            $return = preg_replace('/(<a\s+[^>]*)(>)/i',
    1350                 '$1 id="' . self::$cryptXOptions['css_id'] . '"$2', $return);
     1350                    '$1 id="' . self::$cryptXOptions['css_id'] . '"$2', $return);
    13511351        }
    13521352
    13531353        if (!empty(self::$cryptXOptions['css_class'])) {
    13541354            $return = preg_replace('/(<a\s+[^>]*)(>)/i',
    1355                 '$1 class="' . self::$cryptXOptions['css_class'] . '"$2', $return);
     1355                    '$1 class="' . self::$cryptXOptions['css_class'] . '"$2', $return);
    13561356        }
    13571357
     
    13681368    {
    13691369        return str_replace(
    1370             ['\\', "'", '"', "\n", "\r", "\t"],
    1371             ['\\\\', "\\'", '\\"', '\\n', '\\r', '\\t'],
    1372             $string
     1370                ['\\', "'", '"', "\n", "\r", "\t"],
     1371                ['\\\\', "\\'", '\\"', '\\n', '\\r', '\\t'],
     1372                $string
    13731373        );
    13741374    }
  • cryptx/trunk/cryptx.php

    r3339444 r3340410  
    44 * Plugin URI:        https://wordpress.org/plugins/cryptx/
    55 * 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.0
     6 * Version:           4.0.1
    77 * Requires at least: 6.7
    88 * Tested up to:      6.8
     
    4040
    4141// Plugin constants
    42 define('CRYPTX_VERSION', '4.0.0');
     42define('CRYPTX_VERSION', '4.0.1');
    4343define('CRYPTX_PLUGIN_FILE', __FILE__);
    4444define('CRYPTX_PLUGIN_BASENAME', plugin_basename(__FILE__));
     
    165165    return $links;
    166166});
     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 */
     176if (!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  
    22Contributors: d3395
    33Donate 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, privacy
     4Tags: antispam, mail, spam protection, email encryption, privacy
    55Requires at least: 6.7
    66Tested up to: 6.8
    7 Stable tag: 4.0.0
     7Stable tag: 4.0.1
    88Requires PHP: 8.1
    99License: GPLv2 or later
     
    6969
    7070== 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/)
    7273= 4.0.0 =
    7374* **Major Update**: Complete code refactoring and modernization
Note: See TracChangeset for help on using the changeset viewer.