How to fix Uninitialized string offset: error on a checkbox in WP Settings API

Most likely your $options is a string and not an array. It is always better to validate that the $options are in the format you are expecting especially in development time when you are likely to switch formats and too lazy to clean the DB when doing that. something like if (!isset($options[‘hide_avatar’])) $options[‘hide_avatar’] = 0; … Read more

Trying to understand order and frequency of action hooks firing

I’m not sure if you mean some custom login dialog, but let’s do some logging when we are on the wp-login.php page, where we fill the login form and press enter: #—————– # Page Load #1 #—————– 2015-11-24: 14:45:41 — $_SERVER: Array ( [REQUEST_URI] => /wp-login.php [SCRIPT_NAME] => /wp-login.php [DOCUMENT_URI] => /wp-login.php [REDIRECT_STATUS] => 200 … Read more

Insert terms for custom taxonomy on plugin activation, or each page load (init hook)

50 is relatively not much, and you should create them on the plugin activation hook. For more then 100 (just pulled the number out of my ass 😉 do your own testing on some slow shared hosting) I would create a settings page and initialize the DB from there. The reason is that users do … Read more

Where to add hooks in a class

Where to add hooks in a class? “In class-based object-oriented programming, a constructor (abbreviation: ctor) is a special type of subroutine called to create an object. It prepares the new object for use, often accepting arguments that the constructor uses to set required member variables.” Source: Wikipedia. The constructor is not the place to add … Read more

SMS registration and login [closed]

OTP Verification plugin verifies Email Address/Mobile Number of users by sending verification code(OTP) during registration. It removes the possibility of a user registering with fake Email Address/Mobile Number. This plugin checks the existence of the Email Address/Mobile Number and the ability of a user to access that Email Address/Mobile Number. I have not used this … Read more