expresstechsoftware / connect-memberpress-discord-add-on

This add-on enables connecting your MemberPress enabled website to your discord server. Now you can add/remove MemberPress members directly to your discord server roles, assign roles according to your member levels, unassign roles when they expire, change role when they change membership.
GNU General Public License v2.0
4 stars 1 forks source link

Need to move the discord_api_logs.txt file into wp-content #52

Closed ravisoni6262 closed 2 years ago

ravisoni6262 commented 2 years ago

If the file is not writable (common for plugin folders on some setups) then an error is thrown which also leads to the JS on the settings page hanging.

Warning: fopen(../wp-content/plugins/pmpro-discord-add-on/discord_api_logs.txt): failed to open stream: Permission denied in ../wp-content/plugins/pmpro-discord-add-on/includes/pages/error_log.php on line 4

The best practice for logs like this is to create a file in the /wp-content/ folder and update it there.

When the file is created, a random 8 character or so string should also be added to the filename (and stored in wp_options) so the file is not easily discoverable by users who know its location.