How to hide /wp-content/uploads/ from URL?

Had you considered actually moving the folder? WordPress allows to customize location of whole content folder or parts of it either. According to moving uploads folder in Codex, as simple as: define( ‘UPLOADS’, ‘blog/wp-content/uploads’ );

Is there a global action for when a plugin is uninstalled?

No, deactivated_plugin won’t fire during a plugin’s uninstallation process. But there are indeed two hooks that fire when a plugin is uninstalled: pre_uninstall_plugin, which is called right before a plugin is uninstalled. It acts globally, targeting any plugin. uninstall_{$file}, which fires after a specific plugin is uninstalled. Its scope it’s limited to a unique plugin … Read more

How do I check if my $wpdb->insert() was successful?

It returns either the number of rows inserted or false on error. Maybe you can get id of inserted recode or false if the insert fails: refer link: https://developer.wordpress.org/reference/classes/wpdb/insert/#return So you can check like below: $result_check = $wpdb->insert( $table, array(“name” => $name, “email” => $email)); if($result_check){ //successfully inserted. }else{ //something gone wrong }

Unable to add admin notice on plugin activation

As @MohammadLimon said I need to use the Transients API. The following code worked: register_activation_hook( __FILE__, ‘sp_subscriber_check_activation_hook’ ); function sp_subscriber_check_activation_hook() { set_transient( ‘mp-admin-notice-activation’, true, 5 ); } add_action( ‘admin_notices’, ‘sp_subscriber_check_activation_notice’ ); function sp_subscriber_check_activation_notice(){ if( get_transient( ‘mp-admin-notice-activation’ ) ){ ?> <div class=”updated notice is-dismissible”> <p>If you are using a caching plugin like W3TC or WP Super … Read more

Disable plugins for a specific user role

Try this one. I just changed only current_user_can(‘contributor’) instead of is_user_logged_in(). add_filter( ‘option_active_plugins’, ‘disable_logged_in_plugin’ ); function disable_logged_in_plugin( $plugins ) { // The ‘option_active_plugins’ hook occurs before any user information get generated, // so we need to require this file early to be able to check for logged in status require (ABSPATH . WPINC . ‘/pluggable.php’); … Read more

How to update WordPress plugin readme.txt description page without triggering a plugin update?

When you look at the plugin description (and other sections), it all comes from the current version README.TXT file. So if you upload a changed version of README.TXT to the current version’s repository (not changing the repository version number), the newly updated README.TXT file information is shown on the page. This is great for updating … Read more