Coder Social home page Coder Social logo

lesterchan / wp-ban Goto Github PK

View Code? Open in Web Editor NEW
21.0 8.0 10.0 171 KB

Ban users by IP, IP Range, host name, user agent and referrer url from visiting your WordPress's blog.

Home Page: https://wordpress.org/plugins/wp-ban/

PHP 100.00%
ban wp-ban ban-users wordpress wordpress-plugin lesterchan

wp-ban's Introduction

Hi there 👋

👨‍💻 About Me

🌏 I blogged about gadgets at lesterchan.net.

🥞 Currently working in Grab as a Engineering Manager, Full Stack.

⏪ Previously, I was the Head of Engineering in Tech in Asia.

🔌 During my free time (which I do not have much now), I am a WordPress Plugins Developer.

🔎 Find Me

Email: lesterchan@gmail.com            LinkedIn: https://www.linkedin.com/in/lesterchan            Twitter: @gamerz            Instagram: @gamerz

Latest Blog Posts on lesterchan.net

GitHub Stats

Lester Chan's GitHub Stats

wp-ban's People

Contributors

alexclassroom avatar aranaur avatar jsgm avatar lesterchan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wp-ban's Issues

Fatal Error after Update to WP 4.3

Hi,

after I upate my Site to WP 4.3 I've got this error in my logfiles

2015/08/18 21:40:31 [error] 13515#0: *980600 FastCGI sent in stderr: "PHP message: PHP Fatal error: Cannot redeclare get_language_attributes() (previously declared in /var/www/...../wp-includes/general-template.php:2624) in /var/www/...../wp-content/plugins/wp-ban/wp-ban.php on line 238" while reading response header from upstream, client: 173.XXX.XX.XXX, server: domain.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.domain.com"

I've i try to reinstall WP-Man over the admin Panel i get this error

Fatal error: Cannot redeclare get_language_attributes() (previously declared in /var/www/...../wp-includes/general-template.php:2624) in /var/www/..../wp-content/plugins/wp-ban/wp-ban.php on line 243

Additonal Information
I am using Wordpress with nginx with fastCGI Support.

Recommend changing status codes for ban messages

Currently this plugin responds with a 200 status code for ban messages. This can cause caching systems to cache the page for users who are not banned, resulting in them seeing the ban message even though they are not banned. I would recommend responding with a 401 or 403 status code (or making this configurable.

For example, Pantheon's CDN will cache the banned message if a banned visitor accesses a page before other visitors causing the ban message to be shown to all users until that page falls out of the cache.

Error

hi,
this plugin not active after installation
and when click on active show error:

! ) Fatal error: Call to undefined function get_language_attributes() in C:\wamp\www\wp-content\plugins\wp-ban-master\wp-ban.php on line 283
Call Stack

Time Memory Function Location

1 0.0010 425120 {main}( ) ..\plugins.php:0
2 2.4211 61055056 do_action( ) ..\plugins.php:157
3 2.4211 61056576 call_user_func_array:{C:\wamp\www\wp-includes\plugin.php:496} ( ) ..\plugin.php:496
4 2.4211 61056680 ban_activation( ) ..\plugin.php:496
5 2.4211 61056792 ban_activate( ) ..\wp-ban.php:274

Add Full Multisite Support

It would be nice if when installed on a WP Multisite instance you could configure it from within the Network Admin panel. All IP addresses banned in that panel would then be banned across all sites on the network.

You could also ban IPs from individual sites as you currently do.

Case insensitive match when blocking user agents

When blocking by user agent, it would be ideal to do case insensitive match, or may be add an option to select case insensitive match in admin panel.

So if I specify "AskBot" in the user agent list, it should block "askbot" "askBot" "askBOT" all of them.

For now, I modified the code,
function preg_match_wildcard($regex, $subject) {
$regex = preg_quote($regex, '#');
$regex = str_replace('*', '.*', $regex);
if(preg_match("#^$regex$#i", $subject)) {
return true;
} else {
return false;
}
}

The call to preg_match has a "i" modifier attached to it.

Notice: Undefined variable

Notice: Undefined variable: banned_ips_range in /home/buyacsgo/public_html/wp-content/plugins/wp-ban/ban-options.php on line 88

Notice: Undefined variable: banned_hosts in /home/buyacsgo/public_html/wp-content/plugins/wp-ban/ban-options.php on line 89

Notice: Undefined variable: banned_referers in /home/buyacsgo/public_html/wp-content/plugins/wp-ban/ban-options.php on line 90

Notice: Undefined variable: banned_user_agents in /home/buyacsgo/public_html/wp-content/plugins/wp-ban/ban-options.php on line 91

Notice: Undefined variable: banned_exclude_ips in /home/buyacsgo/public_html/wp-content/plugins/wp-ban/ban-options.php on line 92
\n\n

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.