带有Recaptchav3的Contactform7不显示徽章

时间:2019-02-11 09:51:59

标签: wordpress contact-form-7 invisible-recaptcha recaptcha-v3

我已经将使用contactform7版本4.9的多个Wordpress网站更新为新的版本5.1.1。在此更新中,我必须安装新的Google Recaptcha V3。在大多数情况下,更新不是问题,并且可以正常运行,但是在某些网站中,Recaptcha徽标(右下角)没有显示在网站的前端...?

我已经尝试过搜索它,但是我只能找到想要隐藏徽章的人,但是我想出示徽章ˆˆ。由于某些网站缺少徽章,因此我认为配置可能有问题。有什么方法可以检查Recaptcha是否按预期工作?还是有人遇到了类似的问题,徽章没有显示?预先感谢!

  

已检查grecaptcha-badge类,但没有   检查是否正在加载任何Recaptcha脚本,是的,是否存在(https://www.google.com/recaptcha/api.js?render=6Ld0k48UAAAAAOZmlXfpn-1e91oDo52sWEwyMBLw&ver=3.0'>)

将contactform 7更新到5.1.1版时。并实施Recaptcha V3键,该网站在前端(右下角)显示Google Recaptcha徽章

2 个答案:

答案 0 :(得分:1)

对我有用的只是添加以下CSS

import pygame
import random

# --- classes ---

class Brick():

    def __init__(self, x, y, image):
        self.image = image
        self.rect = self.image.get_rect(x=x, y=y)
        self.x = x
        self.y = y
        self.x_change = 0
        self.y_change = 1

    def draw(self, screen):
        self.rect.x = int(self.x)
        self.rect.y = int(self.y)
        screen.blit(self.image, self.rect)
        pygame.draw.rect(screen, (0, 0, 0), self.rect, 1)

    def update(self):
        self.y += self.y_change
        self.rect.y = int(self.y)

        if self.rect.y <= 0:
            self.y_change = 1
        elif self.rect.y >= 500:
            self.y_change = -1

class Ball():

    def __init__(self):
        #self.image = pygame.image.load("Ball.png")

        self.image = pygame.Surface((16, 16)).convert_alpha()
        self.image.fill((0,0,0,0)) # transparent background
        pygame.draw.circle(self.image, (255,255,255), (8, 8), 8)

        self.rect = self.image.get_rect(centerx=380, centery=280)
        self.x = 380
        self.y = 280
        self.x_change = 3
        self.y_change = 3

    def reset(self):
        self.x = 380
        self.y = 280

    def draw(self, screen):
        self.rect.centerx = int(self.x)
        self.rect.centery = int(self.y)
        screen.blit(self.image, self.rect)

    def update(self):
        # Ball Movement and boundary checking
        self.x += self.x_change
        self.rect.centerx = int(self.x)

        if self.rect.left <= 0:
            self.x_change *= -1
        elif self.rect.right >= 800:
            self.x_change *= -1

        self.y += self.y_change
        self.rect.centery = int(self.y)

        if self.rect.top <= 0:
            self.y_change *= -1
        elif self.rect.bottom >= 600:
            self.reset()

class Paddle():

    def __init__(self):
        #self.image = pygame.image.load("scaledPaddle.png")
        self.image = pygame.Surface((100, 30))
        self.image.fill((255,0,0))

        self.rect = self.image.get_rect(x=335, y=550)
        self.x_change = 0
        self.y_change = 0

    def reset(self):
        self.rect.x = 335
        self.rect.y = 550

    def draw(self, screen):
        screen.blit(self.image, self.rect)

    def update(self):
        # Checking boudries of paddle
        self.rect.x += self.x_change

        if self.rect.left <= 0:
            self.rect.left = 0
        elif self.rect.right >= 800:
            self.rect.right = 800

class Score():

    def __init__(self):
        #self.font = pygame.font.Font("Neufreit-ExtraBold.otf", 24)
        self.font = pygame.font.SysFont(None, 24)
        self.value = 0
        self.x = 10
        self.y = 10

    def reset(self):
        self.value = 0

    def draw(self, screen):
        self.image = self.font.render("Score : " + str(self.value), True, (255,255,255))
        self.rect = self.image.get_rect(x=self.x, y=self.y)
        screen.blit(self.image, self.rect)

# --- functions ---

# empty

# --- main ---

pygame.init()
screen = pygame.display.set_mode((800, 600))

pygame.display.set_caption("Brick Breaker")
#icon = pygame.image.load("Brick Breaker Icon.png")
#pygame.display.set_icon(icon)

# Background Image

#background_image = pygame.image.load("realBackground.png")

background_image = pygame.Surface((800,600))
for y in range(5, 600, 25):
    for x in range(5, 800, 25):
        color = random.choice([(255,128,128), (128,255,128), (128,128,255)])
        background_image.fill(color, [x,y,15,15])

# Brick Images

#brick_images = [
#    pygame.image.load("yellowBrick.png"),
#    pygame.image.load("greenBrick.png"),
#    pygame.image.load("blueBrick.png"),
#    pygame.image.load("pinkBrick.png"),
#]

brick_images = [
    pygame.Surface((100, 30)),
    pygame.Surface((100, 30)),
    pygame.Surface((100, 30)),
    pygame.Surface((100, 30)),
    pygame.Surface((100, 30)),
    pygame.Surface((100, 30)),
]    

brick_images[0].fill((255,0,0))
brick_images[1].fill((0,255,0))
brick_images[2].fill((0,0,255))
brick_images[3].fill((255,255,0))
brick_images[4].fill((255,0,255))
brick_images[5].fill((0,255,255))

# Objects

paddle = Paddle()
ball   = Ball()
score  = Score()

# bricks
rows_number = 5
cols_number = 7

all_bricks = []

y = 0
for row in range(rows_number):
    x = 50
    for col in range(cols_number):
        color_image = random.choice(brick_images)
        brick = Brick(x, y, color_image)
        all_bricks.append(brick)
        x += 100
    y += 30

# Game Loop

clock = pygame.time.Clock()
running = True

while running:

    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False

        # If keystroke is pressed check whether left or right
        if event.type == pygame.KEYDOWN:
            if event.key == pygame.K_LEFT:
                paddle.x_change = -5
            if event.key == pygame.K_RIGHT:
                paddle.x_change = 5
        if event.type == pygame.KEYUP:
            if event.key == pygame.K_LEFT or event.key == pygame.K_RIGHT:
                paddle.x_change = 0

    # --- updates ---

    paddle.update()
    ball.update()

    # Bricks Update
    for brick in all_bricks:
        brick.update()

    # Ball and Paddle Collision
    if ball.rect.colliderect(paddle):
        ball.y_change *= -1

    # Ball and Bricks Collision
    for brick in all_bricks:
        if ball.rect.colliderect(brick):
            brick.x = -400
            ball.y_change *= -1
            score.value += 1

    # --- draws ---

    # To change background colour
    # screen.fill((128, 128, 128)) # you don't need it if background fill all screen

    # background image
    screen.blit(background_image, (0, 0))

    for brick in all_bricks:
        brick.draw(screen)

    paddle.draw(screen)
    ball.draw(screen)

    score.draw(screen)

    pygame.display.flip()

    clock.tick(60) # 60 FPS (Frames Per Second) on all computers

# --- end ---

pygame.quit() 

答案 1 :(得分:0)

我找到了解决方案,或者是显示repatpat的原因。这是因为某些网站中有一些Costum JavaScript。解决方法是安装标准主题并查看ReCaptcha是否出现。但是,我不知道哪个costum javascript阻止了ReCaptcha,所以我的解决方法是安装旧版本的联系表格(<5.0)以能够使用ReCaptcha V2,而这个版本不会被costum javascript阻止。 >