Greg Mount
Forum Replies Created
-
Confirmed. Thanks!
I can confirm this issue. Tested on all websites we host. Broke after upgrading core to 6.7.
This is a DigitalOcean managed database. The error is caused because the MySQL system variable ‘sql_require_primary_key’ is set, as is the case with many managed databases. It’s possible to disable the setting, but not advisable. A better solution would be to add a sequential “entry_id” and use it as the table’s unique primary key.
Although the table contains non-sequential data, sequential IDs can be more efficient in terms of storage and indexing. Random or non-sequential identifiers might lead to index fragmentation, which can slow down query performance in some cases.
- This reply was modified 2 years, 10 months ago by Greg Mount.
Forum: Plugins
In reply to: [Admin and Site Enhancements (ASE)] PHP Warning on Password Protected LoginLooks like that did the trick. No errors logged and functionality still working. Thanks for the quick fix and great work on the plugin.
Any movement on this issue?
Hey Jess. Thanks for the detailed response and especially for the link to the constant values article. Since the original post, we have shifted to using constants to define settings.
For bonus points, it’s also helpful to define conditional constants for WPMS in wp-config.php based on the hosting environment. For example, we define PHP Mailer constants for our development environment, which is configured to send all mail to a specific test account. In production, we configure email to be sent using SendGrid.
This enables us to migrate sites between development, staging and production environments without worrying about transactional email. Here’s a snippet of what we use:
if ( ! preg_match( '/(^dev\.)|(\.dev$)/', $_SERVER['HTTP_HOST'] ) ) { // Production environment only define( 'WPMS_MAILER', 'sendgrid' ); define( 'WPMS_SENDGRID_API_KEY', 'API key required' ); // Enter SendGrid API key } else { // Development environment only define( 'WPMS_MAILER', 'mail' ); }