/home/runcloud/htdocs/www.ibethel.org/app/Helpers/Functions/IndexNow.php
];
// Submit via cURL
$ch = curl_init('https://api.indexnow.org/indexnow');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json; charset=utf-8'
]);
curl_setopt($ch, CURLOPT_TIMEOUT, 2);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
// Increment count even if failed to avoid spamming on errors, but especially on success.
// Actually, let's just increment it anyway so we don't spam the API with bad keys.
$limitData['count']++;
file_put_contents($cacheFile, json_encode($limitData));
}
}
Arguments
"file_put_contents(): Only 0 of 31 bytes written, possibly out of free disk space"
/home/runcloud/htdocs/www.ibethel.org/app/Helpers/Functions/IndexNow.php
];
// Submit via cURL
$ch = curl_init('https://api.indexnow.org/indexnow');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json; charset=utf-8'
]);
curl_setopt($ch, CURLOPT_TIMEOUT, 2);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
// Increment count even if failed to avoid spamming on errors, but especially on success.
// Actually, let's just increment it anyway so we don't spam the API with bad keys.
$limitData['count']++;
file_put_contents($cacheFile, json_encode($limitData));
}
}
Arguments
"/home/runcloud/htdocs/www.ibethel.org/app/Helpers/Functions/../../../data/cache/indexnow_limit.json"
"{"date":"2026-06-12","count":1}"
/home/runcloud/htdocs/www.ibethel.org/app/Middleware/IndexNowMiddleware.php
namespace App\Middleware;
use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Server\RequestHandlerInterface as RequestHandler;
use Psr\Http\Message\ResponseInterface as Response;
use App\Helpers\Functions\IndexNow;
class IndexNowMiddleware
{
public function __invoke(Request $request, RequestHandler $handler): Response
{
$response = $handler->handle($request);
if ($response->getStatusCode() === 200) {
$url = (string) $request->getUri();
// Exclude API, sitemaps, txt
if (!str_contains($url, '/api/') && !str_contains($url, '.xml') && !str_contains($url, '.txt')) {
register_shutdown_function(function() use ($url) {
IndexNow::autoSubmit($url);
});
}
}
return $response;
}
}
Arguments
"https://www.ibethel.org/smooth-animated-border-gradient-html-css.html"