Discover Centmin Mod today
Register Now

Wordpress Related Posts get parameters

Discussion in 'Blogs & CMS usage' started by Matt Williams, Apr 2, 2015.

  1. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    10:14 PM
    latest
    10
    Hello,
    Having an issue with a site and the Related Posts plugin through JetPack and I am hoping someone will be able to assist me with this...

    This is what JetPack support team responded to me with...

    -------------------
    I spoke with one of our developers about this issue and they let me know that your site is actually syncing fine with Jetpack, but that something appears to be stripping the Related Posts get parameters from your site.

    For example if you go here:
    7 Miracle Herbs for Strong, Healthy Hair - hair buddha

    You should get a JSON object returned, but instead nothing shows up. It should look more like this:
    https://www.xyu.io/2014/09/wordpress-performance-with-hhvm/?relatedposts=1


    Our suggestion would be to look at your server configuration and have a look to see what is stripping the get parameters. Then make sure you whitelist relatedposts and relatedposts_* from your get parameters stripping code.
    ----------------------

    If anyone can help with this, It would be appreciated!
     
  2. eva2000

    eva2000 Administrator Staff Member

    53,461
    12,128
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,668
    Local Time:
    12:14 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    what does you site nginx vhost look like ?
     
  3. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    10:14 PM
    latest
    10
    server {
    # listen 80;
    listen 80 default_server backlog=256;
    server_name ngx.hairbuddha.net;
    root html;

    access_log /var/log/nginx/localhost.access.log main buffer=32k;
    error_log /var/log/nginx/localhost.error.log error;

    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;

    # limit_conn limit_per_ip 16;
    # ssi on;

    location / {

    # block common exploits, sql injections etc
    include /usr/local/nginx/conf/block.conf;

    # Enables directory listings when index file not found
    # autoindex on;

    # Shows file listing times as local time
    # autoindex_localtime on;

    # Enable for vBulletin usage WITHOUT vbSEO installed
    # try_files $uri $uri/ /index.php;

    }

    # example nginx-http-concat
    # /csstest/??one.css,two.css
    #location /csstest {
    #concat on;
    #concat_max_files 20;
    #}

    include /usr/local/nginx/conf/staticfiles.conf;
    include /usr/local/nginx/conf/cinfo.conf;
    include /usr/local/nginx/conf/php.conf;
    #include /usr/local/nginx/conf/phpstatus.conf;
    include /usr/local/nginx/conf/drop.conf;
    #include /usr/local/nginx/conf/errorpage.conf;

    }
     
  4. eva2000

    eva2000 Administrator Staff Member

    53,461
    12,128
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,668
    Local Time:
    12:14 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    if you comment out
    Code:
    include /usr/local/nginx/conf/block.conf;
    restart nginx/php-fpm does it work ?
     
  5. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    10:14 PM
    latest
    10
    No, That was actually commented out prior to posting this to you - I un-commented it because it should be lol!
     
  6. eva2000

    eva2000 Administrator Staff Member

    53,461
    12,128
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,668
    Local Time:
    12:14 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  7. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    10:14 PM
    latest
    10
    You know what, As I think of it - your right lol! I ran the WP auto install and didn't even think about looking at this.
     
  8. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    10:14 PM
    latest
    10
    I'll just go back to doing it manually - seems to be having issues with the auto installer lately
     
  9. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    10:14 PM
    latest
    10
    woops, sorry - gave the wrong conf file to you

    server {
    server_name hairbuddha.net www.hairbuddha.net;

    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;

    # limit_conn limit_per_ip 16;
    # ssi on;

    access_log /home/nginx/domains/hairbuddha.net/log/access.log combined buffer=32k;
    error_log /home/nginx/domains/hairbuddha.net/log/error.log;

    root /home/nginx/domains/hairbuddha.net/public;

    include /usr/local/nginx/conf/wpsupercache_hairbuddha.net.conf;

    location / {
    # Enables directory listings when index file not found
    #autoindex on;

    try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php;

    }

    include /usr/local/nginx/conf/wpsecure_hairbuddha.net.conf;
    include /usr/local/nginx/conf/php.conf;
    include /usr/local/nginx/conf/staticfiles.conf;
    include /usr/local/nginx/conf/drop.conf;
    #include /usr/local/nginx/conf/errorpage.conf;
    }
     
  10. eva2000

    eva2000 Administrator Staff Member

    53,461
    12,128
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,668
    Local Time:
    12:14 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    download the latest version of the auto installer, make a update for .08 beta02 detection :)

    also please post code in CODE tags.. easier to read
     
  11. eva2000

    eva2000 Administrator Staff Member

    53,461
    12,128
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,668
    Local Time:
    12:14 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Google.. see it could be Super Cache doesn't work with related posts WordPress › Support » Related Posts Jetpack doesn't work with WP Super Cache ?

    This suggests WordPress › Support » Related posts feature not working that Super Cache hasn't be enabled/configured properly. After auto installer installs, you still have to manually enable and configure Super cache in wordpress super cache section

    The WP auto installer should of given some outlined steps after install i.e.

    Code:
    ------------------------------------------------------------
    To complete setup:
    1. Enable Permalinks (DO NOT use links with .html extensions for performance reasons) i.e. /%post_id%/%postname%/
    2. Settings Menu > Super Cache > Easy tab and enable it by checking Caching On (Recommended) and hit Update Status
    3. Advanced tab and check Use mod_rewrite to serve cache files. (Recommended) and hit Update Status
    4. WP Security Menu > Settings > Check All except Enable Live Traffic tool and hit Update settings
    5. Settings Menu > Updates Notifier and setup your notify email address and cronjob (save and test button to check)
    6. Settings Mnenu > Autoptimize and check Optimize HTML, JavaScript and CSS options (show advanced settings)
    7. Settings Menu > Limit Login Attempts and configure as desired or leave as defaults
    8. Sucuri Security Menu and top left click Generate API key for your domain/email and configure your Settings tab
    9. WP-Optimize Menu and configure as needed
    10. Memory Usage Menu > Settings and adjust accordingly
    11. GTmetrix Menu > setup and register your GTmetrix Account and API Key
    12. go-newrelic plugin installed but not activated read https://wordpress.org/plugins/go-newrelic/installation/
    13. Tools > P3 Plugin Profiler > Start Scan to profile all your plugins
    14. Plugins > Query Monitor is disabled by default, enable to check MySQL query stats
    15. Plugins > DB Cache Reloaded disabled by default unsure if works with Wordpress 4.x ?
    16. Appearance > Theme Options (Responsive theme) > Home Page nav bar > Uncheck Overrides Wordpress front page option
    17. Seo Menu (Yoast SEO) > configure accordingly
    18. Settings > UpdraftPlus Backups > Settings set file/database backup intervals & optional backup to remote storage
    19. Analytics > Settings > configure your Google Analytics UA Code
    ------------------------------------------------------------
     
  12. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    10:14 PM
    latest
    10
    One of the WP Super Cache settings I missed is the

    Don’t cache pages with GET parameters. (?x=y at the end of a url)
    So checking that should fix this...
     
  13. eva2000

    eva2000 Administrator Staff Member

    53,461
    12,128
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,668
    Local Time:
    12:14 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    great will add that note to auto installer's set of instructions too :)

    edit: updated auto installer for all Centmin Mod Premium users
     
    Last edited: Apr 2, 2015
  14. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    10:14 PM
    latest
    10
    Just to give an update to this issue which I finally fixed -

    Within the domain.conf file it has this:
    Code:
    try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php
    By adding
    Code:
    ( ?q=$uri&$args; )
    at the end fixed it along with the ( Don’t cache pages with GET parameters. (?x=y at the end of a url) checked in the WP Super Cache config

    So the whole line would look like:
    Code:
    try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?q=$uri&$args;
    to work with the Jetpack "Related Posts" Plugin

    Which I actually found here: How I Solved Related Posts not Showing when Running WordPress, JetPack, and Nginx | Johnathan Lyman
     
  15. eva2000

    eva2000 Administrator Staff Member

    53,461
    12,128
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,668
    Local Time:
    12:14 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  16. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    10:14 PM
    latest
    10
    Excellent! Thanks George!
    One thing that I did notice is that Centmin Mod doesn't use "Mod Re-Write" so why do the directions say to use it?

    Code:
    Then go to Advanced tab and check “Use mod_rewrite to serve cache files. (Recommended)” and hit Update Status
    I've always used PHP selection with Centmin Mod which seem to work well.
     
  17. eva2000

    eva2000 Administrator Staff Member

    53,461
    12,128
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,668
    Local Time:
    12:14 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    mod_rewrite is nginx rewrite as you want nginx to do the caching not php-fpm :)
     
  18. rdan

    rdan Well-Known Member

    5,439
    1,398
    113
    May 25, 2014
    Ratings:
    +2,187
    Local Time:
    10:14 AM
    Mainline
    10.2
    Super Cache > Mod Rewrite performs very much and really well compare to Super Cache > PHP Caching.