codesnippetspro/code-snippets

Fatal error on update of plugin

Closed this issue · 4 comments

Prerequisites

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • The issue still exists against the latest stable version of Code Snippets.

Type of Bug

Plugin Settings

Description

I just updated the Code Snippets plugin and received this:

Screenshot 2023-11-11 at 23 27 20

Steps to reproduce

Update the plugin to the newest version as of 11 November 2023.

I am using Twenty Twenty Two.
WordPress 6.4.1
https://myactingportfolio.com/

I am using the link in the recovery WordPress email.

Screenshot 2023-11-11 at 23 32 51

Isolating the problem

  • This bug happens with only the Code Snippets plugin active (Free or Pro).
  • This bug happens with a Blank WordPress theme active. For example: (Hello theme).
  • I can reproduce this bug consistently following the steps above.

Comment

See the above information.

Looks like we're trying to use a pluggable function before it's been loaded.

This only affects new installs that require initial setup of the cloud oauth data.

Well I have a few sites that use the free and the premium version of the plugin. I noticed a moment ago that my easywebdesigntutorials.com site also had the same fatal error.

When seeking help with this issue, you may be asked for some of the following information:
WordPress version 6.3.2
Active theme: Blocksy (version 1.9.11)
Current plugin: Code Snippets Pro (Premium) (version 3.6.2)
PHP version 7.4.33

Error Details

An error of type E_ERROR was caused in line 239 of the file /home/easywebd/public_html/wp-content/plugins/code-snippets-pro/php/cloud/class-cloud-api.php. Error message: Uncaught Error: Call to undefined function Code_Snippets\Cloud\wp_generate_password() in /home/easywebd/public_html/wp-content/plugins/code-snippets-pro/php/cloud/class-cloud-api.php:239
Stack trace:
#0 /home/easywebd/public_html/wp-content/plugins/code-snippets-pro/php/cloud/class-cloud-api.php(82): Code_Snippets\Cloud\Cloud_API->init_oauth_sync()
#1 /home/easywebd/public_html/wp-content/plugins/code-snippets-pro/php/class-plugin.php(126): Code_Snippets\Cloud\Cloud_API->__construct()
#2 /home/easywebd/public_html/wp-content/plugins/code-snippets-pro/php/load.php(65): Code_Snippets\Plugin->load_plugin()
#3 /home/easywebd/public_html/wp-content/plugins/code-snippets-pro/code-snippets.php(62): require_once('/home/easywebd/...')
#4 /home/easywebd/public_html/wp-settings.php(462): include_once('/home/easywebd/...')
#5 /home/easywebd/public_html/wp-config.php(89): require_once('/home/easywebd/...')
#6 /home/easywebd/public_html/wp-load.php(50): require_once('/home/easywebd/...')
#7 /home/easywebd/public_html/wp-lo

I switched between PHP 8.1 and 8.0 with all plugins deactivated.
Activating Code Snippet Pro produced the following error.

An error of type E_ERROR was caused in line 33 of the file /home/L/labhusetno/www/dev/wp-content/plugins/code-snippets-pro/vendor/freemius/wordpress-sdk/require.php. Error message: Uncaught Error: Failed opening required '/home/L/labhusetno/www/dev/wp-content/plugins/code-snippets-pro/vendor/freemius/wordpress-sdk/includes/managers/class-fs-plugin-manager.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/L/labhusetno/www/dev/wp-content/plugins/code-snippets-pro/vendor/freemius/wordpress-sdk/require.php:33

Stack trace:

#0 /home/L/labhusetno/www/dev/wp-content/plugins/code-snippets-pro/vendor/freemius/wordpress-sdk/start.php(486): require_once()

#1 /home/L/labhusetno/www/dev/wp-content/plugins/code-snippets-pro/php/class-licensing.php(38): require_once('/home/L/labhuse...')

#2 /home/L/labhusetno/www/dev/wp-content/plugins/code-snippets-pro/php/class-plugin.php(134): Code_Snippets\Licensing->__construct()

#3 /home/L/labhusetno/www/dev/wp-content/plugins/code-snippets-pro/php/load.php(65): Code_Snippets\Plugin->load_plugin()

#4 /home/L/labhusetno/www/dev/wp-content/plugins/code-snippets-pro/code-snippets.php(62): require_once('/home/L/labhuse...')

#5 /home/L/labhusetno/www/dev/wp-settings.php(473): include_once('/home/L/labhuse...')
#6 /home/L/labhusetno/www/dev/wp-config.php(95): require_once('/home/L/labhuse...')
#7 /home/L/labhusetno/www/dev/wp-load.php(50): require_once('/home/L/labhuse...')
#8 /home/L/labhusetno/www/dev/wp-admin/admin-ajax.php(22): require_once('/home/L/labhuse...')
#9 {main}

thrown

Closing this as I believe the issue has since been fixed in more recent versions of Code Snippets.