Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Ultimate › require wp-load.php not working with role vendor
- This topic has 6 replies, 2 voices, and was last updated 6 years, 1 month ago by WCFM Forum.
- AuthorPosts
- September 5, 2018 at 10:12 pm #30908michaParticipant
I started to program a plugin. When I want to use it (opening the plugin URL) everything works fine, except if I login as a user with the role “vendor” then requiring the wp-load.php is not working.
//Load wordpress to allow querying of woocommerce data
require(‘../../../wp-load.php’);It works with different user roles like “shop-manager” etc. It also works with a “vendor” role if I just disable the WCFM plugin.
Do you have an idea what could be the reason for this issue?
Thanks in advance
- September 6, 2018 at 8:15 am #30938WCFM ForumMember
Hi,
Opps! That’s something impossible and mysterious.
Which mult-vendor plugin you are using?
Between,I am not getting your these words -“I started to program a plugin.”
Are you trying to create a custom plugin?Thank You
- September 6, 2018 at 8:50 am #30943michaParticipant
I’m using Dokan and yes I’m programming on a custom plugin. Actually, I’m extending an existing one to be able to show all orders of a customer in a vendor account after the costumer provided their customer id (via qr code on a customer card).
I’m also astonished about that behavior. Especially, because it works after deactivating the WC Frontend Manager Plugin.
I get the following fatal error (only with WCFM activated and logged in as a “Vendor” user):
[06-Sep-2018 08:33:54 UTC] PHP Fatal error: Uncaught Exception: Hybridauth requires the use of ‘session_start()’ at the start of your script, which appears to be disabled. in /…/wp-content/plugins/dokan-pro/includes/lib/Hybrid/Storage.php:21
Stack trace:
#0 /…/wp-content/plugins/dokan-pro/includes/lib/Hybrid/Auth.php(117): Hybrid_Storage->__construct()
#1 /…/wp-content/plugins/dokan-pro/includes/lib/Hybrid/Auth.php(55): Hybrid_Auth::initialize(Array)
#2 /…/wp-content/plugins/wc-frontend-manager-ultimate/core/class-wcfmu-vendor-verification.php(119): Hybrid_Auth->__construct(Array)
#3 /…/wp-content/plugins/wc-frontend-manager-ultimate/core/class-wcfmu-vendor-verification.php(24): WCFMu_Vendor_Verification->wcfm_vendor_auth_requests()
#4 /…/wp-content/plugins/wc-frontend-manager-ultimate/c in /…/wp-content/plugins/dokan-pro/includes/lib/Hybrid/Storage.php on line 21I was hoping you might have an advise for me.
- September 6, 2018 at 10:06 am #30954WCFM ForumMember
Hi,
Kindly send me that custom plugin, I think it has some codes which causing this.
Between, did you checked by deactivating this custom plugin?
Thank You
- October 1, 2018 at 7:35 pm #32998michaParticipant
Hi,
I read again what is exactly stated in the error message. Add session_start();
Thus, I added the following on the beginning of the php script which is producing the error:/**
* Initialize session at start
*/
function init_session() {
if ( session_id() == ” ) {
session_start();
}
}
init_session();Now it works.
Now I only get a warning:
Warning: session_start(): Cannot send session cache limiter – headers already sent (output started at … on line 20 - October 1, 2018 at 7:50 pm #32999michaParticipant
The warning disappeared as I made sure that the php script doesn’t send ANY content before calling session_start (so I put it at the absolute beginning).
- October 2, 2018 at 2:32 pm #33050WCFM ForumMember
Hi,
Such warnings only come if your site has some other errors or some code printed things before WP load properly.
Can you check this from your site’s view source?
Also, as you are using WCFM Ultimate then please disable Dokan Verification module, it’s not required.
One more thing, please be sure you have Dokan and Dokan Pro versions compatible to each other!
Thank You
- AuthorPosts
- The topic ‘require wp-load.php not working with role vendor’ is closed to new replies.