• Resolved Alexander Celeste

    (@alexclst)


    One of my sites uses a custom shortcode I wrote for a contact list. The DOM structure of this output is like:

    <ul class="tgmpro-contacts-list" id="list-board"›
    <li class="tgpmpro-contact-item" onclick="showContact("list-board", "list-board-1515")" style="background-image: ur l(ht
    tps://rea.test/wp-content/uploads/membership_files/1515/pic/resized-mef_student_profile_the_rev_patricia_-bonilla_1000
    ×400-copy-200x200. png) ;">
    <div class="tgpmpro-contact-name bottom-wrap">@</div>
    <div class="tgpmpro-contact-role">Title</div>
    <div class="tgpmpro-contact-card list-board-card" id="list-board-1515" style="display: none;"›
    <div class="tgpmpro-contact-card-details">
    <div class="tgpmpro-contact-card-corner">@</div>
    <div class="tgpmpro-contact-card-name">Name</div>
    <div class="tgpmpro-contact-card-occupation">Occupation</div>
    <div class="tgpmpro-contact-card-institution">Company</div>
    <div class="tgpmpro-contact-card-location">City</div>
    <div class="tgpmpro-contact-card-email">name [at] gmail [dot] com</div>
    </div>
    </div>
    </li>
    </ul>

    CryptX in 3.x would have linked the email address, not just transformed it. But in 4.0.0 it is CryptX that is transforming the email, my code is only echoing the email address straight from the WP_User, but the address is not getting linked. This seems like a bug in the way CryptX 4.0.0 handles complex HTML differently.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Ralf Weber

    (@d3395)

    Hello Alexander,
    First of all, sorry for the inconvenience.

    Can you give me some more details about your shortcode that outputs the email address? I didn’t encounter any errors in my simple test with a shortcode that outputs your HTML code with the email address passed in as an attribute.

    I therefore need a little more information so I can replicate your situation and analyze the cause.

    Thread Starter Alexander Celeste

    (@alexclst)

    @d3395 The shortcode is fairly complex and interlaced as part of our custom add-on for the Paid Memberships Pro plugin and the Users Insights plugin. The site uses a custom child of the Astra theme. I’ve extracted the shortcode function and its direct dependencies to a Gist that you can look over:

    https://gist.github.com/alexclst/0830ea821dc8b9b00ad126c4e80cdbb2

    That also includes the content of the page with the shortcode. I know this may be more than you were bargaining for, but it gives you all the gory details to try and reproduce. For the moment I am just not updating the live website to CryptX 4.0.0 or above, but do have that update on my local copy of the website to be able to see the problem.

    Plugin Author Ralf Weber

    (@d3395)

    @alexclst this helps me a lot, thanks so far!

    Can you change some code in the CryptX class (version 4.0.1) on your local copy of the website to test something for me?
    In the file classes/CryptX.php:

    On line 103 change ‘$this->addAutoLinkFilters($filter, 10);‘ to ‘$this->addAutoLinkFilters($filter, 11);

    On line 394 change ‘$this->addAutoLinkFilters($widgetFilter, 11);‘ to ‘$this->addAutoLinkFilters($widgetFilter, 11);

    After this changes, are the mail addresses auto linked again?

    Thread Starter Alexander Celeste

    (@alexclst)

    @d3395 The change on line 103 did it. There was actually no change in the 394 line you mentioned above.

    Plugin Author Ralf Weber

    (@d3395)

    Thx for the feedback and the help.

    Version 4.0.2 with the changes is out now.

    Thread Starter Alexander Celeste

    (@alexclst)

    @d3395 The bug itself is fixed, but now the main page on my site that uses that shortcode a lot is noticeably slower to load with 4.0.2 than it is on 3.5.2. I feel like there is some sort of significantly slower performance with the newer encryption scheme than the compatible one. The fix is to switch schemes, but it may be worth clarifying somewhere the possible performance gap if CryptX would be used on a page, like where my shortcode gets used, that contains dozens of email addresses.

    Plugin Author Ralf Weber

    (@d3395)

    Hello @alexclst 🙂

    Thanks for the tip. I’ve added another option to select the number of PBKDF2 iterations. This allows you to choose between security and performance in three steps. In my tests with 1,000 email addresses on one page, the impact of the “Performance” setting was minimal. I hope this update and the new option help.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘4.0.0 Breaks Cryptx in Custom Shortcode Output’ is closed to new replies.