Community Forums › Forums › Archived Forums › General Discussion › Genesis auto-update doesn't respect DISALLOW_FILE_EDIT
- This topic has 4 replies, 2 voices, and was last updated 10 years, 1 month ago by benValice.
-
AuthorPosts
-
February 2, 2014 at 12:46 pm #88202benValiceMember
WordPress has a DISALLOW_FILE_EDIT constant which is used to tell plugins and themes to not edit the file system under any circumstances. Looking through the code for the genesis auto-update system, it doesn't look like Genesis respects this constant though.
When DISALLOW_FILE_EDIT is set to true WordPress hides items such as the theme code editor, and plugin installation page, so it'd make sense that Genesis should completely hide the auto-update option field, and never check for updates.
It might not be a bad idea to also introduce some of your own constants to control Genesis auto updating.
February 3, 2014 at 3:06 am #88299Gary JonesMemberHi Ben,
I'm afraid you're mistaken - the constant is for disallowing the editing of files via the built-in Theme and Plugin Editors - not for disabling auto-updates of themes, plugins or core. As such, Genesis should not be looking for this constant.
If you want to disable auto-updates, there's the theme setting. If you want to disable programatically then you can use add
remove_theme_support( 'genesis-auto-updates' );
sometime after the genesis_init priority 10 hook fires. Removing theme support will also hide the corresponding options on the Theme Settings page, so users won't even know about it.Question is, why would you want to disable automatic updates?
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
February 3, 2014 at 2:28 pm #88398benValiceMemberExcuse me, I linked to the wrong constant, you're correct about DISALLOW_FILE_EDIT, I was thinking about DISALLOW_FILE_MODS; my mistake. I use these constants because we manage WordPress sites with git and composer, composer managing plugin and theme dependencies (such as Genesis). Allowing WordPress or Genesis to autoupdate makes the production, development, and staging go out of sync; which can cause issues during development.
February 3, 2014 at 7:04 pm #88447Gary JonesMemberI've not dived into it fully, but the WP core already checks for DISALLOW_FILE_MODS, and disables all updates accordingly, so it may be that Genesis can't update anyway if that constant is true.
You could try setting Genesis version to 2.0.1, defining the constant to be true, then visiting the Updates page (or waiting at least 12 hours), and see if Genesis says an update is available. If so, then there's a problem (with a relatively simple fix in Genesis that would probably be in 2.1 if so), and if not, then everything is working. Do let me know the result.
As stated earlier, if you want to explicitly disable Genesis automatic updates, regardless of whether the constant is defined as true, you can do.
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
February 3, 2014 at 7:36 pm #88452benValiceMemberPerhaps I'm misunderstanding the system. Looking through it now it seems you're actually handing off to WordPress to update the files, and providing information for it using the genesis_update_push function? If so then WordPress would respect the constant and not attempt to update?
If so, then really I'd just recommend hiding the option panel if DISALLOW_FILE_MODS is set to true, as the options are no longer used anywhere.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.