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
This could be Highly eventful year in terms of career matters with more than usual fights and issues coming up. More and unexpected work may creep in the month of January and February and yes, the 4th month April could be a bundle of surprises .
There could be just a fair time in regard to career opportunities but ensure that fights don’t creep in now. Your colleagues can feel your roughness and some anger now and passion. be relaxed and more forgiving. Yes, there could be unexpected delays at times or sudden career matters that may baffle you this time.
With your proper action and effort- and working with patience – you could reach fair levels after the month of October November . You must utilize this time well!!
This time may not be great for career but sure a lot of work and restriction could come in for you. but you need to look for the hidden opportunities which might come your way. Let not any haste or rashness takeover and impact on what you have set your eye for.
You will feel full of zest and energy, in fact a bit rash this time and motivated now- but a lot of surprises and events now at office or job front could irritate you. Your boss or manager if a male must be given due respect. Try to come out of workload well.
Once again, this time may bring in sudden work challenges at the career front, there could be a lot of changes and over all stress with colleagues and people who you trust.
You may want to take care of relationships with female members at your office and yes control haste or anger now. yes, be open to new work opportunities that come through your colleagues now. Let not your emotions impact what you would like to do now.
This is a time that could be fair enough in with regard to career and you having more than normal expansion and opportunities in career. yes, more and yes unexpected socials or meetings and connection with office people or colleagues or subordinate by (WhatsApp/mails/phone calls etc) .
this could help you get ahead in the career. Luck would be supportive but with some stress at your end. Luck and grace of GOD would be supportive for you.
This is a time is ahigh energy time with your energy levels suddenly reaching the speak and making you emotional. yes, a lot of things could come to you and your importance and value may grow. The torch light maybe you. You may want to do maximum work and that also with proper speed .
bit please do Yoga and relax and then deliver. You must go methodically to cash on the opportunities. Try to stay focussed in addition of being forgiving and compassionate now. show more love and consideration to your office people now. some unexpected Delays and surprises in matters could possibly be there .
This time may be somewhat Ok or fair enough for your career or Jobs, your roles and responsibilities may slightly increase at office front as well. Your relationships with female may get too close or passionate or flight may erupt. This matter needs some care. Your love for al may get enhanced now and you may attract more success and status now.
You could also connect more people and people who are more homely or cool now. Your responsibilities at your office may increase.
This can be a fair enough time about your career, with an increase options and unexpected good news coming towards you. that is more communications/messages to help you and workplace or office related outings could be there.
You need to speak or communicate through email or WhatsApp etc with care. also avoid haste and Drive with care and all your office communications should be error free now.
some options and opportunities in specialized or niche areas are there. You could possibly take more study initiatives now in the job and connect more to your subordinates at office . there might be more action and relatively less comfort at office front at times on dates like 5, 14,23 ānd Wednesday. so, some care is needed in that sense.
Might not be the best time you could wish to have , time to keep mind and personality relaxed and no aggression or roughness. Matters may move more relaxed and sow this time. There could be more steam at office and fight on trifles may come in. You need to work on your mind. You must control anger and may be rashness .
Just maintain your calm and avoid haste at home or office. Your image needs more care at the office front. But sure, with conscious cooperation and better planning at your end success would be yours. Let not any kind of agitation or fear come in your mind
This is a time that is Beneficial for your overall growth, image and action and yes job or career growth, there could be good enough opportunities to help expand your interest and ability to cash onto the office situations.
You may find yourself very action oriented and ready to take any risks. At job front also you may feel yourself with high energy . try to handle excess passion well.
If studying or going deep into matters you may find yourself doing well. let not the extra energy make you take sudden conflicts with your BOSS or subordinates or colleague’s .Use basic diplomacy and a balanced approach to more successful now .
yes, your investment in any direction may work great. A well-planned work would enable you to cash on good things of this time and make you a success. Invest your time and energy with care.
This could be a relatively better time for you – but again relatively high energy so what you eat and what you speak needs care. You could expect some aggressive r hard messages coming to you in office but also more positive ones 😉 as well.
There could be sharp exchange of messages or communications on WhatsApp /email messages or even verbal communication at workplace There could be change or fluidity and more fun outings at workplace . Just stay relaxed and avoid conflict , be more thoughtful to people especially people who oppose your n job or career.
You will feel more passion in your mind regarding your work and career now. new connections or contacts at workplace may be formed. speak with care especially to your female colleagues. also, your Family matters may take more energy now and with your spouse front better sexual relationships would be there.
This time is good enough for career, but sure relationships need a massage. yes, more connection to people is there. unexpected responsibilities at office or job front may come in. Career would need your patience more than action orientation and yes more of planning and ownership.
You need to Work not in haste mode but in a planned way to cash on the opportunities you have in hand. You also must stay focussed and additionally being more poised and avoid any locking of horns ;0) with people now. This is could be critical time for your career and professionally as you will be keen and yes aggressive in delivering things.
You must think, and act and then only good results could come. Drive to your office with care. use the best body language to communicate to others. There could also unexpectedly matter or work or some surprise element in the work or career matters.
Now this could be a good enough time or period with regard to your career. Luck would smile at you. There could be more socials/meetings could be there with your subordinates and office colleagues and yes visitors as well.
There could be high degree of friendliness, warmth and passion with people around. Also new connections with more people or communications is there. travel Yoga is also there for you for career or job matters. all this would help your profession. Enjoy the warmth and depth of connection to your colleagues and subordinates now. Please follow the ethical path.
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.