I can install my plugin in localhost but not in my server

Use this code register_activation_hook(__FILE__, ‘rating_install’); register_deactivation_hook(__FILE__, ‘rating_uninstall’); function rating_install(){ global $wpdb; $table_name = $wpdb->prefix.”rating”; $create = “CRETA TABLE “.$table_name.” ( ” . “id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY, ” . “url TINYTEXT NOT NULL, ” . “descripcion TINYTEXT NOT NULL ) “; $wpdb->query($create); } function rating_uninstall(){ global $wpdb; $table_name = $wpdb->prefix.”rating”; $drop … Read more

Refresh or redirect page after activate my plugin

You should be able to do something like this: register_activation_hook(__FILE__, ‘my_plugin_activate’); add_action(‘admin_init’, ‘my_plugin_redirect’); function my_plugin_activate() { add_option(‘my_plugin_do_activation_redirect’, true); } function my_plugin_redirect() { if (get_option(‘my_plugin_do_activation_redirect’, false)) { delete_option(‘my_plugin_do_activation_redirect’); wp_redirect(MY_PLUGIN_SETTINGS_URL); } }

Fetch User Meta Data

All of this can be done using WP_User_Query: $users = new WP_User_Query(array( meta_query( array( ‘key’ => ‘login_status’, ‘value’ => ‘0’ ), array( ‘key’ => ‘active_code’, ‘value’ => ‘3f7431e226893f16cbe44424850d00ad’ ) ) )); This will return a list of users that meet your requirements. Then you can get the ids like so: $user_ids = wp_list_pluck( $users->get_results(), ‘ID’ … Read more

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