WordPress Security tools

There are many precautions you can (and should) follow. Select good hosting/server. Set strong passwords for your hosting and FTP accounts. Don’t use servers that allow remote connections to the DB. If you want to host multiple sites on one server, make sure they’re separated (so one site can’t access files from other sites – … Read more

Extend WordPress Audio Widget to accept HLS (.m3u8) URLs

There is a filter, wp_audio_extensions, that should allow you to add m3u8 to the whitelist of allowed file extensions. Add this code to a child theme’s functions.php file, or using a plugin like Code Snippets: function wpse_341199_allow_m3u8_extension( $exts ) { $exts[] = ‘m3u8’; return $exts; } add_filter( ‘wp_audio_extensions’, ‘wpse_341199_allow_m3u8_extension’ );

Issue calling my functions on Plugin activate in WordPress

Please try below code my-plugin.php file <?php /** Plugin Name: My Plugin Plugin URI: http://##### Description: This plugin just for test Author: Chetan Vaghela Version: 1.0.0 Author URI: http://che##la.###/ */ if ( ! defined(‘ABSPATH’) ){ die; } if(!defined(‘MY_PLUGIN_PATH’)) { define( ‘MY_PLUGIN_PATH’, plugin_dir_path(__FILE__) ); } function mbp_activate(){ flush_rewrite_rules(); add_option( ‘my_plugin_activated’, time() ); } require_once MY_PLUGIN_PATH .’inc/mbp-plugin-activate.php’; … Read more

Make Widget appear on Dashboard

Widgets aren’t metaboxes, they can’t be added to the dashboard directly. wp_add_dashboard_widget expects a callable function, not a sidebar ID. You can’t plug a widget or a widget area/sidebar into a function like that. Instead, you would need to add a metabox, then, in its callback display what you wanted to display, e.g. add_action(‘wp_dashboard_setup’, ‘custom_dashboard_widgets’); … Read more