• bseddon

    (@bseddon)


    The plugin is well presented and appears to be coded well. But I’ve encountered several bugs trying to activate the plug-in so I thought I write and let you know about the issues and their resolutions before posting a review.

    Having finally been able to activate the plugin in a state that it works I was surprised that given the name of the plugin all there appears to be is a dashboard of summary statistics. I can see the IP address of a visitor. I can see that a specific page was visited. However I do not appear to be able to see what page a visitor with a specific IP address visited. The name ‘Power Stats’ might suggest a bit more depth.

    Also, the plugin records statistics in the shutdown event but does so without any regard to the relevance of the visit. On our site we authenticate user licenses. I don’t need these event to be recorded especially as there is no context available in the stats. Really I only want information about pages and posts visited but I get to see any activity on the site. This is a free tool, I cannot expect the world. But, again, the hyperbole around the name sets a possibly misguided expectation.

    Anyway, on to the problems. I’m running WordPress multi-site and have the PHP GeoIP installed.

    Problem #1

    In function set_country() a check is made to determine if GEOIP_COUNTRY_EDITION is defined. If it is, the geoip.inc file is not loaded. However, this variable is defined when the PHP extension is used. As a consequence the .inc file not loaded but the function in the .nc file which is used to retrieve the country is called leading to an error.

    If the GeoIP extension is loaded the solution is to call instead:

    $this->country = geoip_country_code_by_name($this->get_ip())

    Problem #2

    The activation process assumes either that you are on a single site or on a multi-site and will use network activation. It does not accommodate the scenario that a WP installation uses multi-site but only wants to track stats on a sub-set of the sites.

    The solution is to modify wp_power_stats_activate() so that if the site multi-site but that $_GET[‘networkwide’] != 1 then wp_power_stats_install() is called directly without changing blogs.

    #Problem #3

    Our installation of MySQL uses the strict option. As a result it will not coerce an empty string to false. This is problem in log_visits() because these two line result in an empty value which in turn leads to an empty string being included in the insert statement for the respective fields:

    'is_search_engine' => $this->is_search_engine(),
    'is_bot' => $this->is_bot(),

    When MySQL strict mode is active this is not allowed so the insert fails. The fix is simple. Change the two lines in the following way:

    'is_search_engine' => ($this->is_search_engine() ? '1' : '0'),
    'is_bot' => ($this->is_bot() ? '1' : '0'),

    Then the value included in the insert statement is correct and the insert completes successfully.

    https://www.ads-software.com/plugins/wp-power-stats/

Viewing 1 replies (of 1 total)
  • Plugin Author artifex404

    (@artifex404)

    Hello bseddon,

    Thank you for your extensive error reports and suggestions. I will try to fix those in the next version. Thank you for patience.

Viewing 1 replies (of 1 total)
  • The topic ‘Opportunity to respond before review post’ is closed to new replies.