Stop the admin dashboard calendar from flooding /ajax
calendar.js called hasEventDay() twice per day cell, firing ~60-74 simultaneous POST /ajax requests on every dashboard load and month change, which tripped the hosting WAF rate limit (429, then 403 IP ban). The dayHasEvent action has no server handler and the async result was never used, so the calls are removed outright. calendar.js now goes through asset_ver() so browsers drop the cached old copy. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
152048d86a
commit
072e90e28d
@@ -70,15 +70,6 @@ const generateCalendar = (month, year) => {
|
||||
for (let i = 1; i <= days_of_month[month] + first_day.getDay() - 1; i++) {
|
||||
|
||||
let day = document.createElement('div');
|
||||
var l = hasEventDay(year, month, i);
|
||||
console.log(l);
|
||||
if(hasEventDay(year, month, i)){
|
||||
day.classList.add('dayHasEvent');
|
||||
console.log('leffut');
|
||||
day.onclick = function(){
|
||||
//this.parentElement.removeChild(this);
|
||||
};
|
||||
}
|
||||
|
||||
if (i >= first_day.getDay()) {
|
||||
day.innerHTML = i - first_day.getDay() + 1;
|
||||
|
||||
Reference in New Issue
Block a user