OllieJones / index-wp-mysql-for-speed

A plugin to add useful indexes to your WordPress installation's MySQL database.
GNU General Public License v2.0
125 stars 10 forks source link

Fatal Error Call to undefined function mb_convert_encoding() #66

Open ipajen opened 1 year ago

ipajen commented 1 year ago

Environment

When starting monitoring at /wp-admin/tools.php?page=imfs_settings&tab=monitor_database_operations

`[06-Aug-2023 17:42:21 UTC] PHP Fatal error: Uncaught Error: Call to undefined function mb_convert_encoding() in C:\wamp64\www\wordpress\wp-content\plugins\index-wp-mysql-for-speed-2f15cb4144129aea6b7e2ddff9e439c5a6518372\code\querymon.php:52 Stack trace:

0 C:\wamp64\www\wordpress\wp-includes\class-wp-hook.php(310): ImfsMonitor->imfsMonitorGather('')

1 C:\wamp64\www\wordpress\wp-includes\class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array)

2 C:\wamp64\www\wordpress\wp-includes\plugin.php(517): WP_Hook->do_action(Array)

3 C:\wamp64\www\wordpress\wp-includes\load.php(1252): do_action('shutdown')

4 [internal function]: shutdown_action_hook()

5 {main}

thrown in C:\wamp64\www\wordpress\wp-content\plugins\index-wp-mysql-for-speed-2f15cb4144129aea6b7e2ddff9e439c5a6518372\code\querymon.php on line 52`

OllieJones commented 1 year ago

Thanks for the defect report.

The monitoring function in this plugin requires the mbstring extension. Why? It's necessary reliably to parse queries gathered by the monitoring function. Queries may contain serialized text with unpredictable multibyte characters, and this corrects them.

w.org recommends including it in host php configurations. https://make.wordpress.org/hosting/handbook/server-environment/#php-extensions

I suppose it would be wise to disable the monitoring function if the mbstring extension is missing.