Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)
  • I’m not affiliated but yes, it seems it changed hands. What troubles me is:

    1. The silent way in which this happened – no announcement of any kind
    2. The same silent introduction of a PRO version and not a word about the faith of the free one
    3. The fact that it stopped working properly right after the plugin was acquired – they introduced the absolutely unneeded styling sugar along with bugs – not a good sign of their capabilities.

    None of the above is a good sign re the future of this plugin.

    Thread Starter ddenev

    (@ddenev)

    Aha, got it, thank you! I suspected that might be the problem but didn’t find any mention of this requirement πŸ™‚

    Have a nice day!

    Thread Starter ddenev

    (@ddenev)

    BTW, please check how SEOPress have implemented this – they have all the fields (as for pages) in a tabbed section for post categories terms.

    Thread Starter ddenev

    (@ddenev)

    I think I understand your point about being overwhelmed and TSF adding to the bulk – I think you want to keep TSF neat and simple (as possible) so that it keeps its distance from monsters like Yoast πŸ™‚

    But IMHO SEO is more about functionality rather than aesthetics. It’s more like Android rather than iOS, if you get my meaning πŸ™‚

    Your idea is better – could you do the same for taxonomies? Like adding settings (off by default if you want to have it tidy) for enabling social title/description/image for taxonomies?

    Thread Starter ddenev

    (@ddenev)

    Hi Sybre,

    Thank you for replying!

    Personally, I’m fine with the big list – I prefer functionality over aesthetics in this case. After all, this will only be visible in the admin area.

    The thing is that https://core.trac.ww.wp.xz.cn/ticket/36574 lies in the unknown future, it may be 1, 2, 3 years away. And I guess v3.2 for TSF is also at least 6 months away from now, right, maybe even more?

    Therefore I would prefer the ugly but useful implementation now rather than the polished one somewhere in the future πŸ™‚

    Regarding ideas – one idea would be to use taxonomy custom fields – TSF would use them only if defined and the mapping (between the custom fields and the TSF ones) could be done in the TSF settings. I know this might be a stupid idea but it’s the only one that comes to my mind that allows to not overwhelm every TSF user with a big list of fields if he/she does not need them.

    Thread Starter ddenev

    (@ddenev)

    Just to help – the following line in class-list-table.php:
    return array_values( array_unique( $tags, SORT_REGULAR ) );
    has to be replaced with:

    $tags = array_values( array_unique( $tags ) );
    sort($tags);
    return $tags;
    Thread Starter ddenev

    (@ddenev)

    Hi Shea,

    Just wanted to ask you if you plan a release soon. I’m really in need of this functionality and manually patching all my sites is tedious.

    Thank you again!

    Thread Starter ddenev

    (@ddenev)

    Hi Gaspar,

    Thank you for the detailed reply!

    One of the reasons I am asking is based on the following example situation: imagine a user enters the site and starts filling a form. If he/she is halfway with the form and then accepts the cookies then the page will be reloaded, the user will have lost the already entered data and will be VERY frustrated => this will lead to the user just abandoning the site, hence a lost conversion – all just because he/she decided to accept the cookies after starting to fill the form.

    I know of another cookie consent solution (Civicuk Cookie Control) which does not reload the page and deletes the cookies just fine when the user withdraws consent.

    Some additional comments:

    Currently the plugin reload the page to include the scripts defined

    I am sure scripts can be inserted without page reload. Google Tag Manager does this all the time πŸ™‚

    and the because the cookies shouldn’t be cleared immediately with javascript (only we can set the expiration to a past date) this task require reload

    Could you please elaborate a little bit more? Why shouldn’t the cookies be cleared with JS? Cookies are set with JS after all.

    Also we can inject the scripts when you accept the cookies, but we can’t remove the injected script only if we reload the page and re-inject the selected scripts by user.

    Also do not agree here. IMHO, you can perfectly remove the inserted scripts without page reload.

    In a summary, I don’t see any benefits in reloading the page, while there are certainly drawbacks (as described above).

    It is then good to hear that you are working on disabling the reload

    Best regards,
    Drago

    Thread Starter ddenev

    (@ddenev)

    @danieliser, now it works, thanks for the fix!

    Thread Starter ddenev

    (@ddenev)

    Hi Thomas,

    That is great, thank you very much!

    Best regards,
    Drago

    Thread Starter ddenev

    (@ddenev)

    Hi, Thomas

    Thank you very much for the solution!

    I see in the code that you have added the “generate_before_header” hook.

    Would you also add the “elementor/page_templates/canvas/before_content” hook as well?
    You can see in my code above how I use it.
    This is used in the Elementor’s canvas template which is used for pages that do not need a theme (e.g. landing pages, coming soon pages, etc.). And since it does not go via the theme, it would not call GP’s header.php, hence the “generate_before_header” hook will not be called and we need to hook into the special hook that Elementor provides for this case.

    Thank you again!

    Best regards,
    Drago

    Thread Starter ddenev

    (@ddenev)

    Hi Thomas,

    Here is the GeneratePress hook that IMHO you may use:
    https://docs.generatepress.com/article/generate_before_header/

    It is called right after the opening <body> tag.
    From the header.php:

    
    ...
    <body <?php generate_body_schema();?> <?php body_class(); ?>>
    	<?php
    	/**
    	 * generate_before_header hook.
    	 *
    	 * @since 0.1
    	 *
    	 * @hooked generate_do_skip_to_content_link - 2
    	 * @hooked generate_top_bar - 5
    	 * @hooked generate_add_navigation_before_header - 5
    	 */
    	do_action( 'generate_before_header' );
    ...
     

    This is the hook that I actually use in my code above.

    When you implement it, could you also implement hooking into the Elementor’s hook (as above) as well?

    Thank you and best regards,
    Drago

    Thread Starter ddenev

    (@ddenev)

    Hi,

    Thank you for your reply!

    One important clarification – it is not the body_class() that is called twice, it the get_body_class() function that is called which is a regular WP function and not a filter. This function’s purpose (you know that) is to provide the classes of the body tag. This means it may be called by any other plugin and code if it needs to know these classes and there is nothing in the WP docs that says that it should not be called more than once. The get_body_class() in turn applies the “body_class” filters, which is where you hook your code.

    With that clarified, I do not think that Tom (the GeneratePress developer) will agree to change his code, since it seems pretty legit.

    I also understand that you actually need to hook somewhere into the body tag and that this is the only (maybe? πŸ™‚ ) point at which this can be done. I also understand the need for the “code has been written” check.

    I could of course write to Tom but since to me this seems like a major problem to solve on a compatibility level (I am not saying that it is your plugin’s problem), I would suggest that you contact him and try to find a solution together. I wouldn’t want to be a proxy :). I think I provided enough information about the issue.

    Keep in mind that GeneratePress has a pretty large user base, so many people will benefit from the eventual solution.

    For now I applied a workaround – I keep the WPGTM setting to Off and use the following code in Code Snippets (putting here fr other to re-use if needed):

    
    // The <head> part
    add_action( 'wp_head', function () {
    	?>
    	<!-- Google Tag Manager -->
    	<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    	new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    	j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    	'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    	})(window,document,'script','dataLayer','GTM-XXXXXXX');</script>
    	<!-- End Google Tag Manager -->
    	<?php
    }, 0 );
    
    // The <body> part
    add_action( 'generate_before_header', 'custom_add_google_tag_manager_body' );
    add_action( 'elementor/page_templates/canvas/before_content', 'custom_add_google_tag_manager_body' );
    function dde_add_google_tag_manager_body () {
    	?>
    	<!-- Google Tag Manager (noscript) -->
    	<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXXX"
    	height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    	<!-- End Google Tag Manager (noscript) -->
    	<?php
    }
    

    To address your remarks as well:

    1. Unfortunately I am not aware of such a technique – how to find out if get_body_class() was not used to output the body class. I am not a WP dev and am not familiar with the API.
    2. I also tried the approach with the custom code placement but with the same result – here the main issue is that I am using the blank canvas of Elementor which is not calling the header.php but has its own (“plugins/elementor/includes/page-templates/canvas.php”) and this one cannot be used in a child theme – I rather have to use hooks.
    3. Thank you again for your support and have a nice day!

      Best regards,
      Drago

    Thread Starter ddenev

    (@ddenev)

    Hi Sebastian,

    Thank you very much for replying!

    I have the “Admin Bar Button” plugin installed and it adds a “Hide” link to the toolbar. Since Microthemer is adding its link with priority 999999, it is always the last. I would rather prefer to have the “Hide” link be the last.

    This is a very minor issue and I just wanted to know if I could do something myself (I do programming) to solve it, didn’t want to bother you fixing it yourself – I guess you have more important features to work on πŸ™‚

    Best regards,
    Drago

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