My WordPress error log is going to /var/log/php-fpm/www-error.log. That's not where I want it. In fact, it took me too long to figure that out. (I'm new to WP and PHP). I've tried to redirect it with the following in my wp-config.php define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', '/var/www/html/wordpress/wp-content/wp-errors.log' ); error_log("hello from wp-config\n"); but it has no effect. This code is placed before/above the "stop editing" warning. I've tried other log file locations like /tmp, still, my WP_DEBUG_LOG setting is …
I know how to check capabilities for logged in users, with $can_read = current_user_can('read',$post->ID); But the above code returnes false when the user is not logged. So how can I check if the visitor has access to it? Thanks!
This is more like of an inquiry. So I enabled my WP_DEBUG_LOG to true. It does work though, debug.log is in my wp-content's directory. But does it also do log rotation like different file for each day? Example: Today's file - debug.log Yesterday's - 2019-12-18-101010-debug.log Does it work like this? Or just debug.log all through out?
Summary: WP CLI can be used to get a JSON output of all the plugins installed on a site, but the output gets corrupted due to warnings although log levels are set to low. Problem Unfortunately, I have a site that runs an outdated plugin producing some warnings. They are not shown on the website, as WP_DEBUG is set to false in wp-config.php. The website runs fine, because there are no fatal errors. WP CLI produces the correct JSON results, …
Basically, I want to show non-logged in users a page that says 'register or log in.' But I want to show logged in users a standard homepage will all my posts.
With a default Wordpress install, with no plugin installed, does the read-only visiting of the website generates write operations in the database? By read-only, I mean: visitors come and don't post user-submitted contents (like comments, etc.) If so, which data is written, and in which database table? (When using for example Apache, logs age written directly in /var/log/apache2/*.log, and I guess Wordpress doesn't do a second layer of logging into the MySQL database, or does it?)
I want to logout with browser closing. Actually my account seems logged out in front-end but appears logged-in in back-end. How can I logged out when I close browser?
So i was debugging my PHP code while working with Wordpress site by writing to debug.log with error_log($message) or trigger_error($message). My message in these log statements keeps on printing thousand of times in debug.log file from a same single statement declared in functions.php (for example purpose here i am logging from themes's functions.php which results in same issue of multiple printing though i was debugging from some snippet plugin) Accordingly to check if this issue is caused by my code …
(I come from a Java development background, so please excuse my lack of PHP and WordPress knowledge.) My understanding of logging in WordPress is that it must first be enabled in wp-config.php and then calls to error_log() can be seen and read. But logging is not just about errors. It is very useful when developing and debugging to be able to log. For this reason many Java logging libraries (e.g. SLF4J) provide the ability to log at the following levels: …
I want to built a small plugin that will save admin each time login and logout activity inside a table. I try many codes but unable to save the login and logout activity. please help. Thank you.
I´m doing a plugin which includes a query to import data from external API into custom post types/taxonomies/medias etc... The query can be really heavy. I had to make logs to know exactly what happens. For the moment I´m saving logs thanks to update_option() to avoid loose logs when I have these kinds of errors : 503 Service Unavailable errors timeout server error php errors etc... But, I got a new error : mysqli_real_connect(): (HY000/2002): Connection refused Maybe because there …
bbPress has an annoying error about bbp_setup_current_user was called incorrectly. bbPress topic and bbPress ticket #2412, and it looks like nothing will change to fix it. On the site we used to use forum as a support platform, but has since then moved to a ticket system, so I've closed the forums, but you can look through them. I've also commented out the notice that was thrown in the backend because of it, but the problem is that the error.log …
One of my WordPress pages went suddenly "blank". Basically to the point that it shows as if there is clean install of wordpress. Files in wp-content/uploads are there, but all the posts from database are gone. While I do have backups, I would like to know, what actually happened. I have found StackOverflow question, but that history does not log queries run by the aplication. Any help is appreciated Edit: Root cause was infected Theme importer: https://www.zdnet.com/article/bug-in-wordpress-plugin-can-let-hackers-wipe-up-to-200000-sites/
Hello Guys I am using buddypress and I am sharing activity on social network like facebook and google and I am using url like https://www.facebook.com/sharer/sharer.php?t=' . $activity_title . '&u=' . $activity_link . ' buy when facebook crawls the page it is not logged in so it redirects to home page so instead of sharing the image and title of that activity what shows on the facebook is the image and title of home page. activity title and link shows correct …
Is there a hook for error_log(...) ? On my development environment I would like to var_dump the results instead of having to check the log file each time.
New job and new project. I inherited a WordPress Multisite were the developers were working on the live site. Thinking I would be the smart new guy. I asked the sysadmin to make a VM copy, assign a new IP and domain name. Now I can't log into the new system to update the settings. It redirects me to the original site to log in. If I go to a subpage does the same. checked the htaccess file, wp-config.php file …
We currently have this config for our logging in our wordpress wp-config.php file define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); @ini_set( 'display_errors', 1 ); @ini_set( 'log_errors', 1 ); @ini_set( 'error_log', dirname(__FILE__) . '/wp-content/debug.log' ); I'm wondering is there a way to get wordpress to create a distinct log file per day. In java land and log4j, there is a RollingDailyFileLogger which renames the log file at mid-night. Is there any package or library which would allow be to define the wordpress debug file …
I'm adding custom request handler using add_action and register_rest_root. Sometimes it's hanging and I'm stuck without any output. I would like to use something like echo "Label"; to debug my code. But echo only outputs to the webpage source, which is not generated for failed request. How can I achieve this? If possible please advice solution which is applicable on the website already exposed to users.
I'm implementing a Kiosk webapp based off WordPress and I have some conditionals which are key, they work based on whether user is logged in or not. I'm aware that after user clicks "remember me" it will keep them logged in for 14 days. However, I want to keep users logged in for as long as possible once they log in through the kiosk. I was maybe thinking 1 month. Is there any limit to how long I can set? …