Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter aheathgr

    (@aheathgr)

    Following up, I got this plugin working, and it’s truly a dream. Thank you so much – all the right config options, and a great admin interface.

    Mystery solved: activating the plugin manually in the GUI generated the tables as expected!

    Activating the plugin via WP CLI was failing in init.php because it can’t access register_activation_hook(): we fail is_admin() at that point.

    if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
    
    ...
    
            //Activate
            register_activation_hook( __FILE__, array( daexthefu_Admin::get_instance(), 'ac_activate' ) );
    
    }
    

    Updating the line as follows will allow us to maintain our current logic and allow WP CLI in as well:

    if ( (is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )) || ( defined( 'WP_CLI' ) && WP_CLI )) {

    Thanks again for a great plugin!

    Thread Starter aheathgr

    (@aheathgr)

    Hello! Sure thing – here’s my output from a clean WP install with WP_DEBUG set to true in wp-config.php.

    You’ll see me destroy and create a fresh db, install WP, and then install and activate the plugin. As you’ll see, the db isn’t creating the tables we expect, and there is no option to set. (I’m assumingdaexthefu_database_version is in wp_options, but just let me know if I’m wrong! ) There are no errors in the PHP log (PHP8).

    Thank you again so much for the support. I could zip this up and send it, there’s nothing sensitive in here.

Viewing 2 replies - 1 through 2 (of 2 total)