mvied/wordpress-https

WPDB error when updating https_unsecure_external_urls

Opened this issue · 2 comments

I've just got this error message in version 3.3.0 (I've trimmed about 1MB of serialised array data from the SQL):

WordPress database error Got a packet bigger than 'max_allowed_packet' bytes for query UPDATE `wp_options` SET `option_value` = '..............................' WHERE `option_name` = 'wordpress-https_unsecure_external_urls' made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), do_action('template_redirect'), call_user_func_array, WordPressHTTPS_Module_Core->redirect_check, WordPressHTTPS->redirect, WordPressHTTPS->makeUrlHttps, WordPressHTTPS->addUnsecureExternalUrl, Mvied_Plugin->setSetting, update_option

This pushes the query over the limit (which caused error logs to grow at 2MB/s and the server's CPU to spike). I can increase the limit but it seems strange that the plugin is trying to update that much data. It looks like there's about 4000 URLs in the option_value, which I would have thought would be much less than 1MB.

Is this the expected behaviour or have I set something up wrongly?

I think this behavior is the way this plugin works. It was not built with this many URLs in mind, I think. The maintainer should move the secure/unsecure external urls to a table. This will make lookups and storage much more scalable.

The latest version (3.4.1) may address these issues, but I have not implemented the database caching in this version.