pluginkollektiv / cachify

Smart but efficient cache solution for WordPress. Use DB, HDD, APC or Memcached for storing your blog pages. Make WordPress faster!
https://wordpress.org/plugins/cachify/
GNU General Public License v2.0
99 stars 30 forks source link

Invalid robots.txt entry by disallowing /wp-content/cache/cachify #299

Closed hostz-frank closed 5 months ago

hostz-frank commented 5 months ago

That's a valid output section for the robots_txt function inside inc/class-cachify.php:

/* Output */
$data .= sprintf(
    '%2$sUser-agent: *%2$sDisallow: %1$s/wp-content/cache/cachify/%2$s',
    ( empty( $url_parts['path'] ) ? '' : $url_parts['path'] ),
    PHP_EOL
);

You need to output the User-agent line before disallowing something since you cannot rely on it as already existing. In my case I've seen the plugin's output as first entry of robots.txt which produced an invalid robots.txt file.

stklcode commented 5 months ago

duplicate of #282, should be already fixed in #283

hostz-frank commented 5 months ago

It's not fixed on wordpress.org. What lives there is v2.3.2 of Cachify - in that version it is not fixed. Latest update there is 2,5 years old. Doesn't even look like maintained at all.

stklcode commented 5 months ago

Yes, that's true. Nothing to sugarcoat about that.

The issue is fixed in current development state though, so no point keeping this open here. We should push for a release of v2.4.0 (#293) to make this fix available.