• Resolved therealgilles

    (@chamois_blanc)


    I have noticed that the plugin writes its own file user_settings.php. That is not a good idea. Please change the location to something like wp-content/uploads/adaptative-images/. Plugin directories should be for plugin files, not settings.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter therealgilles

    (@chamois_blanc)

    Additionally $wp_content_dir and $wp_content_url are also available from WP functions:

       $wp_content_dir = wp_upload_dir().'/..'; // or WP_CONTENT_DIR, though not recommended
    
       $wp_content_url = content_url();

    I wonder what the reason for modifying a plugin file is. Please fix ??

    Thread Starter therealgilles

    (@chamois_blanc)

    I also think that the better place does plugin options is in the WP database.

    Plugin Author Takis Bouyouris

    (@nevma)

    Hello, @chamois_blanc and thank you for your proposals.

    However:

    1) The user-settings.php is a special file that the plugin needs to store the user settings (which are already in the database) in order to use for image requests which hit the adaptive-images-script.php directly. There is no reason to put it elsewhere, we prefer the plugin to be as self contained as possible.

    2) There are many-many edge cases and scenarios that this approach would simply not be enough. It would be enough if WordPress was always installed in the root directory of the server and the site url was the same as the wp-content url.

    3) As I said in [1] the user settings are indeed in the database, but we need to store them elsewhere as well, because, when image requests arrive to a website we do not want to load the whole of WordPress for each and every one of them.

    Cheers,
    Takis

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Writing to user-settings.php is not a good idea’ is closed to new replies.