Credit link that if removed stops site from working

—————- UPDATE —————-

I do some change of the code provide by @Rizier123

Now it will accept to add a link in the citation varibale

You need to change the line of preg_match ( Thanks goes to @Rizier123) by this :

if(!preg_match("https://wordpress.stackexchange.com/" . preg_quote($citation_string, "https://wordpress.stackexchange.com/") . "https://wordpress.stackexchange.com/", $footer_contents))

so the final code will be like this :

add_action('template_redirect', 'foobar_explode_if_no_citation');
function foobar_explode_if_no_citation(){

#Get the absolute server path to footer.php
$footer_path = locate_template('footer.php');

#Store the footer file contents in a var
$footer_contents = file_get_contents($footer_path);

#The required string
$citation_string = 'Designed by Foo Bar <a href="http://YourLink.com">anchor</a>';

#Set off the nuclear bomb if there is an egregious offense
if(!preg_match("https://wordpress.stackexchange.com/" . preg_quote($citation_string, "https://wordpress.stackexchange.com/") . "https://wordpress.stackexchange.com/", $footer_contents))
    exit('All your websitez are belong to me. Make sure this string "Designed by Foo Bar" is included in footer.php');
}

? Who will work with this code ?

coders who worked days and night to provide great content, and just putting their citation words or link as a copyright..and dont want a user of the script remove it or replace it with his own without permission

it’s just a simple way to respect the copyright! respect coders.

Leave a Comment