Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thanks for the suggested fix Vladski.
    We were also experiencing this problem after upgrade of PHP to 7.

    For anyone else reading this I had to amend the above code snippet slightly for it to work for us.

    The line:
    $output[$object->ID] = $pad . esc_html( apply_filters( 'list_pages', $object->post_title, $object ) ) . " (ID:{$object->ID})";

    Was changed to:
    $output[$object->ID] = $pad . esc_html( apply_filters( 'list_pages', $object->post_title, $object ) ) ;

    Which was what it was in the original file I had from the plugin vendor.

    Hi Charles,
    Thanks for the update.

    At my organisation we do appreciate what you provide as a free plugin and service.

    Thanks
    Warren

    This bug has been in the plugin for some time now. I think there is a duplicate ticket about this.
    https://ww.wp.xz.cn/support/topic/optimize-button-not-working/

    It seems to have been recognized as a bug by the plugin vendor some time ago but none of the subsequent releases has addressed the issue.

    I’d love to see this fixed too as we like to have the optimize on upload turned off and then bulk update periodically.

    fellow plugin user.
    Warren

    Hi all.
    I can confirm that we are experiencing the same issue and it also effects the “Bulk Optimise” feature.
    Late last year we decided to turn off “auto optimise” because it was confusing content authors to wait a few minutes while each image gets processed. (We are in Australia so there is a fair latency in communicating with your web service). We decided we try just bulk optimising periodically.

    I had noticed that the optimise feature hadn’t been working for us lately and put two and two together after reading this ticket.

    Hope this helps.
    Thanks
    Warren

    • This reply was modified 8 years, 4 months ago by warren.lees.

    Hi staceadams.
    We use the plugin on our site and I was seeing the same thing on a couple of cloned copies of our site recently. It seemed to happen as part of moving from one hoster to another. I could not see any technical reasons why this was not working. Nor could our support partner.
    I traced the code a little bit and this one line we were both seeing in the logs is at the start of the process and then it was like nothing else happened.

    Anyway with the help of our support partner they tried just disabling and then re-enabling the plugin and it is now working again.
    I did this on each copy of our site that had stopped working and so far it has resolved the issue.
    I can’t offer any more insight than that I’m afraid.

    Hope this helps
    Warren

    warren.lees

    (@warrenlees)

    Hi gibbsyns3.
    I recently installed this plugin and was initially finding this problem too with the Optimize all button. What I worked out was my local LAN security settings were preventing the application from completing the Ajax calls due to a timeout error/kill decision.

    When I ran the page on a server that was off my local LAN it was fine. On my local LAN the office security web filter was killing the process if took over about 1.5 mins to complete all the thumbnails for the image.

    You could see this happening in the browser debugger > console window.

    May not be relevant in your case but certainly was the cause for us and so was not the fault of the plug-in code.

    Hi again Maecia,
    I worked out what the problem was on our environment. A Sophos filter that our IT partner has monitoring all web traffic on our local environment was forcing the Ajax calls from the WordPress>ReSmush.it admin page to timeout after 60 seconds. So it was killing the jobs if it did not manage to get all thumbnails for an image processed within 60 seconds.
    I found it recording 504 (Timeout while reading response from Server) errors in the Browser Debugger (F12) > Console after a short period of time.

    When I run the “Optimize all pictures” button from a web browser that is off our normal LAN it continues to work through the queue of images as expected.

    So “it’s not you, it’s me” 🙂

    Thanks for the plug-in. Really impressed with what it does so far and will shortly start using on our Production environment.

    Hi Maecia,
    Hope you don’t mind me posting a question about resizing all images here rather than opening a new ticket. I can see this topic is still open.

    I have been testing the Optimize all your existing pictures feature at the moment with thousands of old images to get through.
    I find that the process only gets through one or two images each time I click the Optimize all pictures button.
    I have the logging enabled and can see it get through the original and all the thumbnails for one or maybe two images and then nothing further happens. There are quite a lot of Thumbnail sizes to get through on our implementation.

    It’s like a timeout setting or similar is maybe killing the process from moving on to the next item.
    Any ideas what might be causing this to halt the process?

    Thread Starter warren.lees

    (@warrenlees)

    One other thing to note. I tested in latest:
    – Chrome
    – Internet Explorer 11
    – MS Edge
    And all showed the same behaviour in our version of WordPress.

    Thread Starter warren.lees

    (@warrenlees)

    Haven’t received any response on this. For anyone reading this who may be interested in doing something similar I will include below the code changes I made to this plug-in in my own copy.

    In the plug-in file at:
    …./wp-content/plugins/metronet-tag-manager/metronet-tag-manager.php
    At approximately line 85 you will see this segment:

    public function filter_post_date( $total_match, $match, $post_id ) {
    		$post_date = get_post_field( 'post_date', $post_id );
    		return $post_date;
    	} //end filter_post_date

    After this add my 3 similar new functions

    //Added functions by WL @ TEQ to get extra custom data output
    	public function filter_post_categories( $total_match, $match, $post_id) {
    		$cats = array();
    		foreach (get_the_category($post_id) as $c) {
    		$cat = get_category($c);
    		array_push($cats, $cat->name);
    		}
    		if (sizeOf($cats) > 0) {
    		$post_categories = implode('|', $cats);
    		} else {
    		$post_categories = 'Not Assigned';
    		}
    		return $post_categories;
    	} //end filter_post_categories
    	public function filter_post_tags( $total_match, $match, $post_id) {
    		$tags = array();
    		foreach (get_the_tags($post_id) as $t) {
    		$tag = get_tag($t);
    		array_push($tags, $tag->name);
    		}
    		if (sizeOf($tags) > 0) {
    		$post_tags = implode('|', $tags);
    		} else {
    		$post_tags = 'Not Assigned';
    		}
    		return $post_tags;
    	} //end filter_post_tags
    	public function filter_post_type( $total_match, $match, $post_id) {
    		$post_type = get_post_type($post_id);
    		return $post_type;
    	}
    	//END Added functions by WL @ TEQ to get extra custom data output

    Then locate the section below (after my addition above it will be about line 230):

    //Filters for the GTM variables
    		add_filter( 'gtm_post_title', array( $this, 'filter_post_title' ), 9, 3 );
    		add_filter( 'gtm_author_name', array( $this, 'filter_author_name' ), 9, 3 );
    		add_filter( 'gtm_wordcount', array( $this, 'filter_wordcount' ), 9, 3 );
    		add_filter( 'gtm_logged_in', array( $this, 'filter_logged_in' ), 9, 3 );
    		add_filter( 'gtm_page_id', array( $this, 'filter_page_id' ), 9, 3 );
    		add_filter( 'gtm_post_date', array( $this, 'filter_post_date' ), 9, 3 );

    And immediately after this add my additional 3 filters

    //START Added functions by WL @ TEQ to get extra custom data output
    		add_filter( 'gtm_post_categories', array( $this, 'filter_post_categories'), 9, 3);
    		add_filter( 'gtm_post_tags', array( $this, 'filter_post_tags'), 9, 3);
    		add_filter( 'gtm_post_type', array( $this, 'filter_post_type'), 9, 3);
    		//END Added functions by WL @ TEQ to get extra custom data output

    And that is it.
    Having made these two simple additions you can now use the values
    %post_categories%
    %post_tags%
    %post_type%
    Inside the existing Plug-in config screens and output to GTM dataLayer all the tags and categories on your Posts.
    For us this was really helpful to allow us to apply different tracking tags in GTM based on what content Categories/Tags were used on the Post back in WordPress.

    Happy for anyone to use this as they see fit.
    And would be really happy if this could be included in a future release of the Plug-in.

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