Viewing 11 replies - 1 through 11 (of 11 total)
  • Steven

    (@shazahm1hotmailcom)

    Sorry, this does not seem to be an issue with ezTOC. From what I can tell, the CSS for the ASA flex items does not have the CSS being loaded on the page. I suggest reaching out to the ASA support team for assistance on having its CSS loading on the page.

    Thread Starter Kinghuebi

    (@kinghuebi)

    Hello Steven,

    but ASA 2 Plugin its function all times. But if i insert [toc] with a short code or insert it via click, then the whole Amazon layout is destroyed. So ezTOC must have some cause…

    I can give you login data over an other secure way if you want.

    Many thanks in advance.

    Mario

    • This reply was modified 3 years, 6 months ago by Kinghuebi.
    Steven

    (@shazahm1hotmailcom)

    Please see the screenshots. The correct page has the CSS and the page incorrect page does not.

    Thread Starter Kinghuebi

    (@kinghuebi)

    Hello Steven,

    the source for the conflict is ezTOC.

    If the shortcode [toc] is on a page, the ezTOC plugin uses the function “stripShortcodes” in the file includes/class.post.php. This removes all asa2 shortcodes contained in the $tags_to_remove array.

    Before:
    (
    [0] => wp_caption
    [1] => …
    [7] => asa2
    [8] => asa2_img
    [9] => asa2_collection
    [10] => asa2_textlink
    [11] => asa2_smart_collection
    [12] => asa2_keywords
    [13] => …
    [15] => ez-toc
    [16] => toc

    After:
    (
    [0] => wp_caption
    [1] => …
    [7] => asa2
    [8] => asa2_img
    [9] => asa2_collection
    [10] => asa2_textlink
    [11] => asa2_smart_collection
    [12] => asa2_keywords
    [13] => …
    [15] => ez-toc
    [16] => toc

    If the ASA2 shortcodes are added to the array $shortcodes on line 30 in the file includes/inc.plugin-compatibility.php, the error no longer occurs:

    $shortcodes = array (

    ‘asa2’,
    ‘asa2_img’,
    ‘asa2_collection’,
    ‘asa2_textlink’,
    ‘asa2_smart_collection’,
    ‘asa2_keywords’,

    If the ezTOC plugin did not remove these previously existing shortcodes, the problem would not arise. This should definitely be fixed, as it can certainly lead to conflicts with other plug-ins.

    Can you please clean this up with an update?

    Many thanks in advance.

    Mario

    Steven

    (@shazahm1hotmailcom)

    Sorry, but you are reading the code backward. The shortcodes in the array are the ones being removed. Not the ones not being removed. If you want the ASA shortcodes to be removed, you can hook into the ez_toc_strip_shortcodes_tagnames and add the as shortcodes.

    I hope this helps!

    ps. I really have no clue what ASA2 is.

    Thread Starter Kinghuebi

    (@kinghuebi)

    Hello Steven,

    thanks for the answer. I will give it to the developer.

    ASA2 is this: https://getasa2.com/

    Would it be possible to establish direct contact between you and the ASA 2 developer? Unfortunately, as an end user, I don’t understand any of this…

    Many thanks in advance.

    Steven

    (@shazahm1hotmailcom)

    If the developer wishes to be added to the shortcodes that are being removed, I can add a compatibility filter. Or they can add the filter to their plugin. I’m fine with either solution. The other dev can respond in this thread if it is helpful. Thanks!

    Timo

    (@worschtebrot)

    Hi Steven,

    hooking into the ez_toc_strip_shortcodes_tagnames filter is the solution I already recommended Mario to add in the functions.php, like this:

    
    add_filter('ez_toc_strip_shortcodes_tagnames', function ($tags_to_remove) {
        return array_merge($tags_to_remove, [
    	'asa2',
    	'asa2_img',
    	'asa2_collection',
    	'asa2_textlink',
    	'asa2_smart_collection',
    	'asa2_keywords',
        ]);
    });
    

    But what I don’t really understand: why does another plugin have to care that its own shortcodes still work? Shouldn’t your plugin do that itself or does your plugin not know about other shortcodes at this point? Maybe you can explain the context, I don’t doubt that you have a reason for it. ??

    Regards,
    Timo

    • This reply was modified 3 years, 6 months ago by Timo.
    • This reply was modified 3 years, 6 months ago by Timo.
    • This reply was modified 3 years, 6 months ago by Timo.
    • This reply was modified 3 years, 6 months ago by Timo.
    • This reply was modified 3 years, 6 months ago by Timo.
    Steven

    (@shazahm1hotmailcom)

    RE: Maybe you can explain the context, I don’t doubt that you have a reason for it.

    The filter exists to allow the output from the specified shortcodes to be excluded when processing the post content for headings. Why would I not know the context or reason for adding the filter?

    I can not know every plugin that exists and how it will interact with the post content, so a few filters can be hooked into excluded content. When a situation arises where a conflict/issue occurs, the filters can be leveraged to negate the conflict/issue. Really, no issues even need to exist to utilize the filters; they can be leveraged to exclude headings by plugin authors or users if they decide do not want content in the TOC.

    Anyway, I’m moving on … I tossed the filter in the plugin compact file; it’ll be in the next plugin update, Cheers!

    • This reply was modified 3 years, 6 months ago by Steven. Reason: Strikethrough question
    Steven

    (@shazahm1hotmailcom)

    <face-palm> I obviously need to learn to read, lol.

    Timo

    (@worschtebrot)

    Hi Steven, ok cool. Thanks for the details.

    Just in case, I will include the hook for my shortcodes in my next update. ??

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Conflict with ASA 2 Plugin’ is closed to new replies.