• Resolved DreamOn11

    (@dreamon11)


    Hi,

    I have problems with the plugin:

    – when I want to go to WPP settings page : page crash with 504 Gateway Time-out.
    – when I turn on the plugin, the page where is located summary visits (public page) crash too with 504 Gateway Time-out.

    I try to apply this: https://github.com/cabrerahector/wordpress-popular-posts/wiki/7.-Performance

    But I cannot access WPP admin page.

    For the moment, WPP is running but visits count and summary have been disabled on public pages.

    Can you help me?

    Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter DreamOn11

    (@dreamon11)

    Mysql query which crash:

    SELECT p.ID AS id, p.post_title AS title, p.post_author AS uid, p.post_date AS date, SUM(v.pageviews) AS pageviews FROM wp_popularpostssummary v LEFT JOIN wp_posts p ON v.postid = p.ID WHERE 1 = 1 AND p.post_type IN('post', 'page') AND v.view_datetime > DATE_SUB('2018-04-22 13:02:12', INTERVAL 29 DAY) AND p.post_password = '' AND p.post_status = 'publish' GROUP BY v.postid ORDER BY pageviews DESC LIMIT 10 OFFSET 0

    • This reply was modified 6 years, 11 months ago by DreamOn11.
    Plugin Author Hector Cabrera

    (@hcabrera)

    Hi @dreamon11,

    Please add the following code to your theme’s functions.php file to force enable Data Sampling:

    function wp77654_force_enable_data_sampling(){
        return true;
    }
    add_filter( 'wpp_data_sampling', 'wp77654_force_enable_data_sampling' );

    … or this much shorter version:

    add_filter( 'wpp_data_sampling', '__return_true' );

    If you have a caching plugin installed, flush its cache afterwards so changes are applied.

    Remove this from your theme’s functions.php file when you’re done tweaking WPP’s performance settings.

    Thread Starter DreamOn11

    (@dreamon11)

    Thanks @hcabrera for help.

    Unfortunately, same result: 504 Gateway Time-out…

    Running on VPS dual-core + SSD.

    Plugin Author Hector Cabrera

    (@hcabrera)

    The query you posted earlier seems to come from the WPP widget. For some reason it’s taking WPP a lot of time to read from your database (which should be a fairly quick operation).

    Remove the widget from your site and give it another shot.

    Thread Starter DreamOn11

    (@dreamon11)

    As I wrote, I have disabled all WPP calls in current WP theme.

    I think it is the first page of WPP admin page which show visits summary (day, month…).

    Plugin Author Hector Cabrera

    (@hcabrera)

    That can’t be it, the query would look quite a bit different. The one posted above belongs to the “stock” query WPP builds when displaying the popular lists on the front-end. See:

    SELECT p.ID AS id, p.post_title AS title, p.post_author AS uid, p.post_date AS date, SUM(v.pageviews) AS pageviews

    None of those fields are used in the back-end.

    Other things I’d try:

    • Disable all plugins -except for WPP- and check again.
    • If the problem persists even after that, try switching to another theme for a moment and check one more time.
    Thread Starter DreamOn11

    (@dreamon11)

    @hcabrera

    Miraculously, this morning, the admin page works (maybe because low traffic).

    I confirm the query is generated by this page, because admin page show stats : https://ps.w.org/wordpress-popular-posts/assets/screenshot-4.gif

    So, I have activated Data Sampling and Caching.

    I have a question about Data Logging.

    “After enabling this feature the old data will be deleted every day around midnight.”
    “Data older than the specified time frame will be automatically discarded.” ex: 180 days

    So, if I active this option, views older than 180 days will be deleted?

    Thanks.

    Plugin Author Hector Cabrera

    (@hcabrera)

    So, if I active this option, views older than 180 days will be deleted?

    Correct! Records older than N days will be deleted from the database automatically.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Plugin crash cause MySQL query load time’ is closed to new replies.