Changeset 3451972
- Timestamp:
- 02/02/2026 11:06:32 AM (2 months ago)
- Location:
- pow-captcha
- Files:
-
- 53 added
- 9 edited
-
tags/1.0.22 (added)
-
tags/1.0.22/LICENSE (added)
-
tags/1.0.22/assets (added)
-
tags/1.0.22/assets/css (added)
-
tags/1.0.22/assets/css/pow-captcha.css (added)
-
tags/1.0.22/assets/js (added)
-
tags/1.0.22/assets/js/pow-captcha.js (added)
-
tags/1.0.22/composer.json (added)
-
tags/1.0.22/composer.lock (added)
-
tags/1.0.22/languages (added)
-
tags/1.0.22/languages/pow-captcha-fr_FR.l10n.php (added)
-
tags/1.0.22/languages/pow-captcha-fr_FR.mo (added)
-
tags/1.0.22/languages/pow-captcha-fr_FR.po (added)
-
tags/1.0.22/pow-captcha.php (added)
-
tags/1.0.22/readme.txt (added)
-
tags/1.0.22/src (added)
-
tags/1.0.22/src/Admin.php (added)
-
tags/1.0.22/src/CliCommands.php (added)
-
tags/1.0.22/src/Core.php (added)
-
tags/1.0.22/src/FileCache.php (added)
-
tags/1.0.22/src/HttpClient.php (added)
-
tags/1.0.22/src/Modules (added)
-
tags/1.0.22/src/Modules/ContactForm7.php (added)
-
tags/1.0.22/src/Modules/GravityForms.php (added)
-
tags/1.0.22/src/Modules/Login.php (added)
-
tags/1.0.22/src/Settings.php (added)
-
tags/1.0.22/src/Widget.php (added)
-
tags/1.0.22/vendor (added)
-
tags/1.0.22/vendor/autoload.php (added)
-
tags/1.0.22/vendor/composer (added)
-
tags/1.0.22/vendor/composer/ClassLoader.php (added)
-
tags/1.0.22/vendor/composer/InstalledVersions.php (added)
-
tags/1.0.22/vendor/composer/LICENSE (added)
-
tags/1.0.22/vendor/composer/autoload_classmap.php (added)
-
tags/1.0.22/vendor/composer/autoload_namespaces.php (added)
-
tags/1.0.22/vendor/composer/autoload_psr4.php (added)
-
tags/1.0.22/vendor/composer/autoload_real.php (added)
-
tags/1.0.22/vendor/composer/autoload_static.php (added)
-
tags/1.0.22/vendor/composer/installed.json (added)
-
tags/1.0.22/vendor/composer/installed.php (added)
-
tags/1.0.22/vendor/vendor (added)
-
tags/1.0.22/vendor/vendor/autoload.php (added)
-
tags/1.0.22/vendor/vendor/composer (added)
-
tags/1.0.22/vendor/vendor/composer/ClassLoader.php (added)
-
tags/1.0.22/vendor/vendor/composer/InstalledVersions.php (added)
-
tags/1.0.22/vendor/vendor/composer/LICENSE (added)
-
tags/1.0.22/vendor/vendor/composer/autoload_classmap.php (added)
-
tags/1.0.22/vendor/vendor/composer/autoload_namespaces.php (added)
-
tags/1.0.22/vendor/vendor/composer/autoload_psr4.php (added)
-
tags/1.0.22/vendor/vendor/composer/autoload_real.php (added)
-
tags/1.0.22/vendor/vendor/composer/autoload_static.php (added)
-
tags/1.0.22/vendor/vendor/composer/installed.json (added)
-
tags/1.0.22/vendor/vendor/composer/installed.php (added)
-
trunk/composer.json (modified) (1 diff)
-
trunk/pow-captcha.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/src/Core.php (modified) (2 diffs)
-
trunk/src/Modules/GravityForms.php (modified) (2 diffs)
-
trunk/src/Settings.php (modified) (3 diffs)
-
trunk/src/Widget.php (modified) (4 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/vendor/vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pow-captcha/trunk/composer.json
r3420239 r3451972 4 4 "type": "wordpress-plugin", 5 5 "license": "GPL-2.0-or-later", 6 "version": "1.0.2 1",6 "version": "1.0.22", 7 7 "require": { 8 8 }, -
pow-captcha/trunk/pow-captcha.php
r3420239 r3451972 4 4 * Plugin Name: Pow Captcha 5 5 * Description: Adds Pow Captcha verification to forms. 6 * Version: 1.0.2 16 * Version: 1.0.22 7 7 * Author: Jean-Philippe Bidegain 8 8 * Author URI: https://github.com/aeyoll/pow-captcha-for-wordpress … … 18 18 } 19 19 20 define('POW_CAPTCHA_VERSION', '1.0.2 1');20 define('POW_CAPTCHA_VERSION', '1.0.22'); 21 21 22 22 require_once __DIR__ . '/vendor/autoload.php'; -
pow-captcha/trunk/readme.txt
r3420239 r3451972 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.4 7 Stable tag: 1.0.2 17 Stable tag: 1.0.22 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html -
pow-captcha/trunk/src/Core.php
r3369593 r3451972 20 20 public static $option_captcha_api_url = 'captcha_api_url'; 21 21 public static $option_enable_on_login_form = 'enable_on_login_form'; 22 public static $option_difficulty_level = 'pow_captcha_difficulty_level'; 23 public static $default_difficulty_level = 5; 22 24 23 25 /** … … 85 87 86 88 /** 89 * Retrieves the difficulty level for the captcha. 90 * 91 * @return int Returns the difficulty level (defaults to 5). 92 */ 93 public function get_difficulty_level(): int 94 { 95 $level = get_option(self::$option_difficulty_level, self::$default_difficulty_level); 96 97 return (int) $level; 98 } 99 100 /** 87 101 * Retrieves the contact form 7 active option. 88 102 * -
pow-captcha/trunk/src/Modules/GravityForms.php
r3420239 r3451972 7 7 use GFCommon; 8 8 use GFFormsModel; 9 use G GFormDisplay;9 use GFFormDisplay; 10 10 11 11 class GravityForms … … 100 100 $form = $validation_result['form']; 101 101 102 if (!G GFormDisplay::is_last_page($form)) {102 if (!GFFormDisplay::is_last_page($form)) { 103 103 return $validation_result; 104 104 } -
pow-captcha/trunk/src/Settings.php
r3369593 r3451972 30 30 PowCaptchaForWordpressCore::$option_enable_on_login_form, 31 31 'sanitize_text_field' 32 ); 33 register_setting( 34 PowCaptchaForWordpressCore::$option_group, 35 PowCaptchaForWordpressCore::$option_difficulty_level, 36 [ 37 'type' => 'integer', 38 'sanitize_callback' => 'absint', 39 'default' => PowCaptchaForWordpressCore::$default_difficulty_level, 40 ] 32 41 ); 33 42 … … 81 90 ) 82 91 ); 92 93 // Difficulty level 94 add_settings_field( 95 'pow_captcha_settings_difficulty_level_field', 96 'Difficulty Level', 97 [$this, 'pow_captcha_settings_field_callback'], 98 'pow_captcha_admin', 99 'pow_captcha_general_settings_section', 100 array( 101 'option_name' => PowCaptchaForWordpressCore::$option_difficulty_level, 102 'description' => 'The difficulty level for the captcha challenge (1-10). Higher values require more computational work.', 103 'type' => 'number', 104 'min' => 1, 105 'max' => 10, 106 'default' => PowCaptchaForWordpressCore::$default_difficulty_level, 107 ) 108 ); 83 109 } 84 110 85 // field content cb 111 /** 112 * Renders a settings field input. 113 * 114 * @param array $args Field configuration arguments. 115 */ 86 116 public function pow_captcha_settings_field_callback(array $args) 87 117 { … … 89 119 $option_name = $args['option_name']; 90 120 $description = $args['description']; 121 $default = $args['default'] ?? ''; 91 122 92 123 // Value of the option 93 $setting = get_option($option_name );124 $setting = get_option($option_name, $default); 94 125 95 126 $value = isset($setting) ? esc_attr($setting) : ''; 96 $checked = ""; 127 $checked = ''; 128 $extra_attrs = ''; 97 129 98 if ($type == "checkbox") {130 if ($type === 'checkbox') { 99 131 $value = 1; 100 132 $checked = checked(1, $setting, false); 101 133 } 134 135 if ($type === 'number') { 136 if (isset($args['min'])) { 137 $extra_attrs .= ' min="' . esc_attr($args['min']) . '"'; 138 } 139 140 if (isset($args['max'])) { 141 $extra_attrs .= ' max="' . esc_attr($args['max']) . '"'; 142 } 143 } 102 144 ?> 103 145 <input 104 aut complete="none"146 autocomplete="none" 105 147 type="<?php echo esc_attr($type); ?>" 106 148 name="<?php echo esc_attr($option_name); ?>" 107 149 id="<?php echo esc_attr($option_name); ?>" 108 value="<?php echo esc_attr($value) ?>" <?php echo esc_attr($checked) ?>> 150 value="<?php echo esc_attr($value); ?>" 151 <?php echo esc_attr($checked); ?> 152 <?php echo $extra_attrs; ?>> 109 153 <label 110 154 class="description" 111 155 for="<?php echo esc_attr($option_name); ?>"> 112 <?php echo esc_html($description) ?>156 <?php echo esc_html($description); ?> 113 157 </label> 114 158 <?php -
pow-captcha/trunk/src/Widget.php
r3420239 r3451972 46 46 public function load_challenges() 47 47 { 48 $response = $this->get_client()->post('GetChallenges?difficultyLevel=5'); 48 $plugin = Core::$instance; 49 $difficulty_level = $plugin->get_difficulty_level(); 50 51 $response = $this->get_client()->post('GetChallenges?difficultyLevel=' . $difficulty_level); 49 52 $json = $response->getBody()->getContents(); 50 53 $data = json_decode($json, true); … … 135 138 plugin_dir_url(__FILE__) . '../assets/css/pow-captcha.css', 136 139 array(), 137 '1.0.2 1'140 '1.0.22' 138 141 ); 139 142 … … 143 146 $plugin->get_captcha_api_url() . '/static/captcha.js', 144 147 array(), 145 '1.0.2 1',148 '1.0.22', 146 149 true 147 150 ); … … 151 154 plugin_dir_url(__FILE__) . '../assets/js/pow-captcha.js', 152 155 array(), 153 '1.0.2 1',156 '1.0.22', 154 157 true 155 158 ); -
pow-captcha/trunk/vendor/composer/installed.php
r3420239 r3451972 2 2 'root' => array( 3 3 'name' => 'aeyoll/pow-captcha-for-wordpress', 4 'pretty_version' => '1.0.2 1',5 'version' => '1.0.2 1.0',4 'pretty_version' => '1.0.22', 5 'version' => '1.0.22.0', 6 6 'reference' => null, 7 7 'type' => 'wordpress-plugin', … … 12 12 'versions' => array( 13 13 'aeyoll/pow-captcha-for-wordpress' => array( 14 'pretty_version' => '1.0.2 1',15 'version' => '1.0.2 1.0',14 'pretty_version' => '1.0.22', 15 'version' => '1.0.22.0', 16 16 'reference' => null, 17 17 'type' => 'wordpress-plugin', -
pow-captcha/trunk/vendor/vendor/composer/installed.php
r3420239 r3451972 2 2 'root' => array( 3 3 'name' => 'aeyoll/pow-captcha-for-wordpress', 4 'pretty_version' => '1.0.2 1',5 'version' => '1.0.2 1.0',4 'pretty_version' => '1.0.22', 5 'version' => '1.0.22.0', 6 6 'reference' => null, 7 7 'type' => 'wordpress-plugin', … … 12 12 'versions' => array( 13 13 'aeyoll/pow-captcha-for-wordpress' => array( 14 'pretty_version' => '1.0.2 1',15 'version' => '1.0.2 1.0',14 'pretty_version' => '1.0.22', 15 'version' => '1.0.22.0', 16 16 'reference' => null, 17 17 'type' => 'wordpress-plugin',
Note: See TracChangeset
for help on using the changeset viewer.