function anr_verify_captcha( $response = false ) {
return C4WP_Captcha_Class::init()->verify( $response );
}
/**
* Verify a captcha response.
*
* @param boolean $response - Response to check.
* @return bool - Verification.
*/
public static function c4wp_verify_captcha( $response = false ) {
return C4WP_Captcha_Class::init()->verify( $response );
}
/**
* Add shake script to error screen.
*
* @param array $shake_error_codes - Current error codes.
* @return array - Codes, with ours appended.
*/
public static function c4wp_add_shake_error_codes( $shake_error_codes ) {
$shake_error_codes[] = 'c4wp_error';
return $shake_error_codes;
}
/**
* Create URL for our contact page.
*
* @param string $wp_org_support_forum_url - Original URL.
* @return string - Our URL.
*/
public static function c4wp_fs_support_forum_url( $wp_org_support_forum_url ) {
return 'https://melapress.com/contact/?utm_source=wp+repo&utm_medium=repo+link&utm_campaign=wordpress_org&utm_content=c4wp';
}
/**
* Create correct captcha domain URL.
*
* @return string - URL.
*/
public static function c4wp_recaptcha_domain() {
$domain = self::c4wp_get_option( 'recaptcha_domain', 'google.com' );
return apply_filters( 'c4wp_recaptcha_domain', $domain );
}
/**
* Setup settings page URL.
*
* @param boolean $tab - Is tab settings.
* @return string - URL.
*/
public static function c4wp_settings_page_url( $tab = false ) {
$url = ( method_exists( __CLASS__, 'c4wp_same_settings_for_all_sites' ) && self::c4wp_same_settings_for_all_sites() || ! method_exists( __CLASS__, 'c4wp_same_settings_for_all_sites' ) ) ? network_admin_url( 'admin.php?page=c4wp-admin-captcha' ) : admin_url( 'admin.php?page=c4wp-admin-captcha' );
return $url;
}
/**
* Hode freemius contact link.
*
* @param bool $is_visible - Is currently visible.
* @param int $submenu_id - Item ID.
* @return bool - Is isible.
*/
public static function hide_freemius_submenu_items( $is_visible, $submenu_id ) {
if ( 'contact' === $submenu_id ) {
$is_visible = false;
}
return $is_visible;
}
/**
* Create system info for debugging.
*
* @return string - File markup.
*/
public static function c4wp_get_sysinfo() {
// System info.
global $wpdb;
$sysinfo = '### System Info → Begin ###' . "\n\n";
// Start with the basics...
$sysinfo .= '-- Site Info --' . "\n\n";
$sysinfo .= 'Site URL (WP Address): ' . site_url() . "\n";
$sysinfo .= 'Home URL (Site Address): ' . home_url() . "\n";
$sysinfo .= 'Multisite: ' . ( is_multisite() ? 'Yes' : 'No' ) . "\n";
// Get theme info.
$theme_data = wp_get_theme();
$theme = $theme_data->Name . ' ' . $theme_data->Version; // phpcs:ignore.
$parent_theme = $theme_data->Template; // phpcs:ignore.
if ( ! empty( $parent_theme ) ) {
$parent_theme_data = wp_get_theme( $parent_theme );
$parent_theme = $parent_theme_data->Name . ' ' . $parent_theme_data->Version; // phpcs:ignore.
}
// Language information.
$locale = get_locale();
// WordPress configuration.
$sysinfo .= "\n" . '-- WordPress Configuration --' . "\n\n";
$sysinfo .= 'Version: ' . get_bloginfo( 'version' ) . "\n";
$sysinfo .= 'Language: ' . ( ! empty( $locale ) ? $locale : 'en_US' ) . "\n";
$sysinfo .= 'Permalink Structure: ' . ( get_option( 'permalink_structure' ) ? get_option( 'permalink_structure' ) : 'Default' ) . "\n";
$sysinfo .= 'Active Theme: ' . $theme . "\n";
if ( $parent_theme !== $theme ) {
$sysinfo .= 'Parent Theme: ' . $parent_theme . "\n";
}
$sysinfo .= 'Show On Front: ' . get_option( 'show_on_front' ) . "\n";
// Only show page specs if frontpage is set to 'page'.
if ( 'page' === get_option( 'show_on_front' ) ) {
$front_page_id = (int) get_option( 'page_on_front' );
$blog_page_id = (int) get_option( 'page_for_posts' );
$sysinfo .= 'Page On Front: ' . ( 0 !== $front_page_id ? get_the_title( $front_page_id ) . ' (#' . $front_page_id . ')' : 'Unset' ) . "\n";
$sysinfo .= 'Page For Posts: ' . ( 0 !== $blog_page_id ? get_the_title( $blog_page_id ) . ' (#' . $blog_page_id . ')' : 'Unset' ) . "\n";
}
$sysinfo .= 'ABSPATH: ' . ABSPATH . "\n";
$sysinfo .= 'WP_DEBUG: ' . ( defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set' ) . "\n";
$sysinfo .= 'WP Memory Limit: ' . WP_MEMORY_LIMIT . "\n";
// Get plugins that have an update.
$updates = get_plugin_updates();
// Must-use plugins.
// NOTE: MU plugins can't show updates!
$muplugins = get_mu_plugins();
if ( count( $muplugins ) > 0 ) {
$sysinfo .= "\n" . '-- Must-Use Plugins --' . "\n\n";
foreach ( $muplugins as $plugin => $plugin_data ) {
$sysinfo .= $plugin_data['Name'] . ': ' . $plugin_data['Version'] . "\n";
}
}
// WordPress active plugins.
$sysinfo .= "\n" . '-- WordPress Active Plugins --' . "\n\n";
$plugins = get_plugins();
$active_plugins = get_option( 'active_plugins', array() );
foreach ( $plugins as $plugin_path => $plugin ) {
if ( ! in_array( $plugin_path, $active_plugins, true ) ) {
continue;
}
$update = ( array_key_exists( $plugin_path, $updates ) ) ? ' (needs update - ' . $updates[ $plugin_path ]->update->new_version . ')' : '';
$sysinfo .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n";
}
// WordPress inactive plugins.
$sysinfo .= "\n" . '-- WordPress Inactive Plugins --' . "\n\n";
foreach ( $plugins as $plugin_path => $plugin ) {
if ( in_array( $plugin_path, $active_plugins, true ) ) {
continue;
}
$update = ( array_key_exists( $plugin_path, $updates ) ) ? ' (needs update - ' . $updates[ $plugin_path ]->update->new_version . ')' : '';
$sysinfo .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n";
}
if ( is_multisite() ) {
// WordPress Multisite active plugins.
$sysinfo .= "\n" . '-- Network Active Plugins --' . "\n\n";
$plugins = wp_get_active_network_plugins();
$active_plugins = get_site_option( 'active_sitewide_plugins', array() );
foreach ( $plugins as $plugin_path ) {
$plugin_base = plugin_basename( $plugin_path );
if ( ! array_key_exists( $plugin_base, $active_plugins ) ) {
continue;
}
$update = ( array_key_exists( $plugin_path, $updates ) ) ? ' (needs update - ' . $updates[ $plugin_path ]->update->new_version . ')' : '';
$plugin = get_plugin_data( $plugin_path );
$sysinfo .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n";
}
}
// Server configuration.
$posted = filter_input_array( INPUT_SERVER );
$server_software = sanitize_text_field( $posted[ 'SERVER_SOFTWARE' ] );
$sysinfo .= "\n" . '-- Webserver Configuration --' . "\n\n";
$sysinfo .= 'PHP Version: ' . PHP_VERSION . "\n";
$sysinfo .= 'MySQL Version: ' . $wpdb->db_version() . "\n";
if ( isset( $server_software ) ) {
$sysinfo .= 'Webserver Info: ' . $server_software . "\n";
} else {
$sysinfo .= 'Webserver Info: Global $_SERVER array is not set.' . "\n";
}
// PHP configs.
$sysinfo .= "\n" . '-- PHP Configuration --' . "\n\n";
$sysinfo .= 'Memory Limit: ' . ini_get( 'memory_limit' ) . "\n";
$sysinfo .= 'Upload Max Size: ' . ini_get( 'upload_max_filesize' ) . "\n";
$sysinfo .= 'Post Max Size: ' . ini_get( 'post_max_size' ) . "\n";
$sysinfo .= 'Upload Max Filesize: ' . ini_get( 'upload_max_filesize' ) . "\n";
$sysinfo .= 'Time Limit: ' . ini_get( 'max_execution_time' ) . "\n";
$sysinfo .= 'Max Input Vars: ' . ini_get( 'max_input_vars' ) . "\n";
$sysinfo .= 'Display Errors: ' . ( ini_get( 'display_errors' ) ? 'On (' . ini_get( 'display_errors' ) . ')' : 'N/A' ) . "\n";
$sysinfo .= "\n" . '-- Captcha4WP Settings --' . "\n\n";
$c4wp_options = get_option( 'c4wp_admin_options' );
if ( ! empty( $c4wp_options ) ) {
foreach ( $c4wp_options as $option => $value ) {
$sysinfo .= 'Option: ' . $option . "\n";
$sysinfo .= 'Value: ' . print_r( $value, true ) . "\n\n";
}
}
$sysinfo .= "\n" . '### System Info → End ###' . "\n\n";
return $sysinfo;
}
/**
* Determines if an install is premium/paying.
*
* @return bool - Is premium or not.
*/
public static function c4wp_is_premium_version() {
return ( ( class_exists( 'C4WP_Pro' ) && ! c4wp_fs()->is_not_paying() ) || ( class_exists( 'C4WP_Pro' ) && c4wp_fs()->is_trial() ) ) ? true : false;
}
/**
* Add a small log during testing.
*
* @param array $result - Result data.
* @return void
*/
public static function c4wp_log_verify_result( $result ) {
$stored = self::c4wp_get_option( 'c4wp_recent_results' );
if ( ! $stored || ! is_array( $stored ) ) {
$updated_results[] = $result;
self::c4wp_update_option( 'c4wp_recent_results', $updated_results );
} else {
$updated_results = array_unshift( $stored, $result );
self::c4wp_update_option( 'c4wp_recent_results', $updated_results );
}
}
/**
* An easy to use array of allowed HTML for use with sanitzation of our admin areas etc.
*
* @return $wp_kses_args - Our array.
*/
public static function c4wp_allowed_kses_args() {
$wp_kses_args = array(
'input' => array(
'type' => array(),
'id' => array(),
'name' => array(),
'value' => array(),
'size' => array(),
'class' => array(),
'min' => array(),
'required' => array(),
'checked' => array(),
),
'select' => array(
'id' => array(),
'name' => array(),
),
'option' => array(
'id' => array(),
'name' => array(),
'value' => array(),
'selected' => array(),
),
'tr' => array(
'valign' => array(),
'class' => array(),
'id' => array(),
),
'th' => array(
'scope' => array(),
'class' => array(),
'id' => array(),
),
'td' => array(
'class' => array(),
'id' => array(),
),
'fieldset' => array(
'class' => array(),
'id' => array(),
),
'legend' => array(
'class' => array(),
'id' => array(),
),
'label' => array(
'for' => array(),
'class' => array(),
'id' => array(),
),
'p' => array(
'class' => array(),
'id' => array(),
),
'span' => array(
'class' => array(),
'id' => array(),
'style' => array(),
),
'li' => array(
'class' => array(),
'id' => array(),
'data-role-key' => array(),
),
'a' => array(
'class' => array(),
'id' => array(),
'style' => array(),
'data-tab-target' => array(),
'data-wizard-goto' => array(),
'data-check-inputs' => array(),
'data-nonce' => array(),
'href' => array(),
'target' => array(),
),
'h3' => array(
'class' => array(),
),
'br' => array(),
'b' => array(),
'i' => array(),
'div' => array(
'style' => array(),
'class' => array(),
'id' => array(),
),
'table' => array(
'class' => array(),
'id' => array(),
),
'tbody' => array(
'class' => array(),
'id' => array(),
),
'strong' => array(
'class' => array(),
'data-key-invalid' => array(),
'id' => array(),
),
'img' => array(
'class' => array(),
'src' => array(),
'id' => array(),
),
);
return $wp_kses_args;
}
/**
* WordPress Filter
*
* @param array $old_links - Array of old links.
*/
public static function add_plugin_shortcuts( $old_links ) {
$new_links = array();
if ( ! self::c4wp_is_premium_version() ) {
$new_links[] = '' . __( 'Get Premium!', 'captcha-4wp' ) . '';
$old_links = array_merge( array_slice( $old_links, 0, 1 ), $new_links, array_slice( $old_links, 1 ) );
}
return $old_links;
}
}
}
Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'C4WP\C4WP_Functions' not found in /var/www/html/planilhando.com.br/web/forum/wp-includes/class-wp-hook.php on line 307