Skip to content

Double slash (//) in lcp_paginator.css URL causes 404 errors #531

@Daeevr

Description

@Daeevr

There is a small bug in the lcp_pagination_css() function that results in a double slash (//) in the URL when loading lcp_paginator.css.

The issue is in list-category-posts.php from line 235.

Steps to Reproduce:

  1. Run a broken link check on a site using this plugin.
  2. Observe that the generated URL for lcp_paginator.css contains //, e.g.:

/wp-content/plugins/list-category-posts//lcp_paginator.css?ver=d8d9a89ba25b7821879fa26618f16d2c

  1. Some tools and scripts may treat this as a broken link, even though browsers can resolve it.

Cause:
The function plugin_dir_url(FILE) already includes a trailing slash. However, in lcp_pagination_css(), another slash is manually added:

$css_file = plugin_dir_url(__FILE__) . '/lcp_paginator.css';

This results in //lcp_paginator.css in the URL.

Proposed Fix:
Change line 241:

$css_file = plugin_dir_url(__FILE__) . '/lcp_paginator.css';

To:

$css_file = plugin_dir_url(__FILE__) . 'lcp_paginator.css';

This prevents the double slash while keeping the URL structure correct.

Thanks for the great plugin! Just wanted to report this small issue. 😊

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions