var $enable = true;
var $hits_limit_GET = 3; // hits limit for GET requests (per wpadtiddos_seconds_limit_GET second)
var $hits_limit_XHR = 3; // hits limit for XHR requests (per wpadtiddos_seconds_limit_XHR second)
var $seconds_limit_POST = 3; // seconds limit for POST requests
var $seconds_limit_AUTH = 3; // seconds limit for AUTH (Password) requests
var $visitor; // status of visitor = raw|cool|warm|hot
var $warm_level; // number of hits for last $seconds_limit seconds that cause visitor`s status turn to warm
var $auto = true; // block visitors by AntiDDOS
var $delay_time = 30; // seconds of delay of blocked visitors
var $block_cnet = true; // block all C class net.
var $cloudflare = true; // convert Cloudflare HTTP_CF_CONNECTING_IP to REMOTE_ADDR
var $send_header = false; // send "WP_AntiDDOS: yes" header for debug purposes
var $only_params_enabled = false; // Only Params feature enabled
var $only_params = 's'; // the only GET/POST params that trigger checkup
var $status, $error_msg;
var $conn; // mysql connection
var $hits = false; // actual hits number for current IP
var $cookie = ''; // wpantiddos cookie value that prevents anti DDOS processing
var $table_name = '';
var $pass_param = 'pwd'; // name of POST parameter that indentify Login (AUTH) request
var $delay_message = 'Our server is currently overloaded, your request will be repeated automatically in %s seconds';
var $delay_message_auth = 'Our server is currently overloaded, your request will be repeated automatically in %s seconds';
public function __construct()
$GLOBALS['wp_antiddos_instance'] = &$this;
$this->conn = mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD);
$ok = mysqli_select_db($this->conn,DB_NAME);
if (!$ok) return false;
// plugin disabled
if (!$this->enable) return;
// current request is admin's one
if (isset($_COOKIE['wpantiddos']) && $_COOKIE['wpantiddos']==$this->cookie) return;
// detect request type and limits
if ($this->hits_limit_XHR=='ANY') return;
$request_type = 'xhr';
$hits_limit = $this->hits_limit_XHR;
$seconds_limit = wpadtiddos_seconds_limit_XHR;
elseif ($_POST && isset($_POST[$this->pass_param]) )
if ($this->seconds_limit_AUTH=='ANY') return;
$request_type = 'auth';
$seconds_limit = $this->seconds_limit_AUTH;
$this->only_params .= ' '.$this->pass_param;
$hits_limit = 1;
if ($this->seconds_limit_POST=='ANY') return;
$request_type = 'post';
$hits_limit = 1;
$seconds_limit = $this->seconds_limit_POST;
if ($this->hits_limit_GET=='ANY') return;
$request_type = 'get';
$hits_limit = $this->hits_limit_GET;
$seconds_limit = wpadtiddos_seconds_limit_GET;
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
$this->ip = $_SERVER['REMOTE_ADDR'];
$this->ip = substr($this->ip,0,strrpos($this->ip,'.')+1);
$this->warm_level = ceil($hits_limit/2);
$res = mysqli_query($this->conn,"SELECT count(*) kount FROM $this->table_name WHERE ip='".addslashes($this->ip)."' AND tstamp>".(time()-$seconds_limit)." AND type='$request_type'");
$row = mysqli_fetch_assoc($res);
$this->error_msg = 'Error detected';
$this->hits = @$row['kount']+1; // consider current request too
if ($this->hits==0) // if no hits from this IP
$this->visitor = "new";
$this->visitor = "hot";
$this->visitor = "warm";
$this->visitor = "cool";
// add current hit
mysqli_query($this->conn,"INSERT INTO $this->table_name SET ip='$this->ip', type='$request_type', tstamp=".time());
// cleanup ip list
$clear_time = max($this->delay_time,$seconds_limit);
mysqli_query($this->conn,"DELETE FROM $this->table_name WHERE tstamp<".(time()-$clear_time));
$this->error_msg = $e->getString();
$this->status = 'error';
if (!empty($this->error_msg) )
$this->status = 'error';
if ($this->auto && $this->visitor=='hot')
header('HTTP/1.0 503 Service Unavailable');
header('Status: 503 Service Unavailable');
header("Retry-After: ".($this->delay_time+1)); // submit form first if POST request
Overall, the year 2020 could work out with lots of ups and downs for Aries sun sign people due to conflict of your ascendant t mars(Mangal) energy with Rahu(dragon’s Head) and moon(Chandra energy). Yes, this could be a highly eventful year for you.
You need to show patience in various matters. Mars and rahu conjunctions in this year 2020 suggest avoiding impulse/haste. Year 2020 may not be as great for love and money matters as was the previous year for Aries sun sign. Aries sun sign could get some recognition for work- but they need to avoid fights and sudden decisions this year 2020.
Aries sun sign people may need to take care of their image at home or office matters in 2020. Plus Take good care of your health, especially heat and nerves issues. As suggested earlier drive safe, with Special guard on accidents and sudden matters coming up. Land deals may not payoff great
The month of January & February 2020 could be hard & a month with sudden events and work and challenges for Aries sun sign people. they may feel lost with the un-expected events that happen now. Matters could turn not so great in the month of January.
yes February month could provide some relief & some comforts in the office matters or home matters- but sure excess work is there. You may be running around during the month of February to solve problems better. yes, more planning and discipline is needed now to be successful. just as was true with January month, same is true with February but with more comforts at you end.
The month of March has high Jupiter energy as Jupiter is direct and friendly for you, might mean a high energy and fun time for you. yes, averagely lucky time for you. Yes, barring the stock market crash etc :(, over all for you it may come up well for you. :).
so could the month April be a very high energy and anger plus emotions time for you :). Once again you should also be wary of fights or any kind strong stances at your end being reflected in your behavior at office matters or otherwise. yes, mostly the month favorable, but eat well and drink properly and relax and do more of Yoga.
Now The month of May and October both could be fine and OK, but yes family health and over all mental comfort needs some more care. yes, it is a good time for love and passion, but sure some care on the family front is needed for balancing the rahu or dragon’s head energy impacting your Horoscope. Your impulses in love and family matters need some reining or control and all would be well for you. strong fights within family or personal circles may erupt but could be resolved easily by your initiative.
Now for the month of June this month might mean a lot of unexpected or sudden travel and changes at your end. This June month could be a time when you connect with your family, talk to them more freely and resolve their issues. Yes, what you speak needs some care.
Talking and deeper social connection is something that you would enjoy this month of June – but just take care of how you express yourself now. You may get into stress mode this time due to excessive stress at times. 😉
In the month of July you have tried to keep your tempers relaxed and avoid any rash steps. 😉 The secret lies in thinking and then acting on the same. anger and Stress in relationships and with siblings could increase now and your life could have surprises at the home or office front. mental fears and suddenness need to be avoided. yes, there is a Yoga of travel being formed you. You may he issues in relationships this time. so just a basic care is needed at your end for this.
The month of August is a time when you could have a very high energy and zest in you. protect your image as such. But against you should speak sweetly at office and with your spouse . so is it true with how you connect to your loved ones or boss at office.
,li. You may get political contacts or connection with higher ups. You need to drive with care and in control. take good care of your spouse or love now and let things happen with proper cooperation and not force. children need some care and more energy. love matters may get some boost now.
The month of September is a time to enjoy peace with family members. speak with care and let any haste cause issues. Stay relaxed and speak with care regarding family matters. Communication needs special focus now. There could be lot of strong messages from office, your manager or even your family members.
You would show quicker intelligence now. Health matters and people opposing you may come up. More unexpected Meetings and connection with people could be there for you- be careful in speech and what you study and how you think. Then is all would be good for you.
The month of October could be a fun time and passionate time for love and connection with family. enjoy good time with family members. stay loyal in your relationships now. This is a good time for some planning work at your end- but let not any hastiness or harshness step create issues in job or family.
manage your emotions well. Your interest in love and sex matters would increases and you could find yourself highly passionate and ready to do anything for love. Your lover could get also get more loving and romantic and you may travel plus get unexpected connections within the family front.
November month means a high energy time for you to have outings, travel to distant places and have fun plus become a delivery GURU 😉 on the office font. excess energy and roughness now mean fights too. You could utilize this energy to excel in your career and business matters.
Your office or career/job matters may have a lot of issues and fights now. so just relax more. Life could be more eventful and sudden on office, friends and family front. Avoid any suddenness creeping in your behaviour. travel is on the cards and keep a distance from negative people.
December could be a great fun period or time for you. You could enjoy your holidays to the fullest extent. This is a time for more socials,infact of a new kind. You could have more fun and frolic. socials related travel gain in money matters and travel is there.
You may also get keener on occult and tantra or religion as well. This is a time for you to connect to close and bosom friend . Unexpected Meetings and good amount of money would flow due to your luck.