Ivangelion
Forum Replies Created
-
Forum: Plugins
In reply to: [Media Sync] [Media Sync] [AJAX error] error E: ForbiddenYeah, and I found out to eliminate the issue once and for all, users can untoggle the “LFI: Local File Inclusion” option in “Advanced Firewall Options” section in the All Options page. Thank you again Erol.
Forum: Plugins
In reply to: [Media Sync] [Media Sync] [AJAX error] error E: ForbiddenThank you Erol for the response! It turns out the file import was blocked by another plugin Wordfence: “blocked by firewall for LFI: Local File Inclusion in POST”. After clicking “ADD PARAM TO FIREWALL ALLOWLIST,” the file could be successfully imported.
The above code is wrong. This one should be correct:
// Custom function to redirect restricted posts or categories to the login page function um_redirect_restricted_to_login($wp) { if (!is_user_logged_in()) { // Check if it's a single post or a category if (isset($wp->query_vars['name']) ) { $post_id = url_to_postid($_SERVER['REQUEST_URI']); if($post_id == 0 ){ wp_redirect(get_site_url().'/login?redirect_to='.$_SERVER['REQUEST_URI']); exit; } } else if (isset($wp->query_vars['category_name'])) { if (get_queried_object_id() == 0){ wp_redirect(get_site_url().'/login?redirect_to='.$_SERVER['REQUEST_URI']); exit; } } } } // Hook the function to the 'parse_request' action add_action('wp', 'um_redirect_restricted_to_login');
I’ve come out of something and it seems working:
// Custom function to redirect restricted posts or categories to the login page function um_redirect_restricted_to_login($wp) { if (!is_user_logged_in()) { // Check if it's a single post or a category if (isset($wp->query_vars['name']) || isset($wp->query_vars['category_name'])) { $post_id = url_to_postid($_SERVER['REQUEST_URI']); if($post_id == 0){ wp_redirect(get_site_url().'/login?redirect_to='.$_SERVER['REQUEST_URI']); exit; } } } } // Hook the function to the 'parse_request' action add_action('parse_request', 'um_redirect_restricted_to_login');
Please let me know if this code snippet has any potential issues as well as if there is any fix to the issue that the restricted post is still shown in elementor grid. Thanks.
- This reply was modified 1 year, 7 months ago by Ivangelion.
- This reply was modified 1 year, 7 months ago by Ivangelion.
Just as OP said, adding the code in functions.php will reveal the title instead of showing “Restricted content” or hiding completely if the user is not logged in. Is there any way to hide the post completely for certain categories if the user is not logged in, i.e., not showing the post nor its title completely?
- This reply was modified 2 years, 7 months ago by Ivangelion.
Have you fixed and updated the plugin to enable the import feature? I also couldn’t find the place to import doc files.
Forum: Plugins
In reply to: [Plugin: Nextgen-Gallery] Create Image failed. Check memory limitI turned out using Irfanview batch conversion tool to convert all files from 300 dpi to 72 dpi, and Nextgen can finally generate thumbnails. However, some files would get messages like “Error :[object XMLHttpRequest]”, but their thumbnails were actually generated.
Forum: Plugins
In reply to: [Plugin: Nextgen-Gallery] Create Image failed. Check memory limitI found the problem could very possibly be about DPI.
The jpeg scanned files I uploaded before are about 800×842/900KB/300dpi, and all their thumbnails could not be generated.
To take a experience, I just uploaded two files to Nextgen-Gallery. One is 3000×4000/4.31MB/72dpi jpeg photo file, the other is 800×762/143KB/300dpi. The thumbnail of the former was created without any problem, but the thumbnail of the later could not be created.
Checking lib/gd.thumbnail.inc.php, I found that the message is displayed because the PHP function ImageCreateFromJpeg could not return a resource variable.
This is what i’ve got now, and I have no idea what to do next. Could anyone please help me out?
Forum: Plugins
In reply to: [Plugin: NextGen Gallery] Uploading image problemsI have the same problem, which I cannot create thumbnails due to memory limit issue.
I’ve checked my system memory usage, and it is 173MB used and 850MB available. My current memory_limit in php.ini is 256M, and the wordpress 2.8.1 consumes 13.42MB. Neither totally unistalling nggallery then reinstalling it again, or even changing memory_limit to 512M solved the problem.
Please tell me what I can do. Thank you very much.
Forum: Everything else WordPress
In reply to: [Plugin: Robots Meta] Optimal configuration+1