S
S
Sergey Krivosheev2018-06-06 16:58:20
WordPress
Sergey Krivosheev, 2018-06-06 16:58:20

Where to save the file so that when the plugin is updated, they are not deleted on Wordpress?

Good afternoon. Developed my own WordPress plugin. For it to work, it is necessary that there are files with signatures. At first I put them in the folder with the plugin, but then when I updated the plugin, the folder became empty. they are not in the distribution.
Where is the right place to store these files? You don't need a user interface to upload files. And if you do it, then where is the right place to put them? to the wp-content/uploads folder? how safe would it be from getting direct links to them through the site?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Druzhaev, 2018-06-06
@Nemozar

in wp-content/uploads - create a new folder of your own.
Protect it with htaccess file. Inside the folder, put an empty index.php
Inside your php files, check for the presence of a constant:

// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;

It is not necessary to use all three methods.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question