Title: PHP Error on Activation
Last modified: September 24, 2025

---

# PHP Error on Activation

 *  Resolved [jaroat](https://wordpress.org/support/users/jaroat/)
 * (@jaroat)
 * [8 months, 2 weeks ago](https://wordpress.org/support/topic/php-error-on-activation-12/)
 * Hi!
   The plugin (version 2.6.18) threw an error on activation in a newly set up
   multisite (but I believe it can also throw the error on a normal installation)
   on a PHP 8.4 host.**Caused by src/Upgrade/Ver2.php:**The lines`$role = get_role('
   auto_listings_seller' );$remove = array_keys( $role->capabilities );throw an 
   error since get_role returnes null on a fresh install (the queried role is not
   present yet) and array_keys awaits an array as parameter.You should be safe if
   you insert the following line in between:if ( empty( $role ) ) { return; }resulting
   in
 * `$role = get_role( 'auto_listings_seller' ); 
   if ( empty( $role ) ) { return;}
   $remove = array_keys( $role->capabilities );
    -  This topic was modified 8 months, 2 weeks ago by [jaroat](https://wordpress.org/support/users/jaroat/).
      Reason: better formatting, more precise

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

 *  Plugin Author [Anh Tran](https://wordpress.org/support/users/rilwis/)
 * (@rilwis)
 * [8 months, 2 weeks ago](https://wordpress.org/support/topic/php-error-on-activation-12/#post-18655748)
 * Hi [@jaroat](https://wordpress.org/support/users/jaroat/) ,
 * Thanks for your feedback. Let us check and fix the error.
 *  Plugin Author [Anh Tran](https://wordpress.org/support/users/rilwis/)
 * (@rilwis)
 * [8 months, 1 week ago](https://wordpress.org/support/topic/php-error-on-activation-12/#post-18666199)
 * We’ve fixed this issue in the latest version. Please update.

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

The topic ‘PHP Error on Activation’ is closed to new replies.

 * ![](https://ps.w.org/auto-listings/assets/icon-128x128.jpg?rev=1967501)
 * [Auto Listings - Car Listings & Car Dealership Plugin for WordPress](https://wordpress.org/plugins/auto-listings/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/auto-listings/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/auto-listings/)
 * [Active Topics](https://wordpress.org/support/plugin/auto-listings/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/auto-listings/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/auto-listings/reviews/)

## Tags

 * [bugfix](https://wordpress.org/support/topic-tag/bugfix/)

 * 2 replies
 * 2 participants
 * Last reply from: [Anh Tran](https://wordpress.org/support/users/rilwis/)
 * Last activity: [8 months, 1 week ago](https://wordpress.org/support/topic/php-error-on-activation-12/#post-18666199)
 * Status: resolved