presslabs / toplytics

Plugin for displaying most viewed content using data from a Google Analytics account. Relieves the DB from writing every click.
https://www.presslabs.com/code/toplytics/
30 stars 9 forks source link

css path is wrong #166

Closed 1008k closed 1 year ago

1008k commented 1 year ago

Hello. Thanks for the great plugin!

The CSS path added when toplytics is installed is as follows. <link rel="stylesheet" id="toplytics/toplytics.php-css" href="https://exsample.com/wp-content/plugins/toplytics/components/../resources/backend/css/toplytics-admin.css?ver=4.0.10" media="all">

The code below uses a relative path to register CSS, but isn't a relative path necessary? https://github.com/presslabs/toplytics/blob/de5947430a97dc1215744fa566b92e7b514a0fed/src/components/Backend.php#L211 https://github.com/presslabs/toplytics/blob/de5947430a97dc1215744fa566b92e7b514a0fed/src/components/Backend.php#L227

I would appreciate it if you could consider it.

Best Regards.

DenisFlorin commented 1 year ago

Hello @1008k,

This is the path on my end: /wp-content/plugins/toplytics/resources/backend/js/

2022-11-22_11-19

2022-11-22_11-20

Can you see a 404 error for these files when the plugin is installed on your website?

The path

wp-content/plugins/toplytics/components/../resources/backend/css/

Will become wp-content/plugins/toplytics/resources/backend/css/, because .. from above is used to move to the parent directory of the current directory or the directory one level up from the current directory.

Thank you,

1008k commented 1 year ago

@DenisFlorin Wow! The resources were loading just fine. It's embarrassing that I made a rudimentary mistake😅

Thank you for confirming.