Advertisement
afsarwebdev

wp-edit-prevention

Jan 27th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. //Rules: call the file into functions.php
  2. <?php
  3. $requested_url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
  4.  
  5. $restrict_paths = [ 'themes.php', 'theme-editor.php', 'plugins.php', 'plugin-editor.php', 'plugin-install.php' ];
  6.  
  7. if( $restrict_paths ){
  8.  
  9. foreach( $restrict_paths as $restrict_path ){
  10.  
  11. if (strpos($requested_url, $restrict_path) !== false) {
  12.  
  13. wp_die('Keep Silent! you can\'t access here for security reason');
  14.  
  15. }
  16.  
  17. }
  18.  
  19. }
  20. /**
  21. * The plugin bootstrap file
  22. *
  23. * This file is read by WordPress to generate the plugin information in the plugin
  24. * admin area. This file also includes all of the dependencies used by the plugin,
  25. * registers the activation and deactivation functions, and defines a function
  26. * that starts the plugin.
  27. *
  28. * @link https://itclanbd.com/
  29. * @since 1.0.0
  30. * @package Itclanbd
  31. *
  32. * @wordpress-plugin
  33. * Plugin Name: Afser
  34. * Plugin URI: https://itclanbd.com/
  35. * Description: This is a just helper plugin for themes of itclanbd.com
  36. * Version: 1.0.0
  37. * Author: ITclan BD
  38. * Author URI: https://itclanbd.com/
  39. * License: GPL-2.0+
  40. * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
  41. * Text Domain: itclanbd
  42. * Domain Path: /languages
  43. */
  44.  
  45. // If this file is called directly, abort.
  46. if ( ! defined( 'WPINC' ) ) {
  47. die;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement