How do I debug the Akismet plugin?

How do I debug the Akismet plugin?

As of version 3.0.0, we have built debugging support into the Akismet plugin. This works with the debug system that is already in WordPress. Debug information is useful for identifying connection issues with the Akismet API that can prevent the plugin from working properly.

Between versions 3.0.0 and 3.3.3, Akismet will automatically log its debugging information if WP_DEBUG and WP_DEBUG_LOG are enabled. As of version 3.3.4, you must also enable AKISMET_DEBUG. In wp-config.php, add a line that looks like this:

1define( 'AKISMET_DEBUG', true );

Now the plugin will log debug information in the file /wp-content/debug.log

If your site is in production, it is a good idea to update your .htaccess file to deny access to this log file. You need to add this rule;

1234<Files ~ ".log$">;Order allow,denyDeny from all</Files>;

To turn off Akismet』s debugging, either remove this line:

1define( 'AKISMET_DEBUG', true );

or replace it with this line:

1define( 'AKISMET_DEBUG', false );

If you have more general questions about Akismet, please contact us here.

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注