• Resolved Anas

    (@anashannoun)


    Hi there wpDataTables,

    Kudos on the good plugin and functionality.

    I’m trying to add a Custom JS script to do some minor functions on the tables. However i lose around half the script every time i save the wpDataTables settings.

    After some digging turns out the script gets sanitized by both sanitize_textarea_field and _sanitize_text_fields before it gets saved to the database which is major inconvenience.

    My workaround for now is to directly save the script directly in the wp_options table in the database but that’s rather troublesome every time i need to change some settings.

    I’d like to suggest the settings pages be saved separately as well as validating the custom javascript / CSS without actually having this getting super strictly sanitized by sanitize_text_fields.

    Also being able to have separate custom javascript files per table would be awesome!

    Cheers!

    Anas

    PS. I have the same issue on both the Lite and Premium versions.

Viewing 1 replies (of 1 total)
  • Plugin Author wpDataTables

    (@wpdatatables)

    Hello.
    Firstly, I sincerely apologize for the delayed response, as we have been experiencing an unusually high number of tickets. I am sorry that it has taken longer than usual to respond to your concern, and your patience is highly appreciated.

    Thank you for the kind words about the plugin, we appreciate it.

    1. In regards to the custom JS getting sanitized such as in your use-case, thank you for this feedback and for reporting that behaviour.

      We are passing this to our developers, and they will do their best to add suggested improvements as soon as possible.

      For any other improvement suggestions that you might have,
      please feel free to always search?on our suggestions page,?
      ?to see if someone may be already suggested this improvement/feature.
      If you can’t see it, feel free to add your suggestion there,??and as more people vote, the feature will move higher on the priority list.

      You can certainly follow our?changeLog page?if you’d like (?it is also available in the plugin dashboard), where we state any changes/new features/bug fixes during updates;and?our newsletter,?so you’re informed about new features, bug fixes, freebies, etc.

    For the time being, to avoid these issues and to ensure that your code gets passed in its entirety, it is best to add your JS directly to the WordPress page(s) to be safe,
    either by wrapping the JS in HTML script tag and adding it as Custom HTML with a page builder;
    or other methods to add JS directly to WP pages.

    2. In regards to the suggestion to add an option for separate custom javascript files per table; please add this to our development suggestions, too,
    and our devs will do their best to work on that as soon as possible.

    3. Yes, the behaviour for adding custom CSS and JS is the same on both Lite and Premium Versions, so when we improve that, it will be improved for both.
    Let us know if you have any additional questions or feedback about this.
    Thank you.

Viewing 1 replies (of 1 total)
  • The topic ‘Custom JS Sanitization.’ is closed to new replies.