Don’t activate WP Post Stats plugin with WordPress 3.9.1

Why I even tried the WP Post Stats plugin

I’ve been trying to find a good plugin that will display the unique views on posts and pages and ran into the WP Posts Stats while searching from the Dashboard – Plugins menu.

I tried a couple of plugins before this one, but they lacked one thing or another, such as excluding by post ID those pages or post where you DON’T want to display the view count.

What happens when you activate the plugin

Anyway, I activated the plugin and the next thing I knew was that I had lost connectivity to my /wp-admin folder and also to my domain’s website (www.corpicorp.com). Both displayed a blank screen.

This means that once you activate it there’s no way back from your WP Dashboard. You won’t be able to deactivate the plugin this way.

Your website is also rendered useless because now, when you open it using a web browser, all you’ll see is a blank screen.

I was shocked at first and didn’t know what was going on. I thought that there was something wrong with my web host provider or that maybe I had done something wrong myself, maybe a conflict with the last 2 or 3 plugins that I had been testing in the last hour or so.

I checked then the html source code of that blank screen, and this was it’s only content:

<script type="text/javascript">
        /* <![CDATA[*/
        function views_default_templates(template) {
                var default_template;
                switch(template) {
                        case 'template':
                                default_template = "%VIEW_COUNT% views";
                                break;
                        case 'most_viewed':
                                default_template = "<li><a href=\"%POST_URL%\"  title=\"%POST_TITLE%\">%POST_TITLE%</a> - %VIEW_COUNT% views</li>";
                                break;
                }
                jQuery("#views_template_" + template).val(default_template);
        }
        /* ]]> */
</script>
<form method="post" action="http://www.corpicorp.com/wp-admin/admin.php?page=wp-post-stats/post-stats-options.php">
<div class="wrap">

Troubleshooting

I was then sure that the problem had been caused by this plugin only and decided to open a ticket with them.

This is the thread I opened at the WordPress support forum about my issue with their plugin: WP post stats crashed my site.

This is the link to the Description of the WP Post Stats plugin, where they actually state that it is compatible up to WordPress 3.8.3

WP Post Stats plugin compatible up to WordPress 3.8.3

WP Post Stats plugin WordPress description

Yes, maybe I should have checked this before installing and activating it.

Or maybe they should update their description, so that when you search for new plugins from your WP Dashboard, you can clearly see that this plugin is NOT currently supported with the current versions of WordPress. And not only that! It should clearly state somewhere and WARN you that it will make your site UNUSABLE if you activate it!

Different solutions:

Deactivating all WordPress plugins via SQL

After a while it came to my mind that I should try to update something in the database through an SQL query. Some sort of field in the MySQL DB should tell WordPress to stop trying to use this plugin. I found a couple of articles about it, but this one describes very well how to deactivate all WordPress plugins via the DB.

Basically, the query to do it at once is:

UPDATE wp_options SET option_value = ” WHERE option_name = ‘active_plugins’;

However,  I didn’t want to risk it by doing an UPDATE before doing a SELECT to display the rows that I wanted to affect.

I ran this query from my phpMyadmin SQL tab:

SELECT * FROM wp_options WHERE option_name like ‘active_plugins’;

Only one row came up. Since I had no time to read the previous article in its length, I did not know if this was actually was I was supposed to expect.

Deleting the plugin files via FTP

I thought then that it could be a good idea to connect via FTP and delete the damn thing.

I opened my FileZilla client, connected to my site’s FTP server and browsed to the /wp-content/plugins folder. I deleted the entire “wp-post-stats” folder and that did the trick!

I was again able to login to my WP Dashboard and my domain was again accessible to the public. This was a huge relief.

Lessons learned:

  • Don’t just install any plugin you see while searching for new plugins from the WP dashboard. Make some research first.
  • Don’t use “WP Post Stats” plugin if you’re running the latest version of WordPress (3.9.1 by the time I’m writing this).

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>