Manage subscriptions, Page not found
-
Hi @steve92
Try this:
As for “you can also subscribe…” going to a 404 page, give this a try:
- Go to WP Admin > StCR > Management Page
- Set “Virtual management page” to “No” and save changes
- Go to WP admin > Pages > Add New and create a page called “Comment subscriptions”, the permalink should be comment-subscriptions
- For the content of the page add [stcr_management_page]
- Publish the page and check if it’s still a 404
Good, no more errors and now shows subscribers.
What should I do now with that new page?Hi @steve92
Keep it. In a future version of the plugin that page will be automatically created (not for you since you already have it) instead of using the “virtual page” which in some cases causes 404.
Good.
I have 2 sites, in one site I have to put this page to make your plugin work, the other site works even without this page.
So, I think the solution is not this page, but finding the problem at the source.Hi @steve92
By default it’s a virtual page, meaning a fake page. WordPress does not find a page at that URL but the plugin hooks into that part of the WordPress code and makes it think there is actually a page and shows it.
That doesn’t work out in all cases and lately we’ve been getting more and more complaints that it’s not working out. It should have been a real page from the start, not quite sure why it was made to be a virtual page, it was before we acquired the plugin.
A regular real page is better than a virtual page. And soon we’ll completely get rid of the virtual page approach and go with the real page approach by default.
I remember that when I first downloaded the plugin (years ago) everything worked.
Then you updated it and the problem started.Hi @steve92
You can download version 190214 which was the last update made by the previous owner of the plugin.
I don’t know which change that we did since February 2019 could have caused an issue with virtual pages and it’s not an issue I was able to replicate in order to figure out what’s causing it, as you said it works on one of your websites but not the other, so it’s not an issue that happens in all cases.
Please give the version 190214 a try and let me know if it works.
I installed v. 190214 and works without your file. I then updated it to v. 200813 and it doesn’t work, I have to put your file.
The theme is https://www.themehorse.com/themes/wp-portfolioBut I think the problem is in the plugin.
Hi @steve92
Just to confirm, virtual page works in the older version?
You’re a WordPress develope, correct (based on the website you sent over)? That’ll make things easier, I can send over some code changes for you to try out. Since I can’t replicate it on my installation to test changes, if you can do it on yours that would be great.
I confirm that the previous version does not show 404 error.
Send me the changes that I try on my site.Hi @steve92
Can you try the following:
File: wp_subscribe_reloaded.php
Line: 151You’ll see:
if ( empty( $request_uri_arr[1] ) || $request_uri_arr[1] == '/' || strpos( $request_uri_arr[1], '/?' ) === 0 ) { add_filter( 'the_posts', array( $this, 'subscribe_reloaded_manage' ), 10, 2 ); }Remove the if statement so it’s just the add_filter:
add_filter( 'the_posts', array( $this, 'subscribe_reloaded_manage' ), 10, 2 );That if statement was added back on April 22nd.
-
This reply was modified 5 years, 7 months ago by
WPKube.
No good.
Iput this #151// don't show management page if a "child page" if ( empty( $request_uri_arr[1] ) || $request_uri_arr[1] == '/' || strpos( $request_uri_arr[1], '/?' ) === 0 ) { add_filter( 'the_posts', array( $this, 'subscribe_reloaded_manage' ), 10, 2 ); } }+
Error 404Correct:
// if we are on the management page, filter the_posts if ( ( strpos( $_SERVER["REQUEST_URI"], $manager_page_permalink ) !== false ) ) { $request_uri = $_SERVER['REQUEST_URI']; $request_uri_arr = explode( $manager_page_permalink, $request_uri ); // don't show management page if a "child page" // if ( empty( $request_uri_arr[1] ) || $request_uri_arr[1] == '/' || strpos( $request_uri_arr[1], '/?' ) === 0 ) { add_filter( 'the_posts', array( $this, 'subscribe_reloaded_manage' ), 10, 2 ); } }-
This reply was modified 5 years, 7 months ago by
steve92.
Hi @steve92
I’m not 100% sure we understood each other.
This part of the code:
// don't show management page if a "child page" if ( empty( $request_uri_arr[1] ) || $request_uri_arr[1] == '/' || strpos( $request_uri_arr[1], '/?' ) === 0 ) { add_filter( 'the_posts', array( $this, 'subscribe_reloaded_manage' ), 10, 2 ); }Did you replace that whole part with this:
add_filter( 'the_posts', array( $this, 'subscribe_reloaded_manage' ), 10, 2 );If you did do that, and still got a 404, bring back the original code and then in the same file on line 707 you’ll see a function called
subscribe_reloaded_manage, as the first piece of code in that function (line 708) putexit();Then check the page, is it still a 404 or a blank page?
If it’s a 404 then we’ll know the issue is before that function gets called, if it’s a blank page we’ll know the issue is somewhere in the function.
#150
// don't show management page if a "child page" if ( empty( $request_uri_arr[1] ) || $request_uri_arr[1] == '/' || strpos( $request_uri_arr[1], '/?' ) === 0 ) { add_filter( 'the_posts', array( $this, 'subscribe_reloaded_manage' ), 10, 2 ); } }#707
public function subscribe_reloaded_manage( $_posts = '', $_query = '' ) { exit();404 error again
The topic ‘Manage subscriptions, Page not found’ is closed to new replies.

