first
@ -0,0 +1,234 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: Advanced Google reCAPTCHA
|
||||
Plugin URI: https://getwpcaptcha.com/
|
||||
Description: Advanced Google reCAPTCHA will safeguard your WordPress site from spam comments and brute force attacks. With this plugin, you can easily add Google reCAPTCHA to WordPress comment form, login form and other forms.
|
||||
Version: 1.17
|
||||
Author: WebFactory Ltd
|
||||
Author URI: https://www.webfactoryltd.com/
|
||||
License: GNU General Public License v3.0
|
||||
Text Domain: advanced-google-recaptcha
|
||||
Requires at least: 4.0
|
||||
Tested up to: 6.4
|
||||
Requires PHP: 5.2
|
||||
|
||||
Copyright 2023 - 2024 WebFactory Ltd (email: support@webfactoryltd.com)
|
||||
Copyright 2021 - 2023 WP Concern
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License, version 2, as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
// include only file
|
||||
if (!defined('ABSPATH')) {
|
||||
wp_die(__('Do not open this file directly.', 'advanced-google-recaptcha'));
|
||||
}
|
||||
|
||||
define('WPCAPTCHA_PLUGIN_FILE', __FILE__);
|
||||
define('WPCAPTCHA_PLUGIN_DIR', plugin_dir_path(__FILE__));
|
||||
define('WPCAPTCHA_PLUGIN_URL', plugin_dir_url(__FILE__));
|
||||
define('WPCAPTCHA_OPTIONS_KEY', 'wpcaptcha_options');
|
||||
define('WPCAPTCHA_META_KEY', 'wpcaptcha_meta');
|
||||
define('WPCAPTCHA_POINTERS_KEY', 'wpcaptcha_pointers');
|
||||
define('WPCAPTCHA_NOTICES_KEY', 'wpcaptcha_notices');
|
||||
|
||||
require_once WPCAPTCHA_PLUGIN_DIR . 'libs/admin.php';
|
||||
require_once WPCAPTCHA_PLUGIN_DIR . 'libs/setup.php';
|
||||
require_once WPCAPTCHA_PLUGIN_DIR . 'libs/utility.php';
|
||||
require_once WPCAPTCHA_PLUGIN_DIR . 'libs/functions.php';
|
||||
require_once WPCAPTCHA_PLUGIN_DIR . 'libs/stats.php';
|
||||
require_once WPCAPTCHA_PLUGIN_DIR . 'libs/ajax.php';
|
||||
|
||||
require_once WPCAPTCHA_PLUGIN_DIR . 'interface/tab_login_form.php';
|
||||
require_once WPCAPTCHA_PLUGIN_DIR . 'interface/tab_activity.php';
|
||||
require_once WPCAPTCHA_PLUGIN_DIR . 'interface/tab_temp_access.php';
|
||||
require_once WPCAPTCHA_PLUGIN_DIR . 'interface/tab_firewall.php';
|
||||
require_once WPCAPTCHA_PLUGIN_DIR . 'interface/tab_captcha.php';
|
||||
require_once WPCAPTCHA_PLUGIN_DIR . 'interface/tab_geoip.php';
|
||||
require_once WPCAPTCHA_PLUGIN_DIR . 'interface/tab_design.php';
|
||||
|
||||
require_once WPCAPTCHA_PLUGIN_DIR . 'wf-flyout/wf-flyout.php';
|
||||
|
||||
|
||||
// main plugin class
|
||||
class WPCaptcha
|
||||
{
|
||||
static $version = 0;
|
||||
static $type;
|
||||
|
||||
/**
|
||||
* Setup Hooks
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
static function init()
|
||||
{
|
||||
// check if minimal required WP version is present
|
||||
if (false === WPCaptcha_Setup::check_wp_version(4.6) || false === WPCaptcha_Setup::check_php_version('5.6.20')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
WPCaptcha_Setup::maybe_upgrade();
|
||||
WPCaptcha_Functions::handle_unblock();
|
||||
$options = WPCaptcha_Setup::get_options();
|
||||
|
||||
if (is_admin()) {
|
||||
new wf_flyout(__FILE__);
|
||||
|
||||
// add WP Captcha menu to admin tools menu group
|
||||
add_action('admin_menu', array('WPCaptcha_Admin', 'admin_menu'));
|
||||
|
||||
// aditional links in plugin description and footer
|
||||
add_filter('plugin_action_links_' . plugin_basename(__FILE__), array('WPCaptcha_Admin', 'plugin_action_links'));
|
||||
add_filter('plugin_row_meta', array('WPCaptcha_Admin', 'plugin_meta_links'), 10, 2);
|
||||
add_filter('admin_footer_text', array('WPCaptcha_Admin', 'admin_footer_text'));
|
||||
|
||||
// settings registration
|
||||
add_action('admin_init', array('WPCaptcha_Setup', 'register_settings'));
|
||||
add_action('admin_notices', array('WPCaptcha_Admin', 'admin_notices'));
|
||||
|
||||
// enqueue admin scripts
|
||||
add_action('admin_enqueue_scripts', array('WPCaptcha_Admin', 'admin_enqueue_scripts'));
|
||||
|
||||
// admin actions
|
||||
add_action('admin_action_wpcaptcha_install_template', array('WPCaptcha_Functions', 'install_template'));
|
||||
add_action('admin_action_wpcaptcha_install_wp301', array('WPCaptcha_Functions', 'install_wp301'));
|
||||
|
||||
// AJAX endpoints
|
||||
add_action('wp_ajax_wpcaptcha_run_tool', array('WPCaptcha_AJAX', 'ajax_run_tool'));
|
||||
} else {
|
||||
// Handle login captcha
|
||||
if($options['captcha_show_login']){
|
||||
add_filter( 'login_form', array('WPCaptcha_Functions', 'captcha_fields'));
|
||||
add_action( 'woocommerce_login_form', array('WPCaptcha_Functions', 'captcha_fields'));
|
||||
add_action( 'woocommerce_login_form', array('WPCaptcha_Functions', 'login_form_fields'));
|
||||
add_action( 'woocommerce_login_form', array('WPCaptcha_Functions', 'login_print_scripts'));
|
||||
add_filter( 'edd_login_fields_after', array('WPCaptcha_Functions', 'captcha_fields'));
|
||||
add_filter( 'edd_login_fields_after', array('WPCaptcha_Functions', 'login_print_scripts'));
|
||||
}
|
||||
|
||||
// Handle registration captcha
|
||||
if($options['captcha_show_wp_registration']){
|
||||
add_filter( 'registration_errors', array('WPCaptcha_Functions', 'handle_captcha_wp_registration'), 10, 3 );
|
||||
add_filter( 'register_form', array('WPCaptcha_Functions', 'captcha_fields'));
|
||||
}
|
||||
|
||||
// Handle lost password captcha
|
||||
if($options['captcha_show_wp_lost_password']){
|
||||
add_filter( 'lostpassword_form', array('WPCaptcha_Functions', 'captcha_fields'));
|
||||
add_filter( 'resetpass_form', array('WPCaptcha_Functions', 'captcha_fields'));
|
||||
add_action( 'woocommerce_lostpassword_form', array('WPCaptcha_Functions', 'captcha_fields'));
|
||||
add_action( 'woocommerce_resetpassword_form', array('WPCaptcha_Functions', 'captcha_fields'));
|
||||
add_action( 'woocommerce_lostpassword_form', array('WPCaptcha_Functions', 'login_print_scripts'));
|
||||
add_action( 'woocommerce_resetpassword_form', array('WPCaptcha_Functions', 'login_print_scripts'));
|
||||
add_action( 'lostpassword_post', array('WPCaptcha_Functions', 'process_lost_password_form'), 10, 1 );
|
||||
add_action( 'validate_password_reset', array('WPCaptcha_Functions', 'process_lost_password_form'), 10, 2 );
|
||||
}
|
||||
|
||||
// Handle comment form captcha
|
||||
if($options['captcha_show_wp_comment']){
|
||||
add_filter( 'comment_form_after_fields', array('WPCaptcha_Functions', 'captcha_fields'));
|
||||
add_filter( 'comment_form_after_fields', array('WPCaptcha_Functions', 'login_print_scripts'));
|
||||
add_filter( 'preprocess_comment', array('WPCaptcha_Functions', 'process_comment_form'), 10, 1 );
|
||||
}
|
||||
|
||||
// Handle woocommerce registration
|
||||
if($options['captcha_show_woo_registration']){
|
||||
add_filter( 'woocommerce_register_form', array('WPCaptcha_Functions', 'captcha_fields'));
|
||||
add_filter( 'woocommerce_register_form', array('WPCaptcha_Functions', 'login_print_scripts'));
|
||||
add_filter( 'woocommerce_process_registration_errors', array('WPCaptcha_Functions', 'check_woo_register_form_validation' ) );
|
||||
}
|
||||
|
||||
// Handle woocommerce checkout
|
||||
if($options['captcha_show_woo_checkout']){
|
||||
add_action( 'woocommerce_review_order_before_submit', array('WPCaptcha_Functions', 'captcha_fields'));
|
||||
add_action( 'woocommerce_review_order_before_submit', array('WPCaptcha_Functions', 'login_print_scripts'));
|
||||
add_action( 'woocommerce_checkout_process', array('WPCaptcha_Functions', 'check_woo_checkout_form'));
|
||||
}
|
||||
|
||||
// Handle Easy Digital Downloads registration
|
||||
if($options['captcha_show_edd_registration']){
|
||||
add_filter( 'edd_register_form_fields_before_submit', array('WPCaptcha_Functions', 'captcha_fields'));
|
||||
add_filter( 'edd_register_form_fields_before_submit', array('WPCaptcha_Functions', 'login_print_scripts'));
|
||||
add_action( 'edd_process_register_form', array('WPCaptcha_Functions', 'check_edd_register_form'));
|
||||
}
|
||||
|
||||
// Handle BuddyPress registration
|
||||
if($options['captcha_show_bp_registration']){
|
||||
add_filter( 'bp_after_signup_profile_fields', array('WPCaptcha_Functions', 'captcha_fields'));
|
||||
add_filter( 'bp_after_signup_profile_fields', array('WPCaptcha_Functions', 'login_print_scripts'));
|
||||
add_action( 'bp_signup_validate', array('WPCaptcha_Functions', 'process_buddypress_signup_form'));
|
||||
}
|
||||
|
||||
add_action('login_enqueue_scripts', array('WPCaptcha_Functions', 'login_enqueue_scripts' ));
|
||||
add_action('login_head', array('WPCaptcha_Functions', 'login_head' ), 9999);
|
||||
|
||||
remove_filter('authenticate', 'wp_authenticate_username_password', 9999, 3);
|
||||
add_filter('authenticate', array('WPCaptcha_Functions', 'wp_authenticate_username_password'), 9999, 3);
|
||||
|
||||
if($options['login_protection']){
|
||||
add_action('login_form', array('WPCaptcha_Functions', 'login_form_fields'));
|
||||
add_action('wp_login_failed', array('WPCaptcha_Functions', 'loginFailed' ), 10, 2);
|
||||
add_filter('login_errors', array('WPCaptcha_Functions', 'login_error_message' ));
|
||||
}
|
||||
} // if not admin
|
||||
} // init
|
||||
|
||||
/**
|
||||
* Get plugin version
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return int plugin version
|
||||
*
|
||||
*/
|
||||
static function get_plugin_version()
|
||||
{
|
||||
$plugin_data = get_file_data(__FILE__, array('version' => 'Version'), 'plugin');
|
||||
self::$version = $plugin_data['version'];
|
||||
|
||||
return $plugin_data['version'];
|
||||
} // get_plugin_version
|
||||
|
||||
/**
|
||||
* Set plugin version and texdomain
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
static function plugins_loaded()
|
||||
{
|
||||
self::get_plugin_version();
|
||||
load_plugin_textdomain('advanced-google-recaptcha');
|
||||
} // plugins_loaded
|
||||
|
||||
static function run()
|
||||
{
|
||||
self::plugins_loaded();
|
||||
WPCaptcha_Setup::load_actions();
|
||||
}
|
||||
} // class WPCaptcha
|
||||
|
||||
|
||||
/**
|
||||
* Setup Hooks
|
||||
*/
|
||||
register_activation_hook(__FILE__, array('WPCaptcha_Setup', 'activate'));
|
||||
register_deactivation_hook(__FILE__, array('WPCaptcha_Setup', 'deactivate'));
|
||||
register_uninstall_hook(__FILE__, array('WPCaptcha_Setup', 'uninstall'));
|
||||
add_action('plugins_loaded', array('wpcaptcha', 'run'), -9999);
|
||||
add_action('init', array('wpcaptcha', 'init'), -1);
|
@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>
|
||||
<json>
|
||||
<![CDATA[
|
||||
{
|
||||
"fontFamily": "wpcaptcha-iconset",
|
||||
"description": "Font generated by IcoMoon.",
|
||||
"majorVersion": 1,
|
||||
"minorVersion": 1.2,
|
||||
"version": "Version 1.1",
|
||||
"fontId": "wpcaptcha-iconset",
|
||||
"psName": "wpcaptcha-iconset",
|
||||
"subFamily": "Regular",
|
||||
"fullName": "wpcaptcha-iconset"
|
||||
}
|
||||
]]>
|
||||
</json>
|
||||
</metadata>
|
||||
<defs>
|
||||
<font id="wpcaptcha-iconset" horiz-adv-x="1024">
|
||||
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
||||
<missing-glyph horiz-adv-x="1024" />
|
||||
<glyph unicode=" " horiz-adv-x="512" d="" />
|
||||
<glyph unicode="" glyph-name="404" data-tags="404" d="M512 917.333c49.877 0 97.542-3.233 141.275-9.456v0l21.531-3.359c130.653-22.236 221.194-72.501 221.194-143.63v0-625.778c0-91.561-143.924-147.229-334.413-155.398l-24.563-0.784c-8.267-0.175-16.611-0.263-25.024-0.263s-16.757 0.088-25.024 0.263l-24.563 0.784c-186.436 7.995-328.267 61.49-334.218 149.603l-0.195 5.795v625.778l0.264 6.607c5.434 67.636 94.36 115.481 220.931 137.023v0l21.531 3.359c43.733 6.222 91.398 9.456 141.275 9.456zM561.587 292.602l-24.563-0.784c-8.267-0.175-16.611-0.263-25.024-0.263s-16.757 0.088-25.024 0.263l-24.563 0.784c-105.805 4.537-197.244 23.729-257.634 55.586l0.021-213.076c0-13.698 23.666-29.634 63.812-43.535l13.982-4.552 15.144-4.366 16.246-4.145 17.29-3.889c11.861-2.499 24.378-4.804 37.473-6.868l20.065-2.909 20.871-2.512c3.542-0.384 7.116-0.749 10.72-1.096l21.97-1.85c3.718-0.269 7.464-0.518 11.236-0.745l22.936-1.109c11.616-0.423 23.445-0.645 35.455-0.645s23.839 0.221 35.455 0.645l22.936 1.109c3.772 0.228 7.518 0.476 11.236 0.745l21.97 1.85c3.604 0.347 7.177 0.712 10.72 1.096l20.871 2.512 20.065 2.909c13.094 2.064 25.611 4.369 37.473 6.868l17.29 3.889 16.246 4.145 15.144 4.366 13.982 4.552c37.915 13.129 61.131 28.073 63.594 41.232l0.218 2.303 0.064 213.099c-60.389-31.87-151.847-51.070-257.677-55.608zM819.207 662.031c-37.604-19.904-87.152-35.029-144.401-44.772v0l-21.531-3.359c-43.733-6.222-91.398-9.456-141.275-9.456s-97.542 3.233-141.275 9.456v0l-21.531 3.359c-57.227 9.74-106.759 24.857-144.358 44.749l-0.037-214.008c0-13.698 23.666-29.634 63.812-43.535l13.982-4.552 15.144-4.366 16.246-4.145 17.29-3.889c11.861-2.499 24.378-4.804 37.473-6.868l20.065-2.909 20.871-2.512 10.72-1.096 21.97-1.85c3.718-0.269 7.464-0.518 11.236-0.745l22.936-1.109c11.616-0.423 23.445-0.645 35.455-0.645s23.839 0.221 35.455 0.645l22.936 1.109c3.772 0.228 7.518 0.476 11.236 0.745l21.97 1.85 10.72 1.096 20.871 2.512 20.065 2.909c13.094 2.064 25.611 4.369 37.473 6.868l17.29 3.889 16.246 4.145 15.144 4.366 13.982 4.552c40.146 13.901 63.812 29.838 63.812 43.535zM512 839.111l-11.79-0.075c-19.558-0.248-38.646-1.108-57.099-2.483v0l-21.828-1.89-21.154-2.346c-17.331-2.135-33.893-4.707-49.524-7.619v0l-18.298-3.651-17.339-3.939-16.316-4.191c-57.875-15.781-93.852-35.882-93.852-52.029v0.242l0.005-0.579c0.468-15.189 32.47-33.802 84.406-49.023l9.441-2.669 16.316-4.191 17.339-3.939 18.298-3.651c15.63-2.911 32.193-5.483 49.524-7.619v0l21.154-2.346 21.828-1.89c22.143-1.649 45.202-2.558 68.889-2.558s46.746 0.908 68.889 2.558v0l21.828 1.89 21.154 2.346c17.331 2.135 33.893 4.707 49.524 7.619v0l18.298 3.651 17.339 3.939 16.316 4.191c57.875 15.781 93.852 35.882 93.852 52.029s-35.976 36.248-93.852 52.029v0l-16.316 4.191-17.339 3.939-18.298 3.651c-15.63 2.911-32.193 5.483-49.524 7.619v0l-21.154 2.346-21.828 1.89c-22.143 1.649-45.202 2.558-68.889 2.558v0z" />
|
||||
<glyph unicode="" glyph-name="alert-circle" data-tags="alert-circle" d="M469.333 320h85.333v-85.333h-85.333v85.333zM469.333 661.333h85.333v-256h-85.333v256zM511.573 874.667c-235.52 0-426.24-191.147-426.24-426.667s190.72-426.667 426.24-426.667c235.947 0 427.093 191.147 427.093 426.667s-191.147 426.667-427.093 426.667zM512 106.667c-188.587 0-341.333 152.747-341.333 341.333s152.747 341.333 341.333 341.333c188.587 0 341.333-152.747 341.333-341.333s-152.747-341.333-341.333-341.333z" />
|
||||
<glyph unicode="" glyph-name="alert-triangle" data-tags="alert-triangle" d="M512.053 874.667l-469.387-810.611h938.507zM512.053 704.053l321.229-554.562h-642.722zM469.335 533.44v-170.611h85.171v170.611zM469.335 277.389v-85.175h85.171v85.175z" />
|
||||
<glyph unicode="" glyph-name="arrow-down" data-tags="arrow-down" d="M469.333 789.333h85.333v-512.444l234.889 234.889 60.339-60.339-337.894-337.894-337.895 337.894 60.34 60.339 234.889-234.889z" />
|
||||
<glyph unicode="" glyph-name="arrow-left" data-tags="arrow-left" d="M846.457 494.105v-85.333h-512.445l234.889-234.889-60.339-60.339-337.896 337.894 337.896 337.895 60.339-60.34-234.889-234.889z" />
|
||||
<glyph unicode="" glyph-name="arrow-right" data-tags="arrow-right" d="M170.667 494.105v-85.333h512.444l-234.889-234.889 60.339-60.339 337.894 337.894-337.894 337.895-60.339-60.34 234.889-234.889z" />
|
||||
<glyph unicode="" glyph-name="arrow-up" data-tags="arrow-up" d="M551.229 113.543h-85.333v512.445l-234.889-234.889-60.34 60.339 337.895 337.896 337.894-337.896-60.339-60.339-234.889 234.889z" />
|
||||
<glyph unicode="" glyph-name="check" data-tags="check" d="M501.712 874.569l5.351-0.785 333.913-74.203c16.975-3.772 29.053-18.829 29.053-36.218v0-333.913c0-127.433-69.244-231.299-182.335-312.976-38.606-27.882-79.763-51.204-120.918-70.258v0l-15.734-7.085c-2.482-1.085-4.893-2.123-7.227-3.114v0l-13.068-5.378c-2.017-0.802-3.951-1.558-5.799-2.267v0l-10.021-3.699-4.18-1.435c-7.616-2.539-15.849-2.539-23.465 0-1.298 0.433-2.692 0.911-4.18 1.435v0l-15.82 5.967c-2.017 0.802-4.117 1.652-6.296 2.548v0l-13.999 5.944-15.734 7.085c-41.155 19.053-82.312 42.376-120.918 70.258-113.092 81.677-182.335 185.543-182.335 312.976v0 333.913c0 17.389 12.078 32.446 29.053 36.218v0l333.913 74.203c5.301 1.178 10.796 1.178 16.097 0zM499.014 799.573l-296.812-65.966v-304.158c0-96.249 52.047-177.756 141.487-245.366v0l10.091-7.455c34.438-24.872 71.541-45.897 108.647-63.076 12.968-6.004 24.974-11.083 35.686-15.249v0l0.901-0.318 9.172 3.614c5.669 2.312 11.641 4.852 17.874 7.624v0l9.541 4.33c37.106 17.179 74.21 38.204 108.647 63.076 95.604 69.047 151.578 153.008 151.578 252.821v0 304.158l-296.812 65.966zM708.667 643.126c14.361-12.309 17.001-33.214 6.833-48.593l-2.809-3.722-222.609-259.71c-13.060-15.237-35.599-17.155-50.987-5.116l-3.417 3.026-111.304 111.304c-14.489 14.489-14.489 37.98 0 52.469 13.374 13.374 34.42 14.403 48.974 3.086l3.495-3.086 82.955-82.926 196.554 229.242c13.335 15.558 36.757 17.359 52.315 4.024z" />
|
||||
<glyph unicode="" glyph-name="checkmark" data-tags="checkmark" d="M874.667 686.327l-512-512-234.667 234.667 60.34 60.339 174.327-174.327 451.661 451.661z" />
|
||||
<glyph unicode="" glyph-name="close" data-tags="close" d="M810.667 686.507l-60.16 60.16-238.507-238.507-238.507 238.507-60.16-60.16 238.507-238.507-238.507-238.507 60.16-60.16 238.507 238.507 238.507-238.507 60.16 60.16-238.507 238.507z" />
|
||||
<glyph unicode="" glyph-name="crop" data-tags="crop" d="M213.333 746.667h213.333v-85.333h-128v-128h-85.333v213.333zM597.333 746.666h213.333v-213.333h-85.333v128h-128v85.333zM725.333 362.667h85.333v-213.333h-213.333v85.333h128v128zM426.667 234.667v-85.333h-213.333v213.333h85.333v-128h128z" />
|
||||
<glyph unicode="" glyph-name="edit" data-tags="edit" d="M864.464 95.536c20.491 0 37.101-16.611 37.101-37.101 0-19.027-14.323-34.709-32.775-36.852l-4.327-0.25h-742.029c-20.491 0-37.101 16.611-37.101 37.101 0 19.027 14.323 34.709 32.775 36.852l4.327 0.25h742.029zM615.62 863.8c14.489 14.489 37.98 14.489 52.469 0v0l148.406-148.406c14.489-14.489 14.489-37.98 0-52.469v0l-445.217-445.217c-5.179-5.179-11.776-8.71-18.958-10.146v0l-185.507-37.101c-25.961-5.192-48.849 17.696-43.657 43.657v0l37.101 185.507c1.437 7.183 4.967 13.779 10.146 18.958v0zM641.855 785.067l-411.047-411.010-24.005-119.912 119.912 23.968 411.047 411.047-95.907 95.907z" />
|
||||
<glyph unicode="" glyph-name="expand" data-tags="expand" d="M426.675 64.009v85.333h-153.173l192 192-60.169 60.16-192-192v153.165h-85.333v-298.667l298.675 0.009zM618.667 494.49l192 192v-153.165h85.333v298.675h-298.667v-85.333h153.173l-192-192 60.16-60.177z" />
|
||||
<glyph unicode="" glyph-name="export" data-tags="export" d="M981.333 448l-170.667 170.665v-127.999h-384v-85.333h384v-128zM42.667 192v512c0 47.36 38.4 85.334 85.333 85.334h512c46.933 0 85.333-37.973 85.333-85.333v-128h-85.333v128h-512v-512h512v128h85.333v-128c0-46.933-38.4-85.333-85.333-85.333h-512c-46.933 0-85.333 37.974-85.333 85.333z" />
|
||||
<glyph unicode="" glyph-name="external-link" data-tags="external-link" d="M597.333 832v-85.333h153.003l-419.371-419.326 60.331-60.373 419.371 419.369v-153.003h85.333v298.667zM810.667 149.335h-597.333v597.331h298.667v85.333h-298.667c-47.147 0-85.333-38.229-85.333-85.333v-597.331c0-47.108 38.187-85.333 85.333-85.333h597.333c47.104 0 85.333 38.225 85.333 85.333v298.667h-85.333v-298.667z" />
|
||||
<glyph unicode="" glyph-name="graph" data-tags="graph" d="M81.778 832c20.058 0 36.589-14.824 38.848-33.922l0.263-4.478v-652.8h821.333c20.058 0 36.589-14.824 38.848-33.922l0.263-4.478c0-19.693-15.098-35.923-34.55-38.142l-4.561-0.258h-860.444c-20.058 0-36.589 14.824-38.848 33.922l-0.263 4.478v691.2c0 21.208 17.511 38.4 39.111 38.4zM942.222 832c21.6 0 39.111-17.192 39.111-38.4s-17.511-38.4-39.111-38.4c-129.303 0-194.668-30.495-252.972-121.64l-9.662-15.758c-3.205-5.443-6.399-11.079-9.59-16.912l-9.576-18.097-9.621-19.313-9.724-20.56-9.886-21.839-10.299-23.386-10.489-23.092-10.44-21.956-10.44-20.838c-1.743-3.381-3.488-6.716-5.235-10.006l-10.531-19.198c-75.848-133.727-161.008-185.007-335.535-185.007-21.6 0-39.111 17.192-39.111 38.4s17.511 38.4 39.111 38.4c129.303 0 194.668 30.495 252.972 121.64l9.662 15.758c3.205 5.443 6.399 11.079 9.59 16.912l9.576 18.097 9.621 19.313 9.724 20.56 9.886 21.839 10.299 23.386 10.489 23.092 10.44 21.956 10.44 20.838c1.743 3.381 3.488 6.716 5.235 10.006l10.531 19.198c75.848 133.727 161.008 185.007 335.535 185.007z" />
|
||||
<glyph unicode="" glyph-name="heart" data-tags="heart" d="M516.48 168.364l-4.48-4.053-4.48 4.053c-202.838 184.107-336.854 305.702-336.854 428.969 0 85.12 64.213 149.333 149.333 149.333 65.621 0 129.664-42.325 152.192-100.737h79.616c22.528 58.412 86.571 100.737 152.192 100.737 85.12 0 149.333-64.213 149.333-149.333 0-123.267-134.016-244.863-336.853-428.969zM704 832c-74.282 0-145.45-34.432-192-89.003-46.549 54.57-117.717 89.003-192 89.003-131.585 0-234.667-103.084-234.667-234.667 0-161.070 145.152-292.777 364.843-492.163l61.824-56.145 61.824 56.145c219.691 199.386 364.842 331.093 364.842 492.163 0 131.583-103.082 234.667-234.667 234.667z" />
|
||||
<glyph unicode="" glyph-name="import" data-tags="import" d="M640 448l-170.667 170.667v-128h-341.333v-85.333h341.333v-128zM896 192v512c0 47.36-38.4 85.334-85.333 85.334h-512c-46.933 0-85.333-37.973-85.333-85.333v-128h85.333v128h512v-512h-512v128h-85.333v-128c0-46.933 38.4-85.333 85.333-85.333h512c46.933 0 85.333 37.974 85.333 85.333z" />
|
||||
<glyph unicode="" glyph-name="info" data-tags="info" d="M469.334 576h85.333v85.333h-85.333zM512 106.669c-188.203 0-341.333 153.126-341.333 341.333 0 188.201 153.13 341.331 341.333 341.331s341.333-153.13 341.333-341.331c0-188.207-153.13-341.333-341.333-341.333zM512 874.667c-235.648 0-426.667-191.018-426.667-426.665 0-235.652 191.018-426.667 426.667-426.667s426.667 191.014 426.667 426.667c0 235.646-191.018 426.665-426.667 426.665zM469.334 234.669h85.333v256h-85.333v-256z" />
|
||||
<glyph unicode="" glyph-name="log" data-tags="log" d="M642.436 874.665c2.939 0.001 6.082-0.416 9.072-1.198 0.154-0.049 0.312-0.092 0.47-0.136 1.309-0.352 2.58-0.781 3.816-1.274 0.345-0.147 0.72-0.304 1.092-0.466 1.077-0.462 2.095-0.967 3.085-1.516 0.287-0.166 0.59-0.339 0.891-0.517 1.051-0.617 2.056-1.283 3.023-1.995 1.373-1.012 2.671-2.114 3.891-3.31l-3.027 2.654c0.889-0.696 1.743-1.432 2.561-2.205l0.466-0.449 217.6-213.333c0.166-0.163 0.33-0.327 0.492-0.492 0.769-0.785 1.478-1.575 2.149-2.395 0.328-0.403 0.641-0.803 0.945-1.209 0.526-0.696 1.037-1.433 1.521-2.189 0.368-0.585 0.718-1.172 1.051-1.767 0.352-0.615 0.678-1.24 0.985-1.876 0.33-0.702 0.648-1.42 0.941-2.148 1.147-2.823 1.925-5.81 2.293-8.919l0.244-4.147v-568.889c0-19.637-16.237-35.556-36.267-35.556v0h-652.8c-20.030 0-36.267 15.919-36.267 35.556v0 782.222c0 19.637 16.237 35.556 36.267 35.556v0l435.503-0.001zM605.867 803.584l-362.667-0.028v-711.111h580.267v497.806l-181.333-0.028c-18.599 0-33.928 13.726-36.023 31.409l-0.244 4.147v177.806zM714.667 305.778c20.030 0 36.267-15.919 36.267-35.556 0-18.234-14-33.262-32.037-35.316l-4.229-0.239h-362.667c-20.030 0-36.267 15.919-36.267 35.556 0 18.234 14 33.262 32.037 35.316l4.229 0.239h362.667zM714.667 483.556c20.030 0 36.267-15.919 36.267-35.556 0-18.234-14-33.262-32.037-35.316l-4.229-0.239h-362.667c-20.030 0-36.267 15.919-36.267 35.556 0 18.234 14 33.262 32.037 35.316l4.229 0.239h362.667zM497.067 661.333c20.030 0 36.267-15.919 36.267-35.556 0-18.234-14-33.262-32.037-35.316l-4.229-0.239h-145.067c-20.030 0-36.267 15.919-36.267 35.556 0 18.234 14 33.262 32.037 35.316l4.229 0.239h145.067z" />
|
||||
<glyph unicode="" glyph-name="menu" data-tags="menu" d="M128 704h768v-85.333h-768v85.333zM128 490.667h768v-85.333h-768v85.333zM128 277.333h768v-85.333h-768v85.333z" />
|
||||
<glyph unicode="" glyph-name="minus" data-tags="minus" d="M810.665 405.333h-597.332l0.022 85.244 597.31 0.090z" />
|
||||
<glyph unicode="" glyph-name="more-horizontal" data-tags="more-horizontal" d="M682.667 448c0 47.13 38.204 85.333 85.333 85.333s85.333-38.204 85.333-85.333c0-47.13-38.204-85.333-85.333-85.333s-85.333 38.204-85.333 85.333zM426.667 448c0 47.13 38.204 85.333 85.333 85.333s85.333-38.204 85.333-85.333c0-47.13-38.204-85.333-85.333-85.333s-85.333 38.204-85.333 85.333zM170.667 448c0 47.13 38.205 85.333 85.333 85.333s85.333-38.204 85.333-85.333c0-47.13-38.205-85.333-85.333-85.333s-85.333 38.204-85.333 85.333z" />
|
||||
<glyph unicode="" glyph-name="more-vertical" data-tags="more-vertical" d="M512 277.333c47.13 0 85.333-38.204 85.333-85.333s-38.204-85.333-85.333-85.333c-47.13 0-85.333 38.204-85.333 85.333s38.204 85.333 85.333 85.333zM512 533.333c47.13 0 85.333-38.204 85.333-85.333s-38.204-85.333-85.333-85.333c-47.13 0-85.333 38.204-85.333 85.333s38.204 85.333 85.333 85.333zM512 789.333c47.13 0 85.333-38.205 85.333-85.333s-38.204-85.333-85.333-85.333c-47.13 0-85.333 38.205-85.333 85.333s38.204 85.333 85.333 85.333z" />
|
||||
<glyph unicode="" glyph-name="order" data-tags="order" d="M306.603 675.324l53.635-53.635 96.275 96.275v-156.026l75.631 0.005v156.026l96.27-96.27 53.635 53.635-187.724 187.724-187.724-187.734zM456.503 369.408v-156.026l-96.27 96.27-53.635-53.635 187.729-187.729 187.724 187.724-53.635 53.635-96.275-96.275v156.026l-75.637 0.011z" />
|
||||
<glyph unicode="" glyph-name="pie" data-tags="pie" d="M426.667 917.333c305.164 0 554.667-249.503 554.667-554.667 0-112.403-35.055-223.614-97.054-314.227-13.323-19.473-39.922-24.435-59.37-11.076v0l-108.052 74.21c-70.984-82.472-178.083-132.907-290.191-132.907-211.297 0-384 172.703-384 384 0 196.89 149.953 360.268 341.357 381.634l-0.024 130.366c0 23.564 19.103 42.667 42.667 42.667zM128 362.667c0-164.169 134.497-298.667 298.667-298.667 83.822 0 164.433 36.579 219.328 96.285l-243.485 167.212c-11.587 7.958-18.51 21.113-18.51 35.169v0l0.023 295.604c-144.189-20.876-256.023-145.904-256.023-295.604zM469.333 830.037v-444.885l254.532-174.763c2.778-1.094 5.484-2.498 8.069-4.222 2.915-1.943 5.514-4.183 7.783-6.653l96.55-66.395 3.164 5.609c33.78 62.956 53.603 134.593 56.262 207.175v0l0.308 16.763c0 241.653-185.318 442.313-420.791 466.82v0l-5.876 0.551z" />
|
||||
<glyph unicode="" glyph-name="play-circle" data-tags="play-circle" d="M512 106.666c-188.203 0-341.333 153.131-341.333 341.333s153.13 341.333 341.333 341.333c188.202 0 341.333-153.13 341.333-341.333s-153.131-341.333-341.333-341.333zM512 874.666c-235.648 0-426.667-191.018-426.667-426.667s191.018-426.667 426.667-426.667c235.648 0 426.667 191.019 426.667 426.667s-191.019 426.667-426.667 426.667zM426.667 256l256 192-256 192v-384z" />
|
||||
<glyph unicode="" glyph-name="plus" data-tags="plus" d="M810.668 405.335h-256v-256h-85.333v256h-256.002v85.333h256.002v255.998h85.333v-255.998h256z" />
|
||||
<glyph unicode="" glyph-name="question-circle" data-tags="question-circle" d="M469.333 192h85.333v85.333h-85.333v-85.333zM512 874.667c-235.52 0-426.667-191.147-426.667-426.667s191.147-426.667 426.667-426.667c235.52 0 426.667 191.147 426.667 426.667s-191.147 426.667-426.667 426.667zM512 106.667c-188.16 0-341.333 153.173-341.333 341.333 0 188.167 153.174 341.333 341.333 341.333 188.169 0 341.333-153.167 341.333-341.333 0-188.16-153.165-341.333-341.333-341.333zM512 704c-94.293 0-170.667-76.373-170.667-170.667h85.333c0 46.933 38.4 85.333 85.333 85.333s85.333-38.4 85.333-85.333c0-85.333-128-74.667-128-213.333h85.333c0 96 128 106.667 128 213.333 0 94.293-76.373 170.667-170.667 170.667z" />
|
||||
<glyph unicode="" glyph-name="redirect" data-tags="redirect" d="M809.6 636.779l-54.676-54.676 98.034-98.034-537.385 0.028-0.027-77.34h537.412l-98.035-98.035 54.676-54.676 191.368 191.368zM510.928 69.964l-375.448 375.448 375.447 375.447 187.724-187.724 53.636 53.636-187.724 187.724c-29.634 29.634-77.664 29.607-107.271 0l-375.447-375.447c-29.609-29.609-29.634-77.637 0-107.271l375.448-375.448c29.607-29.607 77.661-29.609 107.271 0l187.724 187.724-53.635 53.635-187.724-187.724z" />
|
||||
<glyph unicode="" glyph-name="search" data-tags="search" d="M405.333 832c153.169 0 277.333-124.166 277.333-277.333 0-68.902-25.131-131.938-66.722-180.442l11.558-11.558h33.83l213.333-213.333-64-64-213.333 213.333v33.83l-11.558 11.558c-48.503-41.591-111.539-66.722-180.442-66.722-153.167 0-277.333 124.164-277.333 277.333 0 153.167 124.166 277.333 277.333 277.333zM405.333 746.666c-106.039 0-192-85.961-192-192s85.961-192 192-192c106.039 0 192 85.961 192 192s-85.961 192-192 192z" />
|
||||
<glyph unicode="" glyph-name="settings" data-tags="settings" d="M316.444 291.556c86.402 0 156.444-70.043 156.444-156.444s-70.043-156.444-156.444-156.444c-72.895 0-134.145 49.855-151.514 117.328l-83.152 0.005c-21.6 0-39.111 17.511-39.111 39.111 0 20.058 15.098 36.589 34.55 38.848l4.561 0.263 83.154 0.012c17.371 67.47 78.62 117.321 151.513 117.321zM316.444 213.333c-43.201 0-78.222-35.021-78.222-78.222s35.021-78.222 78.222-78.222c43.201 0 78.222 35.021 78.222 78.222s-35.021 78.222-78.222 78.222zM942.222 174.222c21.6 0 39.111-17.511 39.111-39.111 0-20.058-15.098-36.589-34.55-38.848l-4.561-0.263h-352c-21.6 0-39.111 17.511-39.111 39.111 0 20.058 15.098 36.589 34.55 38.848l4.561 0.263h352zM629.333 604.444c86.402 0 156.444-70.043 156.444-156.444s-70.043-156.444-156.444-156.444c-72.895 0-134.145 49.855-151.514 117.328l-396.041 0.005c-21.6 0-39.111 17.511-39.111 39.111 0 20.058 15.098 36.589 34.55 38.848l4.561 0.263 396.041 0.005c17.369 67.473 78.619 117.328 151.514 117.328zM629.333 526.222c-43.201 0-78.222-35.021-78.222-78.222s35.021-78.222 78.222-78.222c43.201 0 78.222 35.021 78.222 78.222s-35.021 78.222-78.222 78.222zM942.222 487.111c21.6 0 39.111-17.511 39.111-39.111 0-20.058-15.098-36.589-34.55-38.848l-4.561-0.263h-39.111c-21.6 0-39.111 17.511-39.111 39.111 0 20.058 15.098 36.589 34.55 38.848l4.561 0.263h39.111zM316.444 917.333c86.402 0 156.444-70.043 156.444-156.444s-70.043-156.444-156.444-156.444c-72.893 0-134.142 49.852-151.513 117.321l-83.154 0.012c-21.6 0-39.111 17.511-39.111 39.111 0 20.058 15.098 36.589 34.55 38.848l4.561 0.263 83.152 0.005c17.369 67.473 78.619 117.328 151.514 117.328zM316.444 839.111c-43.201 0-78.222-35.021-78.222-78.222s35.021-78.222 78.222-78.222c43.201 0 78.222 35.021 78.222 78.222s-35.021 78.222-78.222 78.222zM942.222 800c21.6 0 39.111-17.511 39.111-39.111 0-20.058-15.098-36.589-34.55-38.848l-4.561-0.263h-352c-21.6 0-39.111 17.511-39.111 39.111 0 20.058 15.098 36.589 34.55 38.848l4.561 0.263h352z" />
|
||||
<glyph unicode="" glyph-name="small-arrow-down" data-tags="small-arrow-down" d="M316.331 618.667l195.67-195.671 195.669 195.671 60.331-60.331-256-256.001-256.001 256.001z" />
|
||||
<glyph unicode="" glyph-name="small-arrow-left" data-tags="small-arrow-left" d="M657.664 252.329l-195.669 195.669 195.669 195.671-60.331 60.331-256-256.001 256-256z" />
|
||||
<glyph unicode="" glyph-name="small-arrow-right" data-tags="small-arrow-right" d="M341.333 252.33l195.671 195.669-195.671 195.67 60.331 60.331 256.001-256.001-256.001-256z" />
|
||||
<glyph unicode="" glyph-name="small-arrow-up" data-tags="small-arrow-up" d="M316.331 302.335l195.669 195.669 195.669-195.669 60.331 60.331-256 256.001-256-256.001z" />
|
||||
<glyph unicode="" glyph-name="support" data-tags="support" d="M257.778 213.333c68.913 0 126.29-22.763 171.434-58.604 27.788-22.031 43.677-55.758 43.677-91.426v0-45.525c0-21.6-17.511-39.111-39.111-39.111v0h-352c-21.6 0-39.111 17.511-39.111 39.111v0 45.525c0 35.669 15.889 69.396 43.656 91.41 45.165 35.857 102.542 58.62 171.455 58.62zM766.222 213.333c68.913 0 126.29-22.763 171.434-58.604 27.788-22.031 43.677-55.758 43.677-91.426v0-45.525c0-21.6-17.511-39.111-39.111-39.111v0h-352c-21.6 0-39.111 17.511-39.111 39.111v0 45.525c0 35.669 15.889 69.396 43.656 91.41 45.165 35.857 102.542 58.62 171.455 58.62zM257.778 135.111c-49.962 0-90.7-16.162-122.838-41.677-8.843-7.011-14.051-18.065-14.051-30.131v0-6.414h273.778v6.414c0 10.343-3.826 19.941-10.501 26.898v0l-3.571 3.25c-32.118 25.499-72.856 41.661-122.817 41.661zM766.222 135.111c-49.962 0-90.7-16.162-122.838-41.677-8.843-7.011-14.051-18.065-14.051-30.131v0-6.414h273.778v6.414c0 10.343-3.826 19.941-10.501 26.898v0l-3.571 3.25c-32.118 25.499-72.856 41.661-122.817 41.661zM257.778 526.222c75.602 0 136.889-61.287 136.889-136.889s-61.287-136.889-136.889-136.889c-75.602 0-136.889 61.287-136.889 136.889s61.287 136.889 136.889 136.889zM766.222 526.222c75.602 0 136.889-61.287 136.889-136.889s-61.287-136.889-136.889-136.889c-75.602 0-136.889 61.287-136.889 136.889s61.287 136.889 136.889 136.889zM257.778 448c-32.401 0-58.667-26.266-58.667-58.667s26.266-58.667 58.667-58.667c32.401 0 58.667 26.266 58.667 58.667s-26.266 58.667-58.667 58.667zM766.222 448c-32.401 0-58.667-26.266-58.667-58.667s26.266-58.667 58.667-58.667c32.401 0 58.667 26.266 58.667 58.667s-26.266 58.667-58.667 58.667zM942.222 917.333c21.6 0 39.111-17.511 39.111-39.111v0-234.667c0-21.6-17.511-39.111-39.111-39.111v0h-260.128l-184.773-147.874c-24.445-19.556-60.12-3.832-63.313 26.161v0l-0.23 4.38v391.111c0 21.6 17.511 39.111 39.111 39.111v0zM903.111 839.111h-391.111v-270.61l132.012 105.595c5.548 4.438 12.172 7.26 19.147 8.212v0l5.286 0.359h234.667v156.444z" />
|
||||
<glyph unicode="" glyph-name="trash" data-tags="trash" d="M823.106 604.408l4.568-0.062c20.007-1.429 35.42-17.666 36.289-37.229l-0.062-4.568-33.909-474.878c-4.21-59.139-51.749-105.459-110.243-108.809l-6.796-0.194h-401.906c-59.289 0-108.868 44.129-116.362 102.23l-0.676 6.764-33.909 474.887c-1.538 21.546 14.681 40.259 36.226 41.797 20.007 1.429 37.571-12.454 41.21-31.695l0.587-4.531 33.91-474.896c1.353-19.009 16.136-34.045 34.674-36.096l4.34-0.239h401.906c19.058 0 35.106 13.678 38.469 32.029l0.546 4.314 33.909 474.887c1.429 20.007 17.666 35.42 37.229 36.289zM81.778 682.667c-21.6 0-39.111 17.511-39.111 39.111 0 20.058 15.098 36.589 34.55 38.848l4.561 0.263 234.638 0.028 0.028 78.194c0 41.237 31.91 75.022 72.384 78.008l5.838 0.215h234.667c41.237 0 75.022-31.91 78.008-72.384l0.215-5.838-0.014-78.194 234.681-0.028c21.6 0 39.111-17.511 39.111-39.111 0-20.058-15.098-36.589-34.55-38.848l-4.561-0.263h-860.444zM629.333 839.111h-234.667v-78.194h234.667v78.194z" />
|
||||
<glyph unicode="" glyph-name="verify" data-tags="verify" d="M760.889 874.667c18.234 0 33.262-13.726 35.316-31.409l0.239-4.147-0.022-202c22.479-33.795 35.578-74.368 35.578-118 0-36.845-9.34-71.508-25.783-101.751l122.035-121.996c13.885-13.885 13.885-36.398 0-50.283-12.817-12.817-32.985-13.803-46.934-2.958l-3.35 2.958-81.554 81.575 0.028-269.767c0-18.234-13.726-33.262-31.409-35.316l-4.147-0.239h-640c-18.234 0-33.262 13.726-35.316 31.409l-0.239 4.147v782.222c0 18.234 13.726 33.262 31.409 35.316l4.147 0.239h640zM725.333 803.556h-568.889v-711.111h568.889l0.055 241.906c-31.391-18.171-67.842-28.572-106.722-28.572-78.95 0-147.883 42.887-184.774 106.634l-170.781 0.032c-19.637 0-35.556 15.919-35.556 35.556 0 18.234 13.726 33.262 31.409 35.316l4.147 0.239 145.175-0.017c-1.942 11.568-2.953 23.453-2.953 35.573 0 24.934 4.277 48.868 12.139 71.11l-154.361 0.001c-19.637 0-35.556 15.919-35.556 35.556 0 18.234 13.726 33.262 31.409 35.316l4.147 0.239 196.545 0.002c39.063 43.643 95.829 71.109 159.010 71.109 38.88 0 75.331-10.401 106.722-28.572l-0.055 99.683zM618.667 305.778c19.637 0 35.556-15.919 35.556-35.556 0-18.234-13.726-33.262-31.409-35.316l-4.147-0.239h-355.556c-19.637 0-35.556 15.919-35.556 35.556 0 18.234 13.726 33.262 31.409 35.316l4.147 0.239h355.556zM618.667 661.333c-66.252 0-121.924-45.301-137.729-106.618l137.729-0.049c19.637 0 35.556-15.919 35.556-35.556 0-18.234-13.726-33.262-31.409-35.316l-4.147-0.239-137.74-0.007c15.79-61.338 71.472-106.66 137.74-106.66 78.547 0 142.222 63.675 142.222 142.222s-63.675 142.222-142.222 142.222z" />
|
||||
<glyph unicode="" glyph-name="calculator" data-tags="calculator, compute, math, arithmetic, sum" d="M384 896h-320c-35.2 0-64-28.8-64-64v-320c0-35.2 28.796-64 64-64h320c35.2 0 64 28.8 64 64v320c0 35.2-28.8 64-64 64zM384 640h-320v64h320v-64zM896 896h-320c-35.204 0-64-28.8-64-64v-832c0-35.2 28.796-64 64-64h320c35.2 0 64 28.8 64 64v832c0 35.2-28.8 64-64 64zM896 320h-320v64h320v-64zM896 512h-320v64h320v-64zM384 384h-320c-35.2 0-64-28.8-64-64v-320c0-35.2 28.796-64 64-64h320c35.2 0 64 28.8 64 64v320c0 35.2-28.8 64-64 64zM384 128h-128v-128h-64v128h-128v64h128v128h64v-128h128v-64z" />
|
||||
<glyph unicode="" glyph-name="hour-glass" data-tags="hour-glass, loading, busy, wait" d="M728.992 448c137.754 87.334 231.008 255.208 231.008 448 0 21.676-1.192 43.034-3.478 64h-889.042c-2.29-20.968-3.48-42.326-3.48-64 0-192.792 93.254-360.666 231.006-448-137.752-87.334-231.006-255.208-231.006-448 0-21.676 1.19-43.034 3.478-64h889.042c2.288 20.966 3.478 42.324 3.478 64 0.002 192.792-93.252 360.666-231.006 448zM160 0c0 186.912 80.162 345.414 224 397.708v100.586c-143.838 52.29-224 210.792-224 397.706v0h704c0-186.914-80.162-345.416-224-397.706v-100.586c143.838-52.294 224-210.796 224-397.708h-704zM619.626 290.406c-71.654 40.644-75.608 93.368-75.626 125.366v64.228c0 31.994 3.804 84.914 75.744 125.664 38.504 22.364 71.808 56.348 97.048 98.336h-409.582c25.266-42.032 58.612-76.042 97.166-98.406 71.654-40.644 75.606-93.366 75.626-125.366v-64.228c0-31.992-3.804-84.914-75.744-125.664-72.622-42.18-126.738-125.684-143.090-226.336h501.67c-16.364 100.708-70.53 184.248-143.212 226.406z" />
|
||||
<glyph unicode="" glyph-name="key" data-tags="key, password, login, signin" d="M704 960c-176.73 0-320-143.268-320-320 0-20.026 1.858-39.616 5.376-58.624l-389.376-389.376v-192c0-35.346 28.654-64 64-64h64v64h128v128h128v128h128l83.042 83.042c34.010-12.316 70.696-19.042 108.958-19.042 176.73 0 320 143.268 320 320s-143.27 320-320 320zM799.874 639.874c-53.020 0-96 42.98-96 96s42.98 96 96 96 96-42.98 96-96-42.98-96-96-96z" />
|
||||
<glyph unicode="" glyph-name="lock" data-tags="lock, secure, private, encrypted" d="M592 512h-16v192c0 105.87-86.13 192-192 192h-128c-105.87 0-192-86.13-192-192v-192h-16c-26.4 0-48-21.6-48-48v-480c0-26.4 21.6-48 48-48h544c26.4 0 48 21.6 48 48v480c0 26.4-21.6 48-48 48zM192 704c0 35.29 28.71 64 64 64h128c35.29 0 64-28.71 64-64v-192h-256v192z" />
|
||||
<glyph unicode="" glyph-name="unlocked" data-tags="unlocked, lock-open" d="M768 896c105.87 0 192-86.13 192-192v-192h-128v192c0 35.29-28.71 64-64 64h-128c-35.29 0-64-28.71-64-64v-192h16c26.4 0 48-21.6 48-48v-480c0-26.4-21.6-48-48-48h-544c-26.4 0-48 21.6-48 48v480c0 26.4 21.6 48 48 48h400v192c0 105.87 86.13 192 192 192h128z" />
|
||||
<glyph unicode="" glyph-name="cloud" data-tags="cloud, weather" d="M1024 302.458c0 82.090-56.678 150.9-132.996 169.48-3.242 128.7-108.458 232.062-237.862 232.062-75.792 0-143.266-35.494-186.854-90.732-24.442 31.598-62.69 51.96-105.708 51.96-73.81 0-133.642-59.874-133.642-133.722 0-6.436 0.48-12.76 1.364-18.954-11.222 2.024-22.766 3.138-34.57 3.138-106.998 0.002-193.732-86.786-193.732-193.842 0-107.062 86.734-193.848 193.73-193.848l656.262 0.012c96.138 0.184 174.008 78.212 174.008 174.446z" />
|
||||
<glyph unicode="" glyph-name="cloud-check" data-tags="cloud-check, cloud, synced" d="M892.268 445.51c2.442 11.108 3.732 22.646 3.732 34.49 0 88.366-71.634 160-160 160-14.224 0-28.014-1.868-41.134-5.352-24.796 77.352-97.288 133.352-182.866 133.352-87.348 0-161.054-58.336-184.326-138.17-22.742 6.62-46.792 10.17-71.674 10.17-141.384 0-256-114.616-256-256 0-141.382 114.616-256 256-256h608c88.366 0 160 71.632 160 160 0 78.718-56.854 144.16-131.732 157.51zM416 192l-160 160 64 64 96-96 224 224 64-64-288-288z" />
|
||||
<glyph unicode="" glyph-name="earth" data-tags="earth, globe, language, web, internet, sphere, planet" d="M512 960c-282.77 0-512-229.23-512-512s229.23-512 512-512 512 229.23 512 512-229.23 512-512 512zM512-0.002c-62.958 0-122.872 13.012-177.23 36.452l233.148 262.29c5.206 5.858 8.082 13.422 8.082 21.26v96c0 17.674-14.326 32-32 32-112.99 0-232.204 117.462-233.374 118.626-6 6.002-14.14 9.374-22.626 9.374h-128c-17.672 0-32-14.328-32-32v-192c0-12.122 6.848-23.202 17.69-28.622l110.31-55.156v-187.886c-116.052 80.956-192 215.432-192 367.664 0 68.714 15.49 133.806 43.138 192h116.862c8.488 0 16.626 3.372 22.628 9.372l128 128c6 6.002 9.372 14.14 9.372 22.628v77.412c40.562 12.074 83.518 18.588 128 18.588 70.406 0 137.004-16.26 196.282-45.2-4.144-3.502-8.176-7.164-12.046-11.036-36.266-36.264-56.236-84.478-56.236-135.764s19.97-99.5 56.236-135.764c36.434-36.432 85.218-56.264 135.634-56.26 3.166 0 6.342 0.080 9.518 0.236 13.814-51.802 38.752-186.656-8.404-372.334-0.444-1.744-0.696-3.488-0.842-5.224-81.324-83.080-194.7-134.656-320.142-134.656z" />
|
||||
<glyph unicode="" glyph-name="frustrated2" data-tags="frustrated, emoticon, smiley, face, angry" d="M256 304v-96c0-8.674 7.328-16 16-16h112v128h-112c-8.672 0-16-7.326-16-16zM448 320h128v-128h-128v128zM752 320h-112v-128h112c8.674 0 16 7.326 16 16v96c0 8.674-7.326 16-16 16zM512 960c-282.77 0-512-229.23-512-512s229.23-512 512-512 512 229.23 512 512-229.23 512-512 512zM576.096 579.484c2.034 47.454 45.212 78.946 81.592 97.138 34.742 17.37 69.102 26.060 70.548 26.422 17.146 4.288 34.518-6.138 38.806-23.284 4.284-17.144-6.14-34.518-23.284-38.804-17.624-4.45-38.522-12.12-56.936-21.35 10.648-11.43 17.174-26.752 17.174-43.606 0-35.346-28.654-64-64-64s-64 28.654-64 64c0.002 1.17 0.040 2.33 0.1 3.484zM256.958 679.76c4.288 17.146 21.66 27.572 38.806 23.284 1.446-0.362 35.806-9.052 70.548-26.422 36.38-18.192 79.56-49.684 81.592-97.138 0.062-1.154 0.098-2.314 0.098-3.484 0-35.346-28.654-64-64-64s-64 28.654-64 64c0 16.854 6.526 32.176 17.174 43.606-18.414 9.23-39.31 16.9-56.936 21.35-17.142 4.286-27.566 21.66-23.282 38.804zM832 208c0-44.112-35.888-80-80-80h-480c-44.112 0-80 35.888-80 80v96c0 44.112 35.888 80 80 80h480c44.112 0 80-35.888 80-80v-96z" />
|
||||
<glyph unicode="" glyph-name="enter" data-tags="enter, signin, login" d="M384 448h-320v128h320v128l192-192-192-192zM1024 960v-832l-384-192v192h-384v256h64v-192h320v576l256 128h-576v-256h-64v320z" />
|
||||
<glyph unicode="" glyph-name="make-group" data-tags="make-group" d="M320 832h-128c-35.2 0-64-28.8-64-64v-128c0-35.2 28.8-64 64-64h128c35.2 0 64 28.8 64 64v128c0 35.2-28.8 64-64 64zM704 576h128c35.2 0 64 28.8 64 64v128c0 35.2-28.8 64-64 64h-128c-35.2 0-64-28.8-64-64v-128c0-35.2 28.8-64 64-64zM704 768h128v-128h-128v128zM320 320h-128c-35.2 0-64-28.8-64-64v-128c0-35.2 28.8-64 64-64h128c35.2 0 64 28.8 64 64v128c0 35.2-28.8 64-64 64zM320 128h-128v128h128v-128zM832 320h-128c-35.2 0-64-28.8-64-64v-128c0-35.2 28.8-64 64-64h128c35.2 0 64 28.8 64 64v128c0 35.2-28.8 64-64 64zM896 448h-64c-85.476 0-165.834 33.286-226.274 93.724-60.44 60.442-93.726 140.802-93.726 226.276v64c0 70.4-57.6 128-128 128h-256c-70.4 0-128-57.6-128-128v-256c0-70.4 57.6-128 128-128h64c85.476 0 165.834-33.286 226.274-93.724 60.44-60.442 93.726-140.802 93.726-226.276v-64c0-70.4 57.6-128 128-128h256c70.4 0 128 57.6 128 128v256c0 70.4-57.6 128-128 128zM960 64c0-16.954-6.696-32.986-18.856-45.144-12.158-12.16-28.19-18.856-45.144-18.856h-256c-16.954 0-32.986 6.696-45.144 18.856-12.16 12.158-18.856 28.19-18.856 45.144v64c0 212.078-171.922 384-384 384h-64c-16.954 0-32.986 6.696-45.146 18.854-12.158 12.16-18.854 28.192-18.854 45.146v256c0 16.954 6.696 32.986 18.854 45.146 12.16 12.158 28.192 18.854 45.146 18.854h256c16.954 0 32.986-6.696 45.146-18.854 12.158-12.16 18.854-28.192 18.854-45.146v-64c0-212.078 171.922-384 384-384h64c16.954 0 32.986-6.696 45.144-18.856 12.16-12.158 18.856-28.19 18.856-45.144v-256z" />
|
||||
<glyph unicode="" glyph-name="insert-template" data-tags="insert-template, wysiwyg" d="M384 768h128v-64h-128zM576 768h128v-64h-128zM896 768v-256h-192v64h128v128h-64v64zM320 576h128v-64h-128zM512 576h128v-64h-128zM192 704v-128h64v-64h-128v256h192v-64zM384 384h128v-64h-128zM576 384h128v-64h-128zM896 384v-256h-192v64h128v128h-64v64zM320 192h128v-64h-128zM512 192h128v-64h-128zM192 320v-128h64v-64h-128v256h192v-64zM960 896h-896v-896h896v896zM1024 960v0-1024h-1024v1024h1024z" />
|
||||
</font></defs></svg>
|
After Width: | Height: | Size: 32 KiB |
16
wp-content/plugins/advanced-google-recaptcha/css/jquery.dataTables.min.css
vendored
Normal file
7
wp-content/plugins/advanced-google-recaptcha/css/sweetalert2.min.css
vendored
Normal file
1
wp-content/plugins/advanced-google-recaptcha/css/tooltipster.bundle.min.css
vendored
Normal file
3319
wp-content/plugins/advanced-google-recaptcha/css/wpcaptcha.css
Normal file
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 33 KiB |
After Width: | Height: | Size: 1.3 KiB |
BIN
wp-content/plugins/advanced-google-recaptcha/images/design.png
Normal file
After Width: | Height: | Size: 55 KiB |
BIN
wp-content/plugins/advanced-google-recaptcha/images/image.png
Normal file
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 4.7 KiB |
BIN
wp-content/plugins/advanced-google-recaptcha/images/map.png
Normal file
After Width: | Height: | Size: 82 KiB |
BIN
wp-content/plugins/advanced-google-recaptcha/images/sort_asc.png
Normal file
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 24 KiB |
2
wp-content/plugins/advanced-google-recaptcha/index.php
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
// silence is golden
|
@ -0,0 +1,104 @@
|
||||
<?php
|
||||
/**
|
||||
* WP Captcha
|
||||
* https://getwpcaptcha.com/
|
||||
* (c) WebFactory Ltd, 2022 - 2023, www.webfactoryltd.com
|
||||
*/
|
||||
|
||||
class WPCaptcha_Tab_Activity extends WPCaptcha
|
||||
{
|
||||
static function display()
|
||||
{
|
||||
$tabs[] = array('id' => 'tab_log_locks', 'class' => 'tab-content', 'label' => __('Access Locks', 'advanced-google-recaptcha'), 'callback' => array(__CLASS__, 'tab_locks'));
|
||||
$tabs[] = array('id' => 'tab_log_full', 'class' => 'tab-content', 'label' => __('Failed Logins', 'advanced-google-recaptcha'), 'callback' => array(__CLASS__, 'tab_full'));
|
||||
|
||||
echo '<div id="tabs_log" class="ui-tabs wpcaptcha-tabs-2nd-level">';
|
||||
echo '<ul>';
|
||||
foreach ($tabs as $tab) {
|
||||
echo '<li><a href="#' . esc_attr($tab['id']) . '">' . esc_html($tab['label']) . '</a></li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
|
||||
foreach ($tabs as $tab) {
|
||||
if (is_callable($tab['callback'])) {
|
||||
echo '<div style="display: none;" id="' . esc_attr($tab['id']) . '" class="' . esc_attr($tab['class']) . '">';
|
||||
call_user_func($tab['callback']);
|
||||
echo '</div>';
|
||||
}
|
||||
} // foreach
|
||||
|
||||
echo '</div>'; // second level of tabs
|
||||
} // display
|
||||
|
||||
static function tab_locks()
|
||||
{
|
||||
echo '<div class="wpcaptcha-stats-main wpcaptcha-chart-locks" style="display:none"><canvas id="wpcaptcha-locks-chart" style="height: 160px; width: 100%;"></canvas></div>';
|
||||
echo '<div class="wpcaptcha-stats-main wpcaptcha-stats-locks" style="display:none;">';
|
||||
echo '<img src="' . esc_url(WPCAPTCHA_PLUGIN_URL) . '/images/advanced_stats.png" alt="WP Captcha" title="WP Captcha Stats" />';
|
||||
echo'</div>';
|
||||
echo '<div class="tab-content">';
|
||||
echo '<div id="wpcaptcha-locks-log-table-wrapper">
|
||||
<table cellpadding="0" cellspacing="0" border="0" class="display" id="wpcaptcha-locks-log-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th style="width:160px;">Date & time</th>
|
||||
<th>Reason</th>
|
||||
<th>Location/IP</th>
|
||||
<th style="width:280px;">User Agent</th>
|
||||
<th style="width:80px;"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Date & time</th>
|
||||
<th>Reason</th>
|
||||
<th>Location/IP</th>
|
||||
<th>User Agent</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
<div data-log="locks" class="tooltip empty_log tooltipstered" data-msg-success="Access Locks Log Emptied" data-btn-confirm="Yes, empty the log" data-title="Are you sure you want to empty the Access Locks Log?" data-wait-msg="Emptying. Please wait." data-name=""><i class="wpcaptcha-icon wpcaptcha-trash"></i> Empty Access Locks Log</div>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
static function tab_full()
|
||||
{
|
||||
echo '<div class="wpcaptcha-stats-main wpcaptcha-chart-fails" style="display:none"><canvas id="wpcaptcha-fails-chart" style="height: 160px; width: 100%;"></canvas></div>';
|
||||
echo '<div class="wpcaptcha-stats-main wpcaptcha-stats-fails" style="display:none;">';
|
||||
echo '<img src="' . esc_url(WPCAPTCHA_PLUGIN_URL) . '/images/advanced_stats.png" alt="WP Captcha" title="WP Captcha Stats" />';
|
||||
echo'</div>';
|
||||
echo '<div class="tab-content">';
|
||||
echo '<div id="wpcaptcha-fails-log-table-wrapper">
|
||||
<table cellpadding="0" cellspacing="0" border="0" class="display" id="wpcaptcha-fails-log-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:160px;">Date & time</th>
|
||||
<th style="width:280px;">User/Pass</th>
|
||||
<th>Location/IP</th>
|
||||
<th style="width:280px;">User Agent</th>
|
||||
<th style="width:280px;">Reason</th>
|
||||
<th style="width:80px;"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Date & time</th>
|
||||
<th>User/Pass</th>
|
||||
<th>Location/IP</th>
|
||||
<th>User Agent</th>
|
||||
<th>Reason</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
<div data-log="fails" class="tooltip empty_log tooltipstered" data-msg-success="Fails Log Emptied" data-btn-confirm="Yes, empty the log" data-title="Are you sure you want to empty the Failed Logins Log?" data-wait-msg="Emptying. Please wait." data-name=""><i class="wpcaptcha-icon wpcaptcha-trash"></i> Empty Failed Logins Log</div>';
|
||||
echo '</div>';
|
||||
}
|
||||
} // class WPCaptcha_Tab_Activity
|
@ -0,0 +1,251 @@
|
||||
<?php
|
||||
/**
|
||||
* WP Captcha
|
||||
* https://getwpcaptcha.com/
|
||||
* (c) WebFactory Ltd, 2022 - 2023, www.webfactoryltd.com
|
||||
*/
|
||||
|
||||
class WPCaptcha_Tab_Captcha extends WPCaptcha
|
||||
{
|
||||
static function display()
|
||||
{
|
||||
$tabs[] = array('id' => 'tab_captcha', 'class' => 'tab-content', 'label' => __('Captcha', 'advanced-google-recaptcha'), 'callback' => array(__CLASS__, 'tab_captcha'));
|
||||
$tabs[] = array('id' => 'tab_captcha_location', 'class' => 'tab-content', 'label' => __('Where To Show', 'advanced-google-recaptcha'), 'callback' => array(__CLASS__, 'tab_captcha_location'));
|
||||
|
||||
echo '<div id="tabs_log" class="ui-tabs wpcaptcha-tabs-2nd-level">';
|
||||
echo '<ul>';
|
||||
foreach ($tabs as $tab) {
|
||||
echo '<li><a href="#' . esc_attr($tab['id']) . '">' . esc_html($tab['label']) . '</a></li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
|
||||
foreach ($tabs as $tab) {
|
||||
if (is_callable($tab['callback'])) {
|
||||
echo '<div style="display: none;" id="' . esc_attr($tab['id']) . '" class="' . esc_attr($tab['class']) . '">';
|
||||
call_user_func($tab['callback']);
|
||||
echo '</div>';
|
||||
}
|
||||
} // foreach
|
||||
|
||||
echo '</div>'; // second level of tabs
|
||||
} // display
|
||||
|
||||
static function tab_captcha()
|
||||
{
|
||||
$options = WPCaptcha_Setup::get_options();
|
||||
|
||||
echo '<div class="tab-content">';
|
||||
|
||||
echo '<table class="form-table"><tbody>';
|
||||
|
||||
$captcha = array();
|
||||
$captcha[] = array('val' => 'disabled', 'label' => 'Disabled');
|
||||
$captcha[] = array('val' => 'builtin', 'label' => 'Built-in Math Captcha');
|
||||
$captcha[] = array('val' => 'icons', 'label' => 'Built-in Icon Captcha', 'class' => 'pro-option');
|
||||
$captcha[] = array('val' => 'recaptchav2', 'label' => 'Google reCAPTCHA v2');
|
||||
$captcha[] = array('val' => 'recaptchav3', 'label' => 'Google reCAPTCHA v3');
|
||||
$captcha[] = array('val' => 'hcaptcha', 'label' => 'hCaptcha', 'class' => 'pro-option');
|
||||
$captcha[] = array('val' => 'cloudflare', 'label' => 'Cloudflare Turnstile', 'class' => 'pro-option');
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label for="captcha">Captcha</label></th>
|
||||
<td><select id="captcha" name="' . esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[captcha]">';
|
||||
WPCaptcha_Utility::create_select_options($captcha, $options['captcha']);
|
||||
echo '</select>';
|
||||
echo '<br /><span>Captcha or "are you human" verification ensures bots can\'t attack your login page and provides additional protection with minimal impact to users.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr class="captcha_keys_wrapper" style="display:none;" valign="top">
|
||||
<th scope="row"><label for="captcha_site_key">Captcha Site Key</label></th>
|
||||
<td><input type="text" class="regular-text" id="captcha_site_key" name="' . esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[captcha_site_key]" value="' . esc_html($options['captcha_site_key']) . '" data-old="' . esc_html($options['captcha_site_key']) . '" />';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr class="captcha_keys_wrapper" style="display:none;" valign="top">
|
||||
<th scope="row"><label for="captcha_secret_key">Captcha Secret Key</label></th>
|
||||
<td><input type="text" class="regular-text" id="captcha_secret_key" name="' . esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[captcha_secret_key]" value="' . esc_html($options['captcha_secret_key']) . '" data-old="' . esc_html($options['captcha_secret_key']) . '" />';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr class="captcha_verify_wrapper" style="display:none;" valign="top">
|
||||
<th scope="row"></th>
|
||||
<td><button id="verify-captcha" class="button button-primary button-large button-yellow">Verify Captcha <i class="wpcaptcha-icon wpcaptcha-make-group"></i></button>';
|
||||
echo '<input type="hidden" class="regular-text" id="captcha_verified" name="' . esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[captcha_verified]" value="0" />';
|
||||
echo '<br /><span>Click the Verify Captcha button to verify that the captcha is valid and working otherwise captcha settings will not be saved</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr><td></td><td>';
|
||||
WPCaptcha_admin::footer_save_button();
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr><td colspan="2">';
|
||||
echo '<div class="captcha-box-wrapper ' . ($options['captcha'] == 'disabled'?'captcha-selected':'') . '" data-captcha="disabled">';
|
||||
echo '<img src="' . esc_url(WPCAPTCHA_PLUGIN_URL) . '/images/captcha_disabled.png" />';
|
||||
echo '<div class="captcha-box-desc">';
|
||||
echo '<h3>Captcha Disabled</h3>';
|
||||
echo '<ul>';
|
||||
echo '<li>No Additional Security</li>';
|
||||
echo '</ul>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
||||
echo '<div class="captcha-box-wrapper ' . ($options['captcha'] == 'builtin'?'captcha-selected':'') . '" data-captcha="builtin">';
|
||||
echo '<img src="' . esc_url(WPCAPTCHA_PLUGIN_URL) . '/images/captcha_builtin.png" />';
|
||||
echo '<div class="captcha-box-desc">';
|
||||
echo '<h3>Built-in Math Captcha</h3>';
|
||||
echo '<ul>';
|
||||
echo '<li>Medium Security</li>';
|
||||
echo '<li>No API keys</li>';
|
||||
echo '<li>No 3rd party services</li>';
|
||||
echo '<li>GDPR Compatible</li>';
|
||||
echo '</ul>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
||||
echo '<div class="captcha-box-wrapper ' . ($options['captcha'] == 'icons'?'captcha-selected':'') . '" data-captcha="icons">';
|
||||
echo '<a title="This feature is available in the PRO version. Click for details." href="#" data-feature="recaptchav2" class="open-upsell pro-label">PRO</a>';
|
||||
echo '<img src="' . esc_url(WPCAPTCHA_PLUGIN_URL) . '/images/captcha_icons.png" />';
|
||||
echo '<div class="captcha-box-desc">';
|
||||
echo '<h3>Built-in Icon Captcha</h3>';
|
||||
echo '<ul>';
|
||||
echo '<li>Medium Security</li>';
|
||||
echo '<li>No API keys</li>';
|
||||
echo '<li>No 3rd party services</li>';
|
||||
echo '<li>GDPR Compatible</li>';
|
||||
echo '</ul>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
||||
echo '<div class="captcha-box-wrapper ' . ($options['captcha'] == 'recaptchav2'?'captcha-selected':'') . '" data-captcha="recaptchav2">';
|
||||
echo '<img src="' . esc_url(WPCAPTCHA_PLUGIN_URL) . '/images/captcha_recaptcha_v2.png" />';
|
||||
echo '<div class="captcha-box-desc">';
|
||||
echo '<h3>Google reCaptcha v2</h3>';
|
||||
echo '<ul>';
|
||||
echo '<li>High Security</li>';
|
||||
echo '<li>Requires <a href="https://www.google.com/recaptcha/about/" target="_blank">API Keys</a></li>';
|
||||
echo '<li>Powered by Google</li>';
|
||||
echo '<li>Not GDPR Compatible</li>';
|
||||
echo '</ul>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
||||
echo '<div class="captcha-box-wrapper ' . ($options['captcha'] == 'recaptchav3'?'captcha-selected':'') . '" data-captcha="recaptchav3">';
|
||||
echo '<img src="' . esc_url(WPCAPTCHA_PLUGIN_URL) . '/images/captcha_recaptcha_v3.png" />';
|
||||
echo '<div class="captcha-box-desc">';
|
||||
echo '<h3>Google reCaptcha v3</h3>';
|
||||
echo '<ul>';
|
||||
echo '<li>High Security</li>';
|
||||
echo '<li>Requires <a href="https://www.google.com/recaptcha/about/" target="_blank">API Keys</a></li>';
|
||||
echo '<li>Powered by Google</li>';
|
||||
echo '<li>Not GDPR Compatible</li>';
|
||||
echo '</ul>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
||||
echo '<div class="captcha-box-wrapper ' . ($options['captcha'] == 'hcaptcha'?'captcha-selected':'') . '" data-captcha="hcaptcha">';
|
||||
echo '<a title="This feature is available in the PRO version. Click for details." href="#" data-feature="recaptchav2" class="open-upsell pro-label">PRO</a>';
|
||||
echo '<img src="' . esc_url(WPCAPTCHA_PLUGIN_URL) . '/images/captcha_hcaptcha.png" />';
|
||||
echo '<div class="captcha-box-desc">';
|
||||
echo '<h3>hCaptcha</h3>';
|
||||
echo '<ul>';
|
||||
echo '<li>High Security</li>';
|
||||
echo '<li>Requires <a href="https://www.hcaptcha.com/signup-interstitial" target="_blank">API Keys</a></li>';
|
||||
echo '<li>GDPR Compatible</li>';
|
||||
echo '<li>Best Choice</li>';
|
||||
echo '</ul>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
||||
echo '<div class="captcha-box-wrapper ' . ($options['captcha'] == 'cloudflare'?'captcha-selected':'') . '" data-captcha="cloudflare">';
|
||||
echo '<a title="This feature is available in the PRO version. Click for details." href="#" data-feature="recaptchav2" class="open-upsell pro-label">PRO</a>';
|
||||
echo '<img src="' . esc_url(WPCAPTCHA_PLUGIN_URL) . '/images/captcha_cloudflare.png" />';
|
||||
echo '<div class="captcha-box-desc">';
|
||||
echo '<h3>Cloudflare Turnstile</h3>';
|
||||
echo '<ul>';
|
||||
echo '<li>High Security</li>';
|
||||
echo '<li>Requires <a href="https://dash.cloudflare.com/sign-up?to=/:account/turnstile" target="_blank">API Keys</a></li>';
|
||||
echo '<li>Not explicitly GDPR Compatible</li>';
|
||||
echo '<li>Powered by Cloudflare</li>';
|
||||
echo '</ul>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
||||
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '</tbody></table>';
|
||||
|
||||
echo '</div>';
|
||||
} // tab_captcha
|
||||
|
||||
static function tab_captcha_location()
|
||||
{
|
||||
$options = WPCaptcha_Setup::get_options();
|
||||
|
||||
echo '<div class="tab-content">';
|
||||
|
||||
echo '<table class="form-table"><tbody>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label for="captcha_show_login">Login Form</label></th>
|
||||
<td>';
|
||||
WPCaptcha_Utility::create_toggle_switch('captcha_show_login', array('saved_value' => $options['captcha_show_login'], 'option_key' => esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[captcha_show_login]'));
|
||||
echo '<br /><span>Applies to default login, WooCommerce, and Easy Digital Downloads login pages</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label for="captcha_show_wp_registration">Registration Form</label></th>
|
||||
<td>';
|
||||
WPCaptcha_Utility::create_toggle_switch('captcha_show_wp_registration', array('saved_value' => $options['captcha_show_wp_registration'], 'option_key' => esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[captcha_show_wp_registration]'));
|
||||
echo '<br /><span>Show captcha on WordPress user registration form</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label for="captcha_show_wp_lost_password">Lost Password Form</label></th>
|
||||
<td>';
|
||||
WPCaptcha_Utility::create_toggle_switch('captcha_show_wp_lost_password', array('saved_value' => $options['captcha_show_wp_lost_password'], 'option_key' => esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[captcha_show_wp_lost_password]'));
|
||||
echo '<br /><span>Show captcha on WordPress lost password form</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label for="captcha_show_wp_comment">Comment Form</label></th>
|
||||
<td>';
|
||||
WPCaptcha_Utility::create_toggle_switch('captcha_show_wp_comment', array('saved_value' => $options['captcha_show_wp_comment'], 'option_key' => esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[captcha_show_wp_comment]'));
|
||||
echo '<br /><span>Show captcha on WordPress comments form</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label for="captcha_show_woo_registration">WooCommerce Registration Form</label></th>
|
||||
<td>';
|
||||
WPCaptcha_Utility::create_toggle_switch('captcha_show_woo_registration', array('saved_value' => $options['captcha_show_woo_registration'], 'option_key' => esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[captcha_show_woo_registration]'));
|
||||
echo '<br /><span>Show captcha on WooCommerce registration form</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label for="captcha_show_woo_checkout">WooCommerce Checkout Form</label></th>
|
||||
<td>';
|
||||
WPCaptcha_Utility::create_toggle_switch('captcha_show_woo_checkout', array('saved_value' => $options['captcha_show_woo_checkout'], 'option_key' => esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[captcha_show_woo_checkout]'));
|
||||
echo '<br /><span>Show captcha on WooCommerce checkout form</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label for="captcha_show_edd_registration">Easy Digital Downloads Registration Form</label></th>
|
||||
<td>';
|
||||
WPCaptcha_Utility::create_toggle_switch('captcha_show_edd_registration', array('saved_value' => $options['captcha_show_edd_registration'], 'option_key' => esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[captcha_show_edd_registration]'));
|
||||
echo '<br /><span>Show captcha on Easy Digital Downloads registration form</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label for="captcha_show_bp_registration">BuddyPress Registration Form</label></th>
|
||||
<td>';
|
||||
WPCaptcha_Utility::create_toggle_switch('captcha_show_bp_registration', array('saved_value' => $options['captcha_show_bp_registration'], 'option_key' => esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[captcha_show_bp_registration]'));
|
||||
echo '<br /><span>Show captcha on BuddyPress registration form</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr><td></td><td>';
|
||||
WPCaptcha_admin::footer_save_button();
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '</tbody></table>';
|
||||
|
||||
echo '</div>';
|
||||
} // tab_captcha_location
|
||||
} // class WPCaptcha_Tab_Captcha
|
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* WP Captcha
|
||||
* https://getwpcaptcha.com/
|
||||
* (c) WebFactory Ltd, 2022 - 2023, www.webfactoryltd.com
|
||||
*/
|
||||
|
||||
class WPCaptcha_Tab_Design extends WPCaptcha
|
||||
{
|
||||
static function display()
|
||||
{
|
||||
echo '<div class="tab-content">';
|
||||
|
||||
$options = WPCaptcha_Setup::get_options();
|
||||
$templates = WPCaptcha_Functions::get_templates();
|
||||
|
||||
echo '<table class="form-table"><tbody>';
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label for="block_bots">Enable Customizer</label></th>
|
||||
<td>';
|
||||
WPCaptcha_Utility::create_toggle_switch('design_enable', array('saved_value' => $options['design_enable'], 'option_key' => esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[design_enable]'));
|
||||
echo '<br /><span>You can enable the customizer to use the settings below or leave it turned off to show the default WordPress login page style or customize it using a different plugin or theme settings</span>';
|
||||
echo '</td></tr>';
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
|
||||
echo '<h3>Templates:</h3>';
|
||||
echo '<ul class="design-templates">';
|
||||
foreach($templates as $template_id => $template){
|
||||
WPCaptcha_Utility::wp_kses_wf('<li><a class="disable_confirm_action ' . ($template_id == $options['design_template']?'design-template-active':'') . '" data-confirm="Are you sure you want to enable this template? This will overwrite all Design settings." href="' . add_query_arg(array('_wpnonce' => wp_create_nonce('wpcaptcha_install_template'), 'template' => $template_id, 'action' => 'wpcaptcha_install_template', 'redirect' => urlencode($_SERVER['REQUEST_URI'])), admin_url('admin.php')) . '"><img src="' . WPCAPTCHA_PLUGIN_URL . '/images/templates/' . $template_id . '.jpg"></a></li>');
|
||||
}
|
||||
echo '</ul>';
|
||||
|
||||
echo '<tr><td></td><td>';
|
||||
WPCaptcha_admin::footer_save_button();
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<br />';
|
||||
|
||||
echo '<div class="notice-box-info">
|
||||
The Design options allow you to completely customize the login page appearance.<a href="#" class="open-pro-dialog" data-pro-feature="design">Get PRO now</a> to use the Design feature.
|
||||
</div>';
|
||||
|
||||
echo '<img class="open-upsell open-upsell-block" data-feature="design" style="width: 100%;" src="' . esc_url(WPCAPTCHA_PLUGIN_URL) . '/images/design.png" alt="WP Captcha" title="WP Captcha Design" />';
|
||||
echo '</div>';
|
||||
} // display
|
||||
|
||||
} // class WPCaptcha_Tab_Login_Form
|
@ -0,0 +1,229 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* WP Captcha
|
||||
* https://getwpcaptcha.com/
|
||||
* (c) WebFactory Ltd, 2022 - 2023, www.webfactoryltd.com
|
||||
*/
|
||||
|
||||
class WPCaptcha_Tab_Firewall extends WPCaptcha
|
||||
{
|
||||
static function display()
|
||||
{
|
||||
$tabs[] = array('id' => 'tab_general', 'class' => 'tab-content', 'label' => __('General', 'advanced-google-recaptcha'), 'callback' => array(__CLASS__, 'tab_general'));
|
||||
$tabs[] = array('id' => 'tab_2fa', 'class' => 'tab-content', 'label' => __('2FA', 'advanced-google-recaptcha'), 'callback' => array(__CLASS__, 'tab_2fa'));
|
||||
$tabs[] = array('id' => 'tab_cloud_protection', 'class' => 'tab-content', 'label' => __('Cloud Protection', 'advanced-google-recaptcha'), 'callback' => array(__CLASS__, 'tab_cloud_protection'));
|
||||
|
||||
echo '<div id="tabs_log" class="ui-tabs wpcaptcha-tabs-2nd-level">';
|
||||
echo '<ul>';
|
||||
foreach ($tabs as $tab) {
|
||||
echo '<li><a href="#' . esc_attr($tab['id']) . '">' . esc_html($tab['label']) . '</a></li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
|
||||
foreach ($tabs as $tab) {
|
||||
if (is_callable($tab['callback'])) {
|
||||
echo '<div style="display: none;" id="' . esc_attr($tab['id']) . '" class="' . esc_attr($tab['class']) . '">';
|
||||
call_user_func($tab['callback']);
|
||||
echo '</div>';
|
||||
}
|
||||
} // foreach
|
||||
|
||||
echo '</div>'; // second level of tabs
|
||||
|
||||
|
||||
} // display
|
||||
|
||||
static function tab_general()
|
||||
{
|
||||
$options = WPCaptcha_Setup::get_options();
|
||||
|
||||
echo '<p>Securing your WordPress website is vital for maintaining the security and privacy of its users. By preventing against the types of attacks below, website owners can ensure that their users receive legitimate content without being exposed to harmful or malicious data.</p>
|
||||
<p>A secure WordPress website promotes a safe browsing experience for users, fostering trust in the site\'s content and services. Additionally, mitigating these risks helps website owners avoid potential legal issues and financial losses associated with security breaches. It also protects the website\'s reputation, ensuring that users continue to rely on the site as a trustworthy source of information and services.</p>';
|
||||
|
||||
echo '<table class="form-table"><tbody>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label for="firewall_block_bots">Block bad bots</label></th>
|
||||
<td>';
|
||||
WPCaptcha_Utility::create_toggle_switch('firewall_block_bots', array('saved_value' => $options['firewall_block_bots'], 'option_key' => esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[firewall_block_bots]'), true, 'firewall_rule_toggle');
|
||||
echo '<br><span>Blocking bad bots on a WordPress site refers to the process of identifying and preventing malicious automated software programs, known as "bots," from accessing, crawling, or interacting with the website. Bad bots are typically used by attackers to perform various malicious activities, such as content scraping, spamming, DDoS attacks, vulnerability scanning, or brute-force attacks to gain unauthorized access to the site.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" for="firewall_directory_traversal">Directory Traversal</label></th>
|
||||
<td>';
|
||||
echo '<div>';
|
||||
WPCaptcha_Utility::create_toggle_switch('firewall_directory_traversal', array('saved_value' => $options['firewall_directory_traversal'], 'option_key' => esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[firewall_directory_traversal]'), true, 'firewall_rule_toggle');
|
||||
echo '</div>';
|
||||
echo '<span>Directory traversal (also known as file path traversal) is a web security vulnerability that allows an attacker to access files on the server that they should not by passing file paths that attempt to traverse the normal directory structure using the parent folder path.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" for="firewall_http_response_splitting">HTTP Response Splitting</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="firewall_http_response_splitting" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="firewall_http_response_splitting">';
|
||||
WPCaptcha_Utility::create_toggle_switch('firewall_http_response_splitting', array('saved_value' => 0, 'option_key' => ''), true, 'firewall_rule_toggle');
|
||||
echo '</div>';
|
||||
echo '<span>HTTP Response Splitting is a type of attack that occurs when an attacker can manipulate the response headers that will be interpreted by the client. Protecting against HTTP Response Splitting on a WordPress website is crucial to maintain its security and the privacy of its users. By preventing this vulnerability, website owners can reduce the risk of attackers stealing sensitive information, compromising user accounts, or damaging the website\'s reputation. </span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" for="firewall_xss">(XSS) Cross-Site Scripting</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="firewall_xss" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="firewall_xss">';
|
||||
WPCaptcha_Utility::create_toggle_switch('firewall_xss', array('saved_value' => 0, 'option_key' => ''), true, 'firewall_rule_toggle');
|
||||
echo '</div>';
|
||||
echo '<span>Cross-Site Scripting (XSS) is a type of web application vulnerability that allows an attacker to inject malicious scripts into web pages viewed by other users. This occurs when a web application does not properly validate or sanitize user input and includes it in the rendered HTML output. There are three main types of XSS: stored, reflected, and DOM-based.<br />In stored XSS, the malicious script is saved in the target server (e.g., in a database), while in reflected XSS, the malicious script is part of the user\'s request and reflected back in the response. DOM-based XSS occurs when the vulnerability is in the client-side JavaScript code, allowing the attacker to manipulate the Document Object Model (DOM) directly. This option only protects agains reflected/request type XSS attacks. You should still be careful about what plugins you install and make sure they are secure.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" for="firewall_cache_poisoning">Cache Poisoning</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="firewall_cache_poisoning" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="firewall_cache_poisoning">';
|
||||
WPCaptcha_Utility::create_toggle_switch('firewall_cache_poisoning', array('saved_value' => 0, 'option_key' => ''), true, 'firewall_rule_toggle');
|
||||
echo '</div>';
|
||||
echo '<span>Cache Poisoning is a type of cyberattack where an attacker manipulates the cache data of web applications, content delivery networks (CDNs), or DNS resolvers to serve malicious content to unsuspecting users. The attacker exploits vulnerabilities or misconfigurations in caching mechanisms to insert malicious data into the cache, effectively "poisoning" it. When a user makes a request, the compromised cache serves the malicious content instead of the legitimate content. This can lead to various harmful consequences, such as redirecting users to phishing sites, spreading malware, or stealing sensitive information.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" for="firewall_dual_header">Dual-Header Exploits</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="firewall_dual_header" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="firewall_dual_header">';
|
||||
WPCaptcha_Utility::create_toggle_switch('firewall_dual_header', array('saved_value' => 0, 'option_key' => ''), true, 'firewall_rule_toggle');
|
||||
echo '</div>';
|
||||
echo '<span>Dual-Header Exploits, also known as HTTP Header Injection, is a type of web application vulnerability that involves manipulating HTTP headers to execute malicious actions or inject malicious content. Similar to HTTP Response Splitting, an attacker exploits this vulnerability by injecting newline characters (CRLF - carriage return and line feed) or other special characters into user input. This allows the attacker to create or modify HTTP headers, which can lead to various harmful consequences. For instance, an attacker can set cookies, redirect users to malicious websites, or perform cross-site scripting (XSS) attacks.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" for="firewall_sql_injection">SQL/PHP/Code Injection</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="firewall_sql_injection" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="firewall_sql_injection">';
|
||||
WPCaptcha_Utility::create_toggle_switch('firewall_sql_injection', array('saved_value' => 0, 'option_key' => ''), true, 'firewall_rule_toggle');
|
||||
echo '</div>';
|
||||
echo '<span>SQL/PHP/Code Injection is a type of web application vulnerability where an attacker inserts malicious code or commands into a web application, typically by exploiting insufficient input validation or sanitization. This allows the attacker to execute unauthorized actions, such as extracting sensitive information from databases, modifying data, or gaining unauthorized access to the system.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" for="firewall_file_injection">File Injection/Inclusion</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="firewall_file_injection" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="firewall_file_injection">';
|
||||
WPCaptcha_Utility::create_toggle_switch('firewall_file_injection', array('saved_value' => 0, 'option_key' => ''), true, 'firewall_rule_toggle');
|
||||
echo '</div>';
|
||||
echo '<span>File Injection/Inclusion is a type of web application vulnerability where an attacker exploits insufficient validation or sanitization of user input to include or inject malicious files into a web application. There are two main types of File Injection/Inclusion vulnerabilities: Local File Inclusion (LFI) and Remote File Inclusion (RFI). This can lead to unauthorized access to sensitive files, source code disclosure, or even the execution of server-side scripts if the application processes the included file. If the application is manipulated to process a remote file, the attacker\'s code is executed, potentially granting unauthorized access, control over the server, or the ability to perform various malicious actions.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" for="firewall_null_byte_injection">Null Byte Injection</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="firewall_null_byte_injection" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="firewall_null_byte_injection">';
|
||||
WPCaptcha_Utility::create_toggle_switch('firewall_null_byte_injection', array('saved_value' => 0, 'option_key' => ''), true, 'firewall_rule_toggle');
|
||||
echo '</div>';
|
||||
echo '<span>Null Byte Injection is a type of web application vulnerability that exploits the way certain programming languages, such as C and PHP, handle null characters. The null character serves as a string terminator in these languages, signaling the end of a string. An attacker can use a null byte to manipulate user input or file paths, causing the application to truncate the string after the null character. This can lead to unexpected behaviors, such as bypassing input validation or accessing sensitive files.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" for="firewall_php_info">PHP information leakage</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="firewall_php_info" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="firewall_php_info">';
|
||||
WPCaptcha_Utility::create_toggle_switch('firewall_php_info', array('saved_value' => 0, 'option_key' => ''), true, 'firewall_rule_toggle');
|
||||
echo '</div>';
|
||||
echo '<span>PHP information leakage refers to the unintended exposure of sensitive information about the PHP environment, configurations, or code running on a WordPress website. This information can be valuable for attackers, as it may reveal potential vulnerabilities, system details, or other information that could be exploited to compromise the site.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr><td></td><td>';
|
||||
WPCaptcha_admin::footer_save_button();
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '</tbody></table>';
|
||||
}
|
||||
|
||||
static function tab_2fa()
|
||||
{
|
||||
echo '<div class="tab-content">';
|
||||
|
||||
echo '<table class="form-table"><tbody>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row" style="width:300px;"><label class="open-upsell open-upsell-block" for="2fa_email">Email Based Two Factor Authentication</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="2fa_email" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="2fa_email">';
|
||||
WPCaptcha_Utility::create_toggle_switch('2fa_email', array('saved_value' => 0, 'option_key' => ''));
|
||||
echo '</div>';
|
||||
echo '<span>After the correct username & password are entered the user will receive an email with a one-time link to confirm the login.<br>In case somebody steals the username & password they still won\'t be able to login without access to the account email.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr><td></td><td>';
|
||||
echo '<p class="submit"><a class="button button-primary button-large open-upsell" data-feature="2fa-save">Save Changes <i class="wpcaptcha-icon wpcaptcha-checkmark"></i></a></p>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '</tbody></table>';
|
||||
|
||||
echo '</div>';
|
||||
} // display
|
||||
|
||||
static function tab_cloud_protection()
|
||||
{
|
||||
echo '<div class="tab-content">';
|
||||
|
||||
echo '<table class="form-table"><tbody>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" for="cloud_use_account_lists">Use Account Whitelist & Blacklist</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="cloud_use_account_lists" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="cloud_use_account_lists">';
|
||||
WPCaptcha_Utility::create_toggle_switch('cloud_use_account_lists', array('saved_value' => 0, 'option_key' => ''));
|
||||
echo '</div>';
|
||||
echo '<span>These lists are private and available only to your sites. Configure them in the WP Captcha Dashboard</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" for="cloud_use_blacklist">Use Global Cloud Blacklist</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="cloud_use_account_lists" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="cloud_use_blacklist">';
|
||||
WPCaptcha_Utility::create_toggle_switch('cloud_use_blacklist', array('saved_value' => 0, 'option_key' => ''));
|
||||
echo '</div>';
|
||||
echo '<span>A list of bad IPs maintained daily by WebFactory, and based on realtime malicios activity observed on thousands of websites. IPs found on this list are trully bad and should not have access to your site.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" for="global_block">Cloud Block Type</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="cloud_global_block" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<label class="open-upsell open-upsell-block wpcaptcha-radio-option">';
|
||||
echo '<span class="radio-container"><input type="radio" name="" id="cloud_global_block_global" value="1"><span class="radio"></span></span> Completely block website access';
|
||||
echo '</label>';
|
||||
|
||||
echo '<label class="open-upsell open-upsell-block wpcaptcha-radio-option">';
|
||||
echo '<span class="radio-container"><input type="radio" name="" id="cloud_global_block_login" value="0"><span class="radio"></span></span> Only block access to the login page';
|
||||
echo '</label>';
|
||||
echo '<span>Completely block website access for IPs on cloud blacklist, or just blocking access to the login page.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" for="block_message_cloud">Block Message</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="block_message_cloud" class="open-upsell pro-label">PRO</a></th>
|
||||
<td><input type="text" class="open-upsell open-upsell-block regular-text" id="block_message_cloud" name="" value="We\'re sorry, but access from your IP is not allowed." />';
|
||||
echo '<span>Message displayed to visitors blocked based on cloud lists. Default: <i>We\'re sorry, but access from your IP is not allowed.</i></span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block">Cloud Whitelist</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="cloud_protection_whitelist" class="open-upsell pro-label">PRO</a></th>
|
||||
<td><textarea class="open-upsell open-upsell-block" rows="4"></textarea>';
|
||||
echo '<span>The Cloud Protection Whitelist can only be edited in the WP Captcha Dashboard</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block">Cloud Blacklist</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="cloud_protection_blacklist" class="open-upsell pro-label">PRO</a></th>
|
||||
<td><textarea class="open-upsell open-upsell-block" rows="4"></textarea>';
|
||||
echo '<span>The Cloud Protection Blacklist can only be edited in the WP Captcha Dashboard</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr><td></td><td>';
|
||||
echo '<p class="submit"><a class="button button-primary button-large open-upsell" data-feature="cloud-protection-save">Save Changes <i class="wpcaptcha-icon wpcaptcha-checkmark"></i></a></p>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '</tbody></table>';
|
||||
|
||||
echo '</div>';
|
||||
} // display
|
||||
|
||||
} // class WPCaptcha_Tab_Firewall
|
@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* WP Captcha
|
||||
* https://getwpcaptcha.com/
|
||||
* (c) WebFactory Ltd, 2022 - 2023, www.webfactoryltd.com
|
||||
*/
|
||||
|
||||
class WPCaptcha_Tab_GeoIP extends WPCaptcha
|
||||
{
|
||||
static function display()
|
||||
{
|
||||
echo '<div class="tab-content">';
|
||||
|
||||
echo '<div class="notice-box-info">
|
||||
The Country Blocking feature allows you to easily block whole countries from either accessing the login form or the whole website. Or if preferred, you can just allow access from certain countries instead.<a href="#" class="open-pro-dialog" data-pro-feature="country-blocking">Get PRO now</a> to use the Country Blocking feature.
|
||||
</div>';
|
||||
|
||||
echo '<img src="' . esc_url(WPCAPTCHA_PLUGIN_URL) . '/images/map.png" alt="WP Captcha" title="WP Captcha Country Blocking Map" />';
|
||||
|
||||
echo '<table class="form-table"><tbody>';
|
||||
|
||||
$country_blocking_mode = array();
|
||||
$country_blocking_mode[] = array('val' => 'none', 'label' => 'Disable country based blocking');
|
||||
$country_blocking_mode[] = array('val' => 'whitelist', 'label' => 'Whitelist mode - allow selected countries, block all others');
|
||||
$country_blocking_mode[] = array('val' => 'blacklist', 'label' => 'Blacklist mode - block selected countries, allow all others');
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label for="country_blocking_mode">Blocking Mode</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="country_blocking_mode" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<select id="country_blocking_mode" name="" data-feature="country_blocking_mode">';
|
||||
WPCaptcha_Utility::create_select_options($country_blocking_mode, 0);
|
||||
echo '</select>';
|
||||
echo '<br /><span>Whitelabel mode is best when you want to allow only a few, selected countries to access your site. While the blacklist mode is suited for situations when the majority of countries should be able to access it, and just a few should be blocked.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
|
||||
echo '<tr valign="top" class="country-blocking-wrapper" style="display:none">';
|
||||
echo '<th scope="row"><label for="country_blocking_countries" class="country-blocking-label">Countries</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="country_blocking_countries" class="open-upsell pro-label">PRO</a></th>';
|
||||
echo '<td><input data-feature="country_blocking_countries" type="text" class="open-upsell" id="country_blocking_countries" style="width:500px; max-width:500px !important;" name="" placeholder="Select Countries" />';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top" class="country-blocking-wrapper" style="display:none">
|
||||
<th scope="row"><label for="block_undetermined_countries">Block Undetermined Countries</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="block_undetermined_countries" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="block_undetermined_countries">';
|
||||
WPCaptcha_Utility::create_toggle_switch('block_undetermined_countries', array('saved_value' => 0, 'option_key' => ''));
|
||||
echo '</div>';
|
||||
echo '<br /><span>For some IP addresses it\'s impossible to determine their country (localhost addresses, for instance). Enabling this option will blocks regardless of the Blocking Mode setting.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top" class="country-blocking-wrapper" style="display:none">
|
||||
<th scope="row"><label for="country_global_block_global">Country Block Type</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="country_global_block" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="country_global_block">';
|
||||
echo '<label class="wpcaptcha-radio-option">';
|
||||
echo '<span class="radio-container"><input type="radio" name="" id="country_global_block_global" value="1" checked><span class="radio"></span></span> Completely block website access';
|
||||
echo '</label>';
|
||||
|
||||
echo '<label class="wpcaptcha-radio-option">';
|
||||
echo '<span class="radio-container radio-disabled"><input type="radio" name="" id="country_global_block_login" value="0"><span class="radio"></span></span> Only block access to the login page';
|
||||
echo '</label>';
|
||||
echo '</div>';
|
||||
echo '<span>Completely block website access for blocked countries, or just blocking access to the login page.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
|
||||
echo '<tr valign="top" class="country-blocking-wrapper" style="display:none">
|
||||
<th scope="row"><label for="block_message_country">Block Message</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="block_message_country" class="open-upsell pro-label">PRO</a></th>
|
||||
<td><input type="text" data-feature="block_message_country" class="open-upsell regular-text" id="block_message_country" name="" value="" placeholder="We\'re sorry, but access from your location is not allowed." />';
|
||||
echo '<br /><span>Message displayed to visitors blocked based on country blocking rules. Default: <i>We\'re sorry, but access from your location is not allowed.</i></span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr><td></td><td>';
|
||||
echo '<p class="submit"><a class="button button-primary button-large open-upsell" data-feature="country-blocking-save">Save Changes <i class="wpcaptcha-icon wpcaptcha-checkmark"></i></a></p>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '</tbody></table>';
|
||||
|
||||
echo '</div>';
|
||||
} // display
|
||||
} // class WPCaptcha_Tab_GeoIP
|
@ -0,0 +1,284 @@
|
||||
<?php
|
||||
/**
|
||||
* WP Captcha
|
||||
* https://getwpcaptcha.com/
|
||||
* (c) WebFactory Ltd, 2022 - 2023, www.webfactoryltd.com
|
||||
*/
|
||||
|
||||
class WPCaptcha_Tab_Login_Form extends WPCaptcha
|
||||
{
|
||||
static function display()
|
||||
{
|
||||
$tabs[] = array('id' => 'tab_login_basic', 'class' => 'tab-content', 'label' => __('Basic', 'advanced-google-recaptcha'), 'callback' => array(__CLASS__, 'tab_basic'));
|
||||
$tabs[] = array('id' => 'tab_login_advanced', 'class' => 'tab-content', 'label' => __('Advanced', 'advanced-google-recaptcha'), 'callback' => array(__CLASS__, 'tab_advanced'));
|
||||
$tabs[] = array('id' => 'tab_login_tools', 'class' => 'tab-content', 'label' => __('Tools', 'advanced-google-recaptcha'), 'callback' => array(__CLASS__, 'tab_tools'));
|
||||
|
||||
echo '<div id="tabs_log" class="ui-tabs wpcaptcha-tabs-2nd-level">';
|
||||
echo '<ul>';
|
||||
foreach ($tabs as $tab) {
|
||||
echo '<li><a href="#' . esc_attr($tab['id']) . '">' . esc_html($tab['label']) . '</a></li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
|
||||
foreach ($tabs as $tab) {
|
||||
if (is_callable($tab['callback'])) {
|
||||
echo '<div style="display: none;" id="' . esc_attr($tab['id']) . '" class="' . esc_attr($tab['class']) . '">';
|
||||
call_user_func($tab['callback']);
|
||||
echo '</div>';
|
||||
}
|
||||
} // foreach
|
||||
|
||||
echo '</div>'; // second level of tabs
|
||||
|
||||
|
||||
} // display
|
||||
|
||||
static function tab_basic()
|
||||
{
|
||||
$options = WPCaptcha_Setup::get_options();
|
||||
|
||||
echo '<table class="form-table"><tbody>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label for="login_protection">Login Protection</label></th>
|
||||
<td>';
|
||||
WPCaptcha_Utility::create_toggle_switch('login_protection', array('saved_value' => $options['login_protection'], 'option_key' => esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[login_protection]'));
|
||||
echo '<br><span>Enable Login Protection</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label for="max_login_retries">Max Login Retries</label></th>
|
||||
<td><input type="number" class="regular-text" id="max_login_retries" name="' . esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[max_login_retries]" value="' . (int)$options['max_login_retries'] . '" />';
|
||||
echo '<span>Number of failed login attempts within the "Retry Time Period Restriction" (defined below) needed to trigger a Access Lock.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label for="retries_within">Retry Time Period Restriction</label></th>
|
||||
<td><input type="number" class="regular-text" id="retries_within" name="' . esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[retries_within]" value="' . (int)$options['retries_within'] . '" /> minutes';
|
||||
echo '<span>Amount of time in which failed login attempts are allowed before an access lock occurs.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label for="lockout_length">Access Lock Length</label></th>
|
||||
<td><input type="number" class="regular-text" id="lockout_length" name="' . esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[lockout_length]" value="' . (int)$options['lockout_length'] . '" /> minutes';
|
||||
echo '<span>Amount of time a particular IP will be blocked once an access lock has been triggered.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" for="lockout_invalid_usernames" for="lockout_invalid_usernames">Log Failed Attempts With Non-existant Usernames</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="lockout_invalid_usernames" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="lockout_invalid_usernames">';
|
||||
WPCaptcha_Utility::create_toggle_switch('lockout_invalid_usernames', array('saved_value' => 0, 'option_key' => ''));
|
||||
echo '</div>';
|
||||
echo '<span>Log failed log in attempts with non-existant usernames the same way failed attempts with bad passwords are logged.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" for="mask_login_errors" for="mask_login_errors">Mask Login Errors</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="mask_login_errors" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="mask_login_errors">';
|
||||
WPCaptcha_Utility::create_toggle_switch('mask_login_errors', array('saved_value' => 0, 'option_key' => ''));
|
||||
echo '</div>';
|
||||
echo '<span>Hide log in error details (such as invalid username, invalid password, invalid captcha value) to minimize data available to attackers.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" for="global_block" for="global_block">Block Type</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="global_block" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="global_block">';
|
||||
echo '<label class="wpcaptcha-radio-option">';
|
||||
echo '<span class="radio-container"><input type="radio" id="global_block_global" value="1"><span class="radio"></span></span> Completely block website access';
|
||||
echo '</label>';
|
||||
|
||||
echo '<label class="wpcaptcha-radio-option">';
|
||||
echo '<span class="radio-container"><input type="radio" id="global_block_login" value="0" checked><span class="radio"></span></span> Only block access to the login page';
|
||||
echo '</label>';
|
||||
echo '</div>';
|
||||
echo '<span>Completely block website access for blocked IPs, or just blocking access to the login page.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" for="block_message" for="block_message">Block Message</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="block_message" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="block_message">';
|
||||
echo '<input type="text" class="regular-text" id="block_message" value="" />';
|
||||
echo '</div>';
|
||||
echo '<span>Message displayed to visitors blocked due to too many failed login attempts. Default: <i>We\'re sorry, but your IP has been blocked due to too many recent failed login attempts.</i></span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" for="whitelist" for="whitelist">Whitelisted IPs</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="whitelist" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="whitelist">';
|
||||
echo '<textarea class="regular-text" id="whitelist" rows="6"></textarea>';
|
||||
echo '</div>';
|
||||
echo '<span>List of IP addresses that will never be blocked. Enter one IP per line.<br>Your current IP is: <code>' . esc_html($_SERVER['REMOTE_ADDR']) . '</code></span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label for="show_credit_link">Show Credit Link</label></th>
|
||||
<td>';
|
||||
WPCaptcha_Utility::create_toggle_switch('show_credit_link', array('saved_value' => $options['show_credit_link'], 'option_key' => esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[show_credit_link]'));
|
||||
echo '<br><span>Show a small "form protected by" link below the login form to help others learn about WP Captcha and protect their sites.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr><td></td><td>';
|
||||
WPCaptcha_admin::footer_save_button();
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '</tbody></table>';
|
||||
}
|
||||
|
||||
static function tab_advanced()
|
||||
{
|
||||
$options = WPCaptcha_Setup::get_options();
|
||||
|
||||
echo '<table class="form-table"><tbody>';
|
||||
|
||||
if(is_multisite()){
|
||||
echo '<div class="notice-box-info" style="border-color:#ff9f00;">WP Captcha does not support changing the Login URL for multisite installs</div>';
|
||||
}
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" data-feature="login_url" for="login_url">Login URL</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="login_url" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="login_url">';
|
||||
echo '<code>' . esc_url(home_url('/')) . '</code><input type="text" class="regular-text" style="width:160px;" id="login_url" value="" /><code>/</code>';
|
||||
echo '</div>';
|
||||
echo '<span>Protect your website by changing the login page URL and prevent access to the default <code>wp-login.php</code> page and the <code>wp-admin</code> path that represent the main target of most attacks. Leave empty to use default login URL.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" data-feature="login_redirect_url" for="login_redirect_url">Redirect URL</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="login_redirect_url" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="login_redirect_url">';
|
||||
echo '<code>' . esc_url(home_url('/')) . '</code><input type="text" class="regular-text" style="width:160px;" id="login_redirect_url" value="" placeholder="404" /><code>/</code>';
|
||||
echo '</div>';
|
||||
echo '<span>URL where attempts to access <code>wp-login.php</code> or <code>wp-admin</code> should be redirected to. If a custom login URL is set, this defaults to <code>' . esc_url(home_url('/404/')) . '</code> unless you set it to something else.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" data-feature="password_check" for="password_check">Password Check</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="password_check" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="wpcaptcha_run_tests">';
|
||||
echo '<button class="button button-primary button-large" style="margin-bottom:6px;">Test user passwords <i class="wpcaptcha-icon wpcaptcha-lock"></i></button>';
|
||||
echo '</div>';
|
||||
echo '<span>Check if any user has a weak password that is vulnerable to common brute-force dictionary attacks.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" data-feature="anonymous_logging" for="anonymous_logging">Anonymous Activity Logging</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="anonymous_logging" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="anonymous_logging">';
|
||||
WPCaptcha_Utility::create_toggle_switch('anonymous_logging', array('saved_value' => 0, 'option_key' => ''));
|
||||
echo '</div>';
|
||||
echo '<span>Logging anonymously means IP addresses of your visitors are stored as hashed values. The user\'s country and user agent are still logged, but without the IP these are not considered personal data according to GDPR.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" data-feature="log_passwords" for="log_passwords">Log Passwords</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="log_passwords" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="log_passwords">';
|
||||
WPCaptcha_Utility::create_toggle_switch('log_passwords', array('saved_value' => 0, 'option_key' => ''));
|
||||
echo '</div>';
|
||||
echo '<span>Enablign this option will log the passwords used in failed login attempts. This is not recommended on websites with multiple users as the passwords are logged as plain text and can be viewed by all users that have access to the WP Captcha logs or the database.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" data-feature="block_bots" for="block_bots">Block Bots</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="block_bots" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="block_bots">';
|
||||
WPCaptcha_Utility::create_toggle_switch('block_bots', array('saved_value' => 0, 'option_key' => ''));
|
||||
echo '</div>';
|
||||
echo '<span>Block bots from accessing the login page and attempting to log in.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" data-feature="instant_block_nonusers" for="instant_block_nonusers">Block Login Attempts With Non-existing Usernames</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="instant_block_nonusers" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="instant_block_nonusers">';
|
||||
WPCaptcha_Utility::create_toggle_switch('instant_block_nonusers', array('saved_value' => 0, 'option_key' => ''));
|
||||
echo '</div>';
|
||||
echo '<span>Immediately block IP if there is a failed login attempt with a non-existing username</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" data-feature="honeypot" for="honeypot">Add Honeypot for Bots</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="honeypot" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="honeypot">';
|
||||
WPCaptcha_Utility::create_toggle_switch('honeypot', array('saved_value' => 0, 'option_key' => ''));
|
||||
echo '</div>';
|
||||
echo '<span>Add a special, hidden "honeypot" field to the login form to catch and prevent bots from attempting to log in.<br>This does not affect the way humans log in, nor does it add an extra step.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
$cookie_lifetime = array();
|
||||
$cookie_lifetime[] = array('val' => '14', 'label' => '14 days (default)');
|
||||
$cookie_lifetime[] = array('val' => '30', 'label' => '30 days');
|
||||
$cookie_lifetime[] = array('val' => '90', 'label' => '3 months');
|
||||
$cookie_lifetime[] = array('val' => '180', 'label' => '6 months');
|
||||
$cookie_lifetime[] = array('val' => '365', 'label' => '1 year');
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" data-feature="cookie_lifetime" for="cookie_lifetime">Cookie Lifetime</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="cookie_lifetime" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="cookie_lifetime">';
|
||||
echo '<select id="cookie_lifetime">';
|
||||
WPCaptcha_Utility::create_select_options($cookie_lifetime, $options['cookie_lifetime']);
|
||||
echo '</select>';
|
||||
echo '</div>';
|
||||
echo '<span>Cookie lifetime if "Remember Me" option is checked on login form.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr><td></td><td>';
|
||||
WPCaptcha_admin::footer_save_button();
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '</tbody></table>';
|
||||
}
|
||||
|
||||
static function tab_tools()
|
||||
{
|
||||
$options = WPCaptcha_Setup::get_options();
|
||||
|
||||
echo '<table class="form-table"><tbody>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" data-feature="test_email" for="password_check">Email Test</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="test_email" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="test_email">';
|
||||
echo '<button class="button button-primary button-large" style="margin-bottom:6px;">Send test email</button>';
|
||||
echo '</div>';
|
||||
echo '<span>Send an email to test that you can receive emails from your website.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th scope="row"><label class="open-upsell open-upsell-block" data-feature="honeypot" for="recovery_url">Recovery URL</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="recovery_url" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="recovery_url">';
|
||||
echo '<button class="button button-primary button-large" style="margin-bottom:6px;">View Recovery URL</button>';
|
||||
echo '</div>';
|
||||
echo '<span>In case you lock yourself out and need to whitelist your IP address, please save the recovery URL somewhere safe.<br>Do NOT share the recovery URL.</span>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th><label class="open-upsell open-upsell-block" data-feature="import_file">Import Settings</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="import_file" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="import_file">';
|
||||
echo '<input accept="txt" type="file" name="wpcaptcha_import_file" value="">
|
||||
<button name="wpcaptcha_import_file" id="submit" class="button button-primary button-large" value="">Upload</button>';
|
||||
echo '</div>';
|
||||
echo '</td>
|
||||
</tr>';
|
||||
|
||||
echo '<tr valign="top">
|
||||
<th><label class="open-upsell open-upsell-block" data-feature="export">Export Settings</label><a title="This feature is available in the PRO version. Click for details." href="#" data-feature="export" class="open-upsell pro-label">PRO</a></th>
|
||||
<td>';
|
||||
echo '<div class="open-upsell open-upsell-block" data-feature="export">';
|
||||
echo '<a class="button button-primary button-large" style="padding-top: 3px;" href="' . esc_url(add_query_arg(array('action' => 'wpcaptcha_export_settings'), admin_url('admin.php'))) . '">Download Export File</a>';
|
||||
echo '</div>';
|
||||
echo '</td>
|
||||
</tr>';
|
||||
|
||||
echo '</tbody></table>';
|
||||
}
|
||||
} // class WPCaptcha_Tab_Login_Form
|
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* WP Captcha
|
||||
* https://getwpcaptcha.com/
|
||||
* (c) WebFactory Ltd, 2022 - 2023, www.webfactoryltd.com
|
||||
*/
|
||||
|
||||
class WPCaptcha_Tab_Temporary_Access extends WPCaptcha
|
||||
{
|
||||
static function display()
|
||||
{
|
||||
echo '<div class="tab-content">';
|
||||
|
||||
echo '<div class="notice-box-info">
|
||||
Temporary Access links are a convenient way to give temporary access to other people. You can set the lifetime of the link and the maximum number of times it can be used to prevent abuse. <a href="#" class="open-pro-dialog" data-pro-feature="temp-access">Get PRO now</a> to use the Temporary Links feature.
|
||||
</div>';
|
||||
|
||||
echo '<img class="open-upsell open-upsell-block" data-feature="temporary_access" style="width: 100%;" src="' . esc_url(WPCAPTCHA_PLUGIN_URL) . '/images/temporary-access.png" alt="WP Captcha" title="WP Captcha Temporary Access Links" />';
|
||||
echo '</div>';
|
||||
} // display
|
||||
} // class WPCaptcha_Tab_2FA
|
14
wp-content/plugins/advanced-google-recaptcha/js/chart.min.js
vendored
Normal file
164
wp-content/plugins/advanced-google-recaptcha/js/jquery.dataTables.min.js
vendored
Normal file
@ -0,0 +1,164 @@
|
||||
/*!
|
||||
DataTables 1.10.16
|
||||
©2008-2017 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(h){"function"===typeof define&&define.amd?define(["jquery"],function(E){return h(E,window,document)}):"object"===typeof exports?module.exports=function(E,G){E||(E=window);G||(G="undefined"!==typeof window?require("jquery"):require("jquery")(E));return h(G,E,E.document)}:h(jQuery,window,document)})(function(h,E,G,k){function X(a){var b,c,d={};h.each(a,function(e){if((b=e.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(b[1]+" "))c=e.replace(b[0],b[2].toLowerCase()),
|
||||
d[c]=e,"o"===b[1]&&X(a[e])});a._hungarianMap=d}function I(a,b,c){a._hungarianMap||X(a);var d;h.each(b,function(e){d=a._hungarianMap[e];if(d!==k&&(c||b[d]===k))"o"===d.charAt(0)?(b[d]||(b[d]={}),h.extend(!0,b[d],b[e]),I(a[d],b[d],c)):b[d]=b[e]})}function Ca(a){var b=m.defaults.oLanguage,c=a.sZeroRecords;!a.sEmptyTable&&(c&&"No data available in table"===b.sEmptyTable)&&F(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&(c&&"Loading..."===b.sLoadingRecords)&&F(a,a,"sZeroRecords","sLoadingRecords");
|
||||
a.sInfoThousands&&(a.sThousands=a.sInfoThousands);(a=a.sDecimal)&&cb(a)}function db(a){A(a,"ordering","bSort");A(a,"orderMulti","bSortMulti");A(a,"orderClasses","bSortClasses");A(a,"orderCellsTop","bSortCellsTop");A(a,"order","aaSorting");A(a,"orderFixed","aaSortingFixed");A(a,"paging","bPaginate");A(a,"pagingType","sPaginationType");A(a,"pageLength","iDisplayLength");A(a,"searching","bFilter");"boolean"===typeof a.sScrollX&&(a.sScrollX=a.sScrollX?"100%":"");"boolean"===typeof a.scrollX&&(a.scrollX=
|
||||
a.scrollX?"100%":"");if(a=a.aoSearchCols)for(var b=0,c=a.length;b<c;b++)a[b]&&I(m.models.oSearch,a[b])}function eb(a){A(a,"orderable","bSortable");A(a,"orderData","aDataSort");A(a,"orderSequence","asSorting");A(a,"orderDataType","sortDataType");var b=a.aDataSort;"number"===typeof b&&!h.isArray(b)&&(a.aDataSort=[b])}function fb(a){if(!m.__browser){var b={};m.__browser=b;var c=h("<div/>").css({position:"fixed",top:0,left:-1*h(E).scrollLeft(),height:1,width:1,overflow:"hidden"}).append(h("<div/>").css({position:"absolute",
|
||||
top:1,left:1,width:100,overflow:"scroll"}).append(h("<div/>").css({width:"100%",height:10}))).appendTo("body"),d=c.children(),e=d.children();b.barWidth=d[0].offsetWidth-d[0].clientWidth;b.bScrollOversize=100===e[0].offsetWidth&&100!==d[0].clientWidth;b.bScrollbarLeft=1!==Math.round(e.offset().left);b.bBounding=c[0].getBoundingClientRect().width?!0:!1;c.remove()}h.extend(a.oBrowser,m.__browser);a.oScroll.iBarWidth=m.__browser.barWidth}function gb(a,b,c,d,e,f){var g,j=!1;c!==k&&(g=c,j=!0);for(;d!==
|
||||
e;)a.hasOwnProperty(d)&&(g=j?b(g,a[d],d,a):a[d],j=!0,d+=f);return g}function Da(a,b){var c=m.defaults.column,d=a.aoColumns.length,c=h.extend({},m.models.oColumn,c,{nTh:b?b:G.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.mData:d,idx:d});a.aoColumns.push(c);c=a.aoPreSearchCols;c[d]=h.extend({},m.models.oSearch,c[d]);ja(a,d,h(b).data())}function ja(a,b,c){var b=a.aoColumns[b],d=a.oClasses,e=h(b.nTh);if(!b.sWidthOrig){b.sWidthOrig=
|
||||
e.attr("width")||null;var f=(e.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);f&&(b.sWidthOrig=f[1])}c!==k&&null!==c&&(eb(c),I(m.defaults.column,c),c.mDataProp!==k&&!c.mData&&(c.mData=c.mDataProp),c.sType&&(b._sManualType=c.sType),c.className&&!c.sClass&&(c.sClass=c.className),c.sClass&&e.addClass(c.sClass),h.extend(b,c),F(b,c,"sWidth","sWidthOrig"),c.iDataSort!==k&&(b.aDataSort=[c.iDataSort]),F(b,c,"aDataSort"));var g=b.mData,j=Q(g),i=b.mRender?Q(b.mRender):null,c=function(a){return"string"===
|
||||
typeof a&&-1!==a.indexOf("@")};b._bAttrSrc=h.isPlainObject(g)&&(c(g.sort)||c(g.type)||c(g.filter));b._setter=null;b.fnGetData=function(a,b,c){var d=j(a,b,k,c);return i&&b?i(d,b,a,c):d};b.fnSetData=function(a,b,c){return R(g)(a,b,c)};"number"!==typeof g&&(a._rowReadObject=!0);a.oFeatures.bSort||(b.bSortable=!1,e.addClass(d.sSortableNone));a=-1!==h.inArray("asc",b.asSorting);c=-1!==h.inArray("desc",b.asSorting);!b.bSortable||!a&&!c?(b.sSortingClass=d.sSortableNone,b.sSortingClassJUI=""):a&&!c?(b.sSortingClass=
|
||||
d.sSortableAsc,b.sSortingClassJUI=d.sSortJUIAscAllowed):!a&&c?(b.sSortingClass=d.sSortableDesc,b.sSortingClassJUI=d.sSortJUIDescAllowed):(b.sSortingClass=d.sSortable,b.sSortingClassJUI=d.sSortJUI)}function Y(a){if(!1!==a.oFeatures.bAutoWidth){var b=a.aoColumns;Ea(a);for(var c=0,d=b.length;c<d;c++)b[c].nTh.style.width=b[c].sWidth}b=a.oScroll;(""!==b.sY||""!==b.sX)&&ka(a);r(a,null,"column-sizing",[a])}function Z(a,b){var c=la(a,"bVisible");return"number"===typeof c[b]?c[b]:null}function $(a,b){var c=
|
||||
la(a,"bVisible"),c=h.inArray(b,c);return-1!==c?c:null}function aa(a){var b=0;h.each(a.aoColumns,function(a,d){d.bVisible&&"none"!==h(d.nTh).css("display")&&b++});return b}function la(a,b){var c=[];h.map(a.aoColumns,function(a,e){a[b]&&c.push(e)});return c}function Fa(a){var b=a.aoColumns,c=a.aoData,d=m.ext.type.detect,e,f,g,j,i,h,l,q,t;e=0;for(f=b.length;e<f;e++)if(l=b[e],t=[],!l.sType&&l._sManualType)l.sType=l._sManualType;else if(!l.sType){g=0;for(j=d.length;g<j;g++){i=0;for(h=c.length;i<h;i++){t[i]===
|
||||
k&&(t[i]=B(a,i,e,"type"));q=d[g](t[i],a);if(!q&&g!==d.length-1)break;if("html"===q)break}if(q){l.sType=q;break}}l.sType||(l.sType="string")}}function hb(a,b,c,d){var e,f,g,j,i,n,l=a.aoColumns;if(b)for(e=b.length-1;0<=e;e--){n=b[e];var q=n.targets!==k?n.targets:n.aTargets;h.isArray(q)||(q=[q]);f=0;for(g=q.length;f<g;f++)if("number"===typeof q[f]&&0<=q[f]){for(;l.length<=q[f];)Da(a);d(q[f],n)}else if("number"===typeof q[f]&&0>q[f])d(l.length+q[f],n);else if("string"===typeof q[f]){j=0;for(i=l.length;j<
|
||||
i;j++)("_all"==q[f]||h(l[j].nTh).hasClass(q[f]))&&d(j,n)}}if(c){e=0;for(a=c.length;e<a;e++)d(e,c[e])}}function M(a,b,c,d){var e=a.aoData.length,f=h.extend(!0,{},m.models.oRow,{src:c?"dom":"data",idx:e});f._aData=b;a.aoData.push(f);for(var g=a.aoColumns,j=0,i=g.length;j<i;j++)g[j].sType=null;a.aiDisplayMaster.push(e);b=a.rowIdFn(b);b!==k&&(a.aIds[b]=f);(c||!a.oFeatures.bDeferRender)&&Ga(a,e,c,d);return e}function ma(a,b){var c;b instanceof h||(b=h(b));return b.map(function(b,e){c=Ha(a,e);return M(a,
|
||||
c.data,e,c.cells)})}function B(a,b,c,d){var e=a.iDraw,f=a.aoColumns[c],g=a.aoData[b]._aData,j=f.sDefaultContent,i=f.fnGetData(g,d,{settings:a,row:b,col:c});if(i===k)return a.iDrawError!=e&&null===j&&(J(a,0,"Requested unknown parameter "+("function"==typeof f.mData?"{function}":"'"+f.mData+"'")+" for row "+b+", column "+c,4),a.iDrawError=e),j;if((i===g||null===i)&&null!==j&&d!==k)i=j;else if("function"===typeof i)return i.call(g);return null===i&&"display"==d?"":i}function ib(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,
|
||||
d,{settings:a,row:b,col:c})}function Ia(a){return h.map(a.match(/(\\.|[^\.])+/g)||[""],function(a){return a.replace(/\\\./g,".")})}function Q(a){if(h.isPlainObject(a)){var b={};h.each(a,function(a,c){c&&(b[a]=Q(c))});return function(a,c,f,g){var j=b[c]||b._;return j!==k?j(a,c,f,g):a}}if(null===a)return function(a){return a};if("function"===typeof a)return function(b,c,f,g){return a(b,c,f,g)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("[")||-1!==a.indexOf("("))){var c=function(a,
|
||||
b,f){var g,j;if(""!==f){j=Ia(f);for(var i=0,n=j.length;i<n;i++){f=j[i].match(ba);g=j[i].match(U);if(f){j[i]=j[i].replace(ba,"");""!==j[i]&&(a=a[j[i]]);g=[];j.splice(0,i+1);j=j.join(".");if(h.isArray(a)){i=0;for(n=a.length;i<n;i++)g.push(c(a[i],b,j))}a=f[0].substring(1,f[0].length-1);a=""===a?g:g.join(a);break}else if(g){j[i]=j[i].replace(U,"");a=a[j[i]]();continue}if(null===a||a[j[i]]===k)return k;a=a[j[i]]}}return a};return function(b,e){return c(b,e,a)}}return function(b){return b[a]}}function R(a){if(h.isPlainObject(a))return R(a._);
|
||||
if(null===a)return function(){};if("function"===typeof a)return function(b,d,e){a(b,"set",d,e)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("[")||-1!==a.indexOf("("))){var b=function(a,d,e){var e=Ia(e),f;f=e[e.length-1];for(var g,j,i=0,n=e.length-1;i<n;i++){g=e[i].match(ba);j=e[i].match(U);if(g){e[i]=e[i].replace(ba,"");a[e[i]]=[];f=e.slice();f.splice(0,i+1);g=f.join(".");if(h.isArray(d)){j=0;for(n=d.length;j<n;j++)f={},b(f,d[j],g),a[e[i]].push(f)}else a[e[i]]=d;return}j&&(e[i]=e[i].replace(U,
|
||||
""),a=a[e[i]](d));if(null===a[e[i]]||a[e[i]]===k)a[e[i]]={};a=a[e[i]]}if(f.match(U))a[f.replace(U,"")](d);else a[f.replace(ba,"")]=d};return function(c,d){return b(c,d,a)}}return function(b,d){b[a]=d}}function Ja(a){return D(a.aoData,"_aData")}function na(a){a.aoData.length=0;a.aiDisplayMaster.length=0;a.aiDisplay.length=0;a.aIds={}}function oa(a,b,c){for(var d=-1,e=0,f=a.length;e<f;e++)a[e]==b?d=e:a[e]>b&&a[e]--; -1!=d&&c===k&&a.splice(d,1)}function ca(a,b,c,d){var e=a.aoData[b],f,g=function(c,d){for(;c.childNodes.length;)c.removeChild(c.firstChild);
|
||||
c.innerHTML=B(a,b,d,"display")};if("dom"===c||(!c||"auto"===c)&&"dom"===e.src)e._aData=Ha(a,e,d,d===k?k:e._aData).data;else{var j=e.anCells;if(j)if(d!==k)g(j[d],d);else{c=0;for(f=j.length;c<f;c++)g(j[c],c)}}e._aSortData=null;e._aFilterData=null;g=a.aoColumns;if(d!==k)g[d].sType=null;else{c=0;for(f=g.length;c<f;c++)g[c].sType=null;Ka(a,e)}}function Ha(a,b,c,d){var e=[],f=b.firstChild,g,j,i=0,n,l=a.aoColumns,q=a._rowReadObject,d=d!==k?d:q?{}:[],t=function(a,b){if("string"===typeof a){var c=a.indexOf("@");
|
||||
-1!==c&&(c=a.substring(c+1),R(a)(d,b.getAttribute(c)))}},m=function(a){if(c===k||c===i)j=l[i],n=h.trim(a.innerHTML),j&&j._bAttrSrc?(R(j.mData._)(d,n),t(j.mData.sort,a),t(j.mData.type,a),t(j.mData.filter,a)):q?(j._setter||(j._setter=R(j.mData)),j._setter(d,n)):d[i]=n;i++};if(f)for(;f;){g=f.nodeName.toUpperCase();if("TD"==g||"TH"==g)m(f),e.push(f);f=f.nextSibling}else{e=b.anCells;f=0;for(g=e.length;f<g;f++)m(e[f])}if(b=b.firstChild?b:b.nTr)(b=b.getAttribute("id"))&&R(a.rowId)(d,b);return{data:d,cells:e}}
|
||||
function Ga(a,b,c,d){var e=a.aoData[b],f=e._aData,g=[],j,i,n,l,q;if(null===e.nTr){j=c||G.createElement("tr");e.nTr=j;e.anCells=g;j._DT_RowIndex=b;Ka(a,e);l=0;for(q=a.aoColumns.length;l<q;l++){n=a.aoColumns[l];i=c?d[l]:G.createElement(n.sCellType);i._DT_CellIndex={row:b,column:l};g.push(i);if((!c||n.mRender||n.mData!==l)&&(!h.isPlainObject(n.mData)||n.mData._!==l+".display"))i.innerHTML=B(a,b,l,"display");n.sClass&&(i.className+=" "+n.sClass);n.bVisible&&!c?j.appendChild(i):!n.bVisible&&c&&i.parentNode.removeChild(i);
|
||||
n.fnCreatedCell&&n.fnCreatedCell.call(a.oInstance,i,B(a,b,l),f,b,l)}r(a,"aoRowCreatedCallback",null,[j,f,b])}e.nTr.setAttribute("role","row")}function Ka(a,b){var c=b.nTr,d=b._aData;if(c){var e=a.rowIdFn(d);e&&(c.id=e);d.DT_RowClass&&(e=d.DT_RowClass.split(" "),b.__rowc=b.__rowc?qa(b.__rowc.concat(e)):e,h(c).removeClass(b.__rowc.join(" ")).addClass(d.DT_RowClass));d.DT_RowAttr&&h(c).attr(d.DT_RowAttr);d.DT_RowData&&h(c).data(d.DT_RowData)}}function jb(a){var b,c,d,e,f,g=a.nTHead,j=a.nTFoot,i=0===
|
||||
h("th, td",g).length,n=a.oClasses,l=a.aoColumns;i&&(e=h("<tr/>").appendTo(g));b=0;for(c=l.length;b<c;b++)f=l[b],d=h(f.nTh).addClass(f.sClass),i&&d.appendTo(e),a.oFeatures.bSort&&(d.addClass(f.sSortingClass),!1!==f.bSortable&&(d.attr("tabindex",a.iTabIndex).attr("aria-controls",a.sTableId),La(a,f.nTh,b))),f.sTitle!=d[0].innerHTML&&d.html(f.sTitle),Ma(a,"header")(a,d,f,n);i&&da(a.aoHeader,g);h(g).find(">tr").attr("role","row");h(g).find(">tr>th, >tr>td").addClass(n.sHeaderTH);h(j).find(">tr>th, >tr>td").addClass(n.sFooterTH);
|
||||
if(null!==j){a=a.aoFooter[0];b=0;for(c=a.length;b<c;b++)f=l[b],f.nTf=a[b].cell,f.sClass&&h(f.nTf).addClass(f.sClass)}}function ea(a,b,c){var d,e,f,g=[],j=[],i=a.aoColumns.length,n;if(b){c===k&&(c=!1);d=0;for(e=b.length;d<e;d++){g[d]=b[d].slice();g[d].nTr=b[d].nTr;for(f=i-1;0<=f;f--)!a.aoColumns[f].bVisible&&!c&&g[d].splice(f,1);j.push([])}d=0;for(e=g.length;d<e;d++){if(a=g[d].nTr)for(;f=a.firstChild;)a.removeChild(f);f=0;for(b=g[d].length;f<b;f++)if(n=i=1,j[d][f]===k){a.appendChild(g[d][f].cell);
|
||||
for(j[d][f]=1;g[d+i]!==k&&g[d][f].cell==g[d+i][f].cell;)j[d+i][f]=1,i++;for(;g[d][f+n]!==k&&g[d][f].cell==g[d][f+n].cell;){for(c=0;c<i;c++)j[d+c][f+n]=1;n++}h(g[d][f].cell).attr("rowspan",i).attr("colspan",n)}}}}function N(a){var b=r(a,"aoPreDrawCallback","preDraw",[a]);if(-1!==h.inArray(!1,b))C(a,!1);else{var b=[],c=0,d=a.asStripeClasses,e=d.length,f=a.oLanguage,g=a.iInitDisplayStart,j="ssp"==y(a),i=a.aiDisplay;a.bDrawing=!0;g!==k&&-1!==g&&(a._iDisplayStart=j?g:g>=a.fnRecordsDisplay()?0:g,a.iInitDisplayStart=
|
||||
-1);var g=a._iDisplayStart,n=a.fnDisplayEnd();if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++,C(a,!1);else if(j){if(!a.bDestroying&&!kb(a))return}else a.iDraw++;if(0!==i.length){f=j?a.aoData.length:n;for(j=j?0:g;j<f;j++){var l=i[j],q=a.aoData[l];null===q.nTr&&Ga(a,l);l=q.nTr;if(0!==e){var t=d[c%e];q._sRowStripe!=t&&(h(l).removeClass(q._sRowStripe).addClass(t),q._sRowStripe=t)}r(a,"aoRowCallback",null,[l,q._aData,c,j]);b.push(l);c++}}else c=f.sZeroRecords,1==a.iDraw&&"ajax"==y(a)?c=f.sLoadingRecords:
|
||||
f.sEmptyTable&&0===a.fnRecordsTotal()&&(c=f.sEmptyTable),b[0]=h("<tr/>",{"class":e?d[0]:""}).append(h("<td />",{valign:"top",colSpan:aa(a),"class":a.oClasses.sRowEmpty}).html(c))[0];r(a,"aoHeaderCallback","header",[h(a.nTHead).children("tr")[0],Ja(a),g,n,i]);r(a,"aoFooterCallback","footer",[h(a.nTFoot).children("tr")[0],Ja(a),g,n,i]);d=h(a.nTBody);d.children().detach();d.append(h(b));r(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1}}function S(a,b){var c=a.oFeatures,d=c.bFilter;
|
||||
c.bSort&&lb(a);d?fa(a,a.oPreviousSearch):a.aiDisplay=a.aiDisplayMaster.slice();!0!==b&&(a._iDisplayStart=0);a._drawHold=b;N(a);a._drawHold=!1}function mb(a){var b=a.oClasses,c=h(a.nTable),c=h("<div/>").insertBefore(c),d=a.oFeatures,e=h("<div/>",{id:a.sTableId+"_wrapper","class":b.sWrapper+(a.nTFoot?"":" "+b.sNoFooter)});a.nHolding=c[0];a.nTableWrapper=e[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var f=a.sDom.split(""),g,j,i,n,l,q,k=0;k<f.length;k++){g=null;j=f[k];if("<"==j){i=h("<div/>")[0];
|
||||
n=f[k+1];if("'"==n||'"'==n){l="";for(q=2;f[k+q]!=n;)l+=f[k+q],q++;"H"==l?l=b.sJUIHeader:"F"==l&&(l=b.sJUIFooter);-1!=l.indexOf(".")?(n=l.split("."),i.id=n[0].substr(1,n[0].length-1),i.className=n[1]):"#"==l.charAt(0)?i.id=l.substr(1,l.length-1):i.className=l;k+=q}e.append(i);e=h(i)}else if(">"==j)e=e.parent();else if("l"==j&&d.bPaginate&&d.bLengthChange)g=nb(a);else if("f"==j&&d.bFilter)g=ob(a);else if("r"==j&&d.bProcessing)g=pb(a);else if("t"==j)g=qb(a);else if("i"==j&&d.bInfo)g=rb(a);else if("p"==
|
||||
j&&d.bPaginate)g=sb(a);else if(0!==m.ext.feature.length){i=m.ext.feature;q=0;for(n=i.length;q<n;q++)if(j==i[q].cFeature){g=i[q].fnInit(a);break}}g&&(i=a.aanFeatures,i[j]||(i[j]=[]),i[j].push(g),e.append(g))}c.replaceWith(e);a.nHolding=null}function da(a,b){var c=h(b).children("tr"),d,e,f,g,j,i,n,l,q,k;a.splice(0,a.length);f=0;for(i=c.length;f<i;f++)a.push([]);f=0;for(i=c.length;f<i;f++){d=c[f];for(e=d.firstChild;e;){if("TD"==e.nodeName.toUpperCase()||"TH"==e.nodeName.toUpperCase()){l=1*e.getAttribute("colspan");
|
||||
q=1*e.getAttribute("rowspan");l=!l||0===l||1===l?1:l;q=!q||0===q||1===q?1:q;g=0;for(j=a[f];j[g];)g++;n=g;k=1===l?!0:!1;for(j=0;j<l;j++)for(g=0;g<q;g++)a[f+g][n+j]={cell:e,unique:k},a[f+g].nTr=d}e=e.nextSibling}}}function ra(a,b,c){var d=[];c||(c=a.aoHeader,b&&(c=[],da(c,b)));for(var b=0,e=c.length;b<e;b++)for(var f=0,g=c[b].length;f<g;f++)if(c[b][f].unique&&(!d[f]||!a.bSortCellsTop))d[f]=c[b][f].cell;return d}function sa(a,b,c){r(a,"aoServerParams","serverParams",[b]);if(b&&h.isArray(b)){var d={},
|
||||
e=/(.*?)\[\]$/;h.each(b,function(a,b){var c=b.name.match(e);c?(c=c[0],d[c]||(d[c]=[]),d[c].push(b.value)):d[b.name]=b.value});b=d}var f,g=a.ajax,j=a.oInstance,i=function(b){r(a,null,"xhr",[a,b,a.jqXHR]);c(b)};if(h.isPlainObject(g)&&g.data){f=g.data;var n=h.isFunction(f)?f(b,a):f,b=h.isFunction(f)&&n?n:h.extend(!0,b,n);delete g.data}n={data:b,success:function(b){var c=b.error||b.sError;c&&J(a,0,c);a.json=b;i(b)},dataType:"json",cache:!1,type:a.sServerMethod,error:function(b,c){var d=r(a,null,"xhr",
|
||||
[a,null,a.jqXHR]);-1===h.inArray(!0,d)&&("parsererror"==c?J(a,0,"Invalid JSON response",1):4===b.readyState&&J(a,0,"Ajax error",7));C(a,!1)}};a.oAjaxData=b;r(a,null,"preXhr",[a,b]);a.fnServerData?a.fnServerData.call(j,a.sAjaxSource,h.map(b,function(a,b){return{name:b,value:a}}),i,a):a.sAjaxSource||"string"===typeof g?a.jqXHR=h.ajax(h.extend(n,{url:g||a.sAjaxSource})):h.isFunction(g)?a.jqXHR=g.call(j,b,i,a):(a.jqXHR=h.ajax(h.extend(n,g)),g.data=f)}function kb(a){return a.bAjaxDataGet?(a.iDraw++,C(a,
|
||||
!0),sa(a,tb(a),function(b){ub(a,b)}),!1):!0}function tb(a){var b=a.aoColumns,c=b.length,d=a.oFeatures,e=a.oPreviousSearch,f=a.aoPreSearchCols,g,j=[],i,n,l,k=V(a);g=a._iDisplayStart;i=!1!==d.bPaginate?a._iDisplayLength:-1;var t=function(a,b){j.push({name:a,value:b})};t("sEcho",a.iDraw);t("iColumns",c);t("sColumns",D(b,"sName").join(","));t("iDisplayStart",g);t("iDisplayLength",i);var pa={draw:a.iDraw,columns:[],order:[],start:g,length:i,search:{value:e.sSearch,regex:e.bRegex}};for(g=0;g<c;g++)n=b[g],
|
||||
l=f[g],i="function"==typeof n.mData?"function":n.mData,pa.columns.push({data:i,name:n.sName,searchable:n.bSearchable,orderable:n.bSortable,search:{value:l.sSearch,regex:l.bRegex}}),t("mDataProp_"+g,i),d.bFilter&&(t("sSearch_"+g,l.sSearch),t("bRegex_"+g,l.bRegex),t("bSearchable_"+g,n.bSearchable)),d.bSort&&t("bSortable_"+g,n.bSortable);d.bFilter&&(t("sSearch",e.sSearch),t("bRegex",e.bRegex));d.bSort&&(h.each(k,function(a,b){pa.order.push({column:b.col,dir:b.dir});t("iSortCol_"+a,b.col);t("sSortDir_"+
|
||||
a,b.dir)}),t("iSortingCols",k.length));b=m.ext.legacy.ajax;return null===b?a.sAjaxSource?j:pa:b?j:pa}function ub(a,b){var c=ta(a,b),d=b.sEcho!==k?b.sEcho:b.draw,e=b.iTotalRecords!==k?b.iTotalRecords:b.recordsTotal,f=b.iTotalDisplayRecords!==k?b.iTotalDisplayRecords:b.recordsFiltered;if(d){if(1*d<a.iDraw)return;a.iDraw=1*d}na(a);a._iRecordsTotal=parseInt(e,10);a._iRecordsDisplay=parseInt(f,10);d=0;for(e=c.length;d<e;d++)M(a,c[d]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=!1;N(a);a._bInitComplete||
|
||||
ua(a,b);a.bAjaxDataGet=!0;C(a,!1)}function ta(a,b){var c=h.isPlainObject(a.ajax)&&a.ajax.dataSrc!==k?a.ajax.dataSrc:a.sAjaxDataProp;return"data"===c?b.aaData||b[c]:""!==c?Q(c)(b):b}function ob(a){var b=a.oClasses,c=a.sTableId,d=a.oLanguage,e=a.oPreviousSearch,f=a.aanFeatures,g='<input type="search" class="'+b.sFilterInput+'"/>',j=d.sSearch,j=j.match(/_INPUT_/)?j.replace("_INPUT_",g):j+g,b=h("<div/>",{id:!f.f?c+"_filter":null,"class":b.sFilter}).append(h("<label/>").append(j)),f=function(){var b=!this.value?
|
||||
"":this.value;b!=e.sSearch&&(fa(a,{sSearch:b,bRegex:e.bRegex,bSmart:e.bSmart,bCaseInsensitive:e.bCaseInsensitive}),a._iDisplayStart=0,N(a))},g=null!==a.searchDelay?a.searchDelay:"ssp"===y(a)?400:0,i=h("input",b).val(e.sSearch).attr("placeholder",d.sSearchPlaceholder).on("keyup.DT search.DT input.DT paste.DT cut.DT",g?Na(f,g):f).on("keypress.DT",function(a){if(13==a.keyCode)return!1}).attr("aria-controls",c);h(a.nTable).on("search.dt.DT",function(b,c){if(a===c)try{i[0]!==G.activeElement&&i.val(e.sSearch)}catch(d){}});
|
||||
return b[0]}function fa(a,b,c){var d=a.oPreviousSearch,e=a.aoPreSearchCols,f=function(a){d.sSearch=a.sSearch;d.bRegex=a.bRegex;d.bSmart=a.bSmart;d.bCaseInsensitive=a.bCaseInsensitive};Fa(a);if("ssp"!=y(a)){vb(a,b.sSearch,c,b.bEscapeRegex!==k?!b.bEscapeRegex:b.bRegex,b.bSmart,b.bCaseInsensitive);f(b);for(b=0;b<e.length;b++)wb(a,e[b].sSearch,b,e[b].bEscapeRegex!==k?!e[b].bEscapeRegex:e[b].bRegex,e[b].bSmart,e[b].bCaseInsensitive);xb(a)}else f(b);a.bFiltered=!0;r(a,null,"search",[a])}function xb(a){for(var b=
|
||||
m.ext.search,c=a.aiDisplay,d,e,f=0,g=b.length;f<g;f++){for(var j=[],i=0,n=c.length;i<n;i++)e=c[i],d=a.aoData[e],b[f](a,d._aFilterData,e,d._aData,i)&&j.push(e);c.length=0;h.merge(c,j)}}function wb(a,b,c,d,e,f){if(""!==b){for(var g=[],j=a.aiDisplay,d=Oa(b,d,e,f),e=0;e<j.length;e++)b=a.aoData[j[e]]._aFilterData[c],d.test(b)&&g.push(j[e]);a.aiDisplay=g}}function vb(a,b,c,d,e,f){var d=Oa(b,d,e,f),f=a.oPreviousSearch.sSearch,g=a.aiDisplayMaster,j,e=[];0!==m.ext.search.length&&(c=!0);j=yb(a);if(0>=b.length)a.aiDisplay=
|
||||
g.slice();else{if(j||c||f.length>b.length||0!==b.indexOf(f)||a.bSorted)a.aiDisplay=g.slice();b=a.aiDisplay;for(c=0;c<b.length;c++)d.test(a.aoData[b[c]]._sFilterRow)&&e.push(b[c]);a.aiDisplay=e}}function Oa(a,b,c,d){a=b?a:Pa(a);c&&(a="^(?=.*?"+h.map(a.match(/"[^"]+"|[^ ]+/g)||[""],function(a){if('"'===a.charAt(0))var b=a.match(/^"(.*)"$/),a=b?b[1]:a;return a.replace('"',"")}).join(")(?=.*?")+").*$");return RegExp(a,d?"i":"")}function yb(a){var b=a.aoColumns,c,d,e,f,g,j,i,h,l=m.ext.type.search;c=!1;
|
||||
d=0;for(f=a.aoData.length;d<f;d++)if(h=a.aoData[d],!h._aFilterData){j=[];e=0;for(g=b.length;e<g;e++)c=b[e],c.bSearchable?(i=B(a,d,e,"filter"),l[c.sType]&&(i=l[c.sType](i)),null===i&&(i=""),"string"!==typeof i&&i.toString&&(i=i.toString())):i="",i.indexOf&&-1!==i.indexOf("&")&&(va.innerHTML=i,i=Wb?va.textContent:va.innerText),i.replace&&(i=i.replace(/[\r\n]/g,"")),j.push(i);h._aFilterData=j;h._sFilterRow=j.join(" ");c=!0}return c}function zb(a){return{search:a.sSearch,smart:a.bSmart,regex:a.bRegex,
|
||||
caseInsensitive:a.bCaseInsensitive}}function Ab(a){return{sSearch:a.search,bSmart:a.smart,bRegex:a.regex,bCaseInsensitive:a.caseInsensitive}}function rb(a){var b=a.sTableId,c=a.aanFeatures.i,d=h("<div/>",{"class":a.oClasses.sInfo,id:!c?b+"_info":null});c||(a.aoDrawCallback.push({fn:Bb,sName:"information"}),d.attr("role","status").attr("aria-live","polite"),h(a.nTable).attr("aria-describedby",b+"_info"));return d[0]}function Bb(a){var b=a.aanFeatures.i;if(0!==b.length){var c=a.oLanguage,d=a._iDisplayStart+
|
||||
1,e=a.fnDisplayEnd(),f=a.fnRecordsTotal(),g=a.fnRecordsDisplay(),j=g?c.sInfo:c.sInfoEmpty;g!==f&&(j+=" "+c.sInfoFiltered);j+=c.sInfoPostFix;j=Cb(a,j);c=c.fnInfoCallback;null!==c&&(j=c.call(a.oInstance,a,d,e,f,g,j));h(b).html(j)}}function Cb(a,b){var c=a.fnFormatNumber,d=a._iDisplayStart+1,e=a._iDisplayLength,f=a.fnRecordsDisplay(),g=-1===e;return b.replace(/_START_/g,c.call(a,d)).replace(/_END_/g,c.call(a,a.fnDisplayEnd())).replace(/_MAX_/g,c.call(a,a.fnRecordsTotal())).replace(/_TOTAL_/g,c.call(a,
|
||||
f)).replace(/_PAGE_/g,c.call(a,g?1:Math.ceil(d/e))).replace(/_PAGES_/g,c.call(a,g?1:Math.ceil(f/e)))}function ga(a){var b,c,d=a.iInitDisplayStart,e=a.aoColumns,f;c=a.oFeatures;var g=a.bDeferLoading;if(a.bInitialised){mb(a);jb(a);ea(a,a.aoHeader);ea(a,a.aoFooter);C(a,!0);c.bAutoWidth&&Ea(a);b=0;for(c=e.length;b<c;b++)f=e[b],f.sWidth&&(f.nTh.style.width=v(f.sWidth));r(a,null,"preInit",[a]);S(a);e=y(a);if("ssp"!=e||g)"ajax"==e?sa(a,[],function(c){var f=ta(a,c);for(b=0;b<f.length;b++)M(a,f[b]);a.iInitDisplayStart=
|
||||
d;S(a);C(a,!1);ua(a,c)},a):(C(a,!1),ua(a))}else setTimeout(function(){ga(a)},200)}function ua(a,b){a._bInitComplete=!0;(b||a.oInit.aaData)&&Y(a);r(a,null,"plugin-init",[a,b]);r(a,"aoInitComplete","init",[a,b])}function Qa(a,b){var c=parseInt(b,10);a._iDisplayLength=c;Ra(a);r(a,null,"length",[a,c])}function nb(a){for(var b=a.oClasses,c=a.sTableId,d=a.aLengthMenu,e=h.isArray(d[0]),f=e?d[0]:d,d=e?d[1]:d,e=h("<select/>",{name:c+"_length","aria-controls":c,"class":b.sLengthSelect}),g=0,j=f.length;g<j;g++)e[0][g]=
|
||||
new Option("number"===typeof d[g]?a.fnFormatNumber(d[g]):d[g],f[g]);var i=h("<div><label/></div>").addClass(b.sLength);a.aanFeatures.l||(i[0].id=c+"_length");i.children().append(a.oLanguage.sLengthMenu.replace("_MENU_",e[0].outerHTML));h("select",i).val(a._iDisplayLength).on("change.DT",function(){Qa(a,h(this).val());N(a)});h(a.nTable).on("length.dt.DT",function(b,c,d){a===c&&h("select",i).val(d)});return i[0]}function sb(a){var b=a.sPaginationType,c=m.ext.pager[b],d="function"===typeof c,e=function(a){N(a)},
|
||||
b=h("<div/>").addClass(a.oClasses.sPaging+b)[0],f=a.aanFeatures;d||c.fnInit(a,b,e);f.p||(b.id=a.sTableId+"_paginate",a.aoDrawCallback.push({fn:function(a){if(d){var b=a._iDisplayStart,i=a._iDisplayLength,h=a.fnRecordsDisplay(),l=-1===i,b=l?0:Math.ceil(b/i),i=l?1:Math.ceil(h/i),h=c(b,i),k,l=0;for(k=f.p.length;l<k;l++)Ma(a,"pageButton")(a,f.p[l],l,h,b,i)}else c.fnUpdate(a,e)},sName:"pagination"}));return b}function Sa(a,b,c){var d=a._iDisplayStart,e=a._iDisplayLength,f=a.fnRecordsDisplay();0===f||-1===
|
||||
e?d=0:"number"===typeof b?(d=b*e,d>f&&(d=0)):"first"==b?d=0:"previous"==b?(d=0<=e?d-e:0,0>d&&(d=0)):"next"==b?d+e<f&&(d+=e):"last"==b?d=Math.floor((f-1)/e)*e:J(a,0,"Unknown paging action: "+b,5);b=a._iDisplayStart!==d;a._iDisplayStart=d;b&&(r(a,null,"page",[a]),c&&N(a));return b}function pb(a){return h("<div/>",{id:!a.aanFeatures.r?a.sTableId+"_processing":null,"class":a.oClasses.sProcessing}).html(a.oLanguage.sProcessing).insertBefore(a.nTable)[0]}function C(a,b){a.oFeatures.bProcessing&&h(a.aanFeatures.r).css("display",
|
||||
b?"block":"none");r(a,null,"processing",[a,b])}function qb(a){var b=h(a.nTable);b.attr("role","grid");var c=a.oScroll;if(""===c.sX&&""===c.sY)return a.nTable;var d=c.sX,e=c.sY,f=a.oClasses,g=b.children("caption"),j=g.length?g[0]._captionSide:null,i=h(b[0].cloneNode(!1)),n=h(b[0].cloneNode(!1)),l=b.children("tfoot");l.length||(l=null);i=h("<div/>",{"class":f.sScrollWrapper}).append(h("<div/>",{"class":f.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:d?!d?null:v(d):"100%"}).append(h("<div/>",
|
||||
{"class":f.sScrollHeadInner}).css({"box-sizing":"content-box",width:c.sXInner||"100%"}).append(i.removeAttr("id").css("margin-left",0).append("top"===j?g:null).append(b.children("thead"))))).append(h("<div/>",{"class":f.sScrollBody}).css({position:"relative",overflow:"auto",width:!d?null:v(d)}).append(b));l&&i.append(h("<div/>",{"class":f.sScrollFoot}).css({overflow:"hidden",border:0,width:d?!d?null:v(d):"100%"}).append(h("<div/>",{"class":f.sScrollFootInner}).append(n.removeAttr("id").css("margin-left",
|
||||
0).append("bottom"===j?g:null).append(b.children("tfoot")))));var b=i.children(),k=b[0],f=b[1],t=l?b[2]:null;if(d)h(f).on("scroll.DT",function(){var a=this.scrollLeft;k.scrollLeft=a;l&&(t.scrollLeft=a)});h(f).css(e&&c.bCollapse?"max-height":"height",e);a.nScrollHead=k;a.nScrollBody=f;a.nScrollFoot=t;a.aoDrawCallback.push({fn:ka,sName:"scrolling"});return i[0]}function ka(a){var b=a.oScroll,c=b.sX,d=b.sXInner,e=b.sY,b=b.iBarWidth,f=h(a.nScrollHead),g=f[0].style,j=f.children("div"),i=j[0].style,n=j.children("table"),
|
||||
j=a.nScrollBody,l=h(j),q=j.style,t=h(a.nScrollFoot).children("div"),m=t.children("table"),o=h(a.nTHead),p=h(a.nTable),s=p[0],r=s.style,u=a.nTFoot?h(a.nTFoot):null,x=a.oBrowser,T=x.bScrollOversize,Xb=D(a.aoColumns,"nTh"),O,K,P,w,Ta=[],y=[],z=[],A=[],B,C=function(a){a=a.style;a.paddingTop="0";a.paddingBottom="0";a.borderTopWidth="0";a.borderBottomWidth="0";a.height=0};K=j.scrollHeight>j.clientHeight;if(a.scrollBarVis!==K&&a.scrollBarVis!==k)a.scrollBarVis=K,Y(a);else{a.scrollBarVis=K;p.children("thead, tfoot").remove();
|
||||
u&&(P=u.clone().prependTo(p),O=u.find("tr"),P=P.find("tr"));w=o.clone().prependTo(p);o=o.find("tr");K=w.find("tr");w.find("th, td").removeAttr("tabindex");c||(q.width="100%",f[0].style.width="100%");h.each(ra(a,w),function(b,c){B=Z(a,b);c.style.width=a.aoColumns[B].sWidth});u&&H(function(a){a.style.width=""},P);f=p.outerWidth();if(""===c){r.width="100%";if(T&&(p.find("tbody").height()>j.offsetHeight||"scroll"==l.css("overflow-y")))r.width=v(p.outerWidth()-b);f=p.outerWidth()}else""!==d&&(r.width=
|
||||
v(d),f=p.outerWidth());H(C,K);H(function(a){z.push(a.innerHTML);Ta.push(v(h(a).css("width")))},K);H(function(a,b){if(h.inArray(a,Xb)!==-1)a.style.width=Ta[b]},o);h(K).height(0);u&&(H(C,P),H(function(a){A.push(a.innerHTML);y.push(v(h(a).css("width")))},P),H(function(a,b){a.style.width=y[b]},O),h(P).height(0));H(function(a,b){a.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+z[b]+"</div>";a.style.width=Ta[b]},K);u&&H(function(a,b){a.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+
|
||||
A[b]+"</div>";a.style.width=y[b]},P);if(p.outerWidth()<f){O=j.scrollHeight>j.offsetHeight||"scroll"==l.css("overflow-y")?f+b:f;if(T&&(j.scrollHeight>j.offsetHeight||"scroll"==l.css("overflow-y")))r.width=v(O-b);(""===c||""!==d)&&J(a,1,"Possible column misalignment",6)}else O="100%";q.width=v(O);g.width=v(O);u&&(a.nScrollFoot.style.width=v(O));!e&&T&&(q.height=v(s.offsetHeight+b));c=p.outerWidth();n[0].style.width=v(c);i.width=v(c);d=p.height()>j.clientHeight||"scroll"==l.css("overflow-y");e="padding"+
|
||||
(x.bScrollbarLeft?"Left":"Right");i[e]=d?b+"px":"0px";u&&(m[0].style.width=v(c),t[0].style.width=v(c),t[0].style[e]=d?b+"px":"0px");p.children("colgroup").insertBefore(p.children("thead"));l.scroll();if((a.bSorted||a.bFiltered)&&!a._drawHold)j.scrollTop=0}}function H(a,b,c){for(var d=0,e=0,f=b.length,g,j;e<f;){g=b[e].firstChild;for(j=c?c[e].firstChild:null;g;)1===g.nodeType&&(c?a(g,j,d):a(g,d),d++),g=g.nextSibling,j=c?j.nextSibling:null;e++}}function Ea(a){var b=a.nTable,c=a.aoColumns,d=a.oScroll,
|
||||
e=d.sY,f=d.sX,g=d.sXInner,j=c.length,i=la(a,"bVisible"),n=h("th",a.nTHead),l=b.getAttribute("width"),k=b.parentNode,t=!1,m,o,p=a.oBrowser,d=p.bScrollOversize;(m=b.style.width)&&-1!==m.indexOf("%")&&(l=m);for(m=0;m<i.length;m++)o=c[i[m]],null!==o.sWidth&&(o.sWidth=Db(o.sWidthOrig,k),t=!0);if(d||!t&&!f&&!e&&j==aa(a)&&j==n.length)for(m=0;m<j;m++)i=Z(a,m),null!==i&&(c[i].sWidth=v(n.eq(m).width()));else{j=h(b).clone().css("visibility","hidden").removeAttr("id");j.find("tbody tr").remove();var s=h("<tr/>").appendTo(j.find("tbody"));
|
||||
j.find("thead, tfoot").remove();j.append(h(a.nTHead).clone()).append(h(a.nTFoot).clone());j.find("tfoot th, tfoot td").css("width","");n=ra(a,j.find("thead")[0]);for(m=0;m<i.length;m++)o=c[i[m]],n[m].style.width=null!==o.sWidthOrig&&""!==o.sWidthOrig?v(o.sWidthOrig):"",o.sWidthOrig&&f&&h(n[m]).append(h("<div/>").css({width:o.sWidthOrig,margin:0,padding:0,border:0,height:1}));if(a.aoData.length)for(m=0;m<i.length;m++)t=i[m],o=c[t],h(Eb(a,t)).clone(!1).append(o.sContentPadding).appendTo(s);h("[name]",
|
||||
j).removeAttr("name");o=h("<div/>").css(f||e?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(j).appendTo(k);f&&g?j.width(g):f?(j.css("width","auto"),j.removeAttr("width"),j.width()<k.clientWidth&&l&&j.width(k.clientWidth)):e?j.width(k.clientWidth):l&&j.width(l);for(m=e=0;m<i.length;m++)k=h(n[m]),g=k.outerWidth()-k.width(),k=p.bBounding?Math.ceil(n[m].getBoundingClientRect().width):k.outerWidth(),e+=k,c[i[m]].sWidth=v(k-g);b.style.width=v(e);o.remove()}l&&(b.style.width=
|
||||
v(l));if((l||f)&&!a._reszEvt)b=function(){h(E).on("resize.DT-"+a.sInstance,Na(function(){Y(a)}))},d?setTimeout(b,1E3):b(),a._reszEvt=!0}function Db(a,b){if(!a)return 0;var c=h("<div/>").css("width",v(a)).appendTo(b||G.body),d=c[0].offsetWidth;c.remove();return d}function Eb(a,b){var c=Fb(a,b);if(0>c)return null;var d=a.aoData[c];return!d.nTr?h("<td/>").html(B(a,c,b,"display"))[0]:d.anCells[b]}function Fb(a,b){for(var c,d=-1,e=-1,f=0,g=a.aoData.length;f<g;f++)c=B(a,f,b,"display")+"",c=c.replace(Yb,
|
||||
""),c=c.replace(/ /g," "),c.length>d&&(d=c.length,e=f);return e}function v(a){return null===a?"0px":"number"==typeof a?0>a?"0px":a+"px":a.match(/\d$/)?a+"px":a}function V(a){var b,c,d=[],e=a.aoColumns,f,g,j,i;b=a.aaSortingFixed;c=h.isPlainObject(b);var n=[];f=function(a){a.length&&!h.isArray(a[0])?n.push(a):h.merge(n,a)};h.isArray(b)&&f(b);c&&b.pre&&f(b.pre);f(a.aaSorting);c&&b.post&&f(b.post);for(a=0;a<n.length;a++){i=n[a][0];f=e[i].aDataSort;b=0;for(c=f.length;b<c;b++)g=f[b],j=e[g].sType||
|
||||
"string",n[a]._idx===k&&(n[a]._idx=h.inArray(n[a][1],e[g].asSorting)),d.push({src:i,col:g,dir:n[a][1],index:n[a]._idx,type:j,formatter:m.ext.type.order[j+"-pre"]})}return d}function lb(a){var b,c,d=[],e=m.ext.type.order,f=a.aoData,g=0,j,i=a.aiDisplayMaster,h;Fa(a);h=V(a);b=0;for(c=h.length;b<c;b++)j=h[b],j.formatter&&g++,Gb(a,j.col);if("ssp"!=y(a)&&0!==h.length){b=0;for(c=i.length;b<c;b++)d[i[b]]=b;g===h.length?i.sort(function(a,b){var c,e,g,j,i=h.length,k=f[a]._aSortData,m=f[b]._aSortData;for(g=
|
||||
0;g<i;g++)if(j=h[g],c=k[j.col],e=m[j.col],c=c<e?-1:c>e?1:0,0!==c)return"asc"===j.dir?c:-c;c=d[a];e=d[b];return c<e?-1:c>e?1:0}):i.sort(function(a,b){var c,g,j,i,k=h.length,m=f[a]._aSortData,o=f[b]._aSortData;for(j=0;j<k;j++)if(i=h[j],c=m[i.col],g=o[i.col],i=e[i.type+"-"+i.dir]||e["string-"+i.dir],c=i(c,g),0!==c)return c;c=d[a];g=d[b];return c<g?-1:c>g?1:0})}a.bSorted=!0}function Hb(a){for(var b,c,d=a.aoColumns,e=V(a),a=a.oLanguage.oAria,f=0,g=d.length;f<g;f++){c=d[f];var j=c.asSorting;b=c.sTitle.replace(/<.*?>/g,
|
||||
"");var i=c.nTh;i.removeAttribute("aria-sort");c.bSortable&&(0<e.length&&e[0].col==f?(i.setAttribute("aria-sort","asc"==e[0].dir?"ascending":"descending"),c=j[e[0].index+1]||j[0]):c=j[0],b+="asc"===c?a.sSortAscending:a.sSortDescending);i.setAttribute("aria-label",b)}}function Ua(a,b,c,d){var e=a.aaSorting,f=a.aoColumns[b].asSorting,g=function(a,b){var c=a._idx;c===k&&(c=h.inArray(a[1],f));return c+1<f.length?c+1:b?null:0};"number"===typeof e[0]&&(e=a.aaSorting=[e]);c&&a.oFeatures.bSortMulti?(c=h.inArray(b,
|
||||
D(e,"0")),-1!==c?(b=g(e[c],!0),null===b&&1===e.length&&(b=0),null===b?e.splice(c,1):(e[c][1]=f[b],e[c]._idx=b)):(e.push([b,f[0],0]),e[e.length-1]._idx=0)):e.length&&e[0][0]==b?(b=g(e[0]),e.length=1,e[0][1]=f[b],e[0]._idx=b):(e.length=0,e.push([b,f[0]]),e[0]._idx=0);S(a);"function"==typeof d&&d(a)}function La(a,b,c,d){var e=a.aoColumns[c];Va(b,{},function(b){!1!==e.bSortable&&(a.oFeatures.bProcessing?(C(a,!0),setTimeout(function(){Ua(a,c,b.shiftKey,d);"ssp"!==y(a)&&C(a,!1)},0)):Ua(a,c,b.shiftKey,d))})}
|
||||
function wa(a){var b=a.aLastSort,c=a.oClasses.sSortColumn,d=V(a),e=a.oFeatures,f,g;if(e.bSort&&e.bSortClasses){e=0;for(f=b.length;e<f;e++)g=b[e].src,h(D(a.aoData,"anCells",g)).removeClass(c+(2>e?e+1:3));e=0;for(f=d.length;e<f;e++)g=d[e].src,h(D(a.aoData,"anCells",g)).addClass(c+(2>e?e+1:3))}a.aLastSort=d}function Gb(a,b){var c=a.aoColumns[b],d=m.ext.order[c.sSortDataType],e;d&&(e=d.call(a.oInstance,a,b,$(a,b)));for(var f,g=m.ext.type.order[c.sType+"-pre"],j=0,i=a.aoData.length;j<i;j++)if(c=a.aoData[j],
|
||||
c._aSortData||(c._aSortData=[]),!c._aSortData[b]||d)f=d?e[j]:B(a,j,b,"sort"),c._aSortData[b]=g?g(f):f}function xa(a){if(a.oFeatures.bStateSave&&!a.bDestroying){var b={time:+new Date,start:a._iDisplayStart,length:a._iDisplayLength,order:h.extend(!0,[],a.aaSorting),search:zb(a.oPreviousSearch),columns:h.map(a.aoColumns,function(b,d){return{visible:b.bVisible,search:zb(a.aoPreSearchCols[d])}})};r(a,"aoStateSaveParams","stateSaveParams",[a,b]);a.oSavedState=b;a.fnStateSaveCallback.call(a.oInstance,a,
|
||||
b)}}function Ib(a,b,c){var d,e,f=a.aoColumns,b=function(b){if(b&&b.time){var g=r(a,"aoStateLoadParams","stateLoadParams",[a,b]);if(-1===h.inArray(!1,g)&&(g=a.iStateDuration,!(0<g&&b.time<+new Date-1E3*g)&&!(b.columns&&f.length!==b.columns.length))){a.oLoadedState=h.extend(!0,{},b);b.start!==k&&(a._iDisplayStart=b.start,a.iInitDisplayStart=b.start);b.length!==k&&(a._iDisplayLength=b.length);b.order!==k&&(a.aaSorting=[],h.each(b.order,function(b,c){a.aaSorting.push(c[0]>=f.length?[0,c[1]]:c)}));b.search!==
|
||||
k&&h.extend(a.oPreviousSearch,Ab(b.search));if(b.columns){d=0;for(e=b.columns.length;d<e;d++)g=b.columns[d],g.visible!==k&&(f[d].bVisible=g.visible),g.search!==k&&h.extend(a.aoPreSearchCols[d],Ab(g.search))}r(a,"aoStateLoaded","stateLoaded",[a,b])}}c()};if(a.oFeatures.bStateSave){var g=a.fnStateLoadCallback.call(a.oInstance,a,b);g!==k&&b(g)}else c()}function ya(a){var b=m.settings,a=h.inArray(a,D(b,"nTable"));return-1!==a?b[a]:null}function J(a,b,c,d){c="DataTables warning: "+(a?"table id="+a.sTableId+
|
||||
" - ":"")+c;d&&(c+=". For more information about this error, please see http://datatables.net/tn/"+d);if(b)E.console&&console.log&&console.log(c);else if(b=m.ext,b=b.sErrMode||b.errMode,a&&r(a,null,"error",[a,d,c]),"alert"==b)alert(c);else{if("throw"==b)throw Error(c);"function"==typeof b&&b(a,d,c)}}function F(a,b,c,d){h.isArray(c)?h.each(c,function(c,d){h.isArray(d)?F(a,b,d[0],d[1]):F(a,b,d)}):(d===k&&(d=c),b[c]!==k&&(a[d]=b[c]))}function Jb(a,b,c){var d,e;for(e in b)b.hasOwnProperty(e)&&(d=b[e],
|
||||
h.isPlainObject(d)?(h.isPlainObject(a[e])||(a[e]={}),h.extend(!0,a[e],d)):a[e]=c&&"data"!==e&&"aaData"!==e&&h.isArray(d)?d.slice():d);return a}function Va(a,b,c){h(a).on("click.DT",b,function(b){a.blur();c(b)}).on("keypress.DT",b,function(a){13===a.which&&(a.preventDefault(),c(a))}).on("selectstart.DT",function(){return!1})}function z(a,b,c,d){c&&a[b].push({fn:c,sName:d})}function r(a,b,c,d){var e=[];b&&(e=h.map(a[b].slice().reverse(),function(b){return b.fn.apply(a.oInstance,d)}));null!==c&&(b=h.Event(c+
|
||||
".dt"),h(a.nTable).trigger(b,d),e.push(b.result));return e}function Ra(a){var b=a._iDisplayStart,c=a.fnDisplayEnd(),d=a._iDisplayLength;b>=c&&(b=c-d);b-=b%d;if(-1===d||0>b)b=0;a._iDisplayStart=b}function Ma(a,b){var c=a.renderer,d=m.ext.renderer[b];return h.isPlainObject(c)&&c[b]?d[c[b]]||d._:"string"===typeof c?d[c]||d._:d._}function y(a){return a.oFeatures.bServerSide?"ssp":a.ajax||a.sAjaxSource?"ajax":"dom"}function ha(a,b){var c=[],c=Kb.numbers_length,d=Math.floor(c/2);b<=c?c=W(0,b):a<=d?(c=W(0,
|
||||
c-2),c.push("ellipsis"),c.push(b-1)):(a>=b-1-d?c=W(b-(c-2),b):(c=W(a-d+2,a+d-1),c.push("ellipsis"),c.push(b-1)),c.splice(0,0,"ellipsis"),c.splice(0,0,0));c.DT_el="span";return c}function cb(a){h.each({num:function(b){return za(b,a)},"num-fmt":function(b){return za(b,a,Wa)},"html-num":function(b){return za(b,a,Aa)},"html-num-fmt":function(b){return za(b,a,Aa,Wa)}},function(b,c){x.type.order[b+a+"-pre"]=c;b.match(/^html\-/)&&(x.type.search[b+a]=x.type.search.html)})}function Lb(a){return function(){var b=
|
||||
[ya(this[m.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return m.ext.internal[a].apply(this,b)}}var m=function(a){this.$=function(a,b){return this.api(!0).$(a,b)};this._=function(a,b){return this.api(!0).rows(a,b).data()};this.api=function(a){return a?new s(ya(this[x.iApiIndex])):new s(this)};this.fnAddData=function(a,b){var c=this.api(!0),d=h.isArray(a)&&(h.isArray(a[0])||h.isPlainObject(a[0]))?c.rows.add(a):c.row.add(a);(b===k||b)&&c.draw();return d.flatten().toArray()};this.fnAdjustColumnSizing=
|
||||
function(a){var b=this.api(!0).columns.adjust(),c=b.settings()[0],d=c.oScroll;a===k||a?b.draw(!1):(""!==d.sX||""!==d.sY)&&ka(c)};this.fnClearTable=function(a){var b=this.api(!0).clear();(a===k||a)&&b.draw()};this.fnClose=function(a){this.api(!0).row(a).child.hide()};this.fnDeleteRow=function(a,b,c){var d=this.api(!0),a=d.rows(a),e=a.settings()[0],h=e.aoData[a[0][0]];a.remove();b&&b.call(this,e,h);(c===k||c)&&d.draw();return h};this.fnDestroy=function(a){this.api(!0).destroy(a)};this.fnDraw=function(a){this.api(!0).draw(a)};
|
||||
this.fnFilter=function(a,b,c,d,e,h){e=this.api(!0);null===b||b===k?e.search(a,c,d,h):e.column(b).search(a,c,d,h);e.draw()};this.fnGetData=function(a,b){var c=this.api(!0);if(a!==k){var d=a.nodeName?a.nodeName.toLowerCase():"";return b!==k||"td"==d||"th"==d?c.cell(a,b).data():c.row(a).data()||null}return c.data().toArray()};this.fnGetNodes=function(a){var b=this.api(!0);return a!==k?b.row(a).node():b.rows().nodes().flatten().toArray()};this.fnGetPosition=function(a){var b=this.api(!0),c=a.nodeName.toUpperCase();
|
||||
return"TR"==c?b.row(a).index():"TD"==c||"TH"==c?(a=b.cell(a).index(),[a.row,a.columnVisible,a.column]):null};this.fnIsOpen=function(a){return this.api(!0).row(a).child.isShown()};this.fnOpen=function(a,b,c){return this.api(!0).row(a).child(b,c).show().child()[0]};this.fnPageChange=function(a,b){var c=this.api(!0).page(a);(b===k||b)&&c.draw(!1)};this.fnSetColumnVis=function(a,b,c){a=this.api(!0).column(a).visible(b);(c===k||c)&&a.columns.adjust().draw()};this.fnSettings=function(){return ya(this[x.iApiIndex])};
|
||||
this.fnSort=function(a){this.api(!0).order(a).draw()};this.fnSortListener=function(a,b,c){this.api(!0).order.listener(a,b,c)};this.fnUpdate=function(a,b,c,d,e){var h=this.api(!0);c===k||null===c?h.row(b).data(a):h.cell(b,c).data(a);(e===k||e)&&h.columns.adjust();(d===k||d)&&h.draw();return 0};this.fnVersionCheck=x.fnVersionCheck;var b=this,c=a===k,d=this.length;c&&(a={});this.oApi=this.internal=x.internal;for(var e in m.ext.internal)e&&(this[e]=Lb(e));this.each(function(){var e={},g=1<d?Jb(e,a,!0):
|
||||
a,j=0,i,e=this.getAttribute("id"),n=!1,l=m.defaults,q=h(this);if("table"!=this.nodeName.toLowerCase())J(null,0,"Non-table node initialisation ("+this.nodeName+")",2);else{db(l);eb(l.column);I(l,l,!0);I(l.column,l.column,!0);I(l,h.extend(g,q.data()));var t=m.settings,j=0;for(i=t.length;j<i;j++){var o=t[j];if(o.nTable==this||o.nTHead.parentNode==this||o.nTFoot&&o.nTFoot.parentNode==this){var s=g.bRetrieve!==k?g.bRetrieve:l.bRetrieve;if(c||s)return o.oInstance;if(g.bDestroy!==k?g.bDestroy:l.bDestroy){o.oInstance.fnDestroy();
|
||||
break}else{J(o,0,"Cannot reinitialise DataTable",3);return}}if(o.sTableId==this.id){t.splice(j,1);break}}if(null===e||""===e)this.id=e="DataTables_Table_"+m.ext._unique++;var p=h.extend(!0,{},m.models.oSettings,{sDestroyWidth:q[0].style.width,sInstance:e,sTableId:e});p.nTable=this;p.oApi=b.internal;p.oInit=g;t.push(p);p.oInstance=1===b.length?b:q.dataTable();db(g);g.oLanguage&&Ca(g.oLanguage);g.aLengthMenu&&!g.iDisplayLength&&(g.iDisplayLength=h.isArray(g.aLengthMenu[0])?g.aLengthMenu[0][0]:g.aLengthMenu[0]);
|
||||
g=Jb(h.extend(!0,{},l),g);F(p.oFeatures,g,"bPaginate bLengthChange bFilter bSort bSortMulti bInfo bProcessing bAutoWidth bSortClasses bServerSide bDeferRender".split(" "));F(p,g,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer","searchDelay","rowId",["iCookieDuration","iStateDuration"],
|
||||
["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"]]);F(p.oScroll,g,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]);F(p.oLanguage,g,"fnInfoCallback");z(p,"aoDrawCallback",g.fnDrawCallback,"user");z(p,"aoServerParams",g.fnServerParams,"user");z(p,"aoStateSaveParams",g.fnStateSaveParams,"user");z(p,"aoStateLoadParams",g.fnStateLoadParams,"user");z(p,"aoStateLoaded",g.fnStateLoaded,"user");z(p,"aoRowCallback",
|
||||
g.fnRowCallback,"user");z(p,"aoRowCreatedCallback",g.fnCreatedRow,"user");z(p,"aoHeaderCallback",g.fnHeaderCallback,"user");z(p,"aoFooterCallback",g.fnFooterCallback,"user");z(p,"aoInitComplete",g.fnInitComplete,"user");z(p,"aoPreDrawCallback",g.fnPreDrawCallback,"user");p.rowIdFn=Q(g.rowId);fb(p);var u=p.oClasses;h.extend(u,m.ext.classes,g.oClasses);q.addClass(u.sTable);p.iInitDisplayStart===k&&(p.iInitDisplayStart=g.iDisplayStart,p._iDisplayStart=g.iDisplayStart);null!==g.iDeferLoading&&(p.bDeferLoading=
|
||||
!0,e=h.isArray(g.iDeferLoading),p._iRecordsDisplay=e?g.iDeferLoading[0]:g.iDeferLoading,p._iRecordsTotal=e?g.iDeferLoading[1]:g.iDeferLoading);var v=p.oLanguage;h.extend(!0,v,g.oLanguage);v.sUrl&&(h.ajax({dataType:"json",url:v.sUrl,success:function(a){Ca(a);I(l.oLanguage,a);h.extend(true,v,a);ga(p)},error:function(){ga(p)}}),n=!0);null===g.asStripeClasses&&(p.asStripeClasses=[u.sStripeOdd,u.sStripeEven]);var e=p.asStripeClasses,x=q.children("tbody").find("tr").eq(0);-1!==h.inArray(!0,h.map(e,function(a){return x.hasClass(a)}))&&
|
||||
(h("tbody tr",this).removeClass(e.join(" ")),p.asDestroyStripes=e.slice());e=[];t=this.getElementsByTagName("thead");0!==t.length&&(da(p.aoHeader,t[0]),e=ra(p));if(null===g.aoColumns){t=[];j=0;for(i=e.length;j<i;j++)t.push(null)}else t=g.aoColumns;j=0;for(i=t.length;j<i;j++)Da(p,e?e[j]:null);hb(p,g.aoColumnDefs,t,function(a,b){ja(p,a,b)});if(x.length){var w=function(a,b){return a.getAttribute("data-"+b)!==null?b:null};h(x[0]).children("th, td").each(function(a,b){var c=p.aoColumns[a];if(c.mData===
|
||||
a){var d=w(b,"sort")||w(b,"order"),e=w(b,"filter")||w(b,"search");if(d!==null||e!==null){c.mData={_:a+".display",sort:d!==null?a+".@data-"+d:k,type:d!==null?a+".@data-"+d:k,filter:e!==null?a+".@data-"+e:k};ja(p,a)}}})}var T=p.oFeatures,e=function(){if(g.aaSorting===k){var a=p.aaSorting;j=0;for(i=a.length;j<i;j++)a[j][1]=p.aoColumns[j].asSorting[0]}wa(p);T.bSort&&z(p,"aoDrawCallback",function(){if(p.bSorted){var a=V(p),b={};h.each(a,function(a,c){b[c.src]=c.dir});r(p,null,"order",[p,a,b]);Hb(p)}});
|
||||
z(p,"aoDrawCallback",function(){(p.bSorted||y(p)==="ssp"||T.bDeferRender)&&wa(p)},"sc");var a=q.children("caption").each(function(){this._captionSide=h(this).css("caption-side")}),b=q.children("thead");b.length===0&&(b=h("<thead/>").appendTo(q));p.nTHead=b[0];b=q.children("tbody");b.length===0&&(b=h("<tbody/>").appendTo(q));p.nTBody=b[0];b=q.children("tfoot");if(b.length===0&&a.length>0&&(p.oScroll.sX!==""||p.oScroll.sY!==""))b=h("<tfoot/>").appendTo(q);if(b.length===0||b.children().length===0)q.addClass(u.sNoFooter);
|
||||
else if(b.length>0){p.nTFoot=b[0];da(p.aoFooter,p.nTFoot)}if(g.aaData)for(j=0;j<g.aaData.length;j++)M(p,g.aaData[j]);else(p.bDeferLoading||y(p)=="dom")&&ma(p,h(p.nTBody).children("tr"));p.aiDisplay=p.aiDisplayMaster.slice();p.bInitialised=true;n===false&&ga(p)};g.bStateSave?(T.bStateSave=!0,z(p,"aoDrawCallback",xa,"state_save"),Ib(p,g,e)):e()}});b=null;return this},x,s,o,u,Xa={},Mb=/[\r\n]/g,Aa=/<.*?>/g,Zb=/^\d{2,4}[\.\/\-]\d{1,2}[\.\/\-]\d{1,2}([T ]{1}\d{1,2}[:\.]\d{2}([\.:]\d{2})?)?$/,$b=RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^|\\-)",
|
||||
"g"),Wa=/[',$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfk]/gi,L=function(a){return!a||!0===a||"-"===a?!0:!1},Nb=function(a){var b=parseInt(a,10);return!isNaN(b)&&isFinite(a)?b:null},Ob=function(a,b){Xa[b]||(Xa[b]=RegExp(Pa(b),"g"));return"string"===typeof a&&"."!==b?a.replace(/\./g,"").replace(Xa[b],"."):a},Ya=function(a,b,c){var d="string"===typeof a;if(L(a))return!0;b&&d&&(a=Ob(a,b));c&&d&&(a=a.replace(Wa,""));return!isNaN(parseFloat(a))&&isFinite(a)},Pb=function(a,b,c){return L(a)?!0:!(L(a)||"string"===
|
||||
typeof a)?null:Ya(a.replace(Aa,""),b,c)?!0:null},D=function(a,b,c){var d=[],e=0,f=a.length;if(c!==k)for(;e<f;e++)a[e]&&a[e][b]&&d.push(a[e][b][c]);else for(;e<f;e++)a[e]&&d.push(a[e][b]);return d},ia=function(a,b,c,d){var e=[],f=0,g=b.length;if(d!==k)for(;f<g;f++)a[b[f]][c]&&e.push(a[b[f]][c][d]);else for(;f<g;f++)e.push(a[b[f]][c]);return e},W=function(a,b){var c=[],d;b===k?(b=0,d=a):(d=b,b=a);for(var e=b;e<d;e++)c.push(e);return c},Qb=function(a){for(var b=[],c=0,d=a.length;c<d;c++)a[c]&&b.push(a[c]);
|
||||
return b},qa=function(a){var b;a:{if(!(2>a.length)){b=a.slice().sort();for(var c=b[0],d=1,e=b.length;d<e;d++){if(b[d]===c){b=!1;break a}c=b[d]}}b=!0}if(b)return a.slice();b=[];var e=a.length,f,g=0,d=0;a:for(;d<e;d++){c=a[d];for(f=0;f<g;f++)if(b[f]===c)continue a;b.push(c);g++}return b};m.util={throttle:function(a,b){var c=b!==k?b:200,d,e;return function(){var b=this,g=+new Date,j=arguments;d&&g<d+c?(clearTimeout(e),e=setTimeout(function(){d=k;a.apply(b,j)},c)):(d=g,a.apply(b,j))}},escapeRegex:function(a){return a.replace($b,
|
||||
"\\$1")}};var A=function(a,b,c){a[b]!==k&&(a[c]=a[b])},ba=/\[.*?\]$/,U=/\(\)$/,Pa=m.util.escapeRegex,va=h("<div>")[0],Wb=va.textContent!==k,Yb=/<.*?>/g,Na=m.util.throttle,Rb=[],w=Array.prototype,ac=function(a){var b,c,d=m.settings,e=h.map(d,function(a){return a.nTable});if(a){if(a.nTable&&a.oApi)return[a];if(a.nodeName&&"table"===a.nodeName.toLowerCase())return b=h.inArray(a,e),-1!==b?[d[b]]:null;if(a&&"function"===typeof a.settings)return a.settings().toArray();"string"===typeof a?c=h(a):a instanceof
|
||||
h&&(c=a)}else return[];if(c)return c.map(function(){b=h.inArray(this,e);return-1!==b?d[b]:null}).toArray()};s=function(a,b){if(!(this instanceof s))return new s(a,b);var c=[],d=function(a){(a=ac(a))&&(c=c.concat(a))};if(h.isArray(a))for(var e=0,f=a.length;e<f;e++)d(a[e]);else d(a);this.context=qa(c);b&&h.merge(this,b);this.selector={rows:null,cols:null,opts:null};s.extend(this,this,Rb)};m.Api=s;h.extend(s.prototype,{any:function(){return 0!==this.count()},concat:w.concat,context:[],count:function(){return this.flatten().length},
|
||||
each:function(a){for(var b=0,c=this.length;b<c;b++)a.call(this,this[b],b,this);return this},eq:function(a){var b=this.context;return b.length>a?new s(b[a],this[a]):null},filter:function(a){var b=[];if(w.filter)b=w.filter.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)a.call(this,this[c],c,this)&&b.push(this[c]);return new s(this.context,b)},flatten:function(){var a=[];return new s(this.context,a.concat.apply(a,this.toArray()))},join:w.join,indexOf:w.indexOf||function(a,b){for(var c=b||0,
|
||||
d=this.length;c<d;c++)if(this[c]===a)return c;return-1},iterator:function(a,b,c,d){var e=[],f,g,j,h,n,l=this.context,m,o,u=this.selector;"string"===typeof a&&(d=c,c=b,b=a,a=!1);g=0;for(j=l.length;g<j;g++){var r=new s(l[g]);if("table"===b)f=c.call(r,l[g],g),f!==k&&e.push(f);else if("columns"===b||"rows"===b)f=c.call(r,l[g],this[g],g),f!==k&&e.push(f);else if("column"===b||"column-rows"===b||"row"===b||"cell"===b){o=this[g];"column-rows"===b&&(m=Ba(l[g],u.opts));h=0;for(n=o.length;h<n;h++)f=o[h],f=
|
||||
"cell"===b?c.call(r,l[g],f.row,f.column,g,h):c.call(r,l[g],f,g,h,m),f!==k&&e.push(f)}}return e.length||d?(a=new s(l,a?e.concat.apply([],e):e),b=a.selector,b.rows=u.rows,b.cols=u.cols,b.opts=u.opts,a):this},lastIndexOf:w.lastIndexOf||function(a,b){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,map:function(a){var b=[];if(w.map)b=w.map.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)b.push(a.call(this,this[c],c));return new s(this.context,b)},pluck:function(a){return this.map(function(b){return b[a]})},
|
||||
pop:w.pop,push:w.push,reduce:w.reduce||function(a,b){return gb(this,a,b,0,this.length,1)},reduceRight:w.reduceRight||function(a,b){return gb(this,a,b,this.length-1,-1,-1)},reverse:w.reverse,selector:null,shift:w.shift,slice:function(){return new s(this.context,this)},sort:w.sort,splice:w.splice,toArray:function(){return w.slice.call(this)},to$:function(){return h(this)},toJQuery:function(){return h(this)},unique:function(){return new s(this.context,qa(this))},unshift:w.unshift});s.extend=function(a,
|
||||
b,c){if(c.length&&b&&(b instanceof s||b.__dt_wrapper)){var d,e,f,g=function(a,b,c){return function(){var d=b.apply(a,arguments);s.extend(d,d,c.methodExt);return d}};d=0;for(e=c.length;d<e;d++)f=c[d],b[f.name]="function"===typeof f.val?g(a,f.val,f):h.isPlainObject(f.val)?{}:f.val,b[f.name].__dt_wrapper=!0,s.extend(a,b[f.name],f.propExt)}};s.register=o=function(a,b){if(h.isArray(a))for(var c=0,d=a.length;c<d;c++)s.register(a[c],b);else for(var e=a.split("."),f=Rb,g,j,c=0,d=e.length;c<d;c++){g=(j=-1!==
|
||||
e[c].indexOf("()"))?e[c].replace("()",""):e[c];var i;a:{i=0;for(var n=f.length;i<n;i++)if(f[i].name===g){i=f[i];break a}i=null}i||(i={name:g,val:{},methodExt:[],propExt:[]},f.push(i));c===d-1?i.val=b:f=j?i.methodExt:i.propExt}};s.registerPlural=u=function(a,b,c){s.register(a,c);s.register(b,function(){var a=c.apply(this,arguments);return a===this?this:a instanceof s?a.length?h.isArray(a[0])?new s(a.context,a[0]):a[0]:k:a})};o("tables()",function(a){var b;if(a){b=s;var c=this.context;if("number"===
|
||||
typeof a)a=[c[a]];else var d=h.map(c,function(a){return a.nTable}),a=h(d).filter(a).map(function(){var a=h.inArray(this,d);return c[a]}).toArray();b=new b(a)}else b=this;return b});o("table()",function(a){var a=this.tables(a),b=a.context;return b.length?new s(b[0]):a});u("tables().nodes()","table().node()",function(){return this.iterator("table",function(a){return a.nTable},1)});u("tables().body()","table().body()",function(){return this.iterator("table",function(a){return a.nTBody},1)});u("tables().header()",
|
||||
"table().header()",function(){return this.iterator("table",function(a){return a.nTHead},1)});u("tables().footer()","table().footer()",function(){return this.iterator("table",function(a){return a.nTFoot},1)});u("tables().containers()","table().container()",function(){return this.iterator("table",function(a){return a.nTableWrapper},1)});o("draw()",function(a){return this.iterator("table",function(b){"page"===a?N(b):("string"===typeof a&&(a="full-hold"===a?!1:!0),S(b,!1===a))})});o("page()",function(a){return a===
|
||||
k?this.page.info().page:this.iterator("table",function(b){Sa(b,a)})});o("page.info()",function(){if(0===this.context.length)return k;var a=this.context[0],b=a._iDisplayStart,c=a.oFeatures.bPaginate?a._iDisplayLength:-1,d=a.fnRecordsDisplay(),e=-1===c;return{page:e?0:Math.floor(b/c),pages:e?1:Math.ceil(d/c),start:b,end:a.fnDisplayEnd(),length:c,recordsTotal:a.fnRecordsTotal(),recordsDisplay:d,serverSide:"ssp"===y(a)}});o("page.len()",function(a){return a===k?0!==this.context.length?this.context[0]._iDisplayLength:
|
||||
k:this.iterator("table",function(b){Qa(b,a)})});var Sb=function(a,b,c){if(c){var d=new s(a);d.one("draw",function(){c(d.ajax.json())})}if("ssp"==y(a))S(a,b);else{C(a,!0);var e=a.jqXHR;e&&4!==e.readyState&&e.abort();sa(a,[],function(c){na(a);for(var c=ta(a,c),d=0,e=c.length;d<e;d++)M(a,c[d]);S(a,b);C(a,!1)})}};o("ajax.json()",function(){var a=this.context;if(0<a.length)return a[0].json});o("ajax.params()",function(){var a=this.context;if(0<a.length)return a[0].oAjaxData});o("ajax.reload()",function(a,
|
||||
b){return this.iterator("table",function(c){Sb(c,!1===b,a)})});o("ajax.url()",function(a){var b=this.context;if(a===k){if(0===b.length)return k;b=b[0];return b.ajax?h.isPlainObject(b.ajax)?b.ajax.url:b.ajax:b.sAjaxSource}return this.iterator("table",function(b){h.isPlainObject(b.ajax)?b.ajax.url=a:b.ajax=a})});o("ajax.url().load()",function(a,b){return this.iterator("table",function(c){Sb(c,!1===b,a)})});var Za=function(a,b,c,d,e){var f=[],g,j,i,n,l,m;i=typeof b;if(!b||"string"===i||"function"===
|
||||
i||b.length===k)b=[b];i=0;for(n=b.length;i<n;i++){j=b[i]&&b[i].split&&!b[i].match(/[\[\(:]/)?b[i].split(","):[b[i]];l=0;for(m=j.length;l<m;l++)(g=c("string"===typeof j[l]?h.trim(j[l]):j[l]))&&g.length&&(f=f.concat(g))}a=x.selector[a];if(a.length){i=0;for(n=a.length;i<n;i++)f=a[i](d,e,f)}return qa(f)},$a=function(a){a||(a={});a.filter&&a.search===k&&(a.search=a.filter);return h.extend({search:"none",order:"current",page:"all"},a)},ab=function(a){for(var b=0,c=a.length;b<c;b++)if(0<a[b].length)return a[0]=
|
||||
a[b],a[0].length=1,a.length=1,a.context=[a.context[b]],a;a.length=0;return a},Ba=function(a,b){var c,d,e,f=[],g=a.aiDisplay;c=a.aiDisplayMaster;var j=b.search;d=b.order;e=b.page;if("ssp"==y(a))return"removed"===j?[]:W(0,c.length);if("current"==e){c=a._iDisplayStart;for(d=a.fnDisplayEnd();c<d;c++)f.push(g[c])}else if("current"==d||"applied"==d)f="none"==j?c.slice():"applied"==j?g.slice():h.map(c,function(a){return-1===h.inArray(a,g)?a:null});else if("index"==d||"original"==d){c=0;for(d=a.aoData.length;c<
|
||||
d;c++)"none"==j?f.push(c):(e=h.inArray(c,g),(-1===e&&"removed"==j||0<=e&&"applied"==j)&&f.push(c))}return f};o("rows()",function(a,b){a===k?a="":h.isPlainObject(a)&&(b=a,a="");var b=$a(b),c=this.iterator("table",function(c){var e=b,f;return Za("row",a,function(a){var b=Nb(a);if(b!==null&&!e)return[b];f||(f=Ba(c,e));if(b!==null&&h.inArray(b,f)!==-1)return[b];if(a===null||a===k||a==="")return f;if(typeof a==="function")return h.map(f,function(b){var e=c.aoData[b];return a(b,e._aData,e.nTr)?b:null});
|
||||
b=Qb(ia(c.aoData,f,"nTr"));if(a.nodeName){if(a._DT_RowIndex!==k)return[a._DT_RowIndex];if(a._DT_CellIndex)return[a._DT_CellIndex.row];b=h(a).closest("*[data-dt-row]");return b.length?[b.data("dt-row")]:[]}if(typeof a==="string"&&a.charAt(0)==="#"){var i=c.aIds[a.replace(/^#/,"")];if(i!==k)return[i.idx]}return h(b).filter(a).map(function(){return this._DT_RowIndex}).toArray()},c,e)},1);c.selector.rows=a;c.selector.opts=b;return c});o("rows().nodes()",function(){return this.iterator("row",function(a,
|
||||
b){return a.aoData[b].nTr||k},1)});o("rows().data()",function(){return this.iterator(!0,"rows",function(a,b){return ia(a.aoData,b,"_aData")},1)});u("rows().cache()","row().cache()",function(a){return this.iterator("row",function(b,c){var d=b.aoData[c];return"search"===a?d._aFilterData:d._aSortData},1)});u("rows().invalidate()","row().invalidate()",function(a){return this.iterator("row",function(b,c){ca(b,c,a)})});u("rows().indexes()","row().index()",function(){return this.iterator("row",function(a,
|
||||
b){return b},1)});u("rows().ids()","row().id()",function(a){for(var b=[],c=this.context,d=0,e=c.length;d<e;d++)for(var f=0,g=this[d].length;f<g;f++){var h=c[d].rowIdFn(c[d].aoData[this[d][f]]._aData);b.push((!0===a?"#":"")+h)}return new s(c,b)});u("rows().remove()","row().remove()",function(){var a=this;this.iterator("row",function(b,c,d){var e=b.aoData,f=e[c],g,h,i,n,l;e.splice(c,1);g=0;for(h=e.length;g<h;g++)if(i=e[g],l=i.anCells,null!==i.nTr&&(i.nTr._DT_RowIndex=g),null!==l){i=0;for(n=l.length;i<
|
||||
n;i++)l[i]._DT_CellIndex.row=g}oa(b.aiDisplayMaster,c);oa(b.aiDisplay,c);oa(a[d],c,!1);0<b._iRecordsDisplay&&b._iRecordsDisplay--;Ra(b);c=b.rowIdFn(f._aData);c!==k&&delete b.aIds[c]});this.iterator("table",function(a){for(var c=0,d=a.aoData.length;c<d;c++)a.aoData[c].idx=c});return this});o("rows.add()",function(a){var b=this.iterator("table",function(b){var c,f,g,h=[];f=0;for(g=a.length;f<g;f++)c=a[f],c.nodeName&&"TR"===c.nodeName.toUpperCase()?h.push(ma(b,c)[0]):h.push(M(b,c));return h},1),c=this.rows(-1);
|
||||
c.pop();h.merge(c,b);return c});o("row()",function(a,b){return ab(this.rows(a,b))});o("row().data()",function(a){var b=this.context;if(a===k)return b.length&&this.length?b[0].aoData[this[0]]._aData:k;b[0].aoData[this[0]]._aData=a;ca(b[0],this[0],"data");return this});o("row().node()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]].nTr||null:null});o("row.add()",function(a){a instanceof h&&a.length&&(a=a[0]);var b=this.iterator("table",function(b){return a.nodeName&&
|
||||
"TR"===a.nodeName.toUpperCase()?ma(b,a)[0]:M(b,a)});return this.row(b[0])});var bb=function(a,b){var c=a.context;if(c.length&&(c=c[0].aoData[b!==k?b:a[0]])&&c._details)c._details.remove(),c._detailsShow=k,c._details=k},Tb=function(a,b){var c=a.context;if(c.length&&a.length){var d=c[0].aoData[a[0]];if(d._details){(d._detailsShow=b)?d._details.insertAfter(d.nTr):d._details.detach();var e=c[0],f=new s(e),g=e.aoData;f.off("draw.dt.DT_details column-visibility.dt.DT_details destroy.dt.DT_details");0<D(g,
|
||||
"_details").length&&(f.on("draw.dt.DT_details",function(a,b){e===b&&f.rows({page:"current"}).eq(0).each(function(a){a=g[a];a._detailsShow&&a._details.insertAfter(a.nTr)})}),f.on("column-visibility.dt.DT_details",function(a,b){if(e===b)for(var c,d=aa(b),f=0,h=g.length;f<h;f++)c=g[f],c._details&&c._details.children("td[colspan]").attr("colspan",d)}),f.on("destroy.dt.DT_details",function(a,b){if(e===b)for(var c=0,d=g.length;c<d;c++)g[c]._details&&bb(f,c)}))}}};o("row().child()",function(a,b){var c=this.context;
|
||||
if(a===k)return c.length&&this.length?c[0].aoData[this[0]]._details:k;if(!0===a)this.child.show();else if(!1===a)bb(this);else if(c.length&&this.length){var d=c[0],c=c[0].aoData[this[0]],e=[],f=function(a,b){if(h.isArray(a)||a instanceof h)for(var c=0,k=a.length;c<k;c++)f(a[c],b);else a.nodeName&&"tr"===a.nodeName.toLowerCase()?e.push(a):(c=h("<tr><td/></tr>").addClass(b),h("td",c).addClass(b).html(a)[0].colSpan=aa(d),e.push(c[0]))};f(a,b);c._details&&c._details.detach();c._details=h(e);c._detailsShow&&
|
||||
c._details.insertAfter(c.nTr)}return this});o(["row().child.show()","row().child().show()"],function(){Tb(this,!0);return this});o(["row().child.hide()","row().child().hide()"],function(){Tb(this,!1);return this});o(["row().child.remove()","row().child().remove()"],function(){bb(this);return this});o("row().child.isShown()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]]._detailsShow||!1:!1});var bc=/^([^:]+):(name|visIdx|visible)$/,Ub=function(a,b,c,d,e){for(var c=
|
||||
[],d=0,f=e.length;d<f;d++)c.push(B(a,e[d],b));return c};o("columns()",function(a,b){a===k?a="":h.isPlainObject(a)&&(b=a,a="");var b=$a(b),c=this.iterator("table",function(c){var e=a,f=b,g=c.aoColumns,j=D(g,"sName"),i=D(g,"nTh");return Za("column",e,function(a){var b=Nb(a);if(a==="")return W(g.length);if(b!==null)return[b>=0?b:g.length+b];if(typeof a==="function"){var e=Ba(c,f);return h.map(g,function(b,f){return a(f,Ub(c,f,0,0,e),i[f])?f:null})}var k=typeof a==="string"?a.match(bc):"";if(k)switch(k[2]){case "visIdx":case "visible":b=
|
||||
parseInt(k[1],10);if(b<0){var m=h.map(g,function(a,b){return a.bVisible?b:null});return[m[m.length+b]]}return[Z(c,b)];case "name":return h.map(j,function(a,b){return a===k[1]?b:null});default:return[]}if(a.nodeName&&a._DT_CellIndex)return[a._DT_CellIndex.column];b=h(i).filter(a).map(function(){return h.inArray(this,i)}).toArray();if(b.length||!a.nodeName)return b;b=h(a).closest("*[data-dt-column]");return b.length?[b.data("dt-column")]:[]},c,f)},1);c.selector.cols=a;c.selector.opts=b;return c});u("columns().header()",
|
||||
"column().header()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTh},1)});u("columns().footer()","column().footer()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTf},1)});u("columns().data()","column().data()",function(){return this.iterator("column-rows",Ub,1)});u("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].mData},1)});u("columns().cache()","column().cache()",
|
||||
function(a){return this.iterator("column-rows",function(b,c,d,e,f){return ia(b.aoData,f,"search"===a?"_aFilterData":"_aSortData",c)},1)});u("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(a,b,c,d,e){return ia(a.aoData,e,"anCells",b)},1)});u("columns().visible()","column().visible()",function(a,b){var c=this.iterator("column",function(b,c){if(a===k)return b.aoColumns[c].bVisible;var f=b.aoColumns,g=f[c],j=b.aoData,i,n,l;if(a!==k&&g.bVisible!==a){if(a){var m=
|
||||
h.inArray(!0,D(f,"bVisible"),c+1);i=0;for(n=j.length;i<n;i++)l=j[i].nTr,f=j[i].anCells,l&&l.insertBefore(f[c],f[m]||null)}else h(D(b.aoData,"anCells",c)).detach();g.bVisible=a;ea(b,b.aoHeader);ea(b,b.aoFooter);xa(b)}});a!==k&&(this.iterator("column",function(c,e){r(c,null,"column-visibility",[c,e,a,b])}),(b===k||b)&&this.columns.adjust());return c});u("columns().indexes()","column().index()",function(a){return this.iterator("column",function(b,c){return"visible"===a?$(b,c):c},1)});o("columns.adjust()",
|
||||
function(){return this.iterator("table",function(a){Y(a)},1)});o("column.index()",function(a,b){if(0!==this.context.length){var c=this.context[0];if("fromVisible"===a||"toData"===a)return Z(c,b);if("fromData"===a||"toVisible"===a)return $(c,b)}});o("column()",function(a,b){return ab(this.columns(a,b))});o("cells()",function(a,b,c){h.isPlainObject(a)&&(a.row===k?(c=a,a=null):(c=b,b=null));h.isPlainObject(b)&&(c=b,b=null);if(null===b||b===k)return this.iterator("table",function(b){var d=a,e=$a(c),f=
|
||||
b.aoData,g=Ba(b,e),j=Qb(ia(f,g,"anCells")),i=h([].concat.apply([],j)),l,n=b.aoColumns.length,m,o,u,s,r,v;return Za("cell",d,function(a){var c=typeof a==="function";if(a===null||a===k||c){m=[];o=0;for(u=g.length;o<u;o++){l=g[o];for(s=0;s<n;s++){r={row:l,column:s};if(c){v=f[l];a(r,B(b,l,s),v.anCells?v.anCells[s]:null)&&m.push(r)}else m.push(r)}}return m}if(h.isPlainObject(a))return[a];c=i.filter(a).map(function(a,b){return{row:b._DT_CellIndex.row,column:b._DT_CellIndex.column}}).toArray();if(c.length||
|
||||
!a.nodeName)return c;v=h(a).closest("*[data-dt-row]");return v.length?[{row:v.data("dt-row"),column:v.data("dt-column")}]:[]},b,e)});var d=this.columns(b,c),e=this.rows(a,c),f,g,j,i,n,l=this.iterator("table",function(a,b){f=[];g=0;for(j=e[b].length;g<j;g++){i=0;for(n=d[b].length;i<n;i++)f.push({row:e[b][g],column:d[b][i]})}return f},1);h.extend(l.selector,{cols:b,rows:a,opts:c});return l});u("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(a,b,c){return(a=a.aoData[b])&&
|
||||
a.anCells?a.anCells[c]:k},1)});o("cells().data()",function(){return this.iterator("cell",function(a,b,c){return B(a,b,c)},1)});u("cells().cache()","cell().cache()",function(a){a="search"===a?"_aFilterData":"_aSortData";return this.iterator("cell",function(b,c,d){return b.aoData[c][a][d]},1)});u("cells().render()","cell().render()",function(a){return this.iterator("cell",function(b,c,d){return B(b,c,d,a)},1)});u("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(a,
|
||||
b,c){return{row:b,column:c,columnVisible:$(a,c)}},1)});u("cells().invalidate()","cell().invalidate()",function(a){return this.iterator("cell",function(b,c,d){ca(b,c,a,d)})});o("cell()",function(a,b,c){return ab(this.cells(a,b,c))});o("cell().data()",function(a){var b=this.context,c=this[0];if(a===k)return b.length&&c.length?B(b[0],c[0].row,c[0].column):k;ib(b[0],c[0].row,c[0].column,a);ca(b[0],c[0].row,"data",c[0].column);return this});o("order()",function(a,b){var c=this.context;if(a===k)return 0!==
|
||||
c.length?c[0].aaSorting:k;"number"===typeof a?a=[[a,b]]:a.length&&!h.isArray(a[0])&&(a=Array.prototype.slice.call(arguments));return this.iterator("table",function(b){b.aaSorting=a.slice()})});o("order.listener()",function(a,b,c){return this.iterator("table",function(d){La(d,a,b,c)})});o("order.fixed()",function(a){if(!a){var b=this.context,b=b.length?b[0].aaSortingFixed:k;return h.isArray(b)?{pre:b}:b}return this.iterator("table",function(b){b.aaSortingFixed=h.extend(!0,{},a)})});o(["columns().order()",
|
||||
"column().order()"],function(a){var b=this;return this.iterator("table",function(c,d){var e=[];h.each(b[d],function(b,c){e.push([c,a])});c.aaSorting=e})});o("search()",function(a,b,c,d){var e=this.context;return a===k?0!==e.length?e[0].oPreviousSearch.sSearch:k:this.iterator("table",function(e){e.oFeatures.bFilter&&fa(e,h.extend({},e.oPreviousSearch,{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),1)})});u("columns().search()","column().search()",function(a,
|
||||
b,c,d){return this.iterator("column",function(e,f){var g=e.aoPreSearchCols;if(a===k)return g[f].sSearch;e.oFeatures.bFilter&&(h.extend(g[f],{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),fa(e,e.oPreviousSearch,1))})});o("state()",function(){return this.context.length?this.context[0].oSavedState:null});o("state.clear()",function(){return this.iterator("table",function(a){a.fnStateSaveCallback.call(a.oInstance,a,{})})});o("state.loaded()",function(){return this.context.length?
|
||||
this.context[0].oLoadedState:null});o("state.save()",function(){return this.iterator("table",function(a){xa(a)})});m.versionCheck=m.fnVersionCheck=function(a){for(var b=m.version.split("."),a=a.split("."),c,d,e=0,f=a.length;e<f;e++)if(c=parseInt(b[e],10)||0,d=parseInt(a[e],10)||0,c!==d)return c>d;return!0};m.isDataTable=m.fnIsDataTable=function(a){var b=h(a).get(0),c=!1;if(a instanceof m.Api)return!0;h.each(m.settings,function(a,e){var f=e.nScrollHead?h("table",e.nScrollHead)[0]:null,g=e.nScrollFoot?
|
||||
h("table",e.nScrollFoot)[0]:null;if(e.nTable===b||f===b||g===b)c=!0});return c};m.tables=m.fnTables=function(a){var b=!1;h.isPlainObject(a)&&(b=a.api,a=a.visible);var c=h.map(m.settings,function(b){if(!a||a&&h(b.nTable).is(":visible"))return b.nTable});return b?new s(c):c};m.camelToHungarian=I;o("$()",function(a,b){var c=this.rows(b).nodes(),c=h(c);return h([].concat(c.filter(a).toArray(),c.find(a).toArray()))});h.each(["on","one","off"],function(a,b){o(b+"()",function(){var a=Array.prototype.slice.call(arguments);
|
||||
a[0]=h.map(a[0].split(/\s/),function(a){return!a.match(/\.dt\b/)?a+".dt":a}).join(" ");var d=h(this.tables().nodes());d[b].apply(d,a);return this})});o("clear()",function(){return this.iterator("table",function(a){na(a)})});o("settings()",function(){return new s(this.context,this.context)});o("init()",function(){var a=this.context;return a.length?a[0].oInit:null});o("data()",function(){return this.iterator("table",function(a){return D(a.aoData,"_aData")}).flatten()});o("destroy()",function(a){a=a||
|
||||
!1;return this.iterator("table",function(b){var c=b.nTableWrapper.parentNode,d=b.oClasses,e=b.nTable,f=b.nTBody,g=b.nTHead,j=b.nTFoot,i=h(e),f=h(f),k=h(b.nTableWrapper),l=h.map(b.aoData,function(a){return a.nTr}),o;b.bDestroying=!0;r(b,"aoDestroyCallback","destroy",[b]);a||(new s(b)).columns().visible(!0);k.off(".DT").find(":not(tbody *)").off(".DT");h(E).off(".DT-"+b.sInstance);e!=g.parentNode&&(i.children("thead").detach(),i.append(g));j&&e!=j.parentNode&&(i.children("tfoot").detach(),i.append(j));
|
||||
b.aaSorting=[];b.aaSortingFixed=[];wa(b);h(l).removeClass(b.asStripeClasses.join(" "));h("th, td",g).removeClass(d.sSortable+" "+d.sSortableAsc+" "+d.sSortableDesc+" "+d.sSortableNone);f.children().detach();f.append(l);g=a?"remove":"detach";i[g]();k[g]();!a&&c&&(c.insertBefore(e,b.nTableReinsertBefore),i.css("width",b.sDestroyWidth).removeClass(d.sTable),(o=b.asDestroyStripes.length)&&f.children().each(function(a){h(this).addClass(b.asDestroyStripes[a%o])}));c=h.inArray(b,m.settings);-1!==c&&m.settings.splice(c,
|
||||
1)})});h.each(["column","row","cell"],function(a,b){o(b+"s().every()",function(a){var d=this.selector.opts,e=this;return this.iterator(b,function(f,g,h,i,n){a.call(e[b](g,"cell"===b?h:d,"cell"===b?d:k),g,h,i,n)})})});o("i18n()",function(a,b,c){var d=this.context[0],a=Q(a)(d.oLanguage);a===k&&(a=b);c!==k&&h.isPlainObject(a)&&(a=a[c]!==k?a[c]:a._);return a.replace("%d",c)});m.version="1.10.16";m.settings=[];m.models={};m.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};m.models.oRow=
|
||||
{nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null,idx:-1};m.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,
|
||||
sWidthOrig:null};m.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(a){return a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,
|
||||
this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(a){try{return JSON.parse((-1===a.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+a.sInstance+"_"+location.pathname))}catch(b){}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(a,b){try{(-1===a.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+a.sInstance+
|
||||
"_"+location.pathname,JSON.stringify(b))}catch(c){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",
|
||||
sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:h.extend({},m.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null,rowId:"DT_RowId"};
|
||||
X(m.defaults);m.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};X(m.defaults.column);m.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,
|
||||
bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1,bBounding:!1,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aIds:{},aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],
|
||||
aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:k,oAjaxData:k,fnServerData:null,
|
||||
aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==y(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==y(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var a=this._iDisplayLength,
|
||||
b=this._iDisplayStart,c=b+a,d=this.aiDisplay.length,e=this.oFeatures,f=e.bPaginate;return e.bServerSide?!1===f||-1===a?b+d:Math.min(b+a,this._iRecordsDisplay):!f||c>d||-1===a?d:c},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null};m.ext=x={buttons:{},classes:{},builder:"-source-",errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},
|
||||
order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:m.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:m.version};h.extend(x,{afnFiltering:x.search,aTypes:x.type.detect,ofnSearch:x.type.search,oSort:x.type.order,afnSortData:x.order,aoFeatures:x.feature,oApi:x.internal,oStdClasses:x.classes,oPagination:x.pager});h.extend(m.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",
|
||||
sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",
|
||||
sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sJUIHeader:"",sJUIFooter:""});var Kb=m.ext.pager;h.extend(Kb,{simple:function(){return["previous","next"]},full:function(){return["first","previous","next","last"]},numbers:function(a,b){return[ha(a,
|
||||
b)]},simple_numbers:function(a,b){return["previous",ha(a,b),"next"]},full_numbers:function(a,b){return["first","previous",ha(a,b),"next","last"]},first_last_numbers:function(a,b){return["first",ha(a,b),"last"]},_numbers:ha,numbers_length:7});h.extend(!0,m.ext.renderer,{pageButton:{_:function(a,b,c,d,e,f){var g=a.oClasses,j=a.oLanguage.oPaginate,i=a.oLanguage.oAria.paginate||{},n,l,m=0,o=function(b,d){var k,s,u,r,v=function(b){Sa(a,b.data.action,true)};k=0;for(s=d.length;k<s;k++){r=d[k];if(h.isArray(r)){u=
|
||||
h("<"+(r.DT_el||"div")+"/>").appendTo(b);o(u,r)}else{n=null;l="";switch(r){case "ellipsis":b.append('<span class="ellipsis">…</span>');break;case "first":n=j.sFirst;l=r+(e>0?"":" "+g.sPageButtonDisabled);break;case "previous":n=j.sPrevious;l=r+(e>0?"":" "+g.sPageButtonDisabled);break;case "next":n=j.sNext;l=r+(e<f-1?"":" "+g.sPageButtonDisabled);break;case "last":n=j.sLast;l=r+(e<f-1?"":" "+g.sPageButtonDisabled);break;default:n=r+1;l=e===r?g.sPageButtonActive:""}if(n!==null){u=h("<a>",{"class":g.sPageButton+
|
||||
" "+l,"aria-controls":a.sTableId,"aria-label":i[r],"data-dt-idx":m,tabindex:a.iTabIndex,id:c===0&&typeof r==="string"?a.sTableId+"_"+r:null}).html(n).appendTo(b);Va(u,{action:r},v);m++}}}},s;try{s=h(b).find(G.activeElement).data("dt-idx")}catch(u){}o(h(b).empty(),d);s!==k&&h(b).find("[data-dt-idx="+s+"]").focus()}}});h.extend(m.ext.type.detect,[function(a,b){var c=b.oLanguage.sDecimal;return Ya(a,c)?"num"+c:null},function(a){if(a&&!(a instanceof Date)&&!Zb.test(a))return null;var b=Date.parse(a);
|
||||
return null!==b&&!isNaN(b)||L(a)?"date":null},function(a,b){var c=b.oLanguage.sDecimal;return Ya(a,c,!0)?"num-fmt"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Pb(a,c)?"html-num"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Pb(a,c,!0)?"html-num-fmt"+c:null},function(a){return L(a)||"string"===typeof a&&-1!==a.indexOf("<")?"html":null}]);h.extend(m.ext.type.search,{html:function(a){return L(a)?a:"string"===typeof a?a.replace(Mb," ").replace(Aa,""):""},string:function(a){return L(a)?
|
||||
a:"string"===typeof a?a.replace(Mb," "):a}});var za=function(a,b,c,d){if(0!==a&&(!a||"-"===a))return-Infinity;b&&(a=Ob(a,b));a.replace&&(c&&(a=a.replace(c,"")),d&&(a=a.replace(d,"")));return 1*a};h.extend(x.type.order,{"date-pre":function(a){return Date.parse(a)||-Infinity},"html-pre":function(a){return L(a)?"":a.replace?a.replace(/<.*?>/g,"").toLowerCase():a+""},"string-pre":function(a){return L(a)?"":"string"===typeof a?a.toLowerCase():!a.toString?"":a.toString()},"string-asc":function(a,b){return a<
|
||||
b?-1:a>b?1:0},"string-desc":function(a,b){return a<b?1:a>b?-1:0}});cb("");h.extend(!0,m.ext.renderer,{header:{_:function(a,b,c,d){h(a.nTable).on("order.dt.DT",function(e,f,g,h){if(a===f){e=c.idx;b.removeClass(c.sSortingClass+" "+d.sSortAsc+" "+d.sSortDesc).addClass(h[e]=="asc"?d.sSortAsc:h[e]=="desc"?d.sSortDesc:c.sSortingClass)}})},jqueryui:function(a,b,c,d){h("<div/>").addClass(d.sSortJUIWrapper).append(b.contents()).append(h("<span/>").addClass(d.sSortIcon+" "+c.sSortingClassJUI)).appendTo(b);
|
||||
h(a.nTable).on("order.dt.DT",function(e,f,g,h){if(a===f){e=c.idx;b.removeClass(d.sSortAsc+" "+d.sSortDesc).addClass(h[e]=="asc"?d.sSortAsc:h[e]=="desc"?d.sSortDesc:c.sSortingClass);b.find("span."+d.sSortIcon).removeClass(d.sSortJUIAsc+" "+d.sSortJUIDesc+" "+d.sSortJUI+" "+d.sSortJUIAscAllowed+" "+d.sSortJUIDescAllowed).addClass(h[e]=="asc"?d.sSortJUIAsc:h[e]=="desc"?d.sSortJUIDesc:c.sSortingClassJUI)}})}}});var Vb=function(a){return"string"===typeof a?a.replace(/</g,"<").replace(/>/g,">").replace(/"/g,
|
||||
"""):a};m.render={number:function(a,b,c,d,e){return{display:function(f){if("number"!==typeof f&&"string"!==typeof f)return f;var g=0>f?"-":"",h=parseFloat(f);if(isNaN(h))return Vb(f);h=h.toFixed(c);f=Math.abs(h);h=parseInt(f,10);f=c?b+(f-h).toFixed(c).substring(2):"";return g+(d||"")+h.toString().replace(/\B(?=(\d{3})+(?!\d))/g,a)+f+(e||"")}}},text:function(){return{display:Vb}}};h.extend(m.ext.internal,{_fnExternApiFunc:Lb,_fnBuildAjax:sa,_fnAjaxUpdate:kb,_fnAjaxParameters:tb,_fnAjaxUpdateDraw:ub,
|
||||
_fnAjaxDataSrc:ta,_fnAddColumn:Da,_fnColumnOptions:ja,_fnAdjustColumnSizing:Y,_fnVisibleToColumnIndex:Z,_fnColumnIndexToVisible:$,_fnVisbleColumns:aa,_fnGetColumns:la,_fnColumnTypes:Fa,_fnApplyColumnDefs:hb,_fnHungarianMap:X,_fnCamelToHungarian:I,_fnLanguageCompat:Ca,_fnBrowserDetect:fb,_fnAddData:M,_fnAddTr:ma,_fnNodeToDataIndex:function(a,b){return b._DT_RowIndex!==k?b._DT_RowIndex:null},_fnNodeToColumnIndex:function(a,b,c){return h.inArray(c,a.aoData[b].anCells)},_fnGetCellData:B,_fnSetCellData:ib,
|
||||
_fnSplitObjNotation:Ia,_fnGetObjectDataFn:Q,_fnSetObjectDataFn:R,_fnGetDataMaster:Ja,_fnClearTable:na,_fnDeleteIndex:oa,_fnInvalidate:ca,_fnGetRowElements:Ha,_fnCreateTr:Ga,_fnBuildHead:jb,_fnDrawHead:ea,_fnDraw:N,_fnReDraw:S,_fnAddOptionsHtml:mb,_fnDetectHeader:da,_fnGetUniqueThs:ra,_fnFeatureHtmlFilter:ob,_fnFilterComplete:fa,_fnFilterCustom:xb,_fnFilterColumn:wb,_fnFilter:vb,_fnFilterCreateSearch:Oa,_fnEscapeRegex:Pa,_fnFilterData:yb,_fnFeatureHtmlInfo:rb,_fnUpdateInfo:Bb,_fnInfoMacros:Cb,_fnInitialise:ga,
|
||||
_fnInitComplete:ua,_fnLengthChange:Qa,_fnFeatureHtmlLength:nb,_fnFeatureHtmlPaginate:sb,_fnPageChange:Sa,_fnFeatureHtmlProcessing:pb,_fnProcessingDisplay:C,_fnFeatureHtmlTable:qb,_fnScrollDraw:ka,_fnApplyToChildren:H,_fnCalculateColumnWidths:Ea,_fnThrottle:Na,_fnConvertToWidth:Db,_fnGetWidestNode:Eb,_fnGetMaxLenString:Fb,_fnStringToCss:v,_fnSortFlatten:V,_fnSort:lb,_fnSortAria:Hb,_fnSortListener:Ua,_fnSortAttachListener:La,_fnSortingClasses:wa,_fnSortData:Gb,_fnSaveState:xa,_fnLoadState:Ib,_fnSettingsFromNode:ya,
|
||||
_fnLog:J,_fnMap:F,_fnBindAction:Va,_fnCallbackReg:z,_fnCallbackFire:r,_fnLengthOverflow:Ra,_fnRenderer:Ma,_fnDataSource:y,_fnRowAttributes:Ka,_fnCalculateEnd:function(){}});h.fn.dataTable=m;m.$=h;h.fn.dataTableSettings=m.settings;h.fn.dataTableExt=m.ext;h.fn.DataTable=function(a){return h(this).dataTable(a).api()};h.each(m,function(a,b){h.fn.DataTable[a]=b});return h.fn.dataTable});
|
7
wp-content/plugins/advanced-google-recaptcha/js/moment.min.js
vendored
Normal file
7
wp-content/plugins/advanced-google-recaptcha/js/sweetalert2.min.js
vendored
Normal file
2
wp-content/plugins/advanced-google-recaptcha/js/tooltipster.bundle.min.js
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
/**
|
||||
* WP Captcha
|
||||
* Backend GUI pointers
|
||||
* (c) WebFactory Ltd, 2022 - 2023, www.webfactoryltd.com
|
||||
*/
|
||||
|
||||
jQuery(document).ready(function($){
|
||||
if (typeof wpcaptcha_pointers == 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
$.each(wpcaptcha_pointers, function(index, pointer) {
|
||||
if (index.charAt(0) == '_') {
|
||||
return true;
|
||||
}
|
||||
$(pointer.target).pointer({
|
||||
content: '<h3>WP Captcha</h3><p>' + pointer.content + '</p>',
|
||||
pointerWidth: 380,
|
||||
position: {
|
||||
edge: pointer.edge,
|
||||
align: pointer.align
|
||||
},
|
||||
close: function() {
|
||||
$.get(ajaxurl, {
|
||||
action: "wpcaptcha_run_tool",
|
||||
tool: "wpcaptcha_dismiss_pointer",
|
||||
notice_name: index,
|
||||
_ajax_nonce: wpcaptcha_pointers.run_tool_nonce
|
||||
});
|
||||
}
|
||||
}).pointer('open');
|
||||
});
|
||||
});
|
1504
wp-content/plugins/advanced-google-recaptcha/js/wpcaptcha.js
Normal file
538
wp-content/plugins/advanced-google-recaptcha/libs/admin.php
Normal file
@ -0,0 +1,538 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* WP Captcha
|
||||
* https://getwpcaptcha.com/
|
||||
* (c) WebFactory Ltd, 2022 - 2023, www.webfactoryltd.com
|
||||
*/
|
||||
|
||||
class WPCaptcha_Admin extends WPCaptcha
|
||||
{
|
||||
|
||||
/**
|
||||
* Enqueue Admin Scripts
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
static function admin_enqueue_scripts($hook)
|
||||
{
|
||||
if ('settings_page_wpcaptcha' == $hook) {
|
||||
wp_enqueue_style('wpcaptcha-admin', WPCAPTCHA_PLUGIN_URL . 'css/wpcaptcha.css', array(), self::$version);
|
||||
wp_enqueue_style('wpcaptcha-dataTables', WPCAPTCHA_PLUGIN_URL . 'css/jquery.dataTables.min.css', array(), self::$version);
|
||||
wp_enqueue_style('wpcaptcha-sweetalert', WPCAPTCHA_PLUGIN_URL . 'css/sweetalert2.min.css', array(), self::$version);
|
||||
wp_enqueue_style('wpcaptcha-tooltipster', WPCAPTCHA_PLUGIN_URL . 'css/tooltipster.bundle.min.css', array(), self::$version);
|
||||
wp_enqueue_style('wp-color-picker');
|
||||
wp_enqueue_style('wp-jquery-ui-dialog');
|
||||
|
||||
wp_enqueue_script('jquery-ui-tabs');
|
||||
wp_enqueue_script('jquery-ui-core');
|
||||
wp_enqueue_script('jquery-ui-position');
|
||||
wp_enqueue_script('jquery-effects-core');
|
||||
wp_enqueue_script('jquery-effects-blind');
|
||||
wp_enqueue_script('jquery-ui-dialog');
|
||||
|
||||
wp_enqueue_script('wpcaptcha-tooltipster', WPCAPTCHA_PLUGIN_URL . 'js/tooltipster.bundle.min.js', array('jquery'), self::$version, true);
|
||||
wp_enqueue_script('wpcaptcha-dataTables', WPCAPTCHA_PLUGIN_URL . 'js/jquery.dataTables.min.js', array(), self::$version, true);
|
||||
wp_enqueue_script('wpcaptcha-chart', WPCAPTCHA_PLUGIN_URL . 'js/chart.min.js', array(), self::$version, true);
|
||||
wp_enqueue_script('wpcaptcha-moment', WPCAPTCHA_PLUGIN_URL . 'js/moment.min.js', array(), self::$version, true);
|
||||
wp_enqueue_script('wpcaptcha-sweetalert', WPCAPTCHA_PLUGIN_URL . 'js/sweetalert2.min.js', array(), self::$version, true);
|
||||
|
||||
wp_enqueue_script('wp-color-picker');
|
||||
wp_enqueue_media();
|
||||
|
||||
$js_localize = array(
|
||||
'undocumented_error' => __('An undocumented error has occurred. Please refresh the page and try again.', 'advanced-google-recaptcha'),
|
||||
'documented_error' => __('An error has occurred.', 'advanced-google-recaptcha'),
|
||||
'plugin_name' => __('WP Captcha', 'advanced-google-recaptcha'),
|
||||
'plugin_url' => WPCAPTCHA_PLUGIN_URL,
|
||||
'icon_url' => WPCAPTCHA_PLUGIN_URL . 'images/wp-captcha-loader.gif',
|
||||
'settings_url' => admin_url('options-general.php?page=wpcaptcha'),
|
||||
'version' => self::$version,
|
||||
'site' => get_home_url(),
|
||||
'url' => WPCAPTCHA_PLUGIN_URL,
|
||||
'cancel_button' => __('Cancel', 'advanced-google-recaptcha'),
|
||||
'ok_button' => __('OK', 'advanced-google-recaptcha'),
|
||||
'run_tool_nonce' => wp_create_nonce('wpcaptcha_run_tool'),
|
||||
'stats_unavailable' => 'Stats will be available once enough data is collected.',
|
||||
'stats_locks' => WPCaptcha_Stats::get_stats('locks'),
|
||||
'stats_fails' => WPCaptcha_Stats::get_stats('fails'),
|
||||
'wp301_install_url' => add_query_arg(array('action' => 'wpcaptcha_install_wp301', '_wpnonce' => wp_create_nonce('install_wp301'), 'rnd' => rand()), admin_url('admin.php')),
|
||||
);
|
||||
|
||||
$js_localize['chart_colors'] = array('#4285f4', '#ff5429', '#ff7d5c', '#ffac97');
|
||||
|
||||
wp_enqueue_script('wpcaptcha-admin', WPCAPTCHA_PLUGIN_URL . 'js/wpcaptcha.js', array('jquery'), self::$version, true);
|
||||
wp_localize_script('wpcaptcha-admin', 'wpcaptcha_vars', $js_localize);
|
||||
|
||||
// fix for aggressive plugins that include their CSS or JS on all pages
|
||||
wp_dequeue_style('uiStyleSheet');
|
||||
wp_dequeue_style('wpcufpnAdmin');
|
||||
wp_dequeue_style('unifStyleSheet');
|
||||
wp_dequeue_style('wpcufpn_codemirror');
|
||||
wp_dequeue_style('wpcufpn_codemirrorTheme');
|
||||
wp_dequeue_style('collapse-admin-css');
|
||||
wp_dequeue_style('jquery-ui-css');
|
||||
wp_dequeue_style('tribe-common-admin');
|
||||
wp_dequeue_style('file-manager__jquery-ui-css');
|
||||
wp_dequeue_style('file-manager__jquery-ui-css-theme');
|
||||
wp_dequeue_style('wpmegmaps-jqueryui');
|
||||
wp_dequeue_style('wp-botwatch-css');
|
||||
wp_dequeue_style('njt-filebird-admin');
|
||||
wp_dequeue_style('ihc_jquery-ui.min.css');
|
||||
wp_dequeue_style('badgeos-juqery-autocomplete-css');
|
||||
wp_dequeue_style('mainwp');
|
||||
wp_dequeue_style('mainwp-responsive-layouts');
|
||||
wp_dequeue_style('jquery-ui-style');
|
||||
wp_dequeue_style('additional_style');
|
||||
wp_dequeue_style('wobd-jqueryui-style');
|
||||
wp_dequeue_style('wpdp-style3');
|
||||
wp_dequeue_style('jquery_smoothness_ui');
|
||||
wp_dequeue_style('uap_main_admin_style');
|
||||
wp_dequeue_style('uap_font_awesome');
|
||||
wp_dequeue_style('uap_jquery-ui.min.css');
|
||||
wp_dequeue_style('wqm-select2-style');
|
||||
|
||||
wp_deregister_script('wqm-select2-script');
|
||||
|
||||
WPCaptcha_Utility::dismiss_pointer_ajax();
|
||||
}
|
||||
|
||||
$pointers = get_option(WPCAPTCHA_POINTERS_KEY);
|
||||
|
||||
if ('settings_page_wpcaptcha' != $hook) {
|
||||
if ($pointers) {
|
||||
$pointers['run_tool_nonce'] = wp_create_nonce('wpcaptcha_run_tool');
|
||||
wp_enqueue_script('wp-pointer');
|
||||
wp_enqueue_style('wp-pointer');
|
||||
wp_localize_script('wp-pointer', 'wpcaptcha_pointers', $pointers);
|
||||
}
|
||||
|
||||
if ($pointers) {
|
||||
wp_enqueue_script('wpcaptcha-pointers', WPCAPTCHA_PLUGIN_URL . 'js/wpcaptcha-pointers.js', array('jquery'), self::$version, true);
|
||||
}
|
||||
}
|
||||
} // admin_enqueue_scripts
|
||||
|
||||
static function admin_notices()
|
||||
{
|
||||
$notices = get_option(WPCAPTCHA_NOTICES_KEY);
|
||||
|
||||
if (is_array($notices)) {
|
||||
foreach ($notices as $id => $notice) {
|
||||
WPCaptcha_Utility::wp_kses_wf('<div class="notice-' . $notice['type'] . ' notice is-dismissible"><p>' . $notice['text'] . '<button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></p></div>');
|
||||
if ($notice['once'] == true) {
|
||||
unset($notices[$id]);
|
||||
update_option(WPCAPTCHA_NOTICES_KEY, $notices);
|
||||
}
|
||||
}
|
||||
}
|
||||
} // notices
|
||||
|
||||
static function add_notice($id = false, $text = '', $type = 'warning', $show_once = false)
|
||||
{
|
||||
if ($id) {
|
||||
$notices = get_option(WPCAPTCHA_NOTICES_KEY, array());
|
||||
$notices[$id] = array('text' => $text, 'type' => $type, 'once' => $show_once);
|
||||
update_option(WPCAPTCHA_NOTICES_KEY, $notices);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Admin menu entry
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
static function admin_menu()
|
||||
{
|
||||
add_options_page(
|
||||
__('Advanced Google reCAPTCHA', 'advanced-google-recaptcha'),
|
||||
__('Advanced Google reCAPTCHA', 'advanced-google-recaptcha'),
|
||||
'manage_options',
|
||||
'wpcaptcha',
|
||||
array(__CLASS__, 'main_page')
|
||||
);
|
||||
} // admin_menu
|
||||
|
||||
/**
|
||||
* Add settings link to plugins page
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
static function plugin_action_links($links)
|
||||
{
|
||||
$settings_link = '<a href="' . admin_url('options-general.php?page=wpcaptcha') . '" title="WP Captcha Settings">' . __('Settings', 'advanced-google-recaptcha') . '</a>';
|
||||
$pro_link = '<a href="' . admin_url('options-general.php?page=wpcaptcha#open-pro-dialog') . '" title="Get more protection with WP Captcha PRO"><b>' . __('Get EXTRA protection', 'advanced-google-recaptcha') . '</b></a>';
|
||||
|
||||
array_unshift($links, $settings_link);
|
||||
array_unshift($links, $pro_link);
|
||||
|
||||
return $links;
|
||||
} // plugin_action_links
|
||||
|
||||
/**
|
||||
* Add links to plugin's description in plugins table
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
static function plugin_meta_links($links, $file)
|
||||
{
|
||||
if ($file !== 'advanced-google-recaptcha/advanced-google-recaptcha.php') {
|
||||
return $links;
|
||||
}
|
||||
|
||||
$support_link = '<a href="https://getwpcaptcha.com/support/" title="' . __('Get help', 'advanced-google-recaptcha') . '">' . __('Support', 'advanced-google-recaptcha') . '</a>';
|
||||
$links[] = $support_link;
|
||||
|
||||
return $links;
|
||||
} // plugin_meta_links
|
||||
|
||||
/**
|
||||
* Admin footer text
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
static function admin_footer_text($text)
|
||||
{
|
||||
if (!self::is_plugin_page()) {
|
||||
return $text;
|
||||
}
|
||||
|
||||
$text = '<i class="wpcaptcha-footer">WP Captcha v' . self::$version . ' <a href="' . self::generate_web_link('admin_footer') . '" title="Visit WP Captcha page for more info" target="_blank">WebFactory Ltd</a>. Please <a target="_blank" href="https://wordpress.org/support/plugin/advanced-google-recaptcha/reviews/#new-post" title="Rate the plugin">rate the plugin <span>★★★★★</span></a> to help us spread the word. Thank you 🙌 from the WebFactory team!</i>';
|
||||
|
||||
return $text;
|
||||
} // admin_footer_text
|
||||
|
||||
/**
|
||||
* Helper function for generating UTM tagged links
|
||||
*
|
||||
* @param string $placement Optional. UTM content param.
|
||||
* @param string $page Optional. Page to link to.
|
||||
* @param array $params Optional. Extra URL params.
|
||||
* @param string $anchor Optional. URL anchor part.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function generate_web_link($placement = '', $page = '/', $params = array(), $anchor = '')
|
||||
{
|
||||
$base_url = 'https://getwpcaptcha.com';
|
||||
|
||||
if ('/' != $page) {
|
||||
$page = '/' . trim($page, '/') . '/';
|
||||
}
|
||||
if ($page == '//') {
|
||||
$page = '/';
|
||||
}
|
||||
|
||||
$parts = array_merge(array('utm_source' => 'advanced-google-recaptcha', 'utm_medium' => 'plugin', 'utm_content' => $placement, 'utm_campaign' => 'wpcaptcha-v' . self::$version), $params);
|
||||
|
||||
if (!empty($anchor)) {
|
||||
$anchor = '#' . trim($anchor, '#');
|
||||
}
|
||||
|
||||
$out = $base_url . $page . '?' . http_build_query($parts, '', '&') . $anchor;
|
||||
|
||||
return $out;
|
||||
} // generate_web_link
|
||||
|
||||
/**
|
||||
* Test if we're on plugin's page
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
static function is_plugin_page()
|
||||
{
|
||||
$current_screen = get_current_screen();
|
||||
|
||||
if ($current_screen->id == 'settings_page_wpcaptcha') {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} // is_plugin_page
|
||||
|
||||
/**
|
||||
* Settings Page HTML
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
static function main_page()
|
||||
{
|
||||
if (!current_user_can('manage_options')) {
|
||||
wp_die('You do not have sufficient permissions to access this page.');
|
||||
}
|
||||
|
||||
$options = WPCaptcha_Setup::get_options();
|
||||
|
||||
// auto remove welcome pointer when options are opened
|
||||
$pointers = get_option(WPCAPTCHA_POINTERS_KEY);
|
||||
if (isset($pointers['welcome'])) {
|
||||
unset($pointers['welcome']);
|
||||
update_option(WPCAPTCHA_POINTERS_KEY, $pointers);
|
||||
}
|
||||
|
||||
echo '<div class="wrap">';
|
||||
echo '<div class="wpcaptcha-header">
|
||||
<div class="wp-captcha-logo">
|
||||
<img src="' . esc_url(WPCAPTCHA_PLUGIN_URL) . '/images/wp-captcha-logo.png" alt="WP Captcha" height="60" title="WP Captcha">
|
||||
</div>';
|
||||
|
||||
echo '<a data-tab="firewall" data-tab2="general" title="Click to open Firewall Settings" class="tooltip change_tab wpcaptcha-header-status wpcaptcha-header-status-' . ($options['firewall_block_bots'] == 1 ? 'enabled' : 'disabled') . '" style="width: 142px;">';
|
||||
echo '<span class="dashicons dashicons-yes"></span>';
|
||||
echo '<div class="option">Firewall</span></div>';
|
||||
if ($options['firewall_block_bots'] == 'disabled') {
|
||||
echo '<div class="status">Disabled</div>';
|
||||
} else {
|
||||
echo '<div class="status">Enabled</div>';
|
||||
}
|
||||
echo '</a>';
|
||||
|
||||
echo '<a data-tab="login_form" data-tab2="login_basic" title="Click to open Login Protection settings" class="tooltip change_tab wpcaptcha-header-status wpcaptcha-header-status-' . ($options['login_protection'] == 1 ? 'enabled' : 'disabled') . '">';
|
||||
echo '<span class="dashicons dashicons-yes"></span>';
|
||||
echo '<div class="option">Login Protection</span></div>';
|
||||
if ($options['login_protection'] == 'disabled') {
|
||||
echo '<div class="status">Disabled</div>';
|
||||
} else {
|
||||
echo '<div class="status">Enabled</div>';
|
||||
}
|
||||
echo '</a>';
|
||||
|
||||
echo '<a data-tab="captcha" data-tab2="captcha" title="Click to open Captcha settings" class="tooltip change_tab wpcaptcha-header-status wpcaptcha-header-status-' . ($options['captcha'] == 'disabled' ? 'disabled' : 'enabled') . '" style="width: 142px;">';
|
||||
echo '<span class="dashicons dashicons-yes"></span>';
|
||||
echo '<div class="option">Captcha</span></div>';
|
||||
if ($options['captcha'] == 'disabled') {
|
||||
echo '<div class="status">Disabled</div>';
|
||||
} else {
|
||||
echo '<div class="status">Enabled</div>';
|
||||
}
|
||||
echo '</a>';
|
||||
|
||||
echo '</div>';
|
||||
|
||||
echo '<h1></h1>';
|
||||
|
||||
echo '<form method="post" action="options.php" enctype="multipart/form-data" id="wpcaptcha_form">';
|
||||
settings_fields(WPCAPTCHA_OPTIONS_KEY);
|
||||
|
||||
$tabs = array();
|
||||
|
||||
$tabs[] = array('id' => 'wpcaptcha_captcha', 'icon' => 'wpcaptcha-icon wpcaptcha-make-group', 'class' => '', 'label' => __('Captcha', 'advanced-google-recaptcha'), 'callback' => array('WPCaptcha_Tab_Captcha', 'display'));
|
||||
$tabs[] = array('id' => 'wpcaptcha_activity', 'icon' => 'wpcaptcha-icon wpcaptcha-log', 'class' => '', 'label' => __('Activity', 'advanced-google-recaptcha'), 'callback' => array('WPCaptcha_Tab_Activity', 'display'));
|
||||
$tabs[] = array('id' => 'wpcaptcha_login_form', 'icon' => 'wpcaptcha-icon wpcaptcha-enter', 'class' => '', 'label' => __('Login Protection', 'advanced-google-recaptcha'), 'callback' => array('WPCaptcha_Tab_Login_Form', 'display'));
|
||||
$tabs[] = array('id' => 'wpcaptcha_firewall', 'icon' => 'wpcaptcha-icon wpcaptcha-check', 'class' => '', 'label' => __('Firewall', 'advanced-google-recaptcha'), 'callback' => array('WPCaptcha_Tab_Firewall', 'display'));
|
||||
$tabs[] = array('id' => 'wpcaptcha_geoip', 'icon' => 'wpcaptcha-icon wpcaptcha-globe', 'class' => '', 'label' => __('Country Blocking', 'advanced-google-recaptcha'), 'callback' => array('WPCaptcha_Tab_GeoIP', 'display'));
|
||||
$tabs[] = array('id' => 'wpcaptcha_design', 'icon' => 'wpcaptcha-icon wpcaptcha-settings', 'class' => '', 'label' => __('Design', 'advanced-google-recaptcha'), 'callback' => array('WPCaptcha_Tab_Design', 'display'));
|
||||
$tabs[] = array('id' => 'wpcaptcha_temp_access', 'icon' => 'wpcaptcha-icon wpcaptcha-hour-glass', 'class' => '', 'label' => __('Temp Access', 'advanced-google-recaptcha'), 'callback' => array('WPCaptcha_Tab_Temporary_Access', 'display'));
|
||||
$tabs[] = array('id' => 'wpcaptcha_pro', 'class' => 'open-upsell nav-tab-pro', 'icon' => '<span class="dashicons dashicons-star-filled"></span>', 'label' => __('PRO', 'advanced-google-recaptcha'), 'callback' => '');
|
||||
|
||||
$tabs = apply_filters('wpcaptcha_tabs', $tabs);
|
||||
echo '<div id="wpcaptcha_tabs_wrapper" class="ui-tabs">';
|
||||
|
||||
echo '<div id="wpcaptcha_tabs" class="ui-tabs" style="display: none;">';
|
||||
echo '<ul class="wpcaptcha-main-tab">';
|
||||
foreach ($tabs as $tab) {
|
||||
echo '<li><a ' . (!empty($tab['callback']) ? 'href="#' . esc_attr($tab['id']) . '"' : '') . 'class="' . esc_attr($tab['class']) . '">';
|
||||
if (strpos($tab['icon'], 'dashicon')) {
|
||||
WPCaptcha_Utility::wp_kses_wf($tab['icon']);
|
||||
} else {
|
||||
echo '<span class="icon"><i class="' . esc_attr($tab['icon']) . '"></i></span>';
|
||||
}
|
||||
echo '<span class="label">' . esc_attr($tab['label']) . '</span></a></li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
|
||||
foreach ($tabs as $tab) {
|
||||
if (is_callable($tab['callback'])) {
|
||||
echo '<div style="display: none;" id="' . esc_attr($tab['id']) . '">';
|
||||
call_user_func($tab['callback']);
|
||||
echo '</div>';
|
||||
}
|
||||
} // foreach
|
||||
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
||||
echo '<div id="wpcaptcha_tabs_sidebar" style="display:none;">';
|
||||
echo '<div class="sidebar-box pro-ad-box">
|
||||
<p class="text-center"><a href="#" data-pro-feature="sidebar-box-logo" class="open-pro-dialog">
|
||||
<img src="' . esc_url(WPCAPTCHA_PLUGIN_URL . '/images/wp-captcha-logo.png') . '" alt="WP Captcha PRO" title="WP Captcha PRO"></a><br><b>PRO version is here! Grab the launch discount.</b></p>
|
||||
<ul class="plain-list">
|
||||
<li>7 Types of Captcha + GDPR Compatibility</li>
|
||||
<li>Login Page Customization - Visual & URL</li>
|
||||
<li>Advanced Login Page Protection</li>
|
||||
<li>Email Based Two Factor Authentication (2FA)</li>
|
||||
<li>Advanced Firewall + Cloud Blacklists</li>
|
||||
<li>Country Blocking (whitelist & blacklist)</li>
|
||||
<li>Temporary Access Links</li>
|
||||
<li>Recovery URL - You Can Never Get Locked Out</li>
|
||||
<li>Licenses & Sites Manager (remote SaaS dashboard)</li>
|
||||
<li>White-label Mode</li>
|
||||
<li>Complete Codeless Plugin Rebranding</li>
|
||||
<li>Email support from plugin developers</li>
|
||||
</ul>
|
||||
|
||||
<p class="text-center"><a href="#" class="open-pro-dialog button button-buy" data-pro-feature="sidebar-box">Get PRO Now</a></p>
|
||||
</div>';
|
||||
|
||||
if (!defined('EPS_REDIRECT_VERSION') && !defined('WF301_PLUGIN_FILE')) {
|
||||
echo '<div class="sidebar-box pro-ad-box box-301">
|
||||
<h3 class="textcenter"><b>Problems with redirects?<br>Moving content around or changing posts\' URL?<br>Old URLs giving you problems?<br><br><u>Improve your SEO & manage all redirects in one place!</u></b></h3>
|
||||
|
||||
<p class="text-center"><a href="#" class="install-wp301">
|
||||
<img src="' . esc_url(WPCAPTCHA_PLUGIN_URL . '/images/wp-301-logo.png') . '" alt="WP 301 Redirects" title="WP 301 Redirects"></a></p>
|
||||
|
||||
<p class="text-center"><a href="#" class="button button-buy install-wp301">Install and activate the <u>free</u> WP 301 Redirects plugin</a></p>
|
||||
|
||||
<p><a href="https://wordpress.org/plugins/eps-301-redirects/" target="_blank">WP 301 Redirects</a> is a free WP plugin maintained by the same team as this WP Captcha plugin. It has <b>+250,000 users, 5-star rating</b>, and is hosted on the official WP repository.</p>
|
||||
</div>';
|
||||
}
|
||||
|
||||
echo '<div class="sidebar-box" style="margin-top: 35px;">
|
||||
<p>Please <a href="https://wordpress.org/support/plugin/advanced-google-recaptcha/reviews/#new-post" target="_blank">rate the plugin ★★★★★</a> to <b>keep it up-to-date & maintained</b>. It only takes a second to rate. Thank you! 👋</p>
|
||||
</div>';
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
|
||||
echo ' <div id="wpcaptcha-pro-dialog" style="display: none;" title="WP Captcha PRO is here!"><span class="ui-helper-hidden-accessible"><input type="text"/></span>
|
||||
|
||||
<div class="center logo"><a href="https://getwpcaptcha.com/?ref=wpcaptcha-free-pricing-table" target="_blank"><img src="' . esc_url(WPCAPTCHA_PLUGIN_URL . '/images/wp-captcha-logo.png') . '" alt="WP Captcha PRO" title="WP Captcha PRO"></a><br>
|
||||
|
||||
<span>Grab the limited PRO <b>Launch Discount</b></span>
|
||||
</div>
|
||||
|
||||
<table id="wpcaptcha-pro-table">
|
||||
<tr>
|
||||
<td class="center">Personal License</td>
|
||||
<td class="center">Team License</td>
|
||||
<td class="center">Agency License</td>
|
||||
</tr>
|
||||
|
||||
<tr class="prices">
|
||||
<td class="center"><span><del>$59</del> $49</span> <b>/year</b></td>
|
||||
<td class="center"><span><del>$119</del> $99</span> <b>/year</b></td>
|
||||
<td class="center"><span><del>$149</del> $119</span> <b>/year</b></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><span class="dashicons dashicons-yes"></span><b>1 Site License</b> ($49 per site)</td>
|
||||
<td><span class="dashicons dashicons-yes"></span><b>5 Sites License</b> ($20 per site)</td>
|
||||
<td><span class="dashicons dashicons-yes"></span><b>100 Sites License</b> ($1.2 per site)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><span class="dashicons dashicons-yes"></span>All Plugin Features</td>
|
||||
<td><span class="dashicons dashicons-yes"></span>All Plugin Features</td>
|
||||
<td><span class="dashicons dashicons-yes"></span>All Plugin Features</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><span class="dashicons dashicons-yes"></span>7 Types of Captcha</td>
|
||||
<td><span class="dashicons dashicons-yes"></span>7 Types of Captcha</td>
|
||||
<td><span class="dashicons dashicons-yes"></span>7 Types of Captcha</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><span class="dashicons dashicons-yes"></span>Advanced Firewall + Cloud Blacklists</td>
|
||||
<td><span class="dashicons dashicons-yes"></span>Advanced Firewall + Cloud Blacklists</td>
|
||||
<td><span class="dashicons dashicons-yes"></span>Advanced Firewall + Cloud Blacklists</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><span class="dashicons dashicons-yes"></span>Login Page Customization</td>
|
||||
<td><span class="dashicons dashicons-yes"></span>Login Page Customization</td>
|
||||
<td><span class="dashicons dashicons-yes"></span>Login Page Customization</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><span class="dashicons dashicons-yes"></span>Email Based 2FA</td>
|
||||
<td><span class="dashicons dashicons-yes"></span>Email Based 2FA</td>
|
||||
<td><span class="dashicons dashicons-yes"></span>Email Based 2FA</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><span class="dashicons dashicons-yes"></span>Temporary Access Links</td>
|
||||
<td><span class="dashicons dashicons-yes"></span>Temporary Access Links</td>
|
||||
<td><span class="dashicons dashicons-yes"></span>Temporary Access Links</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><span class="dashicons dashicons-yes"></span>Country Blocking</td>
|
||||
<td><span class="dashicons dashicons-yes"></span>Country Blocking</td>
|
||||
<td><span class="dashicons dashicons-yes"></span>Country Blocking</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><span class="dashicons dashicons-yes"></span>SaaS Dashboard</td>
|
||||
<td><span class="dashicons dashicons-yes"></span>SaaS Dashboard</td>
|
||||
<td><span class="dashicons dashicons-yes"></span>SaaS Dashboard</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><span class="dashicons dashicons-no"></span>White-label Mode</td>
|
||||
<td><span class="dashicons dashicons-yes"></span>White-label Mode</td>
|
||||
<td><span class="dashicons dashicons-yes"></span>White-label Mode</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><span class="dashicons dashicons-no"></span>Full Plugin Rebranding</td>
|
||||
<td><span class="dashicons dashicons-no"></span>Full Plugin Rebranding</td>
|
||||
<td><span class="dashicons dashicons-yes"></span>Full Plugin Rebranding</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><a class="button button-buy" data-href-org="https://getwpcaptcha.com/buy/?product=personal-yearly-launch&ref=pricing-table" href="https://getwpcaptcha.com/buy/?product=personal-yearly-launch&ref=pricing-table" target="_blank"><del>$59</del> $49 <small>/y</small><br>BUY NOW</a>
|
||||
<br>or <a class="button-buy" data-href-org="https://getwpcaptcha.com/buy/?product=personal-ltd-launch&ref=pricing-table" href="https://getwpcaptcha.com/buy/?product=personal-ltd-launch&ref=pricing-table" target="_blank">only <del>$99</del> $79 for a lifetime license</a></td>
|
||||
<td><a class="button button-buy" data-href-org="https://getwpcaptcha.com/buy/?product=team-yearly-launch&ref=pricing-table" href="https://getwpcaptcha.com/buy/?product=team-yearly-launch&ref=pricing-table" target="_blank"><del>$119</del> $99 <small>/y</small><br>BUY NOW</a></td>
|
||||
<td><a class="button button-buy" data-href-org="https://getwpcaptcha.com/buy/?product=agency-yearly-launch&ref=pricing-table" href="https://getwpcaptcha.com/buy/?product=agency-yearly-launch&ref=pricing-table" target="_blank"><del>$149</del> $119 <small>/y</small><br>BUY NOW</a></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<div class="center footer"><b>100% No-Risk Money Back Guarantee!</b> If you don\'t like the plugin over the next 7 days, we will happily refund 100% of your money. No questions asked! Payments are processed by our merchant of records - <a href="https://paddle.com/" target="_blank">Paddle</a>.</div>
|
||||
</div>';
|
||||
|
||||
echo '</div>'; // wrap
|
||||
} // options_page
|
||||
|
||||
/**
|
||||
* Reset pointers
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
static function reset_pointers()
|
||||
{
|
||||
$pointers = array();
|
||||
$pointers['welcome'] = array('target' => '#menu-settings', 'edge' => 'left', 'align' => 'right', 'content' => 'Thank you for installing the <b style="font-weight: 800; font-variant: small-caps;">Advanced Google reCAPTCHA</b> plugin! Please open <a href="' . admin_url('options-general.php?page=wpcaptcha') . '">Settings - Advanced Google reCaptcha</a> to set up your captcha and website protection settings.');
|
||||
|
||||
update_option(WPCAPTCHA_POINTERS_KEY, $pointers);
|
||||
} // reset_pointers
|
||||
|
||||
/**
|
||||
* Settings footer submit button HTML
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
static function footer_save_button()
|
||||
{
|
||||
echo '<p class="submit">';
|
||||
echo '<button class="button button-primary button-large">' . __('Save Changes', 'advanced-google-recaptcha') . ' <i class="wpcaptcha-icon wpcaptcha-checkmark"></i></button>';
|
||||
echo '</p>';
|
||||
} // footer_save_button
|
||||
} // class
|
408
wp-content/plugins/advanced-google-recaptcha/libs/ajax.php
Normal file
@ -0,0 +1,408 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* WP Captcha
|
||||
* https://getwpcaptcha.com/
|
||||
* (c) WebFactory Ltd, 2022 - 2023, www.webfactoryltd.com
|
||||
*/
|
||||
|
||||
class WPCaptcha_AJAX extends WPCaptcha
|
||||
{
|
||||
/**
|
||||
* Run one tool via AJAX call
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
static function ajax_run_tool()
|
||||
{
|
||||
global $wpdb, $current_user;
|
||||
|
||||
check_ajax_referer('wpcaptcha_run_tool');
|
||||
set_time_limit(300);
|
||||
|
||||
$tool = trim(@$_REQUEST['tool']);
|
||||
|
||||
$options = WPCaptcha_Setup::get_options();
|
||||
|
||||
$update['last_options_edit'] = current_time('mysql', true);
|
||||
update_option(WPCAPTCHA_OPTIONS_KEY, array_merge($options, $update));
|
||||
|
||||
if ($tool == 'activity_logs') {
|
||||
self::get_activity_logs();
|
||||
} else if ($tool == 'locks_logs') {
|
||||
self::get_locks_logs();
|
||||
} else if ($tool == 'recovery_url') {
|
||||
if ($_POST['reset'] == 'true') {
|
||||
sleep(1);
|
||||
$options['global_unblock_key'] = 'll' . md5(time() . rand(10000, 9999));
|
||||
update_option(WPCAPTCHA_OPTIONS_KEY, array_merge($options, $update));
|
||||
}
|
||||
wp_send_json_success(array('url' => '<a href="' . site_url('/?wpcaptcha_unblock=' . $options['global_unblock_key']) . '">' . site_url('/?wpcaptcha_unblock=' . $options['global_unblock_key']) . '</a>'));
|
||||
} else if ($tool == 'empty_log') {
|
||||
self::empty_log(sanitize_text_field($_POST['log']));
|
||||
wp_send_json_success();
|
||||
} else if ($tool == 'unlock_accesslock') {
|
||||
$wpdb->update(
|
||||
$wpdb->wpcatcha_accesslocks,
|
||||
array(
|
||||
'unlocked' => 1
|
||||
),
|
||||
array(
|
||||
'accesslock_ID' => intval($_POST['lock_id'])
|
||||
)
|
||||
);
|
||||
wp_send_json_success(array('id' => $_POST['lock_id']));
|
||||
} else if ($tool == 'delete_lock_log') {
|
||||
$wpdb->delete(
|
||||
$wpdb->wpcatcha_accesslocks,
|
||||
array(
|
||||
'accesslock_ID' => intval($_POST['lock_id'])
|
||||
)
|
||||
);
|
||||
wp_send_json_success(array('id' => $_POST['lock_id']));
|
||||
} else if ($tool == 'delete_fail_log') {
|
||||
$wpdb->delete(
|
||||
$wpdb->wpcatcha_login_fails,
|
||||
array(
|
||||
'login_attempt_ID' => intval($_POST['fail_id'])
|
||||
)
|
||||
);
|
||||
wp_send_json_success(array('id' => $_POST['fail_id']));
|
||||
} else if ($tool == 'wpcaptcha_dismiss_pointer') {
|
||||
delete_option(WPCAPTCHA_POINTERS_KEY);
|
||||
wp_send_json_success();
|
||||
} else if ($tool == 'verify_captcha') {
|
||||
$captcha_result = self::verify_captcha($_POST['captcha_type'], $_POST['captcha_site_key'], $_POST['captcha_secret_key'], $_POST['captcha_response']);
|
||||
if (is_wp_error($captcha_result)) {
|
||||
wp_send_json_error($captcha_result->get_error_message());
|
||||
}
|
||||
wp_send_json_success();
|
||||
} else {
|
||||
wp_send_json_error(__('Unknown tool.', 'advanced-google-recaptcha'));
|
||||
}
|
||||
die();
|
||||
} // ajax_run_tool
|
||||
|
||||
/**
|
||||
* Get rule row html
|
||||
*
|
||||
* @return string row HTML
|
||||
*
|
||||
* @param array $data with rule settings
|
||||
*/
|
||||
static function get_date_time($timestamp)
|
||||
{
|
||||
$interval = current_time('timestamp') - $timestamp;
|
||||
return '<span class="wpcaptcha-dt-small">' . self::humanTiming($interval, true) . '</span><br />' . date('Y/m/d', $timestamp) . ' <span class="wpcaptcha-dt-small">' . date('h:i:s A', $timestamp) . '</span>';
|
||||
}
|
||||
|
||||
static function verify_captcha($type, $site_key, $secret_key, $response)
|
||||
{
|
||||
if ($type == 'builtin') {
|
||||
if ($response === $_COOKIE['wpcaptcha_captcha']) {
|
||||
return true;
|
||||
} else {
|
||||
return new WP_Error('wpcaptcha_builtin_captcha_failed', __("<strong>ERROR</strong>: captcha verification failed.<br /><br />Please try again.", 'advanced-google-recaptcha'));
|
||||
}
|
||||
} else if ($type == 'recaptchav2') {
|
||||
if (!isset($response) || empty($response)) {
|
||||
return new WP_Error('wpcaptcha_recaptchav2_not_submitted', __("reCAPTCHA verification failed ", 'advanced-google-recaptcha'));
|
||||
} else {
|
||||
$response = wp_remote_get('https://www.google.com/recaptcha/api/siteverify?secret=' . $secret_key . '&response=' . $response);
|
||||
$response = json_decode($response['body']);
|
||||
|
||||
if ($response->success) {
|
||||
return true;
|
||||
} else {
|
||||
return new WP_Error('wpcaptcha_recaptchav2_failed', __("reCAPTCHA verification failed " . (isset($response->{'error-codes'}) ? ': ' . implode(',', $response->{'error-codes'}) : ''), 'advanced-google-recaptcha'));
|
||||
}
|
||||
}
|
||||
} else if ($type == 'recaptchav3') {
|
||||
if (!isset($response) || empty($response)) {
|
||||
return new WP_Error('wpcaptcha_recaptchav3_not_submitted', __("reCAPTCHA verification failed ", 'advanced-google-recaptcha'));
|
||||
} else {
|
||||
$response = wp_remote_get('https://www.google.com/recaptcha/api/siteverify?secret=' . $secret_key . '&response=' . $response);
|
||||
$response = json_decode($response['body']);
|
||||
|
||||
if ($response->success) {
|
||||
return true;
|
||||
} else {
|
||||
return new WP_Error('wpcaptcha_recaptchav2_failed', __("reCAPTCHA verification failed " . (isset($response->{'error-codes'}) ? ': ' . implode(',', $response->{'error-codes'}) : ''), 'advanced-google-recaptcha'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get human readable timestamp like 2 hours ago
|
||||
*
|
||||
* @return int time
|
||||
*
|
||||
* @param string timestamp
|
||||
*/
|
||||
static function humanTiming($time)
|
||||
{
|
||||
$tokens = array(
|
||||
31536000 => 'year',
|
||||
2592000 => 'month',
|
||||
604800 => 'week',
|
||||
86400 => 'day',
|
||||
3600 => 'hour',
|
||||
60 => 'minute',
|
||||
1 => 'second'
|
||||
);
|
||||
|
||||
if ($time < 1) {
|
||||
return 'just now';
|
||||
}
|
||||
foreach ($tokens as $unit => $text) {
|
||||
if ($time < $unit) continue;
|
||||
$numberOfUnits = floor($time / $unit);
|
||||
return $numberOfUnits . ' ' . $text . (($numberOfUnits > 1) ? 's' : '') . ' ago';
|
||||
}
|
||||
}
|
||||
|
||||
static function empty_log($log)
|
||||
{
|
||||
global $wpdb;
|
||||
|
||||
if ($log == 'fails') {
|
||||
$wpdb->query('TRUNCATE TABLE ' . $wpdb->wpcatcha_login_fails);
|
||||
} else {
|
||||
$wpdb->query('TRUNCATE TABLE ' . $wpdb->wpcatcha_accesslocks);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch activity logs and output JSON for datatables
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
static function get_locks_logs()
|
||||
{
|
||||
global $wpdb;
|
||||
|
||||
$aColumns = array('accesslock_ID', 'unlocked', 'accesslock_date', 'release_date', 'reason', 'accesslock_IP');
|
||||
$sIndexColumn = "accesslock_ID";
|
||||
|
||||
// paging
|
||||
$sLimit = '';
|
||||
if (isset($_GET['iDisplayStart']) && $_GET['iDisplayLength'] != '-1') {
|
||||
$sLimit = "LIMIT " . intval($_GET['iDisplayStart']) . ", " .
|
||||
intval($_GET['iDisplayLength']);
|
||||
} // paging
|
||||
|
||||
// ordering
|
||||
$sOrder = '';
|
||||
if (isset($_GET['iSortCol_0'])) {
|
||||
$sOrder = "ORDER BY ";
|
||||
for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) {
|
||||
if ($_GET['bSortable_' . intval($_GET['iSortCol_' . $i])] == "true") {
|
||||
$sOrder .= $aColumns[intval($_GET['iSortCol_' . $i])] . " "
|
||||
. ($_GET['sSortDir_' . $i] == 'desc'?'desc':'asc') . ", ";
|
||||
}
|
||||
}
|
||||
|
||||
$sOrder = substr_replace($sOrder, '', -2);
|
||||
if ($sOrder == "ORDER BY") {
|
||||
$sOrder = '';
|
||||
}
|
||||
} // ordering
|
||||
|
||||
// filtering
|
||||
$sWhere = '';
|
||||
if (isset($_GET['sSearch']) && $_GET['sSearch'] != '') {
|
||||
$sWhere = "WHERE (";
|
||||
for ($i = 0; $i < count($aColumns); $i++) {
|
||||
$sWhere .= $aColumns[$i] . " LIKE '%" . esc_sql($_GET['sSearch']) . "%' OR ";
|
||||
}
|
||||
$sWhere = substr_replace($sWhere, '', -3);
|
||||
$sWhere .= ')';
|
||||
} // filtering
|
||||
|
||||
// individual column filtering
|
||||
for ($i = 0; $i < count($aColumns); $i++) {
|
||||
if (isset($_GET['bSearchable_' . $i]) && $_GET['bSearchable_' . $i] == "true" && $_GET['sSearch_' . $i] != '') {
|
||||
if ($sWhere == '') {
|
||||
$sWhere = "WHERE ";
|
||||
} else {
|
||||
$sWhere .= " AND ";
|
||||
}
|
||||
$sWhere .= $aColumns[$i] . " LIKE '%" . esc_sql($_GET['sSearch_' . $i]) . "%' ";
|
||||
}
|
||||
} // individual columns
|
||||
|
||||
// build query
|
||||
$wpdb->sQuery = "SELECT SQL_CALC_FOUND_ROWS " . str_replace(" , ", " ", implode(", ", $aColumns)) . " FROM " . $wpdb->wpcatcha_accesslocks . " $sWhere $sOrder $sLimit";
|
||||
|
||||
$rResult = $wpdb->get_results($wpdb->sQuery);
|
||||
|
||||
// data set length after filtering
|
||||
$wpdb->sQuery = "SELECT FOUND_ROWS()";
|
||||
$iFilteredTotal = $wpdb->get_var($wpdb->sQuery);
|
||||
|
||||
// total data set length
|
||||
$wpdb->sQuery = "SELECT COUNT(" . $sIndexColumn . ") FROM " . $wpdb->wpcatcha_accesslocks;
|
||||
$iTotal = $wpdb->get_var($wpdb->sQuery);
|
||||
|
||||
// construct output
|
||||
$output = array(
|
||||
"sEcho" => intval(@$_GET['sEcho']),
|
||||
"iTotalRecords" => $iTotal,
|
||||
"iTotalDisplayRecords" => $iFilteredTotal,
|
||||
"aaData" => array()
|
||||
);
|
||||
|
||||
foreach ($rResult as $aRow) {
|
||||
$row = array();
|
||||
$row['DT_RowId'] = $aRow->accesslock_ID;
|
||||
|
||||
if (strtotime($aRow->release_date) < time()) {
|
||||
$row['DT_RowClass'] = 'lock_expired';
|
||||
}
|
||||
|
||||
for ($i = 0; $i < count($aColumns); $i++) {
|
||||
|
||||
if ($aColumns[$i] == 'unlocked') {
|
||||
$unblocked = $aRow->{$aColumns[$i]};
|
||||
if ($unblocked == 0 && strtotime($aRow->release_date) > time()) {
|
||||
$row[] = '<div class="tooltip unlock_accesslock" data-lock-id="' . $aRow->accesslock_ID . '" title="Unlock"><i class="wpcaptcha-icon wpcaptcha-lock"></i></div>';
|
||||
} else {
|
||||
$row[] = '<div class="tooltip unlocked_accesslock" title="Unlock"><i class="wpcaptcha-icon wpcaptcha-unlock"></i></div>';
|
||||
}
|
||||
} else if ($aColumns[$i] == 'accesslock_date') {
|
||||
$row[] = self::get_date_time(strtotime($aRow->{$aColumns[$i]}));
|
||||
} else if ($aColumns[$i] == 'reason') {
|
||||
$row[] = $aRow->{$aColumns[$i]};
|
||||
} else if ($aColumns[$i] == 'accesslock_IP') {
|
||||
$row[] = '<a href="#" class="open-pro-dialog pro-feature" data-pro-feature="access-log-user-location">Available in PRO</a>';
|
||||
$row[] = '<a href="#" class="open-pro-dialog pro-feature" data-pro-feature="access-log-user-agent">Available in PRO</a>';
|
||||
}
|
||||
}
|
||||
$row[] = '<div data-lock-id="' . $aRow->accesslock_ID . '" class="tooltip delete_lock_entry" title="Delete Access Lock?" data-msg-success="Access Lock deleted" data-btn-confirm="Delete Access Lock" data-title="Delete Access Lock?" data-wait-msg="Deleting. Please wait." data-name="" title="Delete this Access Lock"><i class="wpcaptcha-icon wpcaptcha-trash"></i></div>';
|
||||
$output['aaData'][] = $row;
|
||||
} // foreach row
|
||||
|
||||
// json encoded output
|
||||
@ob_end_clean();
|
||||
header('Cache-Control: no-cache, must-revalidate');
|
||||
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
|
||||
echo json_encode($output);
|
||||
die();
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch activity logs and output JSON for datatables
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
static function get_activity_logs()
|
||||
{
|
||||
global $wpdb;
|
||||
$options = WPCaptcha_Setup::get_options();
|
||||
|
||||
$aColumns = array('login_attempt_ID', 'login_attempt_date', 'failed_user', 'failed_pass', 'login_attempt_IP', 'reason');
|
||||
$sIndexColumn = "login_attempt_ID";
|
||||
|
||||
// paging
|
||||
$sLimit = '';
|
||||
if (isset($_GET['iDisplayStart']) && $_GET['iDisplayLength'] != '-1') {
|
||||
$sLimit = "LIMIT " . intval($_GET['iDisplayStart']) . ", " .
|
||||
intval($_GET['iDisplayLength']);
|
||||
} // paging
|
||||
|
||||
// ordering
|
||||
$sOrder = '';
|
||||
if (isset($_GET['iSortCol_0'])) {
|
||||
$sOrder = "ORDER BY ";
|
||||
for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) {
|
||||
if ($_GET['bSortable_' . intval($_GET['iSortCol_' . $i])] == "true") {
|
||||
$sOrder .= $aColumns[intval($_GET['iSortCol_' . $i])] . " "
|
||||
. ($_GET['sSortDir_' . $i] == 'desc'?'desc':'asc') . ", ";
|
||||
}
|
||||
}
|
||||
|
||||
$sOrder = substr_replace($sOrder, '', -2);
|
||||
if ($sOrder == "ORDER BY") {
|
||||
$sOrder = '';
|
||||
}
|
||||
} // ordering
|
||||
|
||||
// filtering
|
||||
$sWhere = '';
|
||||
if (isset($_GET['sSearch']) && $_GET['sSearch'] != '') {
|
||||
$sWhere = "WHERE (";
|
||||
for ($i = 0; $i < count($aColumns); $i++) {
|
||||
$sWhere .= $aColumns[$i] . " LIKE '%" . esc_sql($_GET['sSearch']) . "%' OR ";
|
||||
}
|
||||
$sWhere = substr_replace($sWhere, '', -3);
|
||||
$sWhere .= ')';
|
||||
} // filtering
|
||||
|
||||
// individual column filtering
|
||||
for ($i = 0; $i < count($aColumns); $i++) {
|
||||
if (isset($_GET['bSearchable_' . $i]) && $_GET['bSearchable_' . $i] == "true" && $_GET['sSearch_' . $i] != '') {
|
||||
if ($sWhere == '') {
|
||||
$sWhere = "WHERE ";
|
||||
} else {
|
||||
$sWhere .= " AND ";
|
||||
}
|
||||
$sWhere .= $aColumns[$i] . " LIKE '%" . esc_sql($_GET['sSearch_' . $i]) . "%' ";
|
||||
}
|
||||
} // individual columns
|
||||
|
||||
// build query
|
||||
$wpdb->sQuery = "SELECT SQL_CALC_FOUND_ROWS " . str_replace(" , ", " ", implode(", ", $aColumns)) .
|
||||
" FROM " . $wpdb->wpcatcha_login_fails . " $sWhere $sOrder $sLimit";
|
||||
|
||||
$rResult = $wpdb->get_results($wpdb->sQuery);
|
||||
|
||||
// data set length after filtering
|
||||
$wpdb->sQuery = "SELECT FOUND_ROWS()";
|
||||
$iFilteredTotal = $wpdb->get_var($wpdb->sQuery);
|
||||
|
||||
// total data set length
|
||||
$wpdb->sQuery = "SELECT COUNT(" . $sIndexColumn . ") FROM " . $wpdb->wpcatcha_login_fails;
|
||||
$iTotal = $wpdb->get_var($wpdb->sQuery);
|
||||
|
||||
// construct output
|
||||
$output = array(
|
||||
"sEcho" => intval(@$_GET['sEcho']),
|
||||
"iTotalRecords" => $iTotal,
|
||||
"iTotalDisplayRecords" => $iFilteredTotal,
|
||||
"aaData" => array()
|
||||
);
|
||||
|
||||
foreach ($rResult as $aRow) {
|
||||
$row = array();
|
||||
$row['DT_RowId'] = $aRow->login_attempt_ID;
|
||||
|
||||
for ($i = 0; $i < count($aColumns); $i++) {
|
||||
if ($aColumns[$i] == 'login_attempt_date') {
|
||||
$row[] = self::get_date_time(strtotime($aRow->{$aColumns[$i]}));
|
||||
} elseif ($aColumns[$i] == 'failed_user') {
|
||||
$failed_login = '';
|
||||
$failed_login .= '<strong>User:</strong> ' . htmlspecialchars($aRow->failed_user) . '<br />';
|
||||
if ($options['log_passwords'] == 1) {
|
||||
$failed_login .= '<strong>Pass:</strong> ' . htmlspecialchars($aRow->failed_pass) . '<br />';
|
||||
}
|
||||
$row[] = $failed_login;
|
||||
} else if ($aColumns[$i] == 'login_attempt_IP') {
|
||||
$row[] = '<a href="#" class="open-pro-dialog pro-feature" data-pro-feature="fail-log-user-location">Available in PRO</a>';
|
||||
$row[] = '<a href="#" class="open-pro-dialog pro-feature" data-pro-feature="fail-log-user-agent">Available in PRO</a>';
|
||||
} elseif ($aColumns[$i] == 'reason') {
|
||||
$row[] = WPCaptcha_Functions::pretty_fail_errors($aRow->{$aColumns[$i]});
|
||||
}
|
||||
}
|
||||
$row[] = '<div data-failed-id="' . $aRow->login_attempt_ID . '" class="tooltip delete_failed_entry" title="Delete failed login attempt log entry" data-msg-success="Failed login attempt log entry deleted" data-btn-confirm="Delete failed login attempt log entry" data-title="Delete failed login attempt log entry" data-wait-msg="Deleting. Please wait." data-name="" title="Delete this failed login attempt log entry"><i class="wpcaptcha-icon wpcaptcha-trash"></i></div>';
|
||||
$output['aaData'][] = $row;
|
||||
} // foreach row
|
||||
|
||||
// json encoded output
|
||||
@ob_end_clean();
|
||||
header('Cache-Control: no-cache, must-revalidate');
|
||||
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
|
||||
echo json_encode($output);
|
||||
die();
|
||||
}
|
||||
} // class
|
109
wp-content/plugins/advanced-google-recaptcha/libs/captcha.php
Normal file
@ -0,0 +1,109 @@
|
||||
<?php
|
||||
/**
|
||||
* WP Captcha
|
||||
* https://getwpcaptcha.com/
|
||||
* (c) WebFactory Ltd, 2022 - 2023, www.webfactoryltd.com
|
||||
*/
|
||||
|
||||
class WPCaptcha_Captcha {
|
||||
// convert HEX(HTML) color notation to RGB
|
||||
static function hex2rgb($color) {
|
||||
if ($color[0] == '#') {
|
||||
$color = substr($color, 1);
|
||||
}
|
||||
|
||||
if (strlen($color) == 6) {
|
||||
list($r, $g, $b) = array($color[0].$color[1],
|
||||
$color[2].$color[3],
|
||||
$color[4].$color[5]);
|
||||
} elseif (strlen($color) == 3) {
|
||||
list($r, $g, $b) = array($color[0].$color[0], $color[1].$color[1], $color[2].$color[2]);
|
||||
} else {
|
||||
return array(255, 255, 255);
|
||||
}
|
||||
|
||||
$r = hexdec($r);
|
||||
$g = hexdec($g);
|
||||
$b = hexdec($b);
|
||||
|
||||
return array($r, $g, $b);
|
||||
} // html2rgb
|
||||
|
||||
|
||||
// output captcha image
|
||||
static function generate() {
|
||||
$a = rand(0, (int) 10);
|
||||
$b = rand(0, (int) 10);
|
||||
$color = @$_GET['color'];
|
||||
$color = urldecode($color);
|
||||
if(isset($_GET['id'])){
|
||||
$captcha_cookie_name = 'wpcaptcha_captcha_' . intval($_GET['id']);
|
||||
} else{
|
||||
$captcha_cookie_name = 'wpcaptcha_captcha';
|
||||
}
|
||||
|
||||
if ($a > $b) {
|
||||
$out = "$a - $b";
|
||||
$captcha_value = $a - $b;
|
||||
|
||||
} else {
|
||||
$out = "$a + $b";
|
||||
$captcha_value = $a + $b;
|
||||
}
|
||||
|
||||
setcookie($captcha_cookie_name, $captcha_value, time() + 60 * 5, '/');
|
||||
|
||||
$font = 5;
|
||||
$width = ImageFontWidth($font) * strlen($out);
|
||||
$height = ImageFontHeight($font);
|
||||
$im = ImageCreate($width, $height);
|
||||
|
||||
$x = imagesx($im) - $width ;
|
||||
$y = imagesy($im) - $height;
|
||||
|
||||
$white = imagecolorallocate ($im, 255, 255, 255);
|
||||
$gray = imagecolorallocate ($im, 66, 66, 66);
|
||||
$black = imagecolorallocate ($im, 0, 0, 0);
|
||||
$trans_color = $white; //transparent color
|
||||
|
||||
if ($color) {
|
||||
$color = self::hex2rgb($color);
|
||||
$new_color = imagecolorallocate ($im, $color[0], $color[1], $color[2]);
|
||||
imagefill($im, 1, 1, $new_color);
|
||||
} else {
|
||||
imagecolortransparent($im, $trans_color);
|
||||
}
|
||||
|
||||
imagestring ($im, $font, $x, $y, $out, $black);
|
||||
|
||||
// always add noise
|
||||
if (1 == 1) {
|
||||
$color_min = 100;
|
||||
$color_max = 200;
|
||||
$rand1 = imagecolorallocate ($im, rand($color_min,$color_max), rand($color_min,$color_max), rand($color_min,$color_max));
|
||||
$rand2 = imagecolorallocate ($im, rand($color_min,$color_max), rand($color_min,$color_max), rand($color_min,$color_max));
|
||||
$rand3 = imagecolorallocate ($im, rand($color_min,$color_max), rand($color_min,$color_max), rand($color_min,$color_max));
|
||||
$rand4 = imagecolorallocate ($im, rand($color_min,$color_max), rand($color_min,$color_max), rand($color_min,$color_max));
|
||||
$rand5 = imagecolorallocate ($im, rand($color_min,$color_max), rand($color_min,$color_max), rand($color_min,$color_max));
|
||||
|
||||
$style = array($rand1, $rand2, $rand3, $rand4, $rand5);
|
||||
imagesetstyle($im, $style);
|
||||
imageline($im, rand(0, $width), 0, rand(0, $width), $height, IMG_COLOR_STYLED);
|
||||
imageline($im, rand(0, $width), 0, rand(0, $width), $height, IMG_COLOR_STYLED);
|
||||
imageline($im, rand(0, $width), 0, rand(0, $width), $height, IMG_COLOR_STYLED);
|
||||
imageline($im, rand(0, $width), 0, rand(0, $width), $height, IMG_COLOR_STYLED);
|
||||
imageline($im, rand(0, $width), 0, rand(0, $width), $height, IMG_COLOR_STYLED);
|
||||
}
|
||||
|
||||
header('Cache-Control: no-cache, must-revalidate');
|
||||
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Content-type: image/gif');
|
||||
imagegif($im);
|
||||
die();
|
||||
} // create
|
||||
} // WPCaptcha_Captcha
|
||||
|
||||
|
||||
if (isset($_GET['wpcaptcha-generate-image'])) {
|
||||
WPCaptcha_Captcha::generate();
|
||||
}
|
1184
wp-content/plugins/advanced-google-recaptcha/libs/functions.php
Normal file
720
wp-content/plugins/advanced-google-recaptcha/libs/setup.php
Normal file
@ -0,0 +1,720 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* WP Captcha
|
||||
* https://getwpcaptcha.com/
|
||||
* (c) WebFactory Ltd, 2022 - 2023, www.webfactoryltd.com
|
||||
*/
|
||||
|
||||
class WPCaptcha_Setup extends WPCaptcha
|
||||
{
|
||||
static $wp_filesystem;
|
||||
|
||||
/**
|
||||
* Actions to run on load, but init would be too early as not all classes are initialized
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
static function load_actions()
|
||||
{
|
||||
self::register_custom_tables();
|
||||
} // admin_actions
|
||||
|
||||
static function setup_wp_filesystem()
|
||||
{
|
||||
global $wp_filesystem;
|
||||
|
||||
if (empty($wp_filesystem)) {
|
||||
require_once ABSPATH . '/wp-admin/includes/file.php';
|
||||
WP_Filesystem();
|
||||
}
|
||||
|
||||
self::$wp_filesystem = $wp_filesystem;
|
||||
return self::$wp_filesystem;
|
||||
} // setup_wp_filesystem
|
||||
|
||||
/**
|
||||
* Check if user has the minimal WP version required by WP Captcha
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
*/
|
||||
static function check_wp_version($min_version)
|
||||
{
|
||||
if (!version_compare(get_bloginfo('version'), $min_version, '>=')) {
|
||||
add_action('admin_notices', array(__CLASS__, 'notice_min_wp_version'));
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} // check_wp_version
|
||||
|
||||
/**
|
||||
* Check if user has the minimal PHP version required by WP Captcha
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
*/
|
||||
static function check_php_version($min_version)
|
||||
{
|
||||
if (!version_compare(phpversion(), $min_version, '>=')) {
|
||||
add_action('admin_notices', array(__CLASS__, 'notice_min_php_version'));
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} // check_wp_version
|
||||
|
||||
/**
|
||||
* Display error message if WP version is too low
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return null
|
||||
*
|
||||
*/
|
||||
static function notice_min_wp_version()
|
||||
{
|
||||
WPCaptcha_Utility::wp_kses_wf('<div class="error"><p>' . sprintf(__('WP Captcha plugin <b>requires WordPress version 4.6</b> or higher to function properly. You are using WordPress version %s. Please <a href="%s">update it</a>.', 'advanced-google-recaptcha'), get_bloginfo('version'), admin_url('update-core.php')) . '</p></div>');
|
||||
} // notice_min_wp_version_error
|
||||
|
||||
/**
|
||||
* Display error message if PHP version is too low
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return null
|
||||
*
|
||||
*/
|
||||
static function notice_min_php_version()
|
||||
{
|
||||
WPCaptcha_Utility::wp_kses_wf('<div class="error"><p>' . sprintf(__('WP Captcha plugin <b>requires PHP version 5.6.20</b> or higher to function properly. You are using PHP version %s. Please <a href="%s" target="_blank">update it</a>.', 'advanced-google-recaptcha'), phpversion(), 'https://wordpress.org/support/update-php/') . '</p></div>');
|
||||
} // notice_min_wp_version_error
|
||||
|
||||
|
||||
/**
|
||||
* activate doesn't get fired on upgrades so we have to compensate
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return null
|
||||
*
|
||||
*/
|
||||
public static function maybe_upgrade()
|
||||
{
|
||||
$meta = self::get_meta();
|
||||
if (empty($meta['database_ver']) || $meta['database_ver'] < self::$version) {
|
||||
self::create_custom_tables();
|
||||
}
|
||||
|
||||
|
||||
// Copy options from free
|
||||
$options = get_option(WPCAPTCHA_OPTIONS_KEY);
|
||||
if (false === $options) {
|
||||
$free_options = get_option("agr_options");
|
||||
if (false !== $free_options && isset($free_options['enable_login'])) {
|
||||
$options['captcha'] = $free_options['captcha_type'] == 'v3'?'recaptchav3':'recaptchav2';
|
||||
$options['captcha_site_key'] = $free_options['site_key'];
|
||||
$options['captcha_secret_key'] = $free_options['secret_key'];
|
||||
$options['captcha_show_login'] = $free_options['enable_login'];
|
||||
$options['captcha_show_wp_registration'] = $free_options['enable_register'];
|
||||
$options['captcha_show_wp_lost_password'] = $free_options['enable_lost_password'];
|
||||
$options['captcha_show_wp_comment'] = $free_options['enable_comment_form'];
|
||||
$options['captcha_show_woo_registration'] = $free_options['enable_woo_register'];
|
||||
$options['captcha_show_woo_checkout'] = $free_options['enable_woo_checkout'];
|
||||
$options['captcha_show_edd_registration'] = $free_options['enable_edd_register'];
|
||||
$options['captcha_show_bp_registration'] = $free_options['enable_bp_register'];
|
||||
|
||||
update_option(WPCAPTCHA_OPTIONS_KEY, $options);
|
||||
///delete_option("agr_options");
|
||||
}
|
||||
}
|
||||
} // maybe_upgrade
|
||||
|
||||
|
||||
/**
|
||||
* Get plugin options
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return array options
|
||||
*
|
||||
*/
|
||||
static function get_options()
|
||||
{
|
||||
$options = get_option(WPCAPTCHA_OPTIONS_KEY, array());
|
||||
|
||||
if (!is_array($options)) {
|
||||
$options = array();
|
||||
}
|
||||
$options = array_merge(self::default_options(), $options);
|
||||
|
||||
return $options;
|
||||
} // get_options
|
||||
|
||||
/**
|
||||
* Register all settings
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return false
|
||||
*
|
||||
*/
|
||||
static function register_settings()
|
||||
{
|
||||
register_setting(WPCAPTCHA_OPTIONS_KEY, WPCAPTCHA_OPTIONS_KEY, array(__CLASS__, 'sanitize_settings'));
|
||||
} // register_settings
|
||||
|
||||
|
||||
/**
|
||||
* Set default options
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return null
|
||||
*
|
||||
*/
|
||||
static function default_options()
|
||||
{
|
||||
$defaults = array(
|
||||
'login_protection' => 0,
|
||||
'max_login_retries' => 3,
|
||||
'retries_within' => 5,
|
||||
'lockout_length' => 60,
|
||||
'lockout_invalid_usernames' => 1,
|
||||
'mask_login_errors' => 0,
|
||||
'show_credit_link' => 0,
|
||||
'anonymous_logging' => 0,
|
||||
'block_bots' => 0,
|
||||
'log_passwords' => 0,
|
||||
'instant_block_nonusers' => 0,
|
||||
'cookie_lifetime' => 14,
|
||||
'country_blocking_mode' => 'none',
|
||||
'country_blocking_countries' => '',
|
||||
'block_undetermined_countries' => 0,
|
||||
'captcha' => 'disabled',
|
||||
'captcha_secret_key' => '',
|
||||
'captcha_site_key' => '',
|
||||
'captcha_show_login' => 1,
|
||||
'captcha_show_wp_registration' => 1,
|
||||
'captcha_show_wp_lost_password' => 1,
|
||||
'captcha_show_wp_comment' => 1,
|
||||
'captcha_show_woo_registration' => 0,
|
||||
'captcha_show_woo_checkout' => 0,
|
||||
'captcha_show_edd_registration' => 0,
|
||||
'captcha_show_bp_registration' => 0,
|
||||
'login_url' => '',
|
||||
'login_redirect_url' => '',
|
||||
'global_block' => 0,
|
||||
'country_global_block' => 0,
|
||||
'uninstall_delete' => 0,
|
||||
'block_message' => 'We\'re sorry, but your IP has been blocked due to too many recent failed login attempts.',
|
||||
'block_message_country' => 'We\'re sorry, but access from your location is not allowed.',
|
||||
'global_unblock_key' => 'll' . md5(time() . rand(10000, 9999)),
|
||||
'whitelist' => array(),
|
||||
'firewall_block_bots' => 0,
|
||||
'firewall_directory_traversal' => 0,
|
||||
'design_enable' => 0,
|
||||
'design_template' => 'orange',
|
||||
'design_background_color' => '',
|
||||
'design_background_image' => '',
|
||||
'design_logo' => '',
|
||||
'design_logo_url' => '',
|
||||
'design_logo_width' => '',
|
||||
'design_logo_height' => '',
|
||||
'design_logo_margin_bottom' => '',
|
||||
'design_text_color' => '#3c434a',
|
||||
'design_link_color' => '#2271b1',
|
||||
'design_link_hover_color' => '#135e96',
|
||||
'design_form_border_color' => '#FFFFFF',
|
||||
'design_form_border_width' => 1,
|
||||
'design_form_width' => '',
|
||||
'design_form_width' => '',
|
||||
'design_form_height' => '',
|
||||
'design_form_padding' => 26,
|
||||
'design_form_border_radius' => 2,
|
||||
'design_form_background_color' => '',
|
||||
'design_form_background_image' => '',
|
||||
'design_label_font_size' => 14,
|
||||
'design_label_text_color' => '#3c434a',
|
||||
'design_field_font_size' => 13,
|
||||
'design_field_text_color' => '#3c434a',
|
||||
'design_field_border_color' => '#8c8f94',
|
||||
'design_field_border_width' => 1,
|
||||
'design_field_border_radius' => 2,
|
||||
'design_field_background_color' => '#ffffff',
|
||||
'design_button_font_size' => 14,
|
||||
'design_button_text_color' => '',
|
||||
'design_button_border_color' => '#2271b1',
|
||||
'design_button_border_width' => 0,
|
||||
'design_button_border_radius' => 2,
|
||||
'design_button_background_color' => '#2271b1',
|
||||
'design_button_hover_text_color' => '',
|
||||
'design_button_hover_border_color' => '',
|
||||
'design_button_hover_background_color' => '',
|
||||
'design_custom_css' => ''
|
||||
);
|
||||
|
||||
return $defaults;
|
||||
} // default_options
|
||||
|
||||
|
||||
/**
|
||||
* Sanitize settings on save
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return array updated options
|
||||
*
|
||||
*/
|
||||
static function sanitize_settings($options)
|
||||
{
|
||||
$old_options = self::get_options();
|
||||
|
||||
if (isset($options['captcha_verified']) && $options['captcha_verified'] != 1 && $options['captcha'] != 'disabled') {
|
||||
$options['captcha'] = $old_options['captcha'];
|
||||
$options['captcha_site_key'] = $old_options['captcha_site_key'];
|
||||
$options['captcha_secret_key'] = $old_options['captcha_secret_key'];
|
||||
}
|
||||
|
||||
if (isset($options['captcha']) && ($options['captcha'] == 'disabled' || $options['captcha'] == 'builtin')) {
|
||||
$options['captcha_site_key'] = '';
|
||||
$options['captcha_secret_key'] = '';
|
||||
}
|
||||
|
||||
if (isset($_POST['submit'])) {
|
||||
foreach ($options as $key => $value) {
|
||||
switch ($key) {
|
||||
case 'lockout_invalid_usernames':
|
||||
case 'mask_login_errors':
|
||||
case 'show_credit_link':
|
||||
$options[$key] = trim($value);
|
||||
break;
|
||||
case 'max_login_retries':
|
||||
case 'retries_within':
|
||||
case 'lockout_length':
|
||||
$options[$key] = (int) $value;
|
||||
break;
|
||||
} // switch
|
||||
} // foreach
|
||||
}
|
||||
|
||||
if (!isset($options['login_protection'])) {
|
||||
$options['login_protection'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($options['lockout_invalid_usernames'])) {
|
||||
$options['lockout_invalid_usernames'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($options['mask_login_errors'])) {
|
||||
$options['mask_login_errors'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($options['anonymous_logging'])) {
|
||||
$options['anonymous_logging'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($options['block_bots'])) {
|
||||
$options['block_bots'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($options['instant_block_nonusers'])) {
|
||||
$options['instant_block_nonusers'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($options['country_blocking_mode'])) {
|
||||
$options['country_blocking_mode'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($options['block_undetermined_countries'])) {
|
||||
$options['block_undetermined_countries'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($options['global_block'])) {
|
||||
$options['global_block'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($options['country_global_block'])) {
|
||||
$options['country_global_block'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($options['uninstall_delete'])) {
|
||||
$options['uninstall_delete'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($options['show_credit_link'])) {
|
||||
$options['show_credit_link'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($options['firewall_block_bots'])) {
|
||||
$options['firewall_block_bots'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($options['firewall_directory_traversal'])) {
|
||||
$options['firewall_directory_traversal'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($options['log_passwords'])) {
|
||||
$options['log_passwords'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($options['captcha_show_login'])) {
|
||||
$options['captcha_show_login'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($options['captcha_show_wp_registration'])) {
|
||||
$options['captcha_show_wp_registration'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($options['captcha_show_wp_lost_password'])) {
|
||||
$options['captcha_show_wp_lost_password'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($options['captcha_show_wp_comment'])) {
|
||||
$options['captcha_show_wp_comment'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($options['captcha_show_woo_registration'])) {
|
||||
$options['captcha_show_woo_registration'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($options['captcha_show_woo_checkout'])) {
|
||||
$options['captcha_show_woo_checkout'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($options['design_enable'])) {
|
||||
$options['design_enable'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($options['captcha_show_edd_registration'])) {
|
||||
$options['captcha_show_edd_registration'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($options['captcha_show_bp_registration'])) {
|
||||
$options['captcha_show_bp_registration'] = 0;
|
||||
}
|
||||
|
||||
if (isset($_POST['wpcaptcha_import_file'])) {
|
||||
$mimes = array(
|
||||
'text/plain',
|
||||
'text/anytext',
|
||||
'application/txt'
|
||||
);
|
||||
|
||||
if (!in_array($_FILES['wpcaptcha_import_file']['type'], $mimes)) {
|
||||
WPCaptcha_Utility::display_notice(
|
||||
sprintf(
|
||||
"WARNING: Not a valid CSV file - the Mime Type '%s' is wrong! No settings have been imported.",
|
||||
$_FILES['wpcaptcha_import_file']['type']
|
||||
),
|
||||
"error"
|
||||
);
|
||||
} else if (($handle = fopen($_FILES['wpcaptcha_import_file']['tmp_name'], "r")) !== false) {
|
||||
$options_json = json_decode(fread($handle, 8192), ARRAY_A);
|
||||
|
||||
if (is_array($options_json) && array_key_exists('max_login_retries', $options_json) && array_key_exists('retries_within', $options_json) && array_key_exists('lockout_length', $options_json)) {
|
||||
$options = $options_json;
|
||||
WPCaptcha_Utility::display_notice("Settings have been imported.", "success");
|
||||
} else {
|
||||
WPCaptcha_Utility::display_notice("Invalid import file! No settings have been imported.", "error");
|
||||
}
|
||||
} else {
|
||||
WPCaptcha_Utility::display_notice("Invalid import file! No settings have been imported.", "error");
|
||||
}
|
||||
}
|
||||
|
||||
if ($old_options['firewall_block_bots'] != $options['firewall_block_bots'] || $old_options['firewall_directory_traversal'] != $options['firewall_directory_traversal']) {
|
||||
self::firewall_setup($options);
|
||||
}
|
||||
|
||||
WPCaptcha_Utility::clear_3rdparty_cache();
|
||||
$options['last_options_edit'] = current_time('mysql', true);
|
||||
|
||||
return array_merge($old_options, $options);
|
||||
} // sanitize_settings
|
||||
|
||||
/**
|
||||
* Get plugin metadata
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return array meta
|
||||
*
|
||||
*/
|
||||
static function get_meta()
|
||||
{
|
||||
$meta = get_option(WPCAPTCHA_META_KEY, array());
|
||||
|
||||
if (!is_array($meta) || empty($meta)) {
|
||||
$meta['first_version'] = self::get_plugin_version();
|
||||
$meta['first_install'] = current_time('timestamp');
|
||||
update_option(WPCAPTCHA_META_KEY, $meta);
|
||||
}
|
||||
|
||||
return $meta;
|
||||
} // get_meta
|
||||
|
||||
static function update_meta($key, $value)
|
||||
{
|
||||
$meta = get_option(WPCAPTCHA_META_KEY, array());
|
||||
$meta[$key] = $value;
|
||||
update_option(WPCAPTCHA_META_KEY, $meta);
|
||||
} // update_meta
|
||||
|
||||
/**
|
||||
* Register custom tables
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return null
|
||||
*
|
||||
*/
|
||||
static function register_custom_tables()
|
||||
{
|
||||
global $wpdb;
|
||||
|
||||
$wpdb->wpcatcha_login_fails = $wpdb->prefix . 'wpc_login_fails';
|
||||
$wpdb->wpcatcha_accesslocks = $wpdb->prefix . 'wpc_accesslocks';
|
||||
} // register_custom_tables
|
||||
|
||||
/**
|
||||
* Create custom tables
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return null
|
||||
*
|
||||
*/
|
||||
static function create_custom_tables()
|
||||
{
|
||||
global $wpdb;
|
||||
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
|
||||
|
||||
self::register_custom_tables();
|
||||
|
||||
$wpcaptcha_login_fails = "CREATE TABLE " . $wpdb->wpcatcha_login_fails . " (
|
||||
`login_attempt_ID` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`user_id` bigint(20) NOT NULL,
|
||||
`login_attempt_date` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`login_attempt_IP` varchar(100) NOT NULL default '',
|
||||
`failed_user` varchar(200) NOT NULL default '',
|
||||
`failed_pass` varchar(200) NOT NULL default '',
|
||||
`reason` varchar(200) NULL,
|
||||
PRIMARY KEY (`login_attempt_ID`)
|
||||
);";
|
||||
dbDelta($wpcaptcha_login_fails);
|
||||
|
||||
$wpcaptcha_accesslocks = "CREATE TABLE " . $wpdb->wpcatcha_accesslocks . " (
|
||||
`accesslock_ID` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`user_id` bigint(20) NOT NULL,
|
||||
`accesslock_date` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`release_date` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`accesslock_IP` varchar(100) NOT NULL default '',
|
||||
`reason` varchar(200) NULL,
|
||||
`unlocked` smallint(20) NOT NULL default '0',
|
||||
PRIMARY KEY (`accesslock_ID`)
|
||||
);";
|
||||
dbDelta($wpcaptcha_accesslocks);
|
||||
|
||||
self::update_meta('database_ver', self::$version);
|
||||
} // create_custom_tables
|
||||
|
||||
|
||||
static function firewall_setup($options = false)
|
||||
{
|
||||
self::setup_wp_filesystem();
|
||||
self::firewall_remove_rules();
|
||||
|
||||
if (false === $options) {
|
||||
$options = get_option(WPCAPTCHA_OPTIONS_KEY, array());
|
||||
}
|
||||
|
||||
$htaccess = self::$wp_filesystem->get_contents(WPCaptcha_Utility::get_home_path() . '.htaccess');
|
||||
|
||||
$firewall_rules = [];
|
||||
$firewall_rules[] = '# BEGIN WP Captcha Firewall';
|
||||
|
||||
if ($options['firewall_block_bots']) {
|
||||
$firewall_rules[] = '<IfModule mod_rewrite.c>';
|
||||
|
||||
$firewall_rules[] = 'RewriteCond %{HTTP_USER_AGENT} (ahrefs|alexibot|majestic|mj12bot|rogerbot) [NC,OR]';
|
||||
$firewall_rules[] = 'RewriteCond %{HTTP_USER_AGENT} (econtext|eolasbot|eventures|liebaofast|nominet|oppo\sa33) [NC,OR]';
|
||||
$firewall_rules[] = 'RewriteCond %{HTTP_USER_AGENT} (ahrefs|alexibot|majestic|mj12bot|rogerbot) [NC,OR]';
|
||||
$firewall_rules[] = 'RewriteCond %{HTTP_USER_AGENT} (econtext|eolasbot|eventures|liebaofast|nominet|oppo\sa33) [NC,OR]';
|
||||
$firewall_rules[] = 'RewriteCond %{HTTP_USER_AGENT} (acapbot|acoonbot|asterias|attackbot|backdorbot|becomebot|binlar|blackwidow|blekkobot|blexbot|blowfish|bullseye|bunnys|butterfly|careerbot|casper|checkpriv|cheesebot|cherrypick|chinaclaw|choppy|clshttp|cmsworld|copernic|copyrightcheck|cosmos|crescent|cy_cho|datacha|demon|diavol|discobot|dittospyder|dotbot|dotnetdotcom|dumbot|emailcollector|emailsiphon|emailwolf|extract|eyenetie|feedfinder|flaming|flashget|flicky|foobot|g00g1e|getright|gigabot|go-ahead-got|gozilla|grabnet|grafula|harvest|heritrix|httrack|icarus6j|jetbot|jetcar|jikespider|kmccrew|leechftp|libweb|linkextractor|linkscan|linkwalker|loader|masscan|miner|mechanize|morfeus|moveoverbot|netmechanic|netspider|nicerspro|nikto|ninja|nutch|octopus|pagegrabber|petalbot|planetwork|postrank|proximic|purebot|pycurl|python|queryn|queryseeker|radian6|radiation|realdownload|scooter|seekerspider|semalt|siclab|sindice|sistrix|sitebot|siteexplorer|sitesnagger|skygrid|smartdownload|snoopy|sosospider|spankbot|spbot|sqlmap|stackrambler|stripper|sucker|surftbot|sux0r|suzukacz|suzuran|takeout|teleport|telesoft|true_robots|turingos|turnit|vampire|vikspider|voideye|webleacher|webreaper|webstripper|webvac|webviewer|webwhacker|winhttp|wwwoffle|woxbot|xaldon|xxxyy|yamanalab|yioopbot|youda|zeus|zmeu|zune|zyborg) [NC]';
|
||||
|
||||
$firewall_rules[] = 'RewriteCond %{REMOTE_HOST} (163data|amazonaws|colocrossing|crimea|g00g1e|justhost|kanagawa|loopia|masterhost|onlinehome|poneytel|sprintdatacenter|reverse.softlayer|safenet|ttnet|woodpecker|wowrack) [NC]';
|
||||
|
||||
$firewall_rules[] = 'RewriteCond %{HTTP_REFERER} (semalt\.com|todaperfeita) [NC,OR]';
|
||||
$firewall_rules[] = 'RewriteCond %{HTTP_REFERER} (blue\spill|cocaine|ejaculat|erectile|erections|hoodia|huronriveracres|impotence|levitra|libido|lipitor|phentermin|pro[sz]ac|sandyauer|tramadol|troyhamby|ultram|unicauca|valium|viagra|vicodin|xanax|ypxaieo) [NC]';
|
||||
|
||||
$firewall_rules[] = 'RewriteRule .* - [F,L]';
|
||||
$firewall_rules[] = '</IfModule>';
|
||||
}
|
||||
|
||||
if ($options['firewall_directory_traversal']) {
|
||||
$firewall_rules[] = '<IfModule mod_rewrite.c>';
|
||||
|
||||
$firewall_rules[] = 'RewriteCond %{QUERY_STRING} (((/|%2f){3,3})|((\.|%2e){3,3})|((\.|%2e){2,2})(/|%2f|%u2215)) [NC,OR]';
|
||||
$firewall_rules[] = 'RewriteCond %{QUERY_STRING} (/|%2f)(:|%3a)(/|%2f) [NC,OR]';
|
||||
$firewall_rules[] = 'RewriteCond %{QUERY_STRING} (/|%2f)(\*|%2a)(\*|%2a)(/|%2f) [NC,OR]';
|
||||
$firewall_rules[] = 'RewriteCond %{QUERY_STRING} (absolute_|base|root_)(dir|path)(=|%3d)(ftp|https?) [NC,OR]';
|
||||
$firewall_rules[] = 'RewriteCond %{QUERY_STRING} (/|%2f)(=|%3d|$&|_mm|cgi(\.|-)|inurl(:|%3a)(/|%2f)|(mod|path)(=|%3d)(\.|%2e)) [NC,OR]';
|
||||
|
||||
$firewall_rules[] = 'RewriteCond %{REQUEST_URI} (\^|`|<|>|\\\\|\|) [NC,OR]';
|
||||
$firewall_rules[] = 'RewriteCond %{REQUEST_URI} ([a-z0-9]{2000,}) [NC]';
|
||||
|
||||
$firewall_rules[] = 'RewriteRule .* - [F,L]';
|
||||
$firewall_rules[] = '</IfModule>';
|
||||
}
|
||||
|
||||
$firewall_rules[] = '# END WP Captcha Firewall';
|
||||
|
||||
$htaccess = implode(PHP_EOL, $firewall_rules) . PHP_EOL . $htaccess;
|
||||
|
||||
if (count($firewall_rules) > 2) {
|
||||
$firewall_test = self::firewall_test_htaccess($htaccess);
|
||||
if (is_wp_error($firewall_test)) {
|
||||
WPCaptcha_Utility::display_notice(
|
||||
$firewall_test->get_error_message(),
|
||||
"error"
|
||||
);
|
||||
} else {
|
||||
self::$wp_filesystem->put_contents(WPCaptcha_Utility::get_home_path() . '.htaccess', $htaccess);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static function firewall_test_htaccess($new_content)
|
||||
{
|
||||
$uploads_directory = wp_upload_dir();
|
||||
$test_id = rand(1000, 9999);
|
||||
$htaccess_test_folder = $uploads_directory['basedir'] . '/htaccess-test-' . $test_id . '/';
|
||||
$htaccess_test_url = $uploads_directory['baseurl'] . '/htaccess-test-' . $test_id . '/';
|
||||
|
||||
// Create test directory and files
|
||||
if (!self::$wp_filesystem->is_dir($htaccess_test_folder)) {
|
||||
if (true !== self::$wp_filesystem->mkdir($htaccess_test_folder, 0777)) {
|
||||
return new WP_Error('firewall_failed', 'Failed to create test directory. Please check that your uploads folder is writable.', false);
|
||||
}
|
||||
}
|
||||
|
||||
if (true !== self::$wp_filesystem->put_contents($htaccess_test_folder . 'index.html', 'htaccess-test-' . $test_id)) {
|
||||
return new WP_Error('firewall_failed', 'Failed to create test files. Please check that your uploads folder is writable.', false);
|
||||
}
|
||||
|
||||
if (true !== self::$wp_filesystem->put_contents($htaccess_test_folder . '.htaccess', $new_content)) {
|
||||
return new WP_Error('firewall_failed', 'Failed to create test directory and files. Please check that your uploads folder is writeable.', false);
|
||||
}
|
||||
|
||||
// Retrieve test file over http
|
||||
$response = wp_remote_get($htaccess_test_url . 'index.html', array('sslverify' => false, 'redirection' => 0));
|
||||
$response_code = wp_remote_retrieve_response_code($response);
|
||||
|
||||
// Remove Test Directory
|
||||
self::$wp_filesystem->delete($htaccess_test_folder . '.htaccess');
|
||||
self::$wp_filesystem->delete($htaccess_test_folder . 'index.html');
|
||||
self::$wp_filesystem->rmdir($htaccess_test_folder);
|
||||
|
||||
// Check if test file content is what we expect
|
||||
if ((in_array($response_code, range(200, 299)) && !is_wp_error($response) && wp_remote_retrieve_body($response) == 'htaccess-test-' . $test_id) || (in_array($response_code, range(300, 399)) && !is_wp_error($response))) {
|
||||
return true;
|
||||
} else {
|
||||
return new WP_Error('firewall_failed', 'Unfortunately it looks like installing these firewall rules could cause your entire site, including the admin, to become inaccessible. Fix the errors before saving', false);
|
||||
}
|
||||
}
|
||||
|
||||
static function firewall_remove_rules()
|
||||
{
|
||||
|
||||
if (self::$wp_filesystem->is_writable(WPCaptcha_Utility::get_home_path() . '.htaccess')) {
|
||||
|
||||
$htaccess_rules = self::$wp_filesystem->get_contents(WPCaptcha_Utility::get_home_path() . '.htaccess');
|
||||
|
||||
if ($htaccess_rules) {
|
||||
$htaccess_rules = explode(PHP_EOL, $htaccess_rules);
|
||||
$found = false;
|
||||
$new_content = '';
|
||||
|
||||
foreach ($htaccess_rules as $htaccess_rule) {
|
||||
if ($htaccess_rule == '# BEGIN WP Captcha Firewall') {
|
||||
$found = true;
|
||||
}
|
||||
|
||||
if (!$found) {
|
||||
$new_content .= $htaccess_rule . PHP_EOL;
|
||||
}
|
||||
|
||||
if ($htaccess_rule == '# END WP Captcha Firewall') {
|
||||
$found = false;
|
||||
}
|
||||
}
|
||||
|
||||
$new_content = trim($new_content, PHP_EOL);
|
||||
|
||||
$f = @fopen(WPCaptcha_Utility::get_home_path() . '.htaccess', 'w');
|
||||
self::$wp_filesystem->put_contents(WPCaptcha_Utility::get_home_path() . '.htaccess', $new_content);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Actions on plugin activation
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return null
|
||||
*
|
||||
*/
|
||||
static function activate()
|
||||
{
|
||||
self::create_custom_tables();
|
||||
WPCaptcha_Admin::reset_pointers();
|
||||
} // activate
|
||||
|
||||
|
||||
/**
|
||||
* Actions on plugin deactivaiton
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return null
|
||||
*
|
||||
*/
|
||||
static function deactivate()
|
||||
{
|
||||
} // deactivate
|
||||
|
||||
/**
|
||||
* Actions on plugin uninstall
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
static function uninstall()
|
||||
{
|
||||
global $wpdb;
|
||||
|
||||
$options = get_option(WPCAPTCHA_OPTIONS_KEY, array());
|
||||
|
||||
if ($options['uninstall_delete'] == '1') {
|
||||
delete_option(WPCAPTCHA_OPTIONS_KEY);
|
||||
delete_option(WPCAPTCHA_META_KEY);
|
||||
delete_option(WPCAPTCHA_POINTERS_KEY);
|
||||
delete_option(WPCAPTCHA_NOTICES_KEY);
|
||||
|
||||
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "wpc_login_fails");
|
||||
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "wpc_accesslocks");
|
||||
}
|
||||
} // uninstall
|
||||
} // class
|
63
wp-content/plugins/advanced-google-recaptcha/libs/stats.php
Normal file
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* WP Captcha
|
||||
* https://getwpcaptcha.com/
|
||||
* (c) WebFactory Ltd, 2022 - 2023, www.webfactoryltd.com
|
||||
*/
|
||||
|
||||
class WPCaptcha_Stats extends WPCaptcha
|
||||
{
|
||||
static public $stats_cutoff = 1;
|
||||
|
||||
/**
|
||||
* Get statistics
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @param string $type locks|fails
|
||||
* @param int $ndays period for statistics
|
||||
* @return bool
|
||||
*/
|
||||
static function get_stats($type = "locks", $ndays = 60)
|
||||
{
|
||||
global $wpdb;
|
||||
|
||||
$days = array();
|
||||
for ($i = $ndays; $i >= 0; $i--){
|
||||
$days[date("Y-m-d", strtotime('-' . $i . ' days'))] = 0;
|
||||
}
|
||||
|
||||
if ($type == 'locks') {
|
||||
$results = $wpdb->get_results("SELECT COUNT(*) as count,DATE_FORMAT(accesslock_date, '%Y-%m-%d') AS date FROM " . $wpdb->wpcatcha_accesslocks . " GROUP BY DATE_FORMAT(accesslock_date, '%Y%m%d')");
|
||||
} else {
|
||||
$results = $wpdb->get_results("SELECT COUNT(*) as count,DATE_FORMAT(login_attempt_date, '%Y-%m-%d') AS date FROM " . $wpdb->wpcatcha_login_fails . " GROUP BY DATE_FORMAT(login_attempt_date, '%Y%m%d')");
|
||||
}
|
||||
|
||||
$total = 0;
|
||||
|
||||
foreach ($results as $day) {
|
||||
if(array_key_exists($day->date, $days)){
|
||||
$days[$day->date] = $day->count;
|
||||
$total += $day->count;
|
||||
}
|
||||
}
|
||||
|
||||
if ($total < self::$stats_cutoff) {
|
||||
$stats['days'] = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20);
|
||||
$stats['count'] = array(3, 4, 67, 76, 45, 32, 134, 6, 65, 65, 56, 123, 156, 156, 123, 156, 67, 88, 54, 178);
|
||||
$stats['total'] = $total;
|
||||
|
||||
return $stats;
|
||||
}
|
||||
|
||||
$stats = array('days' => array(), 'count' => array(), 'total' => 0);
|
||||
foreach ($days as $day => $count) {
|
||||
$stats['days'][] = $day;
|
||||
$stats['count'][] = $count;
|
||||
$stats['total'] += $count;
|
||||
}
|
||||
$stats['period'] = $ndays;
|
||||
return $stats;
|
||||
} // get_stats
|
||||
|
||||
} // class
|
594
wp-content/plugins/advanced-google-recaptcha/libs/utility.php
Normal file
@ -0,0 +1,594 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* WP Captcha
|
||||
* https://getwpcaptcha.com/
|
||||
* (c) WebFactory Ltd, 2022 - 2023, www.webfactoryltd.com
|
||||
*/
|
||||
|
||||
use WFMaxMind\Db\Reader;
|
||||
|
||||
class WPCaptcha_Utility extends WPCaptcha
|
||||
{
|
||||
/**
|
||||
* Display settings notice
|
||||
*
|
||||
* @param $redirect
|
||||
* @return bool
|
||||
*/
|
||||
static function display_notice($message, $type = 'error', $code = 'advanced-google-recaptcha')
|
||||
{
|
||||
global $wp_settings_errors;
|
||||
|
||||
$wp_settings_errors[] = array(
|
||||
'setting' => WPCAPTCHA_OPTIONS_KEY,
|
||||
'code' => $code,
|
||||
'message' => $message,
|
||||
'type' => $type
|
||||
);
|
||||
set_transient('settings_errors', $wp_settings_errors);
|
||||
} // display_notice
|
||||
|
||||
/**
|
||||
* Empty cache in various 3rd party plugins
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return null
|
||||
*
|
||||
*/
|
||||
static function clear_3rdparty_cache()
|
||||
{
|
||||
if (function_exists('w3tc_pgcache_flush')) {
|
||||
w3tc_pgcache_flush();
|
||||
}
|
||||
if (function_exists('wp_cache_clean_cache')) {
|
||||
global $file_prefix;
|
||||
wp_cache_clean_cache($file_prefix);
|
||||
}
|
||||
if (function_exists('wp_cache_clear_cache')) {
|
||||
wp_cache_clear_cache();
|
||||
}
|
||||
if (class_exists('Endurance_Page_Cache')) {
|
||||
$epc = new Endurance_Page_Cache;
|
||||
$epc->purge_all();
|
||||
}
|
||||
if (method_exists('SG_CachePress_Supercacher', 'purge_cache')) {
|
||||
SG_CachePress_Supercacher::purge_cache(true);
|
||||
}
|
||||
|
||||
if (class_exists('SiteGround_Optimizer\Supercacher\Supercacher')) {
|
||||
SiteGround_Optimizer\Supercacher\Supercacher::purge_cache();
|
||||
}
|
||||
} // empty_3rdparty_cache
|
||||
|
||||
|
||||
/**
|
||||
* Dismiss pointer
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return null
|
||||
*
|
||||
*/
|
||||
static function dismiss_pointer_ajax()
|
||||
{
|
||||
delete_option(WPCAPTCHA_POINTERS_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* checkbox helper function
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return string checked HTML
|
||||
*
|
||||
*/
|
||||
static function checked($value, $current, $echo = false)
|
||||
{
|
||||
$out = '';
|
||||
|
||||
if (!is_array($current)) {
|
||||
$current = (array) $current;
|
||||
}
|
||||
|
||||
if (in_array($value, $current)) {
|
||||
$out = ' checked="checked" ';
|
||||
}
|
||||
|
||||
if ($echo) {
|
||||
WPCaptcha_Utility::wp_kses_wf($out);
|
||||
} else {
|
||||
return $out;
|
||||
}
|
||||
} // checked
|
||||
|
||||
/**
|
||||
* Create toggle switch
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return string Switch HTML
|
||||
*
|
||||
*/
|
||||
static function create_toggle_switch($name, $options = array(), $output = true, $class = '')
|
||||
{
|
||||
$default_options = array('value' => '1', 'saved_value' => '', 'option_key' => $name);
|
||||
$options = array_merge($default_options, $options);
|
||||
|
||||
$out = "\n";
|
||||
$out .= '<div class="toggle-wrapper">';
|
||||
$out .= '<input class="' . $class . '" type="checkbox" id="' . $name . '" ' . self::checked($options['value'], $options['saved_value']) . ' type="checkbox" value="' . $options['value'] . '" name="' . $options['option_key'] . '">';
|
||||
$out .= '<label for="' . $name . '" class="toggle"><span class="toggle_handler"></span></label>';
|
||||
$out .= '</div>';
|
||||
|
||||
if ($output) {
|
||||
WPCaptcha_Utility::wp_kses_wf($out);
|
||||
} else {
|
||||
return $out;
|
||||
}
|
||||
} // create_toggle_switch
|
||||
|
||||
/**
|
||||
* Get user IP
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @return string userip
|
||||
*
|
||||
*/
|
||||
static function getUserIP($force_clear = false)
|
||||
{
|
||||
$options = WPCaptcha_Setup::get_options();
|
||||
$ip = '';
|
||||
|
||||
if (!empty($_SERVER['REMOTE_ADDR'])) {
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
|
||||
if ($options['anonymous_logging'] == '1' && !$force_clear) {
|
||||
$ip = md5($ip);
|
||||
}
|
||||
|
||||
return $ip;
|
||||
} // getUserIP
|
||||
|
||||
/**
|
||||
* Create select options for select
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @param array $options options
|
||||
* @param string $selected selected value
|
||||
* @param bool $output echo, if false return html as string
|
||||
* @return string html with options
|
||||
*/
|
||||
static function create_select_options($options, $selected = null, $output = true)
|
||||
{
|
||||
$out = "\n";
|
||||
|
||||
foreach ($options as $tmp) {
|
||||
if ((is_array($selected) && in_array($tmp['val'], $selected)) || $selected == $tmp['val']) {
|
||||
$out .= "<option selected=\"selected\" value=\"{$tmp['val']}\" " . (isset($tmp['class']) ? "class=\"{$tmp['class']}\"" : "") . ">{$tmp['label']} </option>\n";
|
||||
} else {
|
||||
$out .= "<option value=\"{$tmp['val']}\" " . (isset($tmp['class']) ? "class=\"{$tmp['class']}\"" : "") . ">{$tmp['label']} </option>\n";
|
||||
}
|
||||
}
|
||||
|
||||
if ($output) {
|
||||
WPCaptcha_Utility::wp_kses_wf($out);
|
||||
} else {
|
||||
return $out;
|
||||
}
|
||||
} // create_select_options
|
||||
|
||||
|
||||
static function create_radio_group($name, $options, $selected = null, $output = true)
|
||||
{
|
||||
$out = "\n";
|
||||
|
||||
foreach ($options as $tmp) {
|
||||
if ($selected == $tmp['val']) {
|
||||
$out .= "<label for=\"{$name}_{$tmp['val']}\" class=\"radio_wrapper\"><input id=\"{$name}_{$tmp['val']}\" name=\"{$name}\" type=\"radio\" checked=\"checked\" value=\"{$tmp['val']}\">{$tmp['label']} </option></label>\n";
|
||||
} else {
|
||||
$out .= "<label for=\"{$name}_{$tmp['val']}\" class=\"radio_wrapper\"><input id=\"{$name}_{$tmp['val']}\" name=\"{$name}\" type=\"radio\" value=\"{$tmp['val']}\">{$tmp['label']} </option></label>\n";
|
||||
}
|
||||
}
|
||||
|
||||
if ($output) {
|
||||
WPCaptcha_Utility::wp_kses_wf($out);
|
||||
} else {
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse user agent to add device icon and clean text
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @param string $user_agent
|
||||
* @return string $user_agent
|
||||
*/
|
||||
static function parse_user_agent($user_agent = false)
|
||||
{
|
||||
if (!$user_agent) {
|
||||
$user_agent = array();
|
||||
foreach ($_SERVER as $name => $value) {
|
||||
if (substr($name, 0, 5) == 'HTTP_') {
|
||||
$user_agent[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$user_agent = new WhichBrowser\Parser($user_agent);
|
||||
|
||||
$user_agent_string = '';
|
||||
if ($user_agent->isType('mobile')) {
|
||||
$user_agent_string .= '<i class="tooltip fas fa-mobile-alt" title="Phone"></i>';
|
||||
} else if ($user_agent->isType('tablet')) {
|
||||
$user_agent_string .= '<i class="tooltip fas fa-tablet-alt" title="Table"></i>';
|
||||
} else if ($user_agent->isType('desktop')) {
|
||||
$user_agent_string .= '<i class="tooltip fas fa-desktop" title="Desktop"></i>';
|
||||
} else {
|
||||
$user_agent_string .= '<i class="tooltip fas fa-robot" title="Bot"></i>';
|
||||
}
|
||||
|
||||
if (isset($user_agent->browser) && isset($user_agent->browser->version)) {
|
||||
$browser_version = explode('.', $user_agent->browser->version->toString());
|
||||
} else {
|
||||
$browser_version = array('unknown');
|
||||
}
|
||||
|
||||
if ($user_agent->os) {
|
||||
$os = $user_agent->os->toString();
|
||||
} else {
|
||||
$os = 'unknown';
|
||||
}
|
||||
|
||||
if (isset($user_agent->browser) && isset($user_agent->browser->name)) {
|
||||
$browser_name = $user_agent->browser->name;
|
||||
} else {
|
||||
$browser_name = 'unknown';
|
||||
}
|
||||
|
||||
$user_agent_string .= ' ' . $browser_name . ' ' . $browser_version[0] . ' on ' . $os;
|
||||
|
||||
|
||||
return $user_agent_string;
|
||||
} // parse_user_agent
|
||||
|
||||
static function get_home_path()
|
||||
{
|
||||
|
||||
if (!function_exists('get_home_path')) {
|
||||
|
||||
require_once(ABSPATH . 'wp-admin/includes/file.php');
|
||||
}
|
||||
|
||||
return get_home_path();
|
||||
}
|
||||
|
||||
static function wp_kses_wf($html)
|
||||
{
|
||||
add_filter('safe_style_css', function ($styles) {
|
||||
$styles_wf = array(
|
||||
'text-align',
|
||||
'margin',
|
||||
'color',
|
||||
'float',
|
||||
'border',
|
||||
'background',
|
||||
'background-color',
|
||||
'border-bottom',
|
||||
'border-bottom-color',
|
||||
'border-bottom-style',
|
||||
'border-bottom-width',
|
||||
'border-collapse',
|
||||
'border-color',
|
||||
'border-left',
|
||||
'border-left-color',
|
||||
'border-left-style',
|
||||
'border-left-width',
|
||||
'border-right',
|
||||
'border-right-color',
|
||||
'border-right-style',
|
||||
'border-right-width',
|
||||
'border-spacing',
|
||||
'border-style',
|
||||
'border-top',
|
||||
'border-top-color',
|
||||
'border-top-style',
|
||||
'border-top-width',
|
||||
'border-width',
|
||||
'caption-side',
|
||||
'clear',
|
||||
'cursor',
|
||||
'direction',
|
||||
'font',
|
||||
'font-family',
|
||||
'font-size',
|
||||
'font-style',
|
||||
'font-variant',
|
||||
'font-weight',
|
||||
'height',
|
||||
'letter-spacing',
|
||||
'line-height',
|
||||
'margin-bottom',
|
||||
'margin-left',
|
||||
'margin-right',
|
||||
'margin-top',
|
||||
'overflow',
|
||||
'padding',
|
||||
'padding-bottom',
|
||||
'padding-left',
|
||||
'padding-right',
|
||||
'padding-top',
|
||||
'text-decoration',
|
||||
'text-indent',
|
||||
'vertical-align',
|
||||
'width',
|
||||
'display',
|
||||
);
|
||||
|
||||
foreach ($styles_wf as $style_wf) {
|
||||
$styles[] = $style_wf;
|
||||
}
|
||||
return $styles;
|
||||
});
|
||||
|
||||
$allowed_tags = wp_kses_allowed_html('post');
|
||||
$allowed_tags['input'] = array(
|
||||
'type' => true,
|
||||
'style' => true,
|
||||
'class' => true,
|
||||
'id' => true,
|
||||
'checked' => true,
|
||||
'disabled' => true,
|
||||
'name' => true,
|
||||
'size' => true,
|
||||
'placeholder' => true,
|
||||
'value' => true,
|
||||
'data-*' => true,
|
||||
'size' => true,
|
||||
'disabled' => true
|
||||
);
|
||||
|
||||
$allowed_tags['textarea'] = array(
|
||||
'type' => true,
|
||||
'style' => true,
|
||||
'class' => true,
|
||||
'id' => true,
|
||||
'checked' => true,
|
||||
'disabled' => true,
|
||||
'name' => true,
|
||||
'size' => true,
|
||||
'placeholder' => true,
|
||||
'value' => true,
|
||||
'data-*' => true,
|
||||
'cols' => true,
|
||||
'rows' => true,
|
||||
'disabled' => true,
|
||||
'autocomplete' => true
|
||||
);
|
||||
|
||||
$allowed_tags['select'] = array(
|
||||
'type' => true,
|
||||
'style' => true,
|
||||
'class' => true,
|
||||
'id' => true,
|
||||
'checked' => true,
|
||||
'disabled' => true,
|
||||
'name' => true,
|
||||
'size' => true,
|
||||
'placeholder' => true,
|
||||
'value' => true,
|
||||
'data-*' => true,
|
||||
'multiple' => true,
|
||||
'disabled' => true
|
||||
);
|
||||
|
||||
$allowed_tags['option'] = array(
|
||||
'type' => true,
|
||||
'style' => true,
|
||||
'class' => true,
|
||||
'id' => true,
|
||||
'checked' => true,
|
||||
'disabled' => true,
|
||||
'name' => true,
|
||||
'size' => true,
|
||||
'placeholder' => true,
|
||||
'value' => true,
|
||||
'selected' => true,
|
||||
'data-*' => true
|
||||
);
|
||||
$allowed_tags['optgroup'] = array(
|
||||
'type' => true,
|
||||
'style' => true,
|
||||
'class' => true,
|
||||
'id' => true,
|
||||
'checked' => true,
|
||||
'disabled' => true,
|
||||
'name' => true,
|
||||
'size' => true,
|
||||
'placeholder' => true,
|
||||
'value' => true,
|
||||
'selected' => true,
|
||||
'data-*' => true,
|
||||
'label' => true
|
||||
);
|
||||
|
||||
$allowed_tags['a'] = array(
|
||||
'href' => true,
|
||||
'data-*' => true,
|
||||
'class' => true,
|
||||
'style' => true,
|
||||
'id' => true,
|
||||
'target' => true,
|
||||
'data-*' => true,
|
||||
'role' => true,
|
||||
'aria-controls' => true,
|
||||
'aria-selected' => true,
|
||||
'disabled' => true
|
||||
);
|
||||
|
||||
$allowed_tags['div'] = array(
|
||||
'style' => true,
|
||||
'class' => true,
|
||||
'id' => true,
|
||||
'data-*' => true,
|
||||
'role' => true,
|
||||
'aria-labelledby' => true,
|
||||
'value' => true,
|
||||
'aria-modal' => true,
|
||||
'tabindex' => true
|
||||
);
|
||||
|
||||
$allowed_tags['li'] = array(
|
||||
'style' => true,
|
||||
'class' => true,
|
||||
'id' => true,
|
||||
'data-*' => true,
|
||||
'role' => true,
|
||||
'aria-labelledby' => true,
|
||||
'value' => true,
|
||||
'aria-modal' => true,
|
||||
'tabindex' => true
|
||||
);
|
||||
|
||||
$allowed_tags['span'] = array(
|
||||
'style' => true,
|
||||
'class' => true,
|
||||
'id' => true,
|
||||
'data-*' => true,
|
||||
'aria-hidden' => true
|
||||
);
|
||||
|
||||
$allowed_tags['style'] = array(
|
||||
'class' => true,
|
||||
'id' => true,
|
||||
'type' => true,
|
||||
'style' => true
|
||||
);
|
||||
|
||||
$allowed_tags['fieldset'] = array(
|
||||
'class' => true,
|
||||
'id' => true,
|
||||
'type' => true,
|
||||
'style' => true
|
||||
);
|
||||
|
||||
$allowed_tags['link'] = array(
|
||||
'class' => true,
|
||||
'id' => true,
|
||||
'type' => true,
|
||||
'rel' => true,
|
||||
'href' => true,
|
||||
'media' => true,
|
||||
'style' => true
|
||||
);
|
||||
|
||||
$allowed_tags['form'] = array(
|
||||
'style' => true,
|
||||
'class' => true,
|
||||
'id' => true,
|
||||
'method' => true,
|
||||
'action' => true,
|
||||
'data-*' => true,
|
||||
'style' => true
|
||||
);
|
||||
|
||||
$allowed_tags['script'] = array(
|
||||
'class' => true,
|
||||
'id' => true,
|
||||
'type' => true,
|
||||
'src' => true,
|
||||
'style' => true
|
||||
);
|
||||
|
||||
$allowed_tags['table'] = array(
|
||||
'class' => true,
|
||||
'id' => true,
|
||||
'type' => true,
|
||||
'cellpadding' => true,
|
||||
'cellspacing' => true,
|
||||
'border' => true,
|
||||
'style' => true
|
||||
);
|
||||
|
||||
$allowed_tags['canvas'] = array(
|
||||
'class' => true,
|
||||
'id' => true,
|
||||
'style' => true
|
||||
);
|
||||
|
||||
echo wp_kses($html, $allowed_tags);
|
||||
|
||||
add_filter('safe_style_css', function ($styles) {
|
||||
$styles_wf = array(
|
||||
'text-align',
|
||||
'margin',
|
||||
'color',
|
||||
'float',
|
||||
'border',
|
||||
'background',
|
||||
'background-color',
|
||||
'border-bottom',
|
||||
'border-bottom-color',
|
||||
'border-bottom-style',
|
||||
'border-bottom-width',
|
||||
'border-collapse',
|
||||
'border-color',
|
||||
'border-left',
|
||||
'border-left-color',
|
||||
'border-left-style',
|
||||
'border-left-width',
|
||||
'border-right',
|
||||
'border-right-color',
|
||||
'border-right-style',
|
||||
'border-right-width',
|
||||
'border-spacing',
|
||||
'border-style',
|
||||
'border-top',
|
||||
'border-top-color',
|
||||
'border-top-style',
|
||||
'border-top-width',
|
||||
'border-width',
|
||||
'caption-side',
|
||||
'clear',
|
||||
'cursor',
|
||||
'direction',
|
||||
'font',
|
||||
'font-family',
|
||||
'font-size',
|
||||
'font-style',
|
||||
'font-variant',
|
||||
'font-weight',
|
||||
'height',
|
||||
'letter-spacing',
|
||||
'line-height',
|
||||
'margin-bottom',
|
||||
'margin-left',
|
||||
'margin-right',
|
||||
'margin-top',
|
||||
'overflow',
|
||||
'padding',
|
||||
'padding-bottom',
|
||||
'padding-left',
|
||||
'padding-right',
|
||||
'padding-top',
|
||||
'text-decoration',
|
||||
'text-indent',
|
||||
'vertical-align',
|
||||
'width'
|
||||
);
|
||||
|
||||
foreach ($styles_wf as $style_wf) {
|
||||
if (($key = array_search($style_wf, $styles)) !== false) {
|
||||
unset($styles[$key]);
|
||||
}
|
||||
}
|
||||
return $styles;
|
||||
});
|
||||
}
|
||||
} // class
|
280
wp-content/plugins/advanced-google-recaptcha/license.txt
Normal file
@ -0,0 +1,280 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
154
wp-content/plugins/advanced-google-recaptcha/readme.txt
Normal file
@ -0,0 +1,154 @@
|
||||
=== Advanced Google reCAPTCHA ===
|
||||
|
||||
Contributors: WebFactory
|
||||
Tags: captcha, recaptcha, google recaptcha, comment recaptcha, login recaptcha, brute force, spam, bots, protect, registration, google captcha, woocommerce recaptcha, comments captcha
|
||||
Requires at least: 4.9
|
||||
Requires PHP: 5.6
|
||||
Tested up to: 6.4
|
||||
Stable tag: 1.17
|
||||
License: GPLv3
|
||||
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
Captcha protection against spam comments & brute force login attacks using Google reCAPTCHA.
|
||||
|
||||
== Description ==
|
||||
<a href="https://getwpcaptcha.com/">Advanced Google reCAPTCHA</a> protects your WordPress site from spam comments & brute force login attacks using captcha. This captcha plugin, quickly adds Google reCAPTCHA and other captcha tests to WordPress comment form, login form, and other forms.
|
||||
|
||||
Using Advanced Google reCAPTCHA (most popular captcha on the market), you'll be safe from spam comments and protect user accounts, WooCommerce, Easy Digital Downloads, BuddyPress and other forms from brute-force login attacks.
|
||||
|
||||
Works for:
|
||||
|
||||
* Login Form
|
||||
* Registration Form
|
||||
* Reset Password Form
|
||||
* Comment Form
|
||||
* BuddyPress Form
|
||||
* WooCommerce Form
|
||||
* Easy Digital Downloads (EDD) Login Form
|
||||
* Easy Digital Downloads (EDD) Registration Form
|
||||
|
||||
|
||||
Plugin uses these 3rd party libs:
|
||||
|
||||
* Chart.js, 2017 Nick Downie, MIT
|
||||
* DataTables, 2008-2017 SpryMedia Ltd, MIT
|
||||
* moment.js, Tim Wood, Iskren Chernev, MIT
|
||||
* SweetAlert 2, github.com/Sweetalert2/Sweetalert2, MIT
|
||||
* tooltipster, www.heteroclito.fr/modules/tooltipster/, MIT
|
||||
|
||||
|
||||
== Installation ==
|
||||
|
||||
1. Upload Advanced Google reCAPTCHA files to the "/wp-content/plugins/advanced-google-recaptcha" directory, or install Advanced Google reCAPTCHA through the WordPress Plugins page directly.
|
||||
2. Activate Advanced Google reCAPTCHA through the WordPress Plugins page.
|
||||
3. Use the menu Advanced Google reCAPTCHA to configure it.
|
||||
|
||||
== Frequently Asked Questions ==
|
||||
|
||||
= How to disable this plugin? =
|
||||
|
||||
Just use standard Plugin overview page in WordPress admin section and deactivate it or rename plugin folder /wp-content/plugins/advanced-google-recaptcha over FTP access.
|
||||
|
||||
= Does Captcha work for comment form? =
|
||||
|
||||
Yes, it works for WordPress comment form.
|
||||
|
||||
= Will it slow my site down? =
|
||||
|
||||
No, it won't. It's only loaded on the pages it protects.
|
||||
|
||||
= How can I report security bugs? =
|
||||
|
||||
You can report security bugs through the Patchstack Vulnerability Disclosure Program. The Patchstack team help validate, triage and handle any security vulnerabilities. [Report a security vulnerability.](https://patchstack.com/database/vdp/advanced-google-recaptcha)
|
||||
|
||||
|
||||
== Screenshots ==
|
||||
|
||||
1. Login form
|
||||
2. Registration form
|
||||
3. Reset Password form
|
||||
4. Comment form
|
||||
5. BuddyPress form
|
||||
6. EDD Registration form
|
||||
7. EDD Login form
|
||||
8. WooCommerce Login and Registration form
|
||||
9. Plugin settings
|
||||
|
||||
== Changelog ==
|
||||
= 1.17 - 09/12/2023 =
|
||||
* security/fatal error fix
|
||||
|
||||
= 1.16 - 05/12/2023 =
|
||||
* Woo registration fix
|
||||
|
||||
= 1.15 - 30/11/2023 =
|
||||
* Woo compatibility fixes
|
||||
|
||||
= 1.14 - 19/11/2023 =
|
||||
* Theme My Login and Woo compatibility fixes
|
||||
|
||||
= 1.13 - 16/11/2023 =
|
||||
* compatibility fixes
|
||||
|
||||
= 1.12 - 02/11/2023 =
|
||||
* small bug fixes for Woo
|
||||
|
||||
= 1.11 - 01/11/2023 =
|
||||
* small bug fixes
|
||||
|
||||
= 1.1 - 31/10/2023 =
|
||||
* new GUI
|
||||
* new features
|
||||
* introduced the PRO version
|
||||
|
||||
= 1.0.15 - 29 May 2023 =
|
||||
* Update packages
|
||||
|
||||
= 1.0.14 - 20 Feb 2023 =
|
||||
* Fix PHP 8 issue
|
||||
|
||||
= 1.0.13 - 15 Dec 2022 =
|
||||
* Fix admin links
|
||||
|
||||
= 1.0.12 - 2 Nov 2022 =
|
||||
* Add option for Woo checkout
|
||||
|
||||
= 1.0.11 - 17 Oct 2022 =
|
||||
* Fix Woo reset password
|
||||
* Minor bug fixes
|
||||
|
||||
= 1.0.10 - 10 Oct 2022 =
|
||||
* Minor bug fixes
|
||||
|
||||
= 1.0.9 - 26 Jul 2022 =
|
||||
* Fix WooCommerce checkout registration
|
||||
* Minor bug fixes
|
||||
|
||||
= 1.0.8 - 26 May 2022 =
|
||||
* Minor bug fixes
|
||||
|
||||
= 1.0.7 - 6 May 2022 =
|
||||
* Minor bug fixes
|
||||
|
||||
= 1.0.6 - 23 Apr 2022 =
|
||||
* Minor bug fixes
|
||||
|
||||
= 1.0.5 - 22 Apr 2022 =
|
||||
* Minor bug fixes
|
||||
|
||||
= 1.0.4 - 31 Jan 2022 =
|
||||
* Minor bug fixes
|
||||
|
||||
= 1.0.3 - 15 Jul 2021 =
|
||||
* Update links
|
||||
* Minor bug fixes
|
||||
|
||||
= 1.0.2 - 13 Jun 2021 =
|
||||
* Minor bug fixes
|
||||
|
||||
= 1.0.1 - 12 May 2021 =
|
||||
* Admin style updated
|
||||
* Documentation and other important links added
|
||||
|
||||
= 1.0.0 - 10 Mar 2021 =
|
||||
* Initial release
|
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
$config = array();
|
||||
|
||||
$config['plugin_screen'] = 'settings_page_wpcaptcha';
|
||||
$config['icon_border'] = 'none';
|
||||
$config['icon_right'] = '35px';
|
||||
$config['icon_bottom'] = '35px';
|
||||
$config['icon_image'] = 'wp-captcha.png';
|
||||
$config['icon_padding'] = '7px';
|
||||
$config['icon_size'] = '65px';
|
||||
$config['menu_accent_color'] = '#4285f4';
|
||||
$config['custom_css'] = '#wf-flyout .wff-menu-item .dashicons.dashicons-universal-access { font-size: 30px; padding: 0px 10px 0px 0; } #wf-flyout .ucp-icon .wff-icon img { max-width: 66%; } #wf-flyout .ucp-icon .wff-icon { line-height: 57px; } #wf-flyout .wpr-icon .wff-icon { line-height: 62px; } #wf-flyout .wp301-icon .wff-icon img { max-width: 66%; } #wf-flyout .wp301-icon .wff-icon { line-height: 57px; } #wf-flyout .wpfssl-icon .wff-icon img { max-width: 66%; } #wf-flyout .wpfssl-icon .wff-icon { line-height: 57px; } #wf-flyout #wff-button img { margin-left: 2px; }';
|
||||
|
||||
$config['menu_items'] = array(
|
||||
array('href' => '#', 'data' => 'data-pro-feature="flyout"', 'label' => 'Get WP Captcha PRO with a special discount', 'icon' => 'wp-captcha.png', 'class' => 'captcha-icon open-pro-dialog'),
|
||||
array('href' => 'https://wpforcessl.com/?ref=wff-captcha', 'label' => 'Fix all SSL problems & monitor site in real-time', 'icon' => 'wp-ssl.png', 'class' => 'wpfssl-icon'),
|
||||
array('href' => 'https://wp301redirects.com/?ref=wff-captcha&coupon=50off', 'label' => 'Fix 2 most common SEO issues on WordPress that most people ignore', 'icon' => '301-logo.png', 'class' => 'wp301-icon'),
|
||||
array('href' => 'https://wpreset.com/?ref=wff-captcha&coupon=50off', 'target' => '_blank', 'label' => 'Get WP Reset PRO with 50% off', 'icon' => 'wp-reset.png', 'class' => 'wpr-icon'),
|
||||
array('href' => 'https://underconstructionpage.com/?ref=wff-captcha&coupon=welcome', 'target' => '_blank', 'label' => 'Create the perfect Under Construction Page', 'icon' => 'ucp.png', 'class' => 'ucp-icon'),
|
||||
array('href' => 'https://wpsticky.com/?ref=wff-captcha', 'target' => '_blank', 'label' => 'Make any element (header, widget, menu) sticky with WP Sticky', 'icon' => 'dashicons-admin-post'),
|
||||
array('href' => 'https://wordpress.org/support/plugin/advanced-google-recaptcha/reviews/#new-post', 'target' => '_blank', 'label' => 'Rate the Plugin', 'icon' => 'dashicons-thumbs-up'),
|
||||
array('href' => 'https://wordpress.org/support/plugin/advanced-google-recaptcha/', 'target' => '_blank', 'label' => 'Get Support', 'icon' => 'dashicons-sos'),
|
||||
);
|
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 13 KiB |
@ -0,0 +1,200 @@
|
||||
/**
|
||||
* Universal fly-out menu for WebFactory plugins
|
||||
* (c) WebFactory Ltd, 2023
|
||||
*/
|
||||
|
||||
#wf-flyout {
|
||||
position: fixed;
|
||||
z-index: 100049;
|
||||
transition: all 0.3s ease-in-out;
|
||||
right: 40px;
|
||||
bottom: 40px;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#wff-overlay {
|
||||
background: #000;
|
||||
opacity: 0.4;
|
||||
filter: alpha(opacity=40);
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
display: none;
|
||||
z-index: 100049;
|
||||
}
|
||||
|
||||
#wf-flyout a:focus {
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
#wf-flyout #wff-button {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#wf-flyout #wff-image-wrapper {
|
||||
border: 3px solid #000000;
|
||||
border-radius: 50%;
|
||||
padding: 0;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
background: #ffffff;
|
||||
box-shadow: 0 3px 20px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
#wf-flyout #wff-button img {
|
||||
width: 55px;
|
||||
height: 55px;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
padding: 2px;
|
||||
background: #ffffff;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
#wf-flyout #wff-button:hover #wff-image-wrapper {
|
||||
box-shadow: 0 3px 30px rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
#wf-flyout:not(.opened) #wff-button:hover .wff-label {
|
||||
opacity: 1;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
#wf-flyout .wff-label {
|
||||
position: absolute;
|
||||
display: block;
|
||||
top: 50%;
|
||||
right: calc(100% + 25px);
|
||||
transform: translateY(-50%) scale(1);
|
||||
-moz-transform: translateY(-50%);
|
||||
-webkit-transform: translateY(-50%);
|
||||
color: #fff;
|
||||
background: #444 0 0 no-repeat padding-box;
|
||||
font-size: 14px;
|
||||
white-space: nowrap;
|
||||
padding: 5px 10px;
|
||||
height: auto !important;
|
||||
line-height: initial;
|
||||
transition: all 0.2s ease-out;
|
||||
border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
opacity: 0;
|
||||
margin-right: -50px;
|
||||
}
|
||||
|
||||
#wf-flyout .wff-icon {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
vertical-align: middle;
|
||||
line-height: 60px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#wf-flyout .wff-icon img {
|
||||
max-width: 80%;
|
||||
filter: brightness(100);
|
||||
}
|
||||
|
||||
#wf-flyout .wff-label.visible {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#wf-flyout .wff-menu-item {
|
||||
position: absolute;
|
||||
left: 10px;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
transform: scale(0);
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 3px 20px rgba(0, 0, 0, 0.2);
|
||||
background: #0071a1;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
text-decoration: none;
|
||||
transition-timing-function: ease-in-out;
|
||||
}
|
||||
|
||||
#wf-flyout .wff-menu-item.accent {
|
||||
background: #ca4a1f;
|
||||
}
|
||||
|
||||
#wf-flyout.opened .wff-menu-item {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
#wf-flyout .wff-menu-item:hover {
|
||||
box-shadow: 0 3px 30px rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
#wf-flyout .wff-menu-item:hover .wff-label {
|
||||
right: calc(100% + 55px);
|
||||
}
|
||||
|
||||
#wf-flyout .wff-menu-item .wff-label {
|
||||
right: calc(100% + 70px);
|
||||
}
|
||||
|
||||
#wf-flyout .wff-menu-item .dashicons {
|
||||
line-height: 41px;
|
||||
font-size: 23px;
|
||||
color: #fff;
|
||||
padding: 0px 3px 0px 0;
|
||||
}
|
||||
|
||||
.wff-menu-item-1 {
|
||||
bottom: 75px;
|
||||
transition: transform 0.2s 30ms, background-color 0.2s;
|
||||
}
|
||||
|
||||
.wff-menu-item-2 {
|
||||
bottom: 130px;
|
||||
transition: transform 0.2s 70ms, background-color 0.2s;
|
||||
}
|
||||
|
||||
.wff-menu-item-3 {
|
||||
bottom: 185px;
|
||||
transition: transform 0.2s 110ms, background-color 0.2s;
|
||||
}
|
||||
|
||||
.wff-menu-item-4 {
|
||||
bottom: 240px;
|
||||
transition: transform 0.2s 150ms, background-color 0.2s;
|
||||
}
|
||||
|
||||
.wff-menu-item-5 {
|
||||
bottom: 295px;
|
||||
transition: transform 0.2s 190ms, background-color 0.2s;
|
||||
}
|
||||
|
||||
.wff-menu-item-6 {
|
||||
bottom: 350px;
|
||||
transition: transform 0.2s 230ms, background-color 0.2s;
|
||||
}
|
||||
|
||||
.wff-menu-item-7 {
|
||||
bottom: 405px;
|
||||
transition: transform 0.2s 270ms, background-color 0.2s;
|
||||
}
|
||||
|
||||
.wff-menu-item-8 {
|
||||
bottom: 460px;
|
||||
transition: transform 0.2s 310ms, background-color 0.2s;
|
||||
}
|
||||
|
||||
.wff-menu-item-9 {
|
||||
bottom: 515px;
|
||||
transition: transform 0.2s 350ms, background-color 0.2s;
|
||||
}
|
||||
|
||||
.wff-menu-item-10 {
|
||||
bottom: 570px;
|
||||
transition: transform 0.2s 390ms, background-color 0.2s;
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Universal fly-out menu for WebFactory plugins
|
||||
* (c) WebFactory Ltd, 2023
|
||||
*/
|
||||
|
||||
jQuery(document).ready(function ($) {
|
||||
$('#wff-button').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#wf-flyout').toggleClass('opened');
|
||||
$('#wff-overlay').toggle();
|
||||
|
||||
return false;
|
||||
}); // open/close menu
|
||||
|
||||
$('#wff-overlay').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$(this).hide();
|
||||
$('#wf-flyout').removeClass('opened');
|
||||
|
||||
return false;
|
||||
}); // click on overlay - hide menu
|
||||
}); // jQuery ready
|
@ -0,0 +1,167 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Universal fly-out menu for WebFactory plugins
|
||||
* (c) WebFactory Ltd, 2023
|
||||
*/
|
||||
|
||||
|
||||
if (false == class_exists('wf_flyout')) {
|
||||
class wf_flyout
|
||||
{
|
||||
var $ver = 1.0;
|
||||
var $plugin_file = '';
|
||||
var $plugin_slug = '';
|
||||
var $config = array();
|
||||
|
||||
|
||||
function __construct($plugin_file)
|
||||
{
|
||||
$this->plugin_file = $plugin_file;
|
||||
$this->plugin_slug = basename(dirname($plugin_file));
|
||||
$this->load_config();
|
||||
|
||||
if (!is_admin()) {
|
||||
return;
|
||||
} else {
|
||||
add_action('admin_init', array($this, 'init'));
|
||||
}
|
||||
} // __construct
|
||||
|
||||
|
||||
function load_config()
|
||||
{
|
||||
$config = array();
|
||||
require_once plugin_dir_path($this->plugin_file) . 'wf-flyout/config.php';
|
||||
|
||||
$defaults = array(
|
||||
'plugin_screen' => '',
|
||||
'icon_border' => '#0000ff',
|
||||
'icon_right' => '40px',
|
||||
'icon_bottom' => '40px',
|
||||
'icon_image' => '',
|
||||
'icon_padding' => '2px',
|
||||
'icon_size' => '55px',
|
||||
'menu_accent_color' => '#ca4a1f',
|
||||
'custom_css' => '',
|
||||
'menu_items' => array(),
|
||||
);
|
||||
|
||||
$config = array_merge($defaults, $config);
|
||||
if (!is_array($config['plugin_screen'])) {
|
||||
$config['plugin_screen'] = array($config['plugin_screen']);
|
||||
}
|
||||
|
||||
$this->config = $config;
|
||||
} // load_config
|
||||
|
||||
|
||||
function is_plugin_screen()
|
||||
{
|
||||
$screen = get_current_screen();
|
||||
|
||||
if (in_array($screen->id, $this->config['plugin_screen'])) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} // is_plugin_screen
|
||||
|
||||
|
||||
function init()
|
||||
{
|
||||
add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
|
||||
add_action('admin_head', array($this, 'admin_head'));
|
||||
add_action('admin_footer', array($this, 'admin_footer'));
|
||||
} // init
|
||||
|
||||
|
||||
function admin_enqueue_scripts()
|
||||
{
|
||||
if (false === $this->is_plugin_screen()) {
|
||||
return;
|
||||
}
|
||||
|
||||
wp_enqueue_style('wf_flyout', plugin_dir_url($this->plugin_file) . 'wf-flyout/wf-flyout.css', array(), $this->ver);
|
||||
wp_enqueue_script('wf_flyout', plugin_dir_url($this->plugin_file) . 'wf-flyout/wf-flyout.js', array(), $this->ver, true);;
|
||||
} // admin_enqueue_scripts
|
||||
|
||||
|
||||
function admin_head()
|
||||
{
|
||||
if (false === $this->is_plugin_screen()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$out = '<style type="text/css">';
|
||||
$out .= '#wf-flyout {
|
||||
right: ' . sanitize_text_field($this->config['icon_right']) . ';
|
||||
bottom: ' . sanitize_text_field($this->config['icon_bottom']) . ';
|
||||
}';
|
||||
$out .= '#wf-flyout #wff-image-wrapper {
|
||||
border: ' . sanitize_text_field($this->config['icon_border']) . ';
|
||||
}';
|
||||
$out .= '#wf-flyout #wff-button img {
|
||||
padding: ' . sanitize_text_field($this->config['icon_padding']) . ';
|
||||
width: ' . sanitize_text_field($this->config['icon_size']) . ';
|
||||
height: ' . sanitize_text_field($this->config['icon_size']) . ';
|
||||
}';
|
||||
$out .= '#wf-flyout .wff-menu-item.accent {
|
||||
background: ' . sanitize_text_field($this->config['menu_accent_color']) . ';
|
||||
}';
|
||||
$out .= sanitize_text_field($this->config['custom_css']);
|
||||
$out .= '</style>';
|
||||
|
||||
WPCaptcha_Utility::wp_kses_wf($out);
|
||||
} // admin_head
|
||||
|
||||
|
||||
function admin_footer()
|
||||
{
|
||||
if (false === $this->is_plugin_screen()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$out = '';
|
||||
$icons_url = plugin_dir_url($this->plugin_file) . 'wf-flyout/icons/';
|
||||
$default_link_item = array('class' => '', 'href' => '#', 'target' => '_blank', 'label' => '', 'icon' => '', 'data' => '');
|
||||
|
||||
$out .= '<div id="wff-overlay"></div>';
|
||||
|
||||
$out .= '<div id="wf-flyout">';
|
||||
|
||||
$out .= '<a href="#" id="wff-button">';
|
||||
$out .= '<span class="wff-label">Open Quick Links</span>';
|
||||
$out .= '<span id="wff-image-wrapper">';
|
||||
$out .= '<img src="' . esc_url($icons_url . $this->config['icon_image']) . '" alt="Open Quick Links" title="Open Quick Links">';
|
||||
$out .= '</span>';
|
||||
$out .= '</a>';
|
||||
|
||||
$out .= '<div id="wff-menu">';
|
||||
$i = 0;
|
||||
foreach (array_reverse($this->config['menu_items']) as $item) {
|
||||
$i++;
|
||||
$item = array_merge($default_link_item, $item);
|
||||
|
||||
if (!empty($item['icon']) && substr($item['icon'], 0, 9) != 'dashicons') {
|
||||
$item['class'] .= ' wff-custom-icon';
|
||||
$item['class'] = trim($item['class']);
|
||||
}
|
||||
|
||||
$out .= '<a ' . $item['data'] . ' href="' . esc_url($item['href']) . '" class="wff-menu-item wff-menu-item-' . $i . ' ' . esc_attr($item['class']) . '" target="_blank">';
|
||||
$out .= '<span class="wff-label visible">' . esc_html($item['label']) . '</span>';
|
||||
if (substr($item['icon'], 0, 9) == 'dashicons') {
|
||||
$out .= '<span class="dashicons ' . sanitize_text_field($item['icon']) . '"></span>';
|
||||
} elseif (!empty($item['icon'])) {
|
||||
$out .= '<span class="wff-icon"><img src="' . esc_url($icons_url . $item['icon']) . '"></span>';
|
||||
}
|
||||
$out .= '</a>';
|
||||
} // foreach
|
||||
$out .= '</div>'; // #wff-menu
|
||||
|
||||
$out .= '</div>'; // #wf-flyout
|
||||
|
||||
WPCaptcha_Utility::wp_kses_wf($out);
|
||||
} // admin_footer
|
||||
} // wf_flyout
|
||||
} // if class exists
|