korchiy
Forum Replies Created
-
Where I can find it in code?
Ok, I understand.
What the php-module and the name of the plugin function that shows the real user IPs (“my real IP”) on the plugin page?
Is there any function in the plugin code to get the real user IP address?
I want to try to rewrite the $_SERVER[‘REMOTE_ADDR’] with the returning value of this function.How the plugin detects proper user IP here (arrow with “my real IP”)?
View post on imgur.com
Unfortunately, I can’t find any work information how to do that.
Unfortunately I can’t find a way to pass it from the proxy server to Apache. I found some solutions in the Internet but all of them are for nginx, but I don’t use nginx, I have only xray proxy and Apache.
But if the plugin can correctly detect the user IP, see screenshot 2, can it use that IP for locking?
I can fully manage the file system through the ssh console. But I don’t know for what else paths I need to change permissions.
Yes, that is. I set the owner of …/plugins/ultimate-member/ to www-data recursively, and all files in this directory recursively too, but this does no effect.
Forum: Plugins
In reply to: [NextScripts: Social Networks Auto-Poster] SNAP Not posting to VKI found how to solve the problem:
In file:
...\social-networks-auto-poster-facebook-twitter-g\inc-cl\vk.api.php
in string 59replace fragment:
'owner_id'=>$options['pgIntID']with:
'owner_id'=>intval($options['pgIntID'])
or for replacing the whole string:from:
$postArr = array('owner_id'=>$options['pgIntID'], 'access_token'=>$options['appAuthToken'], 'from_group'=>'1', 'message'=>$msg, 'attachments'=>$atts, 'v'=>$this->apiVer);to:
$postArr = array('owner_id'=>intval($options['pgIntID']), 'access_token'=>$options['appAuthToken'], 'from_group'=>'1', 'message'=>$msg, 'attachments'=>$atts, 'v'=>$this->apiVer);It’s strange, the code doesn’t depend on hosting.
Should this code be added to function.php?
Yes, you need it in the functions.php to work.
Have you tried my code? If I’m not mistaken, the WooCommerce product pages are the common “post” pages. So I think my code could work with them too. Of course, it needs to be tested in practice.
I searched the source of the WP Optimize plugin and found the function delete_cache_by_url in the WPO_Page_Cache class.
So to clean cache for the different language, I wrote the following code. Maybe it will be useful for somebody elsefunction wp_optimize_dlang_cache_clean($new_status, $old_status, $post) { if(in_array($post->post_type, ['post', 'page']) && $new_status === 'publish') { if(function_exists('pll_get_post_language') && function_exists('pll_default_language')) { $post_lang = pll_get_post_language($post->ID); // fr $def_lang = pll_default_language(); // en if($post_lang && $def_lang && $post_lang != $def_lang) { $url = home_url() . '/' . $post_lang . '/'; if(class_exists('WPO_Page_Cache')) { WPO_Page_Cache::delete_cache_by_url($url, false); } } } } } add_action('transition_post_status', 'wp_optimize_dlang_cache_clean', 10, 3);pll_get_post_language and pll_default_language functions are from the Polylang plugin to get the current post language and the default site language.
Is the force deleting the .html, .php and .gz files of the required directory in WP Optimize cache folder equal with the partial clearing cache for this page?
What will appear if I delete them?No, my question is about the free part of your plugin.
I use the “Ultimate Member” without any paid extensions, all I wrote about is in the base plugin functionality.