Category: WordPress

  • Customize Style Contact Form 7 on WordPress

    Customize Style Contact Form 7 on WordPress

    What is this?

    I’ve edited the CSS for Contact Form 7, a popular WordPress plugin for creating contact forms.

    When implemented, it looks like this:


    A small detail I focused on was adding an ease effect to the focus state.


    How to Apply Styles to Contact Form 7

    First, add Contact Form 7 as a new plugin.

    Download Contact Form 7

    Once installed and activated, you should see a new “Contact” item in the left sidebar of your WordPress dashboard. Click on it.


    When you open it, you’ll likely see a form that has already been added. Open that form.


    In the form editor, paste the following code (feel free to copy-paste):


    The code is based on the classes and elements from the official Contact Form 7 site. I’ve styled it in a way that minimally changes the default settings upon installation.

    <label class="form__label"> 企業名
        [text* your-name class:form__textInput autocomplete:name] </label>
    
    <label class="form__label"> お名前
        [text* your-name class:form__textInput autocomplete:name] </label>
    
    <label class="form__label"> メールアドレス
        [email* your-email class:form__textInput autocomplete:email] </label>
    
    
    <label class="form__label"> お問い合わせ内容
        [textarea* your-message class:form__textInput] </label>
    
    [submit "Submit"]
    
    <style>
    .form__container {
      max-width: 400px;
      margin:0 auto;
    }
    
    .form__label {
      display: block;
      margin-top:1.5em;
      color: gray;
      font-size: 0.8em;
    }
    
    
    
    .form__textInput {
      width: calc(100% - 2.4em);
      border: 1px #c0c0c0 solid;
      border-radius: 2px;
      padding: 1em 1.2em;
      color: 1e1e1f;
    }
    
    .form__textInput:focus {
      transition: .3s ease-out;
      outline: 1px skyblue solid;
    }
    
    .wpcf7-submit {
      display: block;
      color: white;
      background-color: black;
      padding: 0.8em 2em;
      border-radius: 4px;
      margin: 2em auto;
      border: none;
    }
    
    .wpcf7-submit:active {
      background-color: rgb(95, 95, 95);
      /* This style is created by https://coiai.net */
    }
    </style>


    Once the form setup is complete, navigate to a static page where you want to add the form.


    Here’s an example of how it looks when added.


    I’ve kept the code minimal, avoiding unnecessary things like titles, background color settings, or size restrictions. Feel free to adjust it to suit your environment.

  • “Saving failed” WordPress Theme Customize

    “Saving failed” WordPress Theme Customize

    When customizing a theme in WordPress, you may sometimes encounter error messages in a red frame such as “Saving failed,” “Update failed. The response is not a valid JSON response,” and “Saving failed.”

    This post will explain how to resolve this issue as of September 2024.

    How to Resolve the “Saving Failed” Error

    I encountered this error when using WordPress’s default theme called Twenty Twenty-Four. It only appeared when I tried saving from the template customization screen.

    For Users of Onamae.com OR something rental server

    If you are using Onamae.com, the WAF security setting might be turned ON in the Onamae.com control panel. Try turning it OFF.

    To do this, access the rental server control panel:
    https://cp.onamae.ne.jp/homepagesecurity/waf

    In the left side panel, under Homepage Settings/Security, select the WAF option and turn off the Detection Log Management setting.

    For Users of Security Plugins

    If you are using a security plugin in WordPress, such as the “SiteGuard” plugin, which has a WAF security setting, you can turn it OFF from the plugin’s settings page.

    If This Does Not Solve the Issue

    If the issue persists after these steps, feel free to leave a comment. I might be able to help further.


    What is WAF Security?

    WAF (Web Application Firewall) is a security system designed to protect web applications from unauthorized access or attacks.

    WAF plays a role in detecting and preventing application-level attacks. Specifically, it can detect attacks such as SQL injection, cross-site scripting (XSS), and malicious HTTP requests, blocking them before they reach the web application.

    WAF is deployed at the boundary of the network. While a traditional firewall mainly protects the network layer, WAF monitors the communication to and from web applications, identifying attack patterns.

    By implementing WAF, you can improve the security of publicly accessible web services and applications.

    Types of WAF:

    • Host-based WAF: Installed directly on the server, placed on each web server.
    • Cloud-based WAF: Delivered through the cloud, it prevents attacks on web applications over the internet.

    Introducing WAF can reduce the risk of data leaks or service outages caused by unauthorized access or attacks, making it a crucial security measure.


    How WAF Works:

    WAF is positioned between the web server and the internet, and it protects web applications through the following flow:

    1. Traffic Monitoring: WAF monitors HTTP/HTTPS traffic sent to the web application in real-time.
    2. Rule-based Inspection: WAF comes preconfigured with rule (signature) sets that detect common attack patterns and threats. Traffic is inspected against these rules.
      • Examples: SQL injection, cross-site scripting (XSS), file upload attacks, etc.
    3. Attack Detection and Blocking: When a request shows signs of an attack, WAF blocks the request and prevents the attack. Additionally, it can log details of the attack and notify administrators.
    4. Allowing Normal Requests: Requests that do not violate the rules are allowed to reach the web server, and the application operates as usual.

    Reference:

    https://siteguard.jp-secure.com/blog/what-is-owasp

Home
About
Blog
Works
Contact