Plugin Directory

Changeset 3092591


Ignore:
Timestamp:
05/26/2024 06:15:27 AM (22 months ago)
Author:
wpconsults
Message:

Commit in

Location:
badgeshift-for-recaptcha/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • badgeshift-for-recaptcha/trunk/badge-shift-for-recaptcha.php

    r3089844 r3092591  
    33 * Plugin Name: BadgeShift for ReCAPTCHA
    44 * Description: BadgeShift for ReCAPTCHA will <strong>move the Google reCAPTCHA v3 badge to the left side.</strong> Just install and it's done. The plugin is super lightweight so adding it will not slow down your website.
    5  * Version: 1.0.0
     5 * Version: 1.0.3
    66 * Author: WpConsults LLC
    77 * Author URI: https://www.wpconsults.com/
     
    1111
    1212
    13 // Enqueue custom CSS
     13/// Enqueue custom CSS with dynamic values
    1414function badge_shift_enqueue_styles() {
    15     $plugin_version = '1.0.0'; // Set your plugin version here
     15    $plugin_version = '1.0.0'; // Set your plugin version here
     16     wp_enqueue_style( 'badge-shift-recaptcha-css', plugins_url( 'badge-shift-recaptcha.css', __FILE__ ), array(), $plugin_version );
    1617
    17     wp_enqueue_style( 'badge-shift-recaptcha-css', plugins_url( 'badge-shift-recaptcha.css', __FILE__ ), array(), $plugin_version );
     18    $left_position = get_option( 'badge_shift_left_position', '-2px' );
     19    $bottom_position = get_option( 'badge_shift_bottom_position', '20px' );
     20    $z_index = get_option( 'badge_shift_z_index', '999' ); // Default z-index value
     21    $hide_badge = get_option( 'badge_shift_hide_badge' );
     22
     23    $custom_css = "
     24        .grecaptcha-badge {
     25            left: {$left_position} !important;
     26            bottom: {$bottom_position} !important;
     27            z-index: {$z_index} !important;
     28            visibility: " . ( $hide_badge ? 'hidden' : 'visible' ) . " !important;
     29        }
     30    ";
     31
     32    wp_add_inline_style( 'badge-shift-recaptcha-css', $custom_css );
    1833}
    1934add_action( 'wp_enqueue_scripts', 'badge_shift_enqueue_styles' );
    2035
     36// Add settings page
     37function badge_shift_settings_page() {
     38    add_options_page( 'BadgeShift Settings', 'BadgeShift Settings', 'manage_options', 'badge_shift_settings', 'badge_shift_settings_page_content' );
     39}
     40add_action( 'admin_menu', 'badge_shift_settings_page' );
     41
     42
     43
     44// Register settings
     45function badge_shift_register_settings() {
     46    register_setting( 'badge_shift_settings_group', 'badge_shift_left_position' );
     47    register_setting( 'badge_shift_settings_group', 'badge_shift_bottom_position' );
     48    register_setting( 'badge_shift_settings_group', 'badge_shift_z_index' );
     49    register_setting( 'badge_shift_settings_group', 'badge_shift_hide_badge' );
     50}
     51add_action( 'admin_init', 'badge_shift_register_settings' );
     52
     53// Save settings
     54function badge_shift_save_settings() {
     55    // Validation and sanitization can be added here if needed
     56}
     57
     58
     59
     60// Settings page content
     61function badge_shift_settings_page_content() {
     62    ?>
     63    <div class="wrap">
     64        <h2>BadgeShift Settings</h2>
     65        <p>
     66            Normally it will work fine, However If you need you can Adjust position by inputing respective values here.
     67        </p>
     68        <form method="post" action="options.php">
     69            <?php settings_fields( 'badge_shift_settings_group' ); ?>
     70            <?php do_settings_sections( 'badge_shift_settings_group' ); ?>
     71            <table class="form-table">
     72                <tr valign="top">
     73                    <th scope="row">Left Position:</th>
     74                    <td><input type="text" name="badge_shift_left_position" placeholder="-2px" value="<?php echo esc_attr( get_option( 'badge_shift_left_position' ) ); ?>" /></td>
     75                </tr>
     76                <tr valign="top">
     77                    <th scope="row">Bottom Position:</th>
     78                    <td><input type="text" name="badge_shift_bottom_position" placeholder="20px" value="<?php echo esc_attr( get_option( 'badge_shift_bottom_position' ) ); ?>" /></td>
     79                </tr>
     80                <tr valign="top">
     81                    <th scope="row">Z-Index:</th>
     82                    <td><input type="text" name="badge_shift_z_index" placeholder="9999" value="<?php echo esc_attr( get_option( 'badge_shift_z_index' ) ); ?>" /></td>
     83                </tr>
     84                <tr valign="top">
     85                    <th scope="row">Hide reCAPTCHA Badge:</th>
     86                    <td><input type="checkbox" name="badge_shift_hide_badge" <?php checked( get_option( 'badge_shift_hide_badge' ), 'on' ); ?> /></td>
     87                </tr>
     88            </table>
     89            <?php submit_button(); ?>
     90        </form>
     91    </div>
     92    <?php
     93}
     94
     95
     96
     97
     98
  • badgeshift-for-recaptcha/trunk/badge-shift-recaptcha.css

    r3089844 r3092591  
    66    overflow: hidden !important;
    77    transition: all 0.3s ease !important;
    8     left: -2px !important;
    9     bottom: 20px !important;
    108}
    119
  • badgeshift-for-recaptcha/trunk/readme.txt

    r3089983 r3092591  
    11=== BadgeShift for ReCAPTCHA ===
    22Contributors: wpconsults
    3 Donate link: https://www.wpconsults.com/easy-payment/
     3Donate link: https://www.wpconsults.com/support-us/
    44Tags: move google recaptcha, hide recaptcha, google recaptcha, hidden recaptcha, hide google recaptcha
    55Requires at least: 3.0.0
    6 Tested up to: 6.4.3
    7 Stable tag: 1.0.0
    8 Requires PHP: 7.0
     6Tested up to: 6.5.3
     7Stable tag: 1.0.1
     8Requires PHP: 7.4
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    1313
    1414== Description ==
    15 This plugin move the Google reCAPTCHA logo to left side from the front end of your website.
     15BadgeShift for ReCAPTCHA will allow you to move Google reCAPTCHA badge from right to bottom left side.
    1616
    1717== Installation ==
     
    2929
    3030== Changelog ==
     31= 1.0.1 =
     32* Hide features added.
    3133= 1.0.0 =
    3234* Initial release.
Note: See TracChangeset for help on using the changeset viewer.