SMFHacks.com

Modifications/Themes => Modifications Talk => Topic started by: [chrisB] on November 29, 2022, 06:49:13 am

Title: Errors with SMF2WPBridge
Post by: [chrisB] on November 29, 2022, 06:49:13 am
I have tried various versions of WordPress 5.6.10/6.1.1 with SMF 2.1.3, but I always encounter an issue when logging out of WordPress.

Code: [Select]
call_user_func_array() expects parameter 1 to be a valid callback, function 'rest_cookie_collect_status' not found or invalid function name.
Would you also consider a pro (paid) version of this plugin? It would be nice to see some added features such as user group assignment. I don't think people would mind paying a fair fee for more advanced features, plus it enables you to spend your valuable time on the resources Just an idea.. I'm really keen on using SMF for my site.
Title: Re: Errors with SMF2WPBridge
Post by: SMFHacks on November 29, 2022, 09:00:39 am
On the wordpress side try editing bridge.php
Find
Code: [Select]
class_WP_SMFBridge (

Before it add
Code: [Select]
define( 'WP_SMF_BRIDGE_PLUGIN', __FILE__ );

define( 'WP_SMF_BRIDGE_PLUGIN_DIR', untrailingslashit( dirname( WP_SMF_BRIDGE_PLUGIN ) ) );

require_once WP_SMF_BRIDGE_PLUGIN_DIR . '/includes/rest-api.php';


In terms of a paid plugin, there is not enough of a market for it to spend time on. That goes for all SMF paid plugins at this point the peak was back in 2007 to 2010.
Title: Re: Errors with SMF2WPBridge
Post by: [chrisB] on November 29, 2022, 09:30:35 am
Like this?
Quote
define( 'WP_SMF_BRIDGE_PLUGIN', __FILE__ );
define( 'WP_SMF_BRIDGE_PLUGIN_DIR', untrailingslashit( dirname( WP_SMF_BRIDGE_PLUGIN ) ) );
require_once WP_SMF_BRIDGE_PLUGIN_DIR . '/includes/rest-api.php';
class WP_SMFBridge {

After I try to save, I get...
Code: [Select]
Your PHP code changes were rolled back due to an error on line 14 of file wp-content/plugins/WP2SMFBridge/bridge.php. Please fix and try saving again.

require_once(): Failed opening required 'wp-content/plugins/WP2SMFBridge/includes/rest-api.php' (include_path='.:/opt/alt/php74/usr/share/pear')

Thank you, I admire your contributions towards SMF.
Title: Re: Errors with SMF2WPBridge
Post by: SMFHacks on November 29, 2022, 09:43:32 am
Never mind that didn't do what I wanted it to do.

You can try just adding this line but it looks like it is included already

require ABSPATH . WPINC . '/rest-api.php';
Title: Re: Errors with SMF2WPBridge
Post by: [chrisB] on November 29, 2022, 09:51:24 am
Sorry, but where should it go? I tried to search for it but I couldn't find the line.
Title: Re: Errors with SMF2WPBridge
Post by: SMFHacks on November 29, 2022, 10:00:23 am
Replace the old code I gave you to add
Code: [Select]
class_WP_SMFBridge (

Before it add
Title: Re: Errors with SMF2WPBridge
Post by: [chrisB] on November 29, 2022, 10:05:10 am
Same error;

Code: [Select]
Your PHP code changes were rolled back due to an error on line 34 of file wp-includes/rest-api.php. Please fix and try saving again.

Cannot redeclare register_rest_route() (previously declared in wp-includes/rest-api.php:34)
Title: Re: Errors with SMF2WPBridge
Post by: SMFHacks on November 29, 2022, 10:07:54 am
Guess it didn't work.
The original guy who made is at  https://github.com/xchwarze/WP2SMFBridge but he no longer updates it.
I just updated it to with some SMF fixes.
Title: Re: Errors with SMF2WPBridge
Post by: [chrisB] on November 29, 2022, 10:16:59 am
I can appreciate that, if you happen to have any time would you be willing to look into it? I can provide you access to my test site (in case you don't use WordPress).

It's a real shame about the WordPress author.
Title: Re: Errors with SMF2WPBridge
Post by: [chrisB] on November 29, 2022, 12:18:32 pm
Reading the Github page, this is the first time I read:
[qoute]Uncheck "Enable local storage of cookies" and "Use subdomain independent cookie" in SMF. You can turn it off from Admin -> Configuration -> Server Settings -> Cookies and Sessions[/quote]

Could this be the reason? I enabled use subdomain indiependent cookie but messed up being able to login at all.
Title: Re: Errors with SMF2WPBridge
Post by: SMFHacks on November 29, 2022, 12:21:25 pm
I doubt it from the error. Because that is more of an SMF thing than wordpress.
Title: Re: Errors with SMF2WPBridge
Post by: [chrisB] on November 29, 2022, 04:30:26 pm
Yes, logging in via WordPress seems broken as well as signing out.
Title: Re: Errors with SMF2WPBridge
Post by: [chrisB] on December 04, 2022, 10:18:47 am
I'm trying to get the WordPress updated, I have a question if you don't mind.

How does the bridge handle member registration?

Do users register via WordPress and the bridge should send over that users' information into SMF?
Title: Re: Errors with SMF2WPBridge
Post by: SMFHacks on December 04, 2022, 11:28:57 am
If they register on Wordpress it should then auto register in SMF as well.
And vice versa as long as you have both plugins/mods installed.
Title: Re: Errors with SMF2WPBridge
Post by: [chrisB] on December 22, 2022, 05:27:10 pm
With PHP version 7.2 the script is a lot more stable and, in fact, works quite well with WordPress 6.1.1 - only issue is that WordPress signing in has no barring on the SMF side.

It produces this error:
Quote
16384: File session.php is <strong>deprecated</strong> since version 4.7.0 with no alternative available.

I apologise for my persistence with this; I am trying to just sort my migrating site out and tinkering with things is about the best I can do without asking questions. I honestly don't mean to be a nuisance or a pain. 😊

I'm still hoping the script can be updated but in the meantime, would you happen to have any suggestions regarding this error?
Title: Re: Errors with SMF2WPBridge
Post by: SMFHacks on December 28, 2022, 12:14:29 pm
Haven't had any time.

Session.php is on wordpress side would require research to see how that file was used before and what to do in the future
https://www.google.com/search?client=firefox-b-1-d&q=File+session.php+is+%3Cstrong%3Edeprecated%3C%2Fstrong%3E+since+version+4.7.0+with+no+alternative+available.
Title: Re: Errors with SMF2WPBridge
Post by: [chrisB] on December 31, 2022, 01:36:15 pm
Haven't had any time.

Session.php is on wordpress side would require research to see how that file was used before and what to do in the future
https://www.google.com/search?client=firefox-b-1-d&q=File+session.php+is+%3Cstrong%3Edeprecated%3C%2Fstrong%3E+since+version+4.7.0+with+no+alternative+available.
https://en-gb.wordpress.org/plugins/wp-native-php-sessions/
This seemed to fix the issue.

I could login with WordPress and on SMF I would be signed in. I could logout of any area and re-sign in without problems.

However, when I changed the PHP version from 7.2 to 7.4 it stopped logging in via WordPress.

Unless I struck lucky, or something.

I can't get WordPress to sign SMF in now though.