Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent fatal error if used with old version of Appsero Client #38

Merged
merged 3 commits into from
Jan 30, 2024

Conversation

nurul-umbhiya
Copy link
Contributor

@nurul-umbhiya nurul-umbhiya commented Jan 29, 2024

We are getting multiple fatal error reports after updating the Appsero/Client library. The use cases are virtually infinite. Let me explain a bit further.

  1. Some users are using the latest version of the Dokan Lite plugin and an old version of the Dokan Pro plugin. From the old version of Dokan Pro, Appsero\Client::updater() has been called and the user is getting a fatal error. In that case, there is no way the user will be able to update Dokan Pro since their site is inaccessible. Kindly check the error details here: FATAL ERROR =v3.9.9 Jan 29, 2024 getdokan/dokan#2160

  2. Site user updated Dokan or any other plugin with the latest version of Appsero/Client. Some plugins still use the old version configured. From there plugin Appsero\Client::updater() was called. The user is getting a fatal error.
    Below is an example:

2024-01-29T07:09:38+00:00 CRITICAL Uncaught Error: Call to undefined method Appsero\Client::updater() in /home/n8zviv35kkwy/public_html/wp-content/plugins/wp-mobile-bottom-menu-pro/wp-bnav-pro.php:66
Stack trace:
#0 /home/n8zviv35kkwy/public_html/wp-content/plugins/wp-mobile-bottom-menu-pro/wp-bnav-pro.php(84): appsero_init_tracker_wp_bnav_pro()
#1 /home/n8zviv35kkwy/public_html/wp-settings.php(473): include_once('/home/n8zviv35k...')
#2 /home/n8zviv35kkwy/public_html/wp-config.php(103): require_once('/home/n8zviv35k...')
#3 /home/n8zviv35kkwy/public_html/wp-load.php(50): require_once('/home/n8zviv35k...')
#4 /home/n8zviv35kkwy/public_html/wp-admin/admin-ajax.php(22): require_once('/home/n8zviv35k...')
#5 {main}
  thrown in /home/n8zviv35kkwy/public_html/wp-content/plugins/wp-mobile-bottom-menu-pro/wp-bnav-pro.php on line 66

Proposed Solution

The proposed solution will prevent the fatal error as well as display a deprecated warning to update the Appsero client library. Also, the proposed solution includes the new Updater Method ie: \Appsero\Updater::init( $this ) being called from the deprecated Client::updater() method.

PHP Deprecated:  Function Appsero\Client::updater is deprecated since version 2.0! Use \Appsero\Updater::init, for more details please visit: https://github.com/Appsero/updater instead. in /Users/wedevs/htdocs/dokan/wp-includes/functions.php on line 6031

included Appsero\Updater repository link on deprecated notice
update: changed doc url
@anisAronno anisAronno merged commit cc0224c into Appsero:develop Jan 30, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants