| @@ -68,9 +68,14 @@ | ||
| 68 | 68 | return $key ? $plugin_data[$key] : $plugin_data; |
| 69 | 69 | } |
| 70 | 70 | public static function is_updater_library_available(): bool |
| 71 | 71 | { |
| 72 | - return Plugin::is_pro_edition(); | |
| 72 | + if (method_exists(Plugin::class, 'is_pro_edition')) { | |
| 73 | + return Plugin::is_pro_edition(); | |
| 74 | + } | |
| 75 | + // WordPress can run the old Plugin class against the newly installed files during an upgrade. | |
| 76 | + $plugin_directory = dirname(WIND_PRESS::FILE); | |
| 77 | + return is_file($plugin_directory . '/vendor/easy-digital-downloads/edd-sl-sdk/edd-sl-sdk.php') || is_file($plugin_directory . '/vendor/rosua/edd-sl-plugin-updater/src/PluginUpdater.php'); | |
| 73 | 78 | } |
| 74 | 79 | public static function random_slug(int $length = 21): string |
| 75 | 80 | { |
| 76 | 81 | return (new \WindPressDeps\Hidehalo\Nanoid\Client())->generateId($length, \WindPressDeps\Hidehalo\Nanoid\Client::MODE_DYNAMIC); |