wppunk / WPPlugin

Boilerplate for WordPress plugin using autoload, coding standard, webpack, PHP/JS tests, etc.
MIT License
147 stars 25 forks source link

Incorrect pathname #7

Closed JoyceBabu closed 4 years ago

JoyceBabu commented 4 years ago

The compiled file path is assets/build/js/main.js and not assets/js/build/main.js

https://github.com/wppunk/WPPlugin/blob/c837f32bb937f27957b27efca387d824373eaed5/src/Front/Front.php#L58

Similarly, the path to the css file is also incorrect.

JoyceBabu commented 4 years ago

Shall I create a PR fixing this and #5?

wppunk commented 4 years ago

@JoyceBabu sure

JoyceBabu commented 4 years ago

The path to settings.css and settings.js are still incorrect. It is missing the admin directory in the path.

assets/build/js/admin/settings.js and assets/build/css/admin/settings.css.

wppunk commented 4 years ago

@JoyceBabu Thank you for your attention to detail. Also, I think the Setting name is incorrect for this class. I want to rename to SettingsPage this better describes this class.

JoyceBabu commented 4 years ago

I had gone through a few plugins including this one and Google Site Kit to get a better idea on how to properly structure a Wordpress plugin that I am developing.

Also, I think the Setting name is incorrect for this class. I want to rename to SettingsPage this better describes this class.

I too thought so. In my case, I have created an Admin class for handling the generic admin stuff, and a separate Settings class to handling the settings page. SettingsPage sounds better.

JoyceBabu commented 4 years ago

Looks like you missed one 😀

https://github.com/wppunk/WPPlugin/blob/8461a4289238dcc91287e0b20a160cb39bb4e157/.tests/php/unit/Admin/SettingsTest.php#L102

assets/build/js/admin/settings.js