Site logo

Archived topic

GPP hooks and MemberMouse issue

15 replies · Started by Stefan on June 20, 2017

Viewing posts 1–15 of 16

Hi,

I've got a little incompatibility issue which is described here: Getting 404 Errors When Clicking SmartTag Links. There is also a solution.

I found out that it's caused by GPP hooks. Is there any other solution (action hook or something) how can I resolve this issue without modifying core file?

Thank you for your help.
Regards,
Stefan

Hi there,

That would be an issue with adding javascript to the main editors in WP, not GP Hooks. Are you having issues with adding it to the page editors or hooks?

Hi Tom,

let me explain better. MemberMouse has a core page myaccount. Members on that page can modify theirs information but when I click on update button I get an error page. You can see here how myaccount page looks like (myaccout page )

When I disable Hook addon everything works as it should. It also works when I add 'javascript' to the $protocols (wp-includes/functions.php) and hook addon is on.

Otherwise every other funcionality of GP Premium of MemberMouse works good. I can add PHP code or some shortcodes to hooks and it works. Other funcionality of MemberMouse such as submitting the checkout form isn's affectedd by that problem.

I'm sorry I didn't describe this issue better for the first time.

Is there anything in your hook fields? I'm not sure how hooks could cause any error pages, unless the code added into one of them is the cause.

In After content hook is

<?php if (is_single() ) : ?>
[related_posts_by_tax format="thumbnails" columns="2" image_size="medium" title="My Related Posts" posts_per_page="2"]
<?php endif; ?>

It doesn't work even if I delete it.

I tried put this code to my child theme's function file

function gpmm_allow_javascript_protocol( $protocols ) {
$protocols[] = 'javascript';
return $protocols;
}
add_filter('kses_allowed_protocols', 'gpmm_allow_javascript_protocol' );

but it doesn't work either.
Maybe this has something to do with WordPress ticket

I tried that code

function gpmm_allow_javascript_protocol( $protocols ) {
$protocols[] = 'javascript';
return $protocols;
}
add_action('plugins_loaded', function(){add_filter('kses_allowed_protocols', 'gpmm_allow_javascript_protocol' );});
print_r(wp_allowed_protocols());

when Hook add-on activated the problem persists and no javascript protocol is added, but when i deactivate Hook add-on
I can see that javascript protocol is added and everything works.

Hmm, Hooks shouldn't care what functions you have added - it's literally a bunch of text boxes which add hook related functions for you.

Try this code:

function gpmm_allow_javascript_protocol( $protocols ) {
    $protocols[] = 'javascript';
    return $protocols;
}

add_action( 'after_setup_theme', function() {
    add_filter( 'kses_allowed_protocols', 'gpmm_allow_javascript_protocol' );
});

Unfortunately this didn't help. Still the same.

Update:

Maybe I found a solution.

I've created a simple plugin with one php file

<?php
/*
Plugin name: Allow javascript protocol
*/
function gpmm_allow_javascript_protocol( $protocols ) {
	$protocols[] = 'javascript';
	return $protocols;
}
add_filter( 'kses_allowed_protocols', 'gpmm_allow_javascript_protocol' );

added to the folder, uploaded and activated it.

Now javascript protocol is added, hooks add-on activated and on myaccount page button links don't point to http://test.dev/myaccount/myaccount_js.updateAccountDetails(20); but only to javascript:myaccount_js.updateAccountDetails(20);.

Everything works as it should.

Is this the right approach how to solve it?

Yep, I see no problem with that :)

Thank you, Tom.

Also thanks to rosshanney for the idea.

Tom, would you please check on affiliate applications. I just want to know if you can see my application there, because I didn't get any confirmation after I signed up.

Thanks.

Not seeing your application - can you try applying again?

This time I got a confirmation page. I hope you will see it there. :)

Approved :)

Tom, you are awesome.
Thank you.

I've run into this same issue, but the code snippet isn't working for me. I did switch to TwentyTwelve theme and the issue was still happening, so in my case the problem doesn't seem to be GP.

This archived topic is closed to new replies.