loading...

WP-edit prevention

Category: WordPress

<?php
//Rules: call the file into functions.php
$requested_url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];

$restrict_paths = [ 'themes.php', 'theme-editor.php', 'plugins.php', 'plugin-editor.php', 'plugin-install.php' ];

if( $restrict_paths ){

	foreach( $restrict_paths as $restrict_path ){

		if (strpos($requested_url, $restrict_path) !== false) {

			wp_die('Keep Silent! you can\'t access here for security reason');

		 }

	}

}
/**
 * The plugin bootstrap file
 *
 * This file is read by WordPress to generate the plugin information in the plugin
 * admin area. This file also includes all of the dependencies used by the plugin,
 * registers the activation and deactivation functions, and defines a function
 * that starts the plugin.
 *
 * @link              https://itclanbd.com/
 * @since             1.0.0
 * @package           Itclanbd
 *
 * @wordpress-plugin
 * Plugin Name:       Afser
 * Plugin URI:        https://itclanbd.com/
 * Description:       This is a just helper plugin for themes of itclanbd.com
 * Version:           1.0.0
 * Author:            ITclan BD
 * Author URI:        https://itclanbd.com/
 * License:           GPL-2.0+
 * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
 * Text Domain:       itclanbd
 * Domain Path:       /languages
 */

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
	die;
}