WordPress.org

Ready to get started?Download WordPress

Forums

Theme-Check
Theme Check gives warning for file_put_contents (4 posts)

  1. casper1
    Member
    Posted 2 years ago #

    Hello,
    I'm using file_put_contents and file_get_contents functions in my theme to write a small text on a text file stored in the temp folder.

    But the theme-check plugin gives me following warnings:

    WARNING: file_get_contents was found in the file xxx.php possible file operations.
    WARNING: file_put_contents was found in the file xxx.php possible file operations.

    I could not find any alternative wordpress function. Can you please suggest how can I get rid of above warnings?
    Thanks.

    http://wordpress.org/extend/plugins/theme-check/

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    Why do you need to store anything in a file? Why not use the database?

  3. casper1
    Member
    Posted 2 years ago #

    I want to get get the twitter feed, and store in a temp file, so that it does not make requests to twitter everytime the page is load.

  4. esmi
    Forum Moderator
    Posted 2 years ago #

    Store the feed in the database temporarily. Themes submitted to the Theme Repository are not allowed to open or write to files - hence the warning in the Theme Check plugin.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic