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!
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; }
if you comment out Code: include /usr/local/nginx/conf/block.conf; restart nginx/php-fpm does it work ?
No, That was actually commented out prior to posting this to you - I un-commented it because it should be lol!
then the problem is you don't have wordpress try_files in root / location set for wordpress see Nginx Wordpress Configuration Examples for rewrite rules & FastCGI Caching or WordPress + Super Cache plugin for Centmin Mod Nginx | wp1.centmincache.com Code: try_files $uri $uri/ /index.php?q=$request_uri; in fact you don't have a wordpress based nginx vhost there at all
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.
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; }
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
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 ------------------------------------------------------------
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...
great will add that note to auto installer's set of instructions too edit: updated auto installer for all Centmin Mod Premium users
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
ah thanks must of mistyped it somewhere.. updating the installer now Also updated the manual WP Super Cache + Centmin Mod Nginx guide at WordPress + Super Cache plugin for Centmin Mod Nginx | wp1.centmincache.com too
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.