• Resolved seccyeth

    (@seccyeth)


    Hi,

    One of your plugin update completely broke compatibility with the great plugin from Tangible – Loops and Logic. This plugin allows creating templates with custom HTML code via WP admin panel. I guess this update totally broke this functionality, as all the HTML code I write there gets erased when posting the templates.

    I did a plugin troubleshooting, and found out that Masterstudy was responsible for this bug. I find it sad that, to fix a problem of yours, you had to implement something that would affect other plugins as well. I guess this is something you should fix, but as I’m well aware, it always takes you several months to fix breaking issues, so I’m not counting on you to fix this fast. As always, I’m going to look for a fix on my own…

    PS: if you could at least point me toward the file where you made those changes, maybe I could investigate further and more efficiently. Would appreciate it if you could, as I think I pinpointed the update responsible.

    • This topic was modified 2 years, 2 months ago by seccyeth.
Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Support juliastylemixthemes

    (@juliastylemixthemes)

    Hello @seccyeth,

    Thank you for reaching us out!

    We regret to inform you that we have not tested the Loops and Logic plugin with our LMS plugin and do not have experience in using such plugins. As a result, we are unable to offer any suggestions or details regarding the compatibility of the plugin.

    Could you kindly provide a detailed demonstration of the specific code or script from our plugin that is causing the issue? I will then forward it to our development team for consideration.

    Thank you in advance.

    Best regards,

    Thread Starter seccyeth

    (@seccyeth)

    Hi Julia,

    Although I understand you cannot test compatibility with every plugin, the issue is that it used to work, and Masterstudy is now plain preventing to use custom HTML. I’m not talking in Masterstudy’s course or anything, but in the plugin’s own interface, in the admin panel.

    It used to work, and I tried to determine which update broke compatibility, but as 3.1 introduced the new course player along with a database update, going back and forth with Masterstudy created database issues, and I had to restore my DB with a backup. All I can now say for sure is that it was working 3.0.23, which is how far I could test before breaking my website. So, my first feeling was wrong, it was not 3.0.22 that broke compatibility, but probably 3.1.

    I’m not asking you to fix this, although it would be great ofc, but as YOU made your plugin, I was hoping you could point me to where you implemented the changes in HTML filtering along with 3.1 update. This would allow me to debug and find a fix for this issue. Loops and Logic being paramount to my website, if rendered impossible to use, I’ll feel obligated to migrate toward LearnDash, which beneficit from deep integration.

    Plugin Support juliastylemixthemes

    (@juliastylemixthemes)

    HelloΒ @seccyeth,

    Thank you for information.

    We will be grateful if you can describe the issue in more detail and explain the steps of how you used Loops and Logic, for example, where did you add the code: to the course builder/course player, to the course or lesson page? And if possible, kindly send us a small code example. We will try to reproduce the issue. If the case is confirmed, we will forward the issue to our development team for consideration.

    Best regards,

    Thread Starter seccyeth

    (@seccyeth)

    Hi Julia,

    I can of course try to be more precise.

    L&L (Loops and Logic) allow writing custom HTML as templates. This custom HTML is not written inside any content, it is written in a dedicated admin area. You can then include those templates on any page, and they’ll render what you coded (basically, it’s writing PHP with HTML syntax). You can check examples on their page, but here is one:

    <ul>
      <Loop type=post count=3 orderby=date order=desc>
        <li>
          <a href="{Field url}"><Field title /></a>
        </li>
      </Loop>
    </ul>

    Please note that the code is NOT written in any Masterstudy area. It is written in another admin area dedicated to this plugin.

    The issue is not about this code not rendering. My templates are properly rendered. The issue is that Masterstudy PREVENTS me from writing and editing template in L&L admin area. You must have implemented something to filter custom HTML, but instead of applying this to Masterstudy only, it looks like it is affecting the whole website.

    Therefore, if I try to create a new L&L template, or edit an existing one, then all the custom HTML gets erased upon updating or saving the template. This issue happens with only L&L’s and Masterstudy’s plugin activated. It doesn’t happen with only L&L. To reproduce the issue, it’s pretty simple.

    1. Install Masterstudy free plugin
    2. Install Loops and Logic
    3. Copy the template provided as an example in the dedicated template area
    4. Save your template
    5. You’ll notice that all custom HTML is now gone, and be left with
    <ul>
      
        <li>
          <a href="{Field url}"></a>
        </li>
      
    </ul>

    Hey there @seccyeth !

    Thanks for the detailed explanation.

    We were able to replicate the scenario. Before, there was sanitize in the code, which is why it was working.

    I can guide you on where to check that function. It is located in _core/stm-lms-templates/questions/wrapper.php.

    <?php echo esc_html( $question_explanation ); ?>
    
    -> 
    
    <?php echo  $question_explanation; ?>
    
    or 
    
    <?php echo sanitize_text_field( $question_explanation ); ?>

    You can give it a try. Hope it helps!

    Thanks!

    Thread Starter seccyeth

    (@seccyeth)

    Hi Joseph,

    Thank you for acknowledging this issue. I have tried to apply the fix provided, but it did not solve the issue. Did you have any result with it? I’ve tried both options, and none worked for me.

    Just to be sure, I’m not having any problem with putting HTML or custom html in Masterstudy’s questions. My issue is that Masterstudy prevents the input of custom HTML by Loops and Logic’s templates area. If I try to add custom HTML there, it still gets erased.

    Plugin Support juliastylemixthemes

    (@juliastylemixthemes)

    Hello Joseph,

    Thank you for informing us.

    We would greatly appreciate it if you could send us the entire code that you are attempting to apply via the Loops and Logic plugin. We will try to replicate the issue on our testing site and investigate it.

    Best regards,

    Thread Starter seccyeth

    (@seccyeth)

    Hi Joseph and Julia,

    Why are you stalling like this… πŸ™ I’ve already sent you a piece of code in my previous message, any L&L code would replicate the issue. If you want, you can even put

    <Loop></Loop>

    And you’ll see it disappear.

    Best regards,
    Adrien

    Plugin Support juliastylemixthemes

    (@juliastylemixthemes)

    Hello Adrien (@seccyeth),

    Our apologize, I have forwarded the case to our dev team. We will inform you if there are any updates.

    Best regards,

    Plugin Support juliastylemixthemes

    (@juliastylemixthemes)

    Dear Adrien (@seccyeth),

    We have identified the issue and our development team will fix it and include it in the new version of the LMS plugin in one update if there are no critical issues.

    In the meantime, we can offer you a temporary solution. To apply the fix, we recommend commenting out the code from line 80:

    add_filter( 'content_save_pre', 'masterstudy_lms_allow_iframe_in_content' );

    in the file by the path plugins/masterstudy-lms-learning-management-system/includes/filters.php .

    Best regards,

    Thread Starter seccyeth

    (@seccyeth)

    Hi Julia,

    Sorry for the late answer. I’m glad you were able to find the culprit. I’ve applied your temporary fix, and it did solve my problem. I’ll be waiting for an update for a permanent fix.

    Thank you for your work, I’m glad we were able to find a solution.

    Best regards,

    Plugin Support juliastylemixthemes

    (@juliastylemixthemes)

    Hello @seccyeth,

    I’m glad to know that the issue is solved. We will release an update with the fix once it’s ready and inform you in the changelog here: https://docs.stylemixthemes.com/masterstudy-lms/changelog-free-version

    Best regards,

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

The topic ‘HTML filtering breaking compatibility’ is closed to new replies.