Can the uniqueness of the plugin file/plugin slug and version number be trusted?

Not really. There’s no 100% reliable way to guarantee that wordpress-seo/wp-seo.php on one site is the same plugin as wordpress-seo/wp-seo.php on another site, short of hashing the files, as you mentioned. It is highly unlikely that they are different plugins, but since there is no centralised system for registering unique plugin names, it cannot be … Read more

Associate multiple email addresses with the same user account, so they can log in with either

If you create them programmatically, you could set it up so that all of the usernames are one type of email address (business or personal) and the WP email address field contains the other type. It’s not clear if this would fit your particular use case, but one other login possibility is to integrate single … Read more

Call to undefined function is_home() or any conditional tags

It’s a timing issue. This tries to call is_home() before that function exists. $my_ver = check_home(); It works in the function called by add_action because then is_home() does exist because WP has fully loaded. If you load php files in your plugin, then you can call check_home anytime in those files. For example: define( ‘MY_PLUGIN_PATH’, … Read more

How best to handle database version dependence (from $wp_db_version)

I sorted this out. It looks like the core team rolls out new versions of the database with their beta program. So, it’s plenty easy to get advance warning. And, the database upgrades live in wp-admin/includes/upgrade.php. There’s a sequence of functions in there named things like upgrade_500, upgrade_560, upgrade_590. They’re named for the WordPress version … Read more

Undefined variable’s error when expected to have passed the content of variable [closed]

The problem is that the code ignores scope, a fundamental programming concept. This scope: function form_validation() { … $error_message=”Too short!”; … } and this scope: function save_to_db() { … … echo $error_message;… } Are not the same. It would be unreasonable and illogical to expect it to transfer over. When you assign $error_message a value … Read more