cabrerahector / wordpress-popular-posts

WordPress Popular Posts - A highly customizable WordPress widget that displays your most popular posts.
https://wordpress.org/plugins/wordpress-popular-posts/
GNU General Public License v2.0
279 stars 83 forks source link

Locale that isn't in the wordpress-popular-posts/src/Moment/Locales directory cause the plugin to crash #234

Closed ofer closed 4 years ago

ofer commented 4 years ago

Describe the bug If wordpress is set to a locale not in the Locales directory, the plugin throws an exception because it cannot find the proper locales file (happens in he_IL)

To Reproduce Steps to reproduce the behavior:

  1. Go to any page that uses the shortcode with the wordpress locale set to any locale not in a file (our case, he_IL)

Expected behavior Expectation is for the system not to throw an exception, possibly default to English locale

cabrerahector commented 4 years ago

Hi @ofer,

I switched my locale to es_VE (which doesn't have a locale file available) and the plugin didn't crash. Could you please share your shortcode settings so I can test them out?

cabrerahector commented 4 years ago

Also, if you could share the exact error message you're seeing that would help a lot.