• Resolved chrisjdahl

    (@chrisjdahl)


    I’m running into an issue when I have a plugin (Plugin A) installed that uses version: 3.6.15 Redux.
    My plugin (Plugin B) uses Version 4.1.26.

    I receive the error Uncaught Error: Call to undefined method Redux::set_args() I think this is because Plugin A is loaded first and does not have the methods that Redux V4 uses.

    I used the provided here: https://devs.redux.io/guides/advanced/embedding-redux.html to embed the plugin (for if the user does not want to install Redux plugin)

    if ( !class_exists( 'ReduxFramework' ) && file_exists( dirname( __FILE__ ) . '/ReduxFramework/redux-core/framework.php' ) ) {
        require_once( dirname( __FILE__ ) . '/ReduxFramework/redux-core/framework.php' );
    }
    if ( !isset( $redux_demo ) && file_exists( dirname( __FILE__ ) . '/ReduxFramework/sample/sample-config.php' ) ) {
        require_once( dirname( __FILE__ ) . '/ReduxFramework/sample/sample-config.php' );
    }

    I tried changing the !class_exists to !method_exists( ‘ReduxFramework’, ‘set_args’ ) but this did not work.

    Deactivating Plugin A, or activating the installed WordPress Redux plugin resolves my issues. However, It would be nice if there was a solution or workaround for this?

    • This topic was modified 3 years, 4 months ago by chrisjdahl.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    We recently had issues with the previous versions of Redux. I would advise to update Redux to its latest version which is 4.1.29

    Plugin Author Kev Provance

    (@kprovance)

    Hi, Chris,

    I’m the current and one of the original developers for Redux.

    In addition to what Arreane said, I’d also offer the following.

    If this were me, I would contact the author of the plugin with the outdated version and suggest he update. Your plugin is trying to call API that is not available in v3, so yes, Plugin A is loading first and dominating the namespace. v4 has backward compatible API that supports old API.

    This is one reason we’ve never recommended embedding. Things like this happen when theme or plugin authors do not stay current. We’ve always recommended use of the plugin and something like TGM to distribute it. This way, everyone stays current, plus, the latest plugin is up to date in terms of security. v3 is FAR from and one reasons it was laid to rest. v4 fixed everything wrong from v3, plus anything new that crops up. If you user is balking at the thought of the plugin, I’d explain that the continued use of that old version of Redux in plugin A could be a security risk. One plugin to solve this is a better precaution. It’s also not a lie. Hopefully, plugin A author will step up and do the right thing. Porting over is practically seamless, plus, we’re here to help if he has issues.

    You could also try this, off the top of my head. I don’t guarantee it will work, as I’d have to try plugin A for myself. If plugin A is using the Redux API, you could, conceivably, set your plugin to load Redux in an earlier init action hook with a priority below 10. I’d start at 9 and work my way down. It might not work, however. It all depends on how plugin A is doing things. It could be worth a try.

    – Kev

    Thread Starter chrisjdahl

    (@chrisjdahl)

    Thank you both for your quick and well thought out responses!
    @kprovance I will reach out to the plugin author and also look into working with TGM so that I don’t need to embed Redux with my plugin.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Conflicting versions of Redux; blocks new version’ is closed to new replies.