• Resolved Clayton Collie

    (@claytoncollie)


    Hi. We are bundling this plugin inside another plugin using Composer and WPackagist. Because we are autoactivating this plugin, the plugin is not firing the activation hook that creates the database tables resulting in an error in the admin. Can you please test this use case and add some checks around your query to the database to make it has the table, and if not, create them.

    They all relate to wp_lrga_widge_global_settings while selecting name and value.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Lara Google Analytics – Support

    (@laragoogleanalytics)

    Hello @claytoncollie,

    Adding a database check with each page/plugin request doesn’t seem to be a good idea, as it’ll add unnecessary extra calls to the database.

    If you are auto-activating the plugin using a custom mechanism, you can create a “mu-plugin”, which loads before all other plugins, and use it to either run the activation hook(s) or just create the required database entries.

    With that said, we’ll be thinking of better ways to handle cases like this.

    Thread Starter Clayton Collie

    (@claytoncollie)

    That is actually what I did. I copied your code from the activation script and dropped it into a function that fires on admin_init. I know it’s not the best solution to be firing all of the time but it works for now.

    The weird thing is that we use other plugins that create tables or options but this one is not. Have a look at MB Relationships. It creates a table and works perfectly with our setup. I wish i had more info about you can adjust your plugin.

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

The topic ‘Database error on installation with Composer’ is closed to new replies.