WordPress.org

Ready to get started?Download WordPress

Forums

Repost
[resolved] Welcome Pointer will not stay gone. (11 posts)

  1. Kurt Flint
    Member
    Posted 8 months ago #

    Hi there, small bug, so I made this easy for you: the Welcome pointer in Admin for the Content Feeds button will not go away.

    I sat down and started to debug it, (woot! commented Javascript. Oh, maybe you should minify that) and I suddenly realized that just this once the relationship goes the other way from the norm! We report a bug to you and you fix it instead of us hearing about something from someone and having assign someone to fix it based on a terrible write up like this one!

    Bad news is: We have only installed it on one site, so we don't have the ability to tell you too much, and to make matters worse there is a lot of kruft on that site. Maybe you could one-off a copy of the plugin without that entire bit of script. Set "if(TRUE)" and package it up. We've seen it, know that the button is there, and would just like to see the three buttons below yours more often.

    /**
    	 * Welcome ppinter
    	 **/
    	/** Check that pointer support exists AND that text is not empty */
    	if(typeof(jQuery().pointer) != 'undefined' && repost_content_ajax_object.pointers.length) {
    	    for (var p in repost_content_ajax_object.pointers) {
    		var ptr = repost_content_ajax_object.pointers[p];
    		jQuery(ptr.pointerTarget).pointer({
    			content    : ptr.pointerText,
    			close  : function() {
    				jQuery.post( ajaxurl, {
    					pointer: ptr.pointerHandle,
    					action: 'dismiss-wp-pointer'
    				});
    			}
    		}).pointer('open');
    	    }
    	}

    Thanks again, and if you contact me I'll dig up more detail. The debugger I was using was freezing when I stepped up to the most interesting lines.

    Kurt
    DynamicMarketConcepts

    http://wordpress.org/plugins/repostus/

  2. Kurt Flint
    Member
    Posted 8 months ago #

    Oh, my boss, who provides the content for this site likes the experiment (no effort syndication) a lot, so much so we haven't even checked if it is helping or hindering that site's SEO yet. But new analytic and SEO A/B testing start the moment this gets fixed, it was scheduled for yesterday. So please, in all seriousness let me know what you think ASAP so I can decide to run the testing with or without your content.

    Thank you,
    Kurt

  3. freerange
    Member
    Plugin Author

    Posted 8 months ago #

    That's odd, right now we can't reproduce it - can you answer some questions to help us track down the issues?

    what version of WP core are you using?

    what version of the Repost plugin?

    Are there any javascript errors in the browser console log?

  4. freerange
    Member
    Plugin Author

    Posted 8 months ago #

    We did see one bug that meant that only one pointer could be dismissed at a time, but the second one should go away if you dismiss it a second time.

    If you email us at support@repost.us we have a replacement admin.js we'd like to send you to try

  5. Kurt Flint
    Member
    Posted 8 months ago #

    WP 3.6, Your 4.03, and I believe that when the flurry of ajax and jQuery errors happened as I opened your page the Admin.js said it was a 3.6 or so.

    Well, I have neither the time nor manpower this week to chase it down. And I'm two programmers and an artist short at the moment going into a huge project, so while shaking my fist at the idiot on the Chromium team who thought that F11 would be an excellent key to use for "resume execution" since people so rarely use it for "Toggle Full Screen" I'm going to have to let this one go.

    Thanks,
    Kurt

    CTO
    DynamicMarketConcepts

  6. freerange
    Member
    Plugin Author

    Posted 8 months ago #

    Understood, we'll put the new admin.js through QA and probably push 4.04 on Monday or Tuesday.

  7. Kurt Flint
    Member
    Posted 8 months ago #

    I'd say that at one point the one pointer fix did work then, because I was surprised to see two when I went to the dashboard. I _knew_ that the first one worked during setup.

    The second one, well we have had to dismiss it on every admin page view for two or three weeks now.

    I'd do more if I had time. I've been doing a lot of the content loading myself over the last four or five days, and now understand the level of annoyance! imagine trying to use your W3 Cache, Better Security, P3, Backup... I've got a lifetime English habit, so like so many people with the same language roots I tend to scan everything left to right, top to bottom. Your poor plug-in broke down in the fast lane of the admin pages!

    Thanks
    Kurt

    Ps, I didn't continue, but where does it write that the user has seen it? Does it delete a transient, or write to an option, or (hope not) use ajax to send an update to your server? If it is any of the above, up to and including header/post hacking to send you a "fixed" http, all of those things are QED for us.

  8. freerange
    Member
    Plugin Author

    Posted 8 months ago #

    The actual pointer code is a wordpress supplied utility function - when you dismiss it it makes an ajax call that stores the handle of the dismissed pointer in a user-meta entry. That entry gets checked before we set the pointer on page load.

    The bug we just fixed was causing us to dismiss the same pointer twice if both our pointers were displayed. However it should have cleared on for good the second time it was dismissed.

    Here is the revised code

    /**
    	 * Welcome pointer
    	 **/
    	/** Check that pointer support exists AND that text is not empty */
    	if(typeof(jQuery().pointer) != 'undefined' && repost_content_ajax_object.pointers.length) {
    	    for (var p in repost_content_ajax_object.pointers) {
    		var ptr = repost_content_ajax_object.pointers[p];
    		doPointer(ptr);
    	    }
    	}
    
    	//NB ptr is in closure so the callback gets the right one
    	function doPointer(ptr) {
    	    jQuery(ptr.pointerTarget).pointer({
    		    content    : ptr.pointerText,
    		    close  : function() {
    			    jQuery.post( ajaxurl, {
    				    pointer: ptr.pointerHandle,
    				    action: 'dismiss-wp-pointer'
    			    });
    		    }
    	    }).pointer('open');
    	}

    The dismiss action is this fragment

    jQuery.post( ajaxurl, {
    				    pointer: ptr.pointerHandle,
    				    action: 'dismiss-wp-pointer'
    			    });

    It calls the admin ajax handler with a dismiss-wp-pointer action and the handle of the pointer to dismiss.

    The bug in the old code was that the ptr value was updated in the for loop so the value picked up in the dismiss was the wrong pointer half the time if both were displayed.

  9. freerange
    Member
    Plugin Author

    Posted 8 months ago #

    forgot to ask - which browser do you use?

  10. Kurt Flint
    Member
    Posted 8 months ago #

    Well, I see two handles, which makes sense now that I know the dashboard is back. I will switch to firebugs and see what I can finagle.

  11. Kurt Flint
    Member
    Posted 8 months ago #

    Ok, I should probably have you give me an address where I can send you the entire request and response raw.

    I do have the same plugin (from the same zip) on two sites, and the other worked, so it is some sort of conflict.

    I could put it on a pastebin link.

    By the way, how are you liking that server? Is the N set up as a reverse proxy or is it the one and only?

Reply

You must log in to post.

About this Plugin

About this Topic