Skip to content

Merge pull request #14 from Gitanuj993/fix - #15

Merged
Gitanuj993 merged 1 commit into
fixfrom
main
Aug 22, 2026
Merged

Gitanuj993 merged 1 commit into
fixfrom
main

Conversation

@Gitanuj993

Copy link
Copy Markdown
Owner

Fix formatting issues and add HCaptcha integration

Fix formatting issues and add HCaptcha integration
@Gitanuj993
Gitanuj993 merged commit a7d7573 into fix Aug 22, 2026
2 checks passed
@github-actions

Copy link
Copy Markdown

🤖 AI Code Review

As an expert software engineer, I've reviewed your codebase for bugs, security issues, performance, and code quality.

The project appears to be a static personal portfolio website, utilizing HTML, CSS, and JavaScript, intended for deployment on Vercel.

Here's a detailed breakdown:


Bugs

  1. Missing Navbar on index.html: The public/index.html file, which is your main landing page, does not include the <script src="./assets/js/navbar.js"></script> tag. As a result, the navigation bar will not be loaded or displayed on the home page, which is a critical functional bug.
  2. Missing Footer on index.html, projects.html, contact.html: Similarly, public/index.html, public/projects.html, and public/contact.html are missing the <script src="./assets/js/footer.js"></script> tag. This means the footer will be absent from these pages.
  3. Malformed JavaScript Script Tag in index.html: At the very end of public/index.html, the script tag for index.js is incomplete: <script src=. It's missing the closing double quote and the ></script> part. This prevents public/assets/js/index.js from loading, rendering your contact form submission logic and success message non-functional. This is a critical bug.
  4. Non-functional hCaptcha: In public/index.html, you have a div for hCaptcha (<div class="h-captcha" data-captcha="true"></div>), but the necessary hCaptcha script is not included anywhere in the HTML. Without this script, the captcha will not render, nor will it provide any bot protection, making your form vulnerable to spam.
  5. Future Dates:
    • The "Last Updated: 3rd July 2026" in public/index.html is a date in the future. This should be updated to reflect the actual last update date.
    • The copyright notice in public/components/footer.html reads "© 2026 Anuj Tanwar." This also uses a future year and should be corrected to the current year.
  6. Empty Content Sections: The "C++ Projects", "Python Projects", and some "Libraries & Modules" lists in public/index.html are empty (<ul></ul>). While this might be placeholders, for a user visiting, these appear as incomplete sections.
  7. Inconsistent Link Visibility: In public/components/navbar.html, the links for "Projects" and "Contact" are commented out. However, corresponding HTML files (public/projects.html, public/contact.html) exist. This creates a discrepancy where pages are part of the project but not accessible via the main navigation.

Security Issues

  1. Web3Forms Access Key Exposure: Your Web3Forms access_key (49509339-1ae4-436d-bfaf-745a13591829) is directly embedded and hardcoded in public/index.html. While Web3Forms is designed for client-side usage, exposing this key publicly allows anyone to see and potentially misuse it. This could lead to your form being spammed, exhausting your submission limits, or potentially tracing back to your Web3Forms account. For an expert review, this is a noteworthy security concern, even if common for simple static forms. It's better to proxy this via a serverless function or use build-time environment variables if possible.
  2. Lack of Bot Protection on Contact Form: As mentioned in the Bugs section, the hCaptcha implementation is incomplete. Without a functioning captcha, your contact form is highly vulnerable to automated spam submissions, which can be an annoyance and potentially costly if it exceeds Web3Forms' free tier limits.

Performance Improvements

  1. CSS Consolidation and Redundancy Elimination:
    • The CSS files public/assets/css/blogs.css, public/assets/css/contact.css, public/assets/css/editorial.css, and public/assets/css/projects.css are nearly identical, containing repetitive styles for main and section elements. These common styles should be moved into public/assets/css/global.css to reduce file requests and improve maintainability.
    • public/assets/css/about.css duplicates several CSS variables (e.g., --bg-color, --surface-color, --border-color, --accent-color, --border-radius) that are already defined in public/assets/css/global.css. All global CSS variables should be defined once in global.css.
  2. JavaScript File Reduction:
    • public/assets/js/about.js, public/assets/js/editorial.js, public/assets/js/contact.js, public/assets/js/blogs.js, and public/assets/js/projects.js are all identical and contain only empty placeholder functions. These files contribute to unnecessary HTTP requests. If they don't contain unique, page-specific JavaScript logic, they should be removed.
  3. Image Optimization: While not directly shown in the code, ensure that preview.jpg, favicon.png, and any other images used on the site are properly compressed and sized for web delivery. This will reduce their file size and improve page load times.

Code Quality Suggestions

  1. README.md Completion: The README.md has several sections marked with a '?' (Badges & info, Tech Stack Used, Project Structure). These should be filled in to provide a complete and helpful overview of your project.
  2. Dead Code Removal:
    • The Rule_Set.md file appears to be a copy of GitHub documentation and seems extraneous to the project's codebase. It should likely be removed unless there's a specific, documented reason for its inclusion.
    • Commented-out CSS rules at the top of public/assets/css/global.css should be removed.
    • Commented-out JavaScript logic in public/assets/js/index.js (e.g., old alert or fetch implementations) should be cleaned up.
  3. Consistent Styling and Variable Usage:
    • The --secondary-text:yellow; variable definition and its usage in public/assets/css/about.css clash with the var(--secondary-text) value (#c9d1d9) defined in global.css and the overall dark theme. Harmonize this color to maintain a consistent design language.
    • The <span> Programming Languages </span> in public/index.html under "Tech Stack" does not have the badge class, making its visual style inconsistent with other items in that section.
  4. Meaningful Placeholder Functions: The placeholder function initializeAboutPage() is copied identically into multiple JavaScript files (editorial.js, contact.js, blogs.js, projects.js). If these files are kept for future use, the function names should be unique and descriptive for each page (e.g., initializeEditorialPage, initializeContactPage).
  5. Vercel Configuration Review: Re-evaluate "deploymentEnabled": false in vercel.json. If you intend for continuous deployment (automatic deploys on Git pushes), this should be true or removed (as true is often the default). If it's intentional for manual deployments, it's fine.
  6. Use of components Directory: The strategy of fetching navbar.html and footer.html via JavaScript is a common pattern for static sites to simulate templating. However, for simpler static sites, server-side includes (if using a pre-processor like Jekyll or Eleventy) or a build step might be more efficient. For pure client-side, the current approach works, but ensure scripts are loaded correctly on all pages.
  7. File Naming: Images.md in public/logo/ is an empty Markdown file. It should either contain relevant documentation or be removed.
  8. Consistent Internal Links: Consider using root-relative paths (e.g., /about.html) for all internal links instead of relative paths (e.g., about.html). This makes refactoring easier and prevents broken links if the file structure changes.

Final Score (/10)

Score: 4/10

Rationale:

The project has a clear goal (a personal portfolio) and uses a reasonable tech stack for a static site (HTML, CSS, JS, Vercel). The design aesthetics are generally good, aligning with a modern dark theme. The use of semantic HTML and preconnect hints are positive aspects.

However, the codebase is significantly hampered by several critical functional bugs that prevent core features (navbar, footer, contact form) from working correctly on key pages. The direct exposure of the Web3Forms access_key and the lack of a functioning captcha introduce notable security vulnerabilities. Furthermore, there's a considerable amount of redundant code (CSS, JS files) and inconsistencies in styling and content, indicating a lack of thorough review and optimization. Addressing these issues would greatly improve the project's reliability, security, and maintainability.

Gitanuj993 added a commit that referenced this pull request Aug 22, 2026
Merge pull request #15 from Gitanuj993/main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant