Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Finland93 authored Oct 6, 2023
1 parent c824da6 commit 7882261
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions all-in-one-content-protection.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php
/*
Plugin Name: All in one Content protection
Plugin URI: https://github.com/Finland93/AllInOneContentProtection
Description: WordPress plugin empowers you to safeguard your website's content effortlessly. With just a click, this plugin adds an extra layer of security and protection to your valuable text, images, and multimedia elements. It prevents unauthorized actions and enhances your website's copyright protection.
Version: 1.0
Author: Finland93
Author URI: https://github.com/Finland93
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

// Exit if directly accessed
if (!defined('ABSPATH')) {
exit;
}


// Add custom JavaScript to the footer
function add_custom_footer_script() {
echo '<script>
document.addEventListener(\'contextmenu\', event => event.preventDefault());
console.log("%cSTOP!", "color: red; font-size: 80px; font-weight:bolder;");
console.log("%cThis website is protected by copyright laws!", "font-size: 20px; font-weight:bold;");
console.log("%cCopying is strictly prohibited!", "font-size: 20px; font-weight:bold;");
</script>';
}
add_action('wp_footer', 'add_custom_footer_script');

// Add custom CSS to the head
function add_custom_head_css() {
echo '<style>
@media print {
html, body {
display: none;
}
}
p, h1, h2, h3, h4, h5, h6, img, iframe, br, li, ul, a, div {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
img, picture, a {
-webkit-user-drag: none;
-khtml-user-drag: none;
-moz-user-drag: none;
-o-user-drag: none;
user-drag: none;
}
</style>';
}
add_action('wp_head', 'add_custom_head_css');

0 comments on commit 7882261

Please sign in to comment.