• Resolved harryfear

    (@harryfear)


    Steps to reproduce, invoke WP CRON

    Call to undefined function eos_dp_get_option()

    /wp-content/plugins/freesoul-deactivate-plugins/fdp-load.php in eos_dp_update_plugins_slugs_names at line 195

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jose

    (@giuse)

    Thank you @harryfear.

    That function fires only after a plugin is activated or updated.
    Probably when you invoke the WP CRON one or more plugins are updated.
    In any case, the function eos_dp_get_option() is defined in the file wp-content/mu-plugins/eos-deactivate-plugins.php which is called by WordPress before the file /wp-content/plugins/freesoul-deactivate-plugins/fdp-load.php where the error was triggered.
    This means the file eos-deactivate-plugins.php is not called when you invoke the WP CRON which is very strange.

    Can you please check the file wp-content/mu-plugins/eos-deactivate-plugins.php exists?

    I suppose it exists, in another case, FDP would not be able to disable any plugin. So I suspect the files in wp-content/mu-plugins are not called during the WP CRON in your case. If confirmed, this would not be a normal behavior.
    Do you have any code that defines a different path for WPMU_PLUGIN_DIR during the WP CRON?
    How do you invoke the WP CRON? Using WP CLI?

    For me, it would be easy to modify the code in fdp-load.php to avoid the error about the undefined function, but it would be better if we first understood what is going on, in another case, you could have other issues.

    Have a great day!
    Jose

    Thread Starter harryfear

    (@harryfear)

    Howdy Jose,

    Thanks for the detailed reply.

    The site doesn’t have any Must Use plugin files and no WPMU_PLUGIN_DIR defined. It seems we’re hit a bingo there, as this doesn’t exist:

    > wp-content/mu-plugins/eos-deactivate-plugins.php

    A missing plugin dependency in the Must Use folder is missing. Is this something that can be auto-detected and -healed by the plugin itself? I see no admin warnings for the same.

    I guess the context is a plugin being deactivated before upgrade by an updates manager plugin. CRON is enabled in wp-config. I don’t have the CLI in use.

    Best,

    Harry.

    Plugin Author Jose

    (@giuse)

    Hi @harryfear,

    when the file wp-content/mu-plugins/eos-deactivate-plugins.php doesn’t exist and you have Freesoul Deactivate Plugins active, you should see an error in the FDP backend pages that is very visible, with big fonts.
    Maybe you have some CSS in the backend that hides that error.

    However, without that file, FDP can’t disable any plugin. Hadn’t you noticed FDP was not working? All the plugins should be always and everywhere active without that file. This is why I suspected your mu-plugins folder is elsewhere.
    What do you see if you go to Plugins => Installed Plugins?
    Can you see the link “Must-Use”?
    If you see it and click on that link, can you see freesoul deactivate plugins [fdp]?

    When you activate or update Freesoul Deactivate Plugins, it writes the file eos-deactivate-plugins.php into the folder wp-content/mu-plugins.
    So, if you confirm that the mu-plugin doesn’t exist, try to deactivate, and then activate again Fresoul Deactivate Plugins.
    Be careful, you have only to deactivate it, not delete it. If you delete it you will lose all the settings.

    After doing so, can you see the file wp-content/mu-plugins/eos-deactivate-plugins.php? Or in Plugins => Installed Plugins => Must-Use, can you see freesoul deactivate plugins [fdp]?


    If you still don’t see it, via FTP, create the folder wp-content/mu-plugins, and manually copy that file from wp-content/plugins/freesoul-deactivate-plugins/mu-plugins/eos-deactivate-plugins.php to wp-content/mu-plugins/eos-deactivate-plugins.php.

    Have a great day!
    Jose

    Thread Starter harryfear

    (@harryfear)

    Hey Jose!

    I deactivated and reactivated the plugin, the file was created and the plugin interface now loads correctly and all is great.

    Before doing so, the plugin’s pages were not rendering properly and there were ‘critical error’ boxes coming up within the UI.

    Is it possible to enqueue a basic *global* admin notice that warns if the must-use file isn’t present?

    Plugin Author Jose

    (@giuse)

    Hi @harryfear

    sorry for my late answer. I don’t know why, but I didn’t see the notification about your relply.
    Anyway, FDP already shows an admin notice when that file misses. Maybe you didn’t see it because of a CSS conflict with another plugin, or because the fatal error occurred before that message.

    Have a great day!

    Jose

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘WP Cron Bug’ is closed to new replies.