Skip to content

Instantly share code, notes, and snippets.

@gitname
Created October 30, 2014 20:19
Show Gist options
  • Save gitname/05fda3f62b7d5f93b0f9 to your computer and use it in GitHub Desktop.
Save gitname/05fda3f62b7d5f93b0f9 to your computer and use it in GitHub Desktop.
WordPress Plugin File Protection Instruction
<?php
/*
Plugin Name: My Plugin
Description: My Plugin
*/
// Put this instruction after the opening comments to disallow users from accessing the plugin file directly.
defined('ABSPATH') or die('Access denied. <a href="javascript:history.back();" title="Go back">Go back</a>');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment