x***@qq.com
x***@qq.com
  • 发布:2025-04-20 17:10
  • 更新:2025-04-20 18:33
  • 阅读:77

#插件讨论# 【 WordPress多端应用 - mrTwelve 】20250317最新版本签到报错

分类:uni-app
关联插件: WordPress多端应用


如图所示在更新到【20250317】最新版本后,出现了签到报错的情况,麻烦作者解决以下。

2025-04-20 17:10 负责人:无 分享
已邀请:
mrTwelve

mrTwelve - www.minapper.com

安装更新插件后 禁用启用一次

另外反馈问题最好带上debug报错 不然就是在算命

在 WordPress 中调试(Debug)通常涉及以下几个步骤,可以帮助你定位和解决网站运行中的错误或异常问题。以下是详细的调试方法:


一、启用 WordPress 调试模式

  1. 修改 wp-config.php 文件
    找到 WordPress 根目录下的 wp-config.php 文件,添加或修改以下代码:

    // 启用调试模式  
    define('WP_DEBUG', true);  
    
    // 将错误记录到 /wp-content/debug.log(可选)  
    define('WP_DEBUG_LOG', true);  
    
    // 在页面上显示错误(仅开发环境建议开启)  
    define('WP_DEBUG_DISPLAY', true);  
    
    // 禁用 WordPress 自动修正 HTML 功能(可选)  
    define('SCRIPT_DEBUG', true);  
    • WP_DEBUG_LOG: 错误会写入到 wp-content/debug.log 文件中。
    • WP_DEBUG_DISPLAY: 设置为 false 可隐藏页面上的错误信息(适合生产环境)。
  2. 查看调试日志
    错误日志会生成在 wp-content/debug.log 中,通过 FTP 或服务器文件管理器可直接查看。


二、使用调试插件

  1. Query Monitor

    • 功能:显示数据库查询、PHP 错误、钩子(Hooks)、HTTP 请求等。
    • 安装:在插件库搜索安装并激活。
    • 使用:激活后,页面底部会显示调试工具栏。
  2. Debug Bar

    • 功能:在后台显示调试信息,包括缓存、查询、PHP 错误等。
    • 需要配合扩展插件(如 Debug Bar Cron、Debug Bar Actions and Filters Addon)增强功能。
  3. Log Deprecated Notices

    • 功能:检测并记录 WordPress 弃用的函数和参数。

三、检查 PHP 错误日志

  • 服务器错误日志路径
    通常位于服务器的 /var/log/apache2/error.log/var/log/nginx/error.log(路径可能因环境不同而变化)。
  • 通过 cPanel/Plesk 查看
    大部分主机面板提供直接查看错误日志的功能。

四、处理常见错误场景

  1. 白屏(White Screen of Death, WSOD)

    • 原因:PHP 致命错误或内存不足。
    • 解决方法:
      1. 通过 FTP 重命名当前主题目录(如 wp-content/themes/your-theme 改为 your-theme-bak),强制切换为默认主题。
      2. 禁用所有插件:将 wp-content/plugins 目录重命名为 plugins-bak
  2. 主题/插件冲突

    • 停用所有插件,逐一重新激活,观察问题是否重现。
    • 切换为默认主题(如 Twenty Twenty-Four)测试是否主题导致问题。

五、高级调试工具

  1. Xdebug(本地开发推荐)

    • 功能:PHP 调试工具,支持断点调试、变量跟踪等。
    • 配置:需在 php.ini 中启用并配置 IDE(如 VS Code、PhpStorm)。
  2. Browser DevTools

    • 使用浏览器开发者工具(Chrome/Firefox 按 F12)检查 JavaScript 错误、网络请求问题。
  3. WP-CLI

    • 通过命令行工具运行调试命令,例如:
      wp option list  # 查看所有选项  
      wp cron event list  # 检查计划任务  

六、生产环境注意事项

  • 关闭调试模式
    调试完成后,务必将 wp-config.php 中的 WP_DEBUG 设为 false,避免泄露敏感信息。
  • 使用错误监控服务
    如 Sentry、New Relic 监控线上错误。

七、代码示例:自定义调试

functions.php 中添加自定义调试代码:

// 记录自定义调试信息到 debug.log  
if (!function_exists('log_message')) {  
    function log_message($message) {  
        if (WP_DEBUG === true) {  
            error_log(print_r($message, true));  
        }  
    }  
}  

// 使用示例  
log_message('当前用户ID:' . get_current_user_id());

通过以上方法,你可以系统地排查 WordPress 中的问题。如果遇到具体错误信息,可以结合日志和工具进一步分析!

x***@qq.com

x***@qq.com (作者)

禁用重启以后还是失败,hbx情况如下:

  • mrTwelve

    后台的错误日志

    2025-04-20 17:40

x***@qq.com

x***@qq.com (作者)

debug.log里的内容:

[20-Apr-2025 10:30:52 UTC] PHP Notice:  Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>health-check</code> domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the <code>init</code> action or later. Please see <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /www/wwwroot/xinenw.com/wp-includes/functions.php on line 6121  
[20-Apr-2025 10:31:01 UTC] PHP Notice:  Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>health-check</code> domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the <code>init</code> action or later. Please see <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /www/wwwroot/xinenw.com/wp-includes/functions.php on line 6121  
[20-Apr-2025 10:31:03 UTC] PHP Notice:  Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>health-check</code> domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the <code>init</code> action or later. Please see <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /www/wwwroot/xinenw.com/wp-includes/functions.php on line 6121  
[20-Apr-2025 10:31:03 UTC] PHP Notice:  Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>health-check</code> domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the <code>init</code> action or later. Please see <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /www/wwwroot/xinenw.com/wp-includes/functions.php on line 6121  
[20-Apr-2025 10:31:03 UTC] PHP Warning:  Undefined array key 0 in /www/wwwroot/xinenw.com/wp-content/plugins/app-craft/includes/class/appcraft-user-profile.php on line 38  
[20-Apr-2025 10:31:03 UTC] PHP Warning:  Undefined array key 0 in /www/wwwroot/xinenw.com/wp-content/plugins/app-craft/includes/class/appcraft-user-profile.php on line 39  
[20-Apr-2025 10:31:03 UTC] PHP Notice:  Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>health-check</code> domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the <code>init</code> action or later. Please see <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /www/wwwroot/xinenw.com/wp-includes/functions.php on line 6121  
[20-Apr-2025 10:31:03 UTC] PHP Notice:  Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>health-check</code> domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the <code>init</code> action or later. Please see <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /www/wwwroot/xinenw.com/wp-includes/functions.php on line 6121  
[20-Apr-2025 10:31:04 UTC] PHP Notice:  Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>health-check</code> domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the <code>init</code> action or later. Please see <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /www/wwwroot/xinenw.com/wp-includes/functions.php on line 6121  
[20-Apr-2025 10:31:05 UTC] PHP Notice:  Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>health-check</code> domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the <code>init</code> action or later. Please see <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /www/wwwroot/xinenw.com/wp-includes/functions.php on line 6121  
[20-Apr-2025 10:31:05 UTC] WordPress database error Unknown column 'transaction_id' in 'where clause' for query SELECT id FROM wp_appcraft_points_log WHERE transaction_id = 'pt_6804cce9c176f9561' LIMIT 1 made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, appcraft_signin_api, appcraft_user_sign_in, appcraft_manage_points, appcraft_log_points  
[20-Apr-2025 10:31:05 UTC] WordPress database error Unknown column 'transaction_id' in 'field list' for query INSERT INTO `wp_appcraft_points_log` (`user_id`, `event`, `points_earned`, `inviter_id`, `current_points`, `inviter_count`, `article_id`, `time`, `type`, `transaction_id`) VALUES (1, '用户签到', '5', '0', '100', '0', NULL, '2025-04-20 18:31:05', 'check_in', 'pt_6804cce9c176f9561') made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, appcraft_signin_api, appcraft_user_sign_in, appcraft_manage_points, appcraft_log_points  
[20-Apr-2025 10:31:05 UTC] Failed to log points for user 1: Failed to insert points log:   
[20-Apr-2025 10:31:05 UTC] Points operation failed: Failed to insert points log:   
[20-Apr-2025 10:31:07 UTC] PHP Notice:  Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>health-check</code> domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the <code>init</code> action or later. Please see <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /www/wwwroot/xinenw.com/wp-includes/functions.php on line 6121  
[20-Apr-2025 10:31:08 UTC] PHP Notice:  Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>health-check</code> domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the <code>init</code> action or later. Please see <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /www/wwwroot/xinenw.com/wp-includes/functions.php on line 6121  
[20-Apr-2025 10:31:10 UTC] PHP Notice:  Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>health-check</code> domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the <code>init</code> action or later. Please see <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /www/wwwroot/xinenw.com/wp-includes/functions.php on line 6121  
[20-Apr-2025 10:31:10 UTC] PHP Notice:  Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>health-check</code> domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the <code>init</code> action or later. Please see <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /www/wwwroot/xinenw.com/wp-includes/functions.php on line 6121  
[20-Apr-2025 10:31:11 UTC] PHP Notice:  Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>health-check</code> domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the <code>init</code> action or later. Please see <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /www/wwwroot/xinenw.com/wp-includes/functions.php on line 6121  
[20-Apr-2025 10:31:11 UTC] WordPress database error Unknown column 'transaction_id' in 'where clause' for query SELECT id FROM wp_appcraft_points_log WHERE transaction_id = 'pt_6804ccefac5552743' LIMIT 1 made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, appcraft_signin_api, appcraft_user_sign_in, appcraft_manage_points, appcraft_log_points  
[20-Apr-2025 10:31:11 UTC] WordPress database error Unknown column 'transaction_id' in 'field list' for query INSERT INTO `wp_appcraft_points_log` (`user_id`, `event`, `points_earned`, `inviter_id`, `current_points`, `inviter_count`, `article_id`, `time`, `type`, `transaction_id`) VALUES (1, '用户签到', '5', '0', '100', '0', NULL, '2025-04-20 18:31:11', 'check_in', 'pt_6804ccefac5552743') made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, appcraft_signin_api, appcraft_user_sign_in, appcraft_manage_points, appcraft_log_points  
[20-Apr-2025 10:31:11 UTC] Failed to log points for user 1: Failed to insert points log:   
[20-Apr-2025 10:31:11 UTC] Points operation failed: Failed to insert points log:   
[20-Apr-2025 10:31:12 UTC] PHP Notice:  Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>health-check</code> domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the <code>init</code> action or later. Please see <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /www/wwwroot/xinenw.com/wp-includes/functions.php on line 6121  
[20-Apr-2025 10:31:15 UTC] PHP Notice:  Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>health-check</code> domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the <code>init</code> action or later. Please see <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /www/wwwroot/xinenw.com/wp-includes/functions.php on line 6121  
[20-Apr-2025 10:31:15 UTC] PHP Warning:  Undefined array key 0 in /www/wwwroot/xinenw.com/wp-content/plugins/app-craft/includes/class/appcraft-user-profile.php on line 38  
[20-Apr-2025 10:31:15 UTC] PHP Warning:  Undefined array key 0 in /www/wwwroot/xinenw.com/wp-content/plugins/app-craft/includes/class/appcraft-user-profile.php on line 39  
[20-Apr-2025 10:31:18 UTC] PHP Notice:  Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>health-check</code> domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the <code>init</code> action or later. Please see <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /www/wwwroot/xinenw.com/wp-includes/functions.php on line 6121  
[20-Apr-2025 10:31:18 UTC] WordPress database error Unknown column 'transaction_id' in 'where clause' for query SELECT id FROM wp_appcraft_points_log WHERE transaction_id = 'pt_6804ccf66f8b35390' LIMIT 1 made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, appcraft_signin_api, appcraft_user_sign_in, appcraft_manage_points, appcraft_log_points  
[20-Apr-2025 10:31:18 UTC] WordPress database error Unknown column 'transaction_id' in 'field list' for query INSERT INTO `wp_appcraft_points_log` (`user_id`, `event`, `points_earned`, `inviter_id`, `current_points`, `inviter_count`, `article_id`, `time`, `type`, `transaction_id`) VALUES (1, '用户签到', '5', '0', '100', '0', NULL, '2025-04-20 18:31:18', 'check_in', 'pt_6804ccf66f8b35390') made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, appcraft_signin_api, appcraft_user_sign_in, appcraft_manage_points, appcraft_log_points  
[20-Apr-2025 10:31:18 UTC] Failed to log points for user 1: Failed to insert points log:   
[20-Apr-2025 10:31:18 UTC] Points operation failed: Failed to insert points log:   
  • mrTwelve

    这个错误就是没有更新好插件 ,不行就删除重新安装下

    2025-04-25 13:14

要回复问题请先登录注册