SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    724
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    functions.php is super sensitive

    am using wpEditor.
    It seems that not only it won't let me ftp files to the server (gives me permission error even though i have the permissions) but lately i went to edit the functions.php.
    i created an error(unintentionally).
    Even after i removed the offending lines, i was not able to save the page. Or copy & paste over it the original copy of functions.php that i had saved in case this happened.
    has anyone come across this & is there a way for me to get around it?
    Also wpEditor won't let me upload & overwrite an already existing files.
    is there a better editor for wp?
    thx
    D

  2. #2
    SitePoint Addict
    Join Date
    Oct 2008
    Location
    Virtual World is my location
    Posts
    311
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Well if I understand correctly, you tried to edit something in functions.php via the wp-admin and it resulted in an error. Once an error occurs it stays and the only option is to either edit the functions.php by FTP or via CPANEL / hosting panel. You say that the FTP is not working. In that case you need to go via the hosting panel check and update the file permissions and try to copy paste the functions.php from your local system to the online file and save it and that should work.
    RecipesNext.com - recipes, kitchen queries, videos & more...
    BargainNext.com - coupons / deals / bargains / offers & more...

  3. #3
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    functions.php of the current theme is loaded before any plugin, so you shouldn't be editing it from within wp-admin, coz as you found out - if you screw up you're jacked!

    Basically, editing any theme/plugin/WordPress core file from within wp-admin is a seriously bad idea.
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!

  4. #4
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    724
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    yup!
    but afaik it's the only way to do it.
    w/the exception of doing it on a local sandbox first.

  5. #5
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,044
    Mentioned
    187 Post(s)
    Tagged
    2 Thread(s)
    IMHO anything and everything (except possibly very minor edits like fixing a typo or making a small tweak) should be done on localhost first, tested, and uploaded after a backup has been saved.

    You may be able to get away with editing a live site for a while, but sooner a later you'll get bit.

  6. #6
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mittineague View Post
    IMHO anything and everything (except possibly very minor edits like fixing a typo or making a small tweak) should be done on localhost first, tested, and uploaded after a backup has been saved.
    Someone who edits theme/plugin code (editing core code is just asking for trouble) regularly should be using a SCM - not doing so is just being cavalier! I've never understood why people edit code directly on a production site, thats just playing Russian roulette.
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!

  7. #7
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Location
    Augusta, Georgia, United States
    Posts
    4,146
    Mentioned
    16 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by asp_funda View Post
    I've never understood why people edit code directly on a production site, thats just playing Russian roulette.
    Partially the systems fault for providing the tools to edit those types of files directly through the admin. Another part is the ignorance of site builders and developers. The way Wordpress provides direct edit capabilities through an admin UI is just asking for trouble. An assumption is immediately formed by ignorant users that it is ok to edit files directly on production when it in deed is not. I'm not just going to bash Wordpress though on that considering many other systems provide similar tools with comparable consequences.
    The only code I hate more than my own is everyone else's.

  8. #8
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by oddz View Post
    Partially the systems fault for providing the tools to edit those types of files directly through the admin.
    That's like saying its a car's fault just coz you can drive it up a pole!
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!

  9. #9
    SitePoint Addict
    Join Date
    Oct 2008
    Location
    Virtual World is my location
    Posts
    311
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by oddz View Post
    Partially the systems fault for providing the tools to edit those types of files directly through the admin. Another part is the ignorance of site builders and developers. The way Wordpress provides direct edit capabilities through an admin UI is just asking for trouble. An assumption is immediately formed by ignorant users that it is ok to edit files directly on production when it in deed is not. I'm not just going to bash Wordpress though on that considering many other systems provide similar tools with comparable consequences.
    Yes, on a live site its best to disable direct edit capabilities in wordpress using htaccess so that even in error no one is able to make changes via the wordpress editor.
    RecipesNext.com - recipes, kitchen queries, videos & more...
    BargainNext.com - coupons / deals / bargains / offers & more...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •