diff --git a/app/api/seo-check/route.js b/app/api/seo-check/route.js
index 252a369..5b09cb2 100644
--- a/app/api/seo-check/route.js
+++ b/app/api/seo-check/route.js
@@ -54,6 +54,7 @@ export async function POST(request) {
let page;
let finalUrl;
+ let html;
let securityHeaders = {};
let response;
diff --git a/components/sections/Callback1.js b/components/sections/Callback1.js
index a77c760..8756617 100644
--- a/components/sections/Callback1.js
+++ b/components/sections/Callback1.js
@@ -1,6 +1,6 @@
"use client";
-import ReCAPTCHA from "react-google-recaptcha";
-import { useState, useRef } from "react";
+import Link from "next/link";
+import { useState } from "react";
export default function Callback1() {
const [domain, setDomain] = useState("");
@@ -8,8 +8,6 @@ export default function Callback1() {
const [captchaValue, setCaptchaValue] = useState(null);
const [isLoading, setIsLoading] = useState(false);
- const recaptchaRef = useRef(null);
-
const handleChange = ({ target: { name, value } }) => {
if (name === "domain") {
setDomain(value);
@@ -18,10 +16,6 @@ export default function Callback1() {
}
};
- const handleCaptchaChange = (value) => {
- setCaptchaValue(value);
- };
-
const handleSubmit = async (event) => {
event.preventDefault();
setIsLoading(true);
@@ -138,30 +132,9 @@ export default function Callback1() {
-
- {!isLoading && (
-
- )}
- {isLoading && (
-
- )}
+
+
Check Now
+
diff --git a/components/sections/Callback2.js b/components/sections/Callback2.js
index 881e0cf..298e9c4 100644
--- a/components/sections/Callback2.js
+++ b/components/sections/Callback2.js
@@ -1,6 +1,6 @@
"use client";
-import ReCAPTCHA from "react-google-recaptcha";
-import { useState, useRef } from "react";
+import { useState } from "react";
+import Link from "next/link";
export default function Callback2() {
const [domain, setDomain] = useState("");
@@ -8,8 +8,6 @@ export default function Callback2() {
const [captchaValue, setCaptchaValue] = useState(null);
const [isLoading, setIsLoading] = useState(false);
- const recaptchaRef = useRef(null);
-
const handleChange = ({ target: { name, value } }) => {
if (name === "domain") {
setDomain(value);
@@ -18,10 +16,6 @@ export default function Callback2() {
}
};
- const handleCaptchaChange = (value) => {
- setCaptchaValue(value);
- };
-
const handleSubmit = async (event) => {
event.preventDefault();
setIsLoading(true);
@@ -86,6 +80,7 @@ export default function Callback2() {
setIsLoading(false);
}
};
+
return (
<>
@@ -136,30 +131,9 @@ export default function Callback2() {
-
- {!isLoading && (
-
- )}
- {isLoading && (
-
- )}
+
+
Check Now
+
diff --git a/components/seoChecker.js b/components/seoChecker.js
index 539f289..f438fae 100644
--- a/components/seoChecker.js
+++ b/components/seoChecker.js
@@ -1,5 +1,6 @@
"use client";
-import { useState } from "react";
+import { useSearchParams } from "next/navigation";
+import { useEffect, useRef, useState } from "react";
import {
FiCheckCircle,
FiAlertTriangle,
@@ -9,11 +10,21 @@ import {
} from "react-icons/fi";
const SEOChecker = () => {
- const [url, setUrl] = useState("");
+ const searchParams = useSearchParams();
+ const site = searchParams.get("site");
+
+ const [url, setUrl] = useState(site);
const [seoData, setSeoData] = useState(null);
const [loading, setLoading] = useState(false);
const [error, setError] = useState(null);
const [activeTab, setActiveTab] = useState("summary");
+ const submitRef = useRef();
+
+ useEffect(() => {
+ if (site) {
+ submitRef.current.click();
+ }
+ }, [site])
const checkSEO = async () => {
if (!url) {
@@ -508,8 +519,8 @@ const SEOChecker = () => {
: "Missing"}
- Headings: H1={seoData.headings.h1.count},{" "}
- H2={seoData.headings.h2.count}, H3={seoData.headings.h3.count}
+ Headings: H1={seoData.headings.h1.count}, H2=
+ {seoData.headings.h2.count}, H3={seoData.headings.h3.count}
@@ -575,6 +586,7 @@ const SEOChecker = () => {
onKeyDown={(e) => e.key === "Enter" && checkSEO()}
/>