dbDelta ALTER TABLE syntax?

You’ve used the dbDelta function incorrectly. The whole point of that function is you pass in a table creation SQL command. If the table doesn’t exist, it creates it. If the table exists but doesn’t match, it’s modified until it matches. This includes adding and updating columns, indexes, and other aspects. So what you want … Read more

WordPress scheduled task is called but not executed

I was having the same issue recently, until I followed an example from the WordPress Codex which suggests using action hooks to run the function. I think if you add the following… add_action( ‘recalculate_all_scores_hook’, ‘recalculate_all_scores’ ); …and amend the wp_schedule_event function to use the action hook name rather than the function directly… wp_schedule_event( time(), ‘fiveminutes’, … Read more

Making plugin unique to not conflict with plugins with the same name

Do you need the “View Details” link? It shouldn’t show up unless it’s a WP hosted plugin. Could you just name the plugin whatever you want, but change it with JS in the admin function my_enqueue($hook) { if ( ‘plugins.php’ != $hook ) { return; } wp_enqueue_script( ‘my_custom_script’, plugin_dir_url( __FILE__ ) . ‘changeName.js’, array( ‘jquery’ … Read more

Is there any way to test if a function running only on plugin update is successfully running?

Is there any way to test if a function running only on plugin update is successfully running? Yes. Background When you update a plugin, WordPress does several actions behind the scenes. Download the new version of the plugin Deactivate the old plugin version Delete the old plugin version Extract the new version Activate the new … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)