WordPress.org

Make WordPress Core

Opened 16 months ago

Last modified 9 months ago

#44582 new defect (bug)

Notice: Undefined property:stdClass::$plugin - wordpress

Reported by: sangwan4pankaj Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.9.7
Component: Plugins Keywords: reporter-feedback
Focuses: Cc:
PR Number:

Description

Notice: Undefined property: stdClass::$plugin in /hermes/bosnaweb07a/b1754/ipg.account_name/folder_name/wp-includes/class-wp-list-util.php on line 150

Change History (4)

#1 @MattyRob
15 months ago

  • Keywords reporter-feedback added

Hey sangwan4pankaj, welcome to Trac.

Please can you tell us where you are seeing this error message? Steps to reproduce would be very helpful. I think this coming from a core WordPress utility call for creating lists, but it may well also be in use from plugins or themes. The issue may therefore be with the plugin or theme rather than this being a core bug.

#2 @rogerlos
11 months ago

  • Component changed from General to Plugins

I have just had this pop-up in my local wordpress install, when visiting the "wp-admin/plugin-install.php".

I believe this is caused by a "rogue" plugin which has a very different object registered with $installed_plugins. In this case the "rogue" plugin is SearchWP--actually quite good bit of kit, aside from the fact that my windows dev box still cannot install upgrades of it because of the deeply nested structure and super-long filenames, but that is another ticket (#40795)...

If I dump $installed_plugins at line 252 of class-wp-plugin-install-list-table.php, I get a fairly neat (as in tidy) array where every plugin's object follows this pattern (using CMB2 as an example):

'cmb2' => 
    object(stdClass)[1931]
      public 'id' => string 'w.org/plugins/cmb2' (length=18)
      public 'slug' => string 'cmb2' (length=4)
      public 'plugin' => string 'cmb2/init.php' (length=13)
      public 'new_version' => string '2.4.2' (length=5)
      public 'url' => string 'https://wordpress.org/plugins/cmb2/' (length=35)
      public 'package' => string 'https://downloads.wordpress.org/plugin/cmb2.zip' (length=47)
      public 'icons' => 
        array (size=2)
          '2x' => string 'https://ps.w.org/cmb2/assets/icon-256x256.png?rev=1081087' (length=57)
          '1x' => string 'https://ps.w.org/cmb2/assets/icon-128x128.png?rev=1081087' (length=57)
      public 'banners' => 
        array (size=2)
          '2x' => string 'https://ps.w.org/cmb2/assets/banner-1544x500.png?rev=1081087' (length=60)
          '1x' => string 'https://ps.w.org/cmb2/assets/banner-772x250.png?rev=1081087' (length=59)
      public 'banners_rtl' => 
        array (size=0)
          empty
      public 'upgrade' => boolean false

Until we get to SearchWP, in this case version 2.9.13, where the object for it looks like this:

'searchwp' => 
    object(stdClass)[1924]
      public 'new_version' => string '2.9.17' (length=6)
      public 'stable_version' => string '2.9.17' (length=6)
      public 'name' => string 'SearchWP' (length=8)
      public 'slug' => string 'searchwp' (length=8)
      public 'url' => string 'https://searchwp.com/downloads/searchwp/?changelog=1' (length=52)
      public 'last_updated' => string '2018-11-27 08:30:24' (length=19)
      public 'homepage' => string 'https://searchwp.com/downloads/searchwp/' (length=40)
      public 'package' => string 'https://searchwp.com/edd-sl/package_download/XXX0XXX3XXXxXxxxXXXxXXxxXXXxXxXxX1X1XXX1Xxx1XXXlxXXxX1XxXxx4XxXxXXXxXXXxXxXxXXX1XXXxXxx1Xxx1XXxxXXX1XxXXXxx0xXXXXx1xxXXxxX1xXXx1XX==' (length=177)
      public 'download_link' => string 'https://searchwp.com/edd-sl/package_download/XXX0XXX3XXXxXxxxXXXxXXxxXXXxXxXxX1X1XXX1Xxx1XXXlxXXxX1XxXxx4XxXxXXXxXXXxXxXxXXX1XXXxXxx1Xxx1XXxxXXX1XxXXXxx0xXXXXx1xxXXxxX1xXXx1XX==' (length=177)
      public 'sections' => 
        object(stdClass)[1925]
          public 'description' => string '' (length=0)
          public 'changelog' => string '<p>2.9.17</p>'... (length=83111)
      public 'banners' => 
        object(stdClass)[1926]
          public 'high' => string '' (length=0)
          public 'low' => string '' (length=0)
      public 'icons' => string 'a:0:{}' (length=6)
      public 'description' => 
        array (size=1)
          0 => string '' (length=0)
      public 'changelog' => 
        array (size=1)
          0 => string '<p>2.9.17</p>'... (length=83111)
      public 'upgrade' => boolean true

There is no plugin property in this array, which is triggering the exception.

Here are the notices themselves:

( ! ) Notice: Undefined property: stdClass::$plugin in C:\wamp\www\wordpress\wp\wp-includes\class-wp-list-util.php on line 150
Call Stack
#	Time	Memory	Function	Location
1	0.0008	396152	{main}( )	...\plugin-install.php:0
2	1.8819	55825728	WP_Plugin_Install_List_Table->prepare_items( )	...\plugin-install.php:39
3	2.3318	56485400	wp_list_pluck( )	...\class-wp-plugin-install-list-table.php:253
4	2.3318	56485552	WP_List_Util->pluck( )	...\functions.php:3662

( ! ) Notice: Undefined property: stdClass::$plugin in C:\wamp\www\wordpress\wp\wp-includes\class-wp-list-util.php on line 150
Call Stack
#	Time	Memory	Function	Location
1	0.0008	396152	{main}( )	...\plugin-install.php:0
2	1.8819	55825728	WP_Plugin_Install_List_Table->prepare_items( )	...\plugin-install.php:39
3	2.3401	56486504	wp_filter_object_list( )	...\class-wp-plugin-install-list-table.php:254
4	2.3401	56487032	WP_List_Util->pluck( )	...\functions.php:3612

I guess while this seems like a plugin-specific issue (I have no idea if the original poster was also working with SearchWP), either a plugin should not be included in this array without at least doing a check of the object properties, or perhaps the list pluck utility needs to do a check to see if the property exists before trying to grab it. SearchWP was otherwise able to be activated, and if that's the case I would not expect a plugin which passes that "test" to cause an error on the "install plugins" page.

Note that disabling the plugin does not make this go away (I assume that the purpose on this install screen is to hide or otherwise indicate to users plugins that may already be installed, so it makes sense that disabling this without uninstalling it would still cause the error.)

Last edited 11 months ago by rogerlos (previous) (diff)

#3 @pento
9 months ago

#45957 was marked as a duplicate.

#4 @swissspidy
9 months ago

#46012 was marked as a duplicate.

Note: See TracTickets for help on using tickets.