require wp-load.php not working with role vendor

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM – Ultimate require wp-load.php not working with role vendor

Viewing 6 reply threads
  • Author
    Posts
    • #30908
      micha
      Participant

      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

    • #30938
      WCFM Forum
      Keymaster

      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

    • #30943
      micha
      Participant

      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 21

      I was hoping you might have an advise for me.

    • #30954
      WCFM Forum
      Keymaster

      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

    • #32998
      micha
      Participant

      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

    • #32999
      micha
      Participant

      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).

    • #33050
      WCFM Forum
      Keymaster

      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

Viewing 6 reply threads
  • The topic ‘require wp-load.php not working with role vendor’ is closed to new replies.