Zeliha Canderengul
Forum Replies Created
-
Forum: Plugins
In reply to: [Captcha Code] How to fix “An active PHP session was detected” error message.I solved this problem myself. To fix the problem, do the following:
This coding is for version 2.7.
Open the plugin’s wpCaptcha.php page and delete all the codes, add the codes below to the page and save.
<?php
/*
Plugin Name: Captcha Code
Plugin URI: https://www.vinojcardoza.com/captcha-code-authentication/
Description: Adds Captcha Code anti-spam methods to User front-end WordPress forms.
Version: 2.7
Author: Vinoj Cardoza
Author URI: https://www.vinojcardoza.com
License: GPL2
*/define(‘WP_CAPTCHA_DIR_URL’, plugin_dir_url(__FILE__));
define(‘WP_CAPTCHA_DIR’, dirname(__FILE__));require ‘general_options.php’;
/* Hook to initalize the admin menu */
add_action(‘admin_menu’, ‘wp_captcha_admin_menu’);
/* Hook to initialize sessions */
add_action(‘init’, ‘wp_captcha_init_sessions’);/* Hook to store the plugin status */
register_activation_hook(__FILE__, ‘wp_captcha_enabled’);
register_deactivation_hook(__FILE__, ‘wp_captcha_disabled’);function wp_captcha_enabled(){
update_option(‘wpcaptcha_status’, ‘enabled’);
}
function wp_captcha_disabled(){
update_option(‘wpcaptcha_status’, ‘disabled’);
}/* To add the menus in the admin section */
function wp_captcha_admin_menu(){
add_options_page(
__(‘Captcha settings’),
__(‘Captcha settings’),
‘manage_options’,
‘wp_captcha_slug’,
‘wp_captcha_general_options’);
}function wp_captcha_init_sessions(){
if(!session_id()){
session_start();
}
load_plugin_textdomain(‘wpcaptchadomain’, false, dirname( plugin_basename(__FILE__)).’/languages’);
$_SESSION[‘captcha_type’] = get_option(‘wpcaptcha_type’);
$_SESSION[‘captcha_letters’] = get_option(‘wpcaptcha_letters’);
$_SESSION[‘total_no_of_characters’] = get_option(‘wpcaptcha_total_no_of_characters’);
if(empty($_SESSION[‘total_no_of_characters’])){
$_SESSION[‘total_no_of_characters’] = 6;
}
session_write_close();
}/* Captcha for login authentication starts here */
$login_captcha = get_option(‘wpcaptcha_login’);
if($login_captcha == ‘yes’){
add_action(‘login_form’, ‘include_wp_captcha_login’);
add_filter( ‘login_errors’, ‘include_captcha_login_errors’ );
add_filter( ‘login_redirect’, ‘include_captcha_login_redirect’, 10, 3 );
}/* Function to include captcha for login form */
function include_wp_captcha_login(){
echo ‘<p class=”login-form-captcha”>
<label><b>’. __(‘Captcha’, ‘wpcaptchadomain’).’ </b></label>
<span class=”required”>*</span>
<div style=”clear:both;”></div>
<div style=”clear:both;”></div>’;/* Will retrieve the get varibale and prints a message from url if the captcha is wrong */
if(isset($_GET[‘captcha’]) && $_GET[‘captcha’] == ‘confirm_error’ ) {
echo ‘<label style=”color:#FF0000;” id=”capt_err”>’.$_SESSION[‘captcha_error’].'</label><div style=”clear:both;”></div>’;;
$_SESSION[‘captcha_error’] = ”;
}echo ‘<label>’.__(‘Type the text displayed above’, ‘wpcaptchadomain’).’:</label>
<input id=”captcha_code” name=”captcha_code” size=”15″ type=”text” tabindex=”30″ />
</p>’;
return true;
}/* Hook to find out the errors while logging in */
function include_captcha_login_errors($errors){
if( isset( $_REQUEST[‘action’] ) && ‘register’ == $_REQUEST[‘action’] )
return($errors);if($_SESSION[‘captcha_code’] != $_REQUEST[‘captcha_code’]){
return $errors.'<label id=”capt_err” for=”captcha_code_error”>’.__(‘Captcha confirmation error!’, ‘wpcaptchadomain’).'</label>’;
}
return $errors;
}/* Hook to redirect after captcha confirmation */
function include_captcha_login_redirect($url){/* Captcha mismatch */
if(isset($_SESSION[‘captcha_code’]) && isset($_REQUEST[‘captcha_code’]) && $_SESSION[‘captcha_code’] != $_REQUEST[‘captcha_code’]){
$_SESSION[‘captcha_error’] = __(‘Incorrect captcha confirmation!’, ‘wpcaptchadomain’);
wp_clear_auth_cookie();
return $_SERVER[“REQUEST_URI”].”/?captcha=’confirm_error'”;
}
/* Captcha match: take to the admin panel */
else{
return home_url(‘/wp-admin/’);
}
}/* <!– Captcha for login authentication ends here –> */
/* Captcha for Comments ends here */
$comment_captcha = get_option(‘wpcaptcha_comments’);
if($comment_captcha == ‘yes’){
global $wp_version;
if( version_compare($wp_version,’3′,’>=’) ) { // wp 3.0 +
add_action( ‘comment_form_after_fields’, ‘include_wp_captcha_comment_form_wp3’, 1 );
add_action( ‘comment_form_logged_in_after’, ‘include_wp_captcha_comment_form_wp3’, 1 );
}
// for WP before WP 3.0
add_action( ‘comment_form’, ‘include_captcha_comment_form’ );
add_filter( ‘preprocess_comment’, ‘include_captcha_comment_post’ );
}/* Function to include captcha for comments form */
function include_captcha_comment_form(){
$c_registered = get_option(‘wpcaptcha_registered’);
if ( is_user_logged_in() && $c_registered == ‘yes’) {
return true;
}
echo ‘<p class=”comment-form-captcha”>
<label><b>’. __(‘Captcha’, ‘wpcaptchadomain’).’ </b></label>
<span class=”required”>*</span>
<div style=”clear:both;”></div>
<div style=”clear:both;”></div>
<label>’.__(‘Type the text displayed above’, ‘wpcaptchadomain’).’:</label>
<input id=”captcha_code” name=”captcha_code” size=”15″ type=”text” />
<div style=”clear:both;”></div>
</p>’;
return true;
}/* Function to include captcha for comments form > wp3 */
function include_wp_captcha_comment_form_wp3(){
$c_registered = get_option(‘wpcaptcha_registered’);
if ( is_user_logged_in() && $c_registered == ‘yes’) {
return true;
}echo ‘<p class=”comment-form-captcha”>
<label><b>’. __(‘Captcha’, ‘wpcaptchadomain’).’ </b></label>
<span class=”required”>*</span>
<div style=”clear:both;”></div>
<div style=”clear:both;”></div>
<label>’.__(‘Type the text displayed above’, ‘wpcaptchadomain’).’:</label>
<input id=”captcha_code” name=”captcha_code” size=”15″ type=”text” />
<div style=”clear:both;”></div>
</p>’;remove_action( ‘comment_form’, ‘include_captcha_comment_form’ );
return true;
}// this function checks captcha posted with the comment
function include_captcha_comment_post($comment) {
$c_registered = get_option(‘wpcaptcha_registered’);
if (is_user_logged_in() && $c_registered == ‘yes’) {
return $comment;
}// skip captcha for comment replies from the admin menu
if ( isset( $_REQUEST[‘action’] ) && $_REQUEST[‘action’] == ‘replyto-comment’ &&
( check_ajax_referer( ‘replyto-comment’, ‘_ajax_nonce’, false ) || check_ajax_referer( ‘replyto-comment’, ‘_ajax_nonce-replyto-comment’, false ) ) ) {
// skip capthca
return $comment;
}// Skip captcha for trackback or pingback
if ( $comment[‘comment_type’] != ” && $comment[‘comment_type’] != ‘comment’ ) {
// skip captcha
return $comment;
}// If captcha is empty
if(empty($_REQUEST[‘captcha_code’]))
wp_die( __(‘CAPTCHA cannot be empty.’, ‘wpcaptchadomain’ ) );// captcha was matched
if($_SESSION[‘captcha_code’] == $_REQUEST[‘captcha_code’]) return($comment);
else wp_die( __(‘Error: Incorrect CAPTCHA. Press your browser\’s back button and try again.’, ‘wpcaptchadomain’));
}/* <!– Captcha for Comments authentication ends here –> */
// Add captcha in the register form
$register_captcha = get_option(‘wpcaptcha_register’);
if($register_captcha == ‘yes’){
add_action(‘register_form’, ‘include_wp_captcha_register’);
add_action( ‘register_post’, ‘include_captcha_register_post’, 10, 3 );
add_action( ‘signup_extra_fields’, ‘include_wp_captcha_register’ );
add_filter( ‘wpmu_validate_user_signup’, ‘include_captcha_register_validate’ );
}/* Function to include captcha for register form */
function include_wp_captcha_register($default){
echo ‘<p class=”register-form-captcha”>
<label><b>’. __(‘Captcha’, ‘wpcaptchadomain’).’ </b></label>
<span class=”required”>*</span>
<div style=”clear:both;”></div>
<div style=”clear:both;”></div>
<label>’.__(‘Type the text displayed above’, ‘wpcaptchadomain’).’:</label>
<input id=”captcha_code” name=”captcha_code” size=”15″ type=”text” />
</p>’;
return true;
}/* This function checks captcha posted with registration */
function include_captcha_register_post($login,$email,$errors) {// If captcha is blank – add error
if ( isset( $_REQUEST[‘captcha_code’] ) && “” == $_REQUEST[‘captcha_code’] ) {
$errors->add(‘captcha_blank’, ‘‘.__(‘ERROR’, ‘wpcaptchadomain’).’: ‘.__(‘Please complete the CAPTCHA.’, ‘wpcaptchadomain’));
return $errors;
}if ( isset( $_REQUEST[‘captcha_code’] ) && ($_SESSION[‘captcha_code’] == $_REQUEST[‘captcha_code’] )) {
// captcha was matched
} else {
$errors->add(‘captcha_wrong’, ‘‘.__(‘ERROR’, ‘wpcaptchadomain’).’: ‘.__(‘That CAPTCHA was incorrect.’, ‘wpcaptchadomain’));
}
return($errors);
}
/* End of the function include_captcha_register_post */function include_captcha_register_validate($results) {
if ( isset( $_REQUEST[‘captcha_code’] ) && “” == $_REQUEST[‘captcha_code’] ) {
$results[‘errors’]->add(‘captcha_blank’, ‘‘.__(‘ERROR’, ‘wpcaptchadomain’).’: ‘.__(‘Please complete the CAPTCHA.’, ‘wpcaptchadomain’));
return $results;
}if ( isset( $_REQUEST[‘captcha_code’] ) && ($_SESSION[‘captcha_code’] == $_REQUEST[‘captcha_code’] )) {
// captcha was matched
} else {
$results[‘errors’]->add(‘captcha_wrong’, ‘‘.__(‘ERROR’, ‘wpcaptchadomain’).’: ‘.__(‘That CAPTCHA was incorrect.’, ‘wpcaptchadomain’));
}
return($results);
}
/* End of the function include_captcha_register_validate */$lost_captcha = get_option(‘wpcaptcha_lost’);
// Add captcha into lost password form
if($lost_captcha == ‘yes’){
add_action( ‘lostpassword_form’, ‘include_wp_captcha_lostpassword’ );
add_action( ‘lostpassword_post’, ‘include_wp_captcha_lostpassword_post’, 10, 3 );
}/* Function to include captcha for lost password form */
function include_wp_captcha_lostpassword($default){
echo ‘<p class=”lost-form-captcha”>
<label><b>’. __(‘Captcha’, ‘wpcaptchadomain’).’ </b></label>
<span class=”required”>*</span>
<div style=”clear:both;”></div>
<div style=”clear:both;”></div>
<label>’.__(‘Type the text displayed above’, ‘wpcaptchadomain’).’:</label>
<input id=”captcha_code” name=”captcha_code” size=”15″ type=”text” />
</p>’;
}function include_wp_captcha_lostpassword_post() {
if( isset( $_REQUEST[‘user_login’] ) && “” == $_REQUEST[‘user_login’] )
return;// If captcha doesn’t entered
if ( isset( $_REQUEST[‘captcha_code’] ) && “” == $_REQUEST[‘captcha_code’] ) {
wp_die( __( ‘Please complete the CAPTCHA.’, ‘wpcaptchadomain’ ) );
}// Check entered captcha
if ( isset( $_REQUEST[‘captcha_code’] ) && ($_SESSION[‘captcha_code’] == $_REQUEST[‘captcha_code’] )) {
return;
} else {
wp_die( __( ‘Error: Incorrect CAPTCHA. Press your browser\’s back button and try again.’, ‘wpcaptchadomain’ ) );
}
}
?>Add the bold text in the above code (session_write_close();) and save the page. If you don’t understand the above explanation,… Add the code after line 53 and save the page.
I don’t want to remove it. you misunderstood me. I want to use the /category/ base already. i already use it.
When the URL above is clicked, the page opens.
However, I want it to open as below.
https://ozmyo.com/category/blog/
Because both pages can be added to the search index. However, it opens even though I don’t use the URL above on my site. However, if it is directed to the URL below, the problem will be solved.
I changed the product price for 0 dollars, and the result is great. thank u…
Forum: Fixing WordPress
In reply to: How can I change the in WordPress 5.8?Here is a code that works correctly.
add_filter( ‘document_title_parts’, function( $title ) {
unset( $title[‘site’] );
return $title;
} );Forum: Fixing WordPress
In reply to: How can I change the in WordPress 5.8?@sterndata
of course it’s easy, but I don’t want to slow down my website using a plugin just to be able to do it. What I want is just some working code.Forum: Fixing WordPress
In reply to: How can I change the in WordPress 5.8?What I want is exactly this:
Homepage title: <title>Blog Title</title>
Page title: <title>Page Title</title>
Post title: <title>Post Title</title>
Category title: <title>Category Title</title>
Author title: <title>Author Title</title>Ok…. ?
- This reply was modified 3 years, 5 months ago by Zeliha Canderengul.
Forum: Fixing WordPress
In reply to: How can I change the in WordPress 5.8?The code you added successfully transformed the Post titles to the result you wanted. However, this time the title of the homepage has changed to the title of the last Post. It should be such a code that it should work correctly for all URLs including “Page, Post, Category, and Homepage”.
Forum: Fixing WordPress
In reply to: I want to change wordpress version info to 10.8 instead of 5.8Thanks everyone. I wanted to change the update version for an important reason. I’ve been managing a website for a long time and I have Adsense ads on my website. According to my experience, when an update alert is active on the website, Adsense per click ad revenue decreases. Until I noticed the update warning, Adsense revenue is decreasing considerably. I replaced the plugins and the theme with higher version information via css files. So I don’t get an update alert. But I couldn’t stop the WordPress files from updating. That’s why I want to make the version information 10.8. If you have an Adsense account, if you carefully examine what I have said, you will see that your income also decreases until the update notification is closed.`
Forum: Plugins
In reply to: [AMP] Screen gets bigger and smaller (flickering) on AMP page@milindmore22 I removed AMP Plugin from my website due to unresolved AMP AD issue.
- This reply was modified 3 years, 9 months ago by Zeliha Canderengul.
@jamesosborne The .htaccess is:
`# BEGIN WpFastestCache
# Modified Time: 30-06-21 0:30:05
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} =on
RewriteCond %{HTTP_HOST} ^ozmyo.com
# Start WPFC Exclude
# End WPFC Exclude
# Start_WPFC_Exclude_Admin_Cookie
RewriteCond %{HTTP:Cookie} !wordpress_logged_in_[^\=]+\=Zeliha\sCanderengul
# End_WPFC_Exclude_Admin_Cookie
RewriteCond %{HTTP_HOST} ^ozmyo.com
RewriteCond %{HTTP_USER_AGENT} !(facebookexternalhit|WP_FASTEST_CACHE_CSS_VALIDATOR|Twitterbot|LinkedInBot|WhatsApp|Mediatoolkitbot)
RewriteCond %{HTTP_USER_AGENT} !(WP\sFastest\sCache\sPreload(\siPhone\sMobile)?\s*Bot)
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{REQUEST_URI} !(\/){2}$
RewriteCond %{REQUEST_URI} \/$
RewriteCond %{QUERY_STRING} !.+
RewriteCond %{HTTP:Cookie} !wordpress_logged_in
RewriteCond %{HTTP:Cookie} !comment_author_
RewriteCond %{HTTP:Cookie} !safirmobilswitcher=mobil
RewriteCond %{HTTP:Profile} !^[a-z0-9\”]+ [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/all/$1/index.html -f [or]
RewriteCond /home2/b452006/public_html/ozmyo/wp-content/cache/all/$1/index.html -f
RewriteRule ^(.*) “/wp-content/cache/all/$1/index.html” [L]
</IfModule>
<FilesMatch “index\.(html|htm)$”>
AddDefaultCharset UTF-8
<ifModule mod_headers.c>
FileETag None
Header unset ETag
Header set Cache-Control “max-age=0, no-cache, no-store, must-revalidate”
Header set Pragma “no-cache”
Header set Expires “Mon, 29 Oct 1923 20:30:00 GMT”
</ifModule>
</FilesMatch>
# END WpFastestCache# BEGIN rlrssslReallySimpleSSL rsssl_version[4.0.15]
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>
# END rlrssslReallySimpleSSL# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress# php — BEGIN cPanel-generated handler, do not edit
# Set the “ea-php74” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
</IfModule>
# php — END cPanel-generated handler, do not edit`@jamesosborne I redirected it to /public_html/ozmyo.com/ so that the en.subdomain.com subdomain could point to the main domain. I did this via cPanel. I didn’t edit an htaccess. Thus, en.ozmyo.com, which you point to the main domain directory, is operational.
Forum: Plugins
In reply to: [AMP] Screen gets bigger and smaller (flickering) on AMP page@milindmore22 Google Kit automatically changes the width of the ads on my website. Therefore, it is not possible for me to change the size of 100vw with another size. So what can I fix this problem?
@jamesosborne After adding the Polylang plugin, activate the IKNOW theme. Add a static page for the home page of the website. (The homepage should be a static page, not as a blog archives.) Do the same for the English language. So: add a homepage for both languages of your website. When you try in this way, you will see that the subdomain is not opened and is directed to the main domain.
Settins / Reading / Your homepage displays / A static page (select below)
Exmple: https://ozmyo.com/wp-content/uploads/2021/06/lang2.jpg
- This reply was modified 3 years, 9 months ago by Zeliha Canderengul.
@jamesosborne / Screenshot is at this link: https://ozmyo.com/wp-content/uploads/2021/06/language.jpg
@cemsid ozmyo.com/en ?eklinde bir yap? istemiyorum. O yüzden onu tercih etmedim. Domain otoritesi i?in bu gereklilik de?ildir.
- This reply was modified 3 years, 9 months ago by Zeliha Canderengul.