Title: prevent direct access
Last modified: September 23, 2016

---

# prevent direct access

 *  [Mustafa Uysal](https://wordpress.org/support/users/m_uysl/)
 * (@m_uysl)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/prevent-direct-access/)
 * Hello,
 * **class.akismet-widget.php** file open to direct calls. Could you add something
   like
 *     ```
       if ( ! defined( 'ABSPATH' ) ) {
       	exit; // Exit if accessed directly.
       }
       ```
   
 * Also, two of wrapper functions seems rotten. Please check `akismet_add_comment_nonce`
   and `akismet_update_alert`
 * Sorry for posting here, I couldn’t find repo on github 😉

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Christopher Finke](https://wordpress.org/support/users/cfinke/)
 * (@cfinke)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/prevent-direct-access/#post-8214537)
 * Thanks for the heads up about the wrapper functions; I’ve fixed them in [https://plugins.trac.wordpress.org/changeset/1501241/akismet/trunk](https://plugins.trac.wordpress.org/changeset/1501241/akismet/trunk)
 * The `.htaccess` file should prevent `class.akismet-widget.php` from being accessed
   directly. If you’re running nginx, a configuration like the one here: [https://www.tinywp.in/akismet-nginx-rewrite-rules/](https://www.tinywp.in/akismet-nginx-rewrite-rules/)
   should do the same.
 *  Thread Starter [Mustafa Uysal](https://wordpress.org/support/users/m_uysl/)
 * (@m_uysl)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/prevent-direct-access/#post-8214642)
 * > [https://plugins.trac.wordpress.org/changeset/1501241/akismet/trunk](https://plugins.trac.wordpress.org/changeset/1501241/akismet/trunk)
 * Thanks 🙂
 * > The `.htaccess` file should prevent `class.akismet-widget.php` from being accessed
   > directly. If you’re running nginx, a configuration like the one here: [https://www.tinywp.in/akismet-nginx-rewrite-rules/](https://www.tinywp.in/akismet-nginx-rewrite-rules/)
   > should do the same.
 * Yes, I know that, but most of nginx users probably don’t have right configuration.
   It would be better to solve problem inside the plugin.(IMO)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘prevent direct access’ is closed to new replies.

 * ![](https://ps.w.org/akismet/assets/icon-256x256.png?rev=2818463)
 * [Akismet Anti-spam: Spam Protection](https://wordpress.org/plugins/akismet/)
 * [Support Threads](https://wordpress.org/support/plugin/akismet/)
 * [Active Topics](https://wordpress.org/support/plugin/akismet/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/akismet/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/akismet/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Christopher Finke](https://wordpress.org/support/users/cfinke/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/prevent-direct-access/#post-8214537)
 * Status: not a support question