A Coda plugin aimed at PHP & Web development – not in active development.
Current version: 4.1 – Coda 1 and Coda 2
- (Automatic) PHP syntax validation with
jump to errorand auto-save
- Automatic check for updates
- It’s free (you can donate of course)
All features use the editor buffer (no need to save first) – Works with local and remote files – Written in Cocoa/ObjC.
Download Coda PHP & Web Toolkit 4.1 »
Download Coda PHP & Web Toolkit 4.2 beta »
JSHint 2.3.0 included
Removed some legacy options from JSHint configuration
Use any JSHint option, there’s a text field in which you can enter JSHint config options. (separated by comma).
A list of valid options can be found here: jshint.com/docs/options/
Rewritten JSHint-Wrapper (because JSHint works a bit differently now)
Removed some legacy JSHint options
Bugfix for a very improbable exception
Code update (mostly internal stuff)
Dialog layout improved when resized
CSSTidy updated to the current development release. This should now correctly format CSS inside @media-tags.
Integrated HTML 5 compatible tidy for validation and reformatting
New: Validate JS on save (Coda 2 only)
New: Separate CSS minification included
Fix PHP validation on save with selection
Laxcomma setting for JSHINT
Lots of bugfixes
Compatibility with other plugins improved
New: Minify on Publish (Coda 2 only)
New: Modify file extension list for PHP validate on save
Check if Growl is present, includes Growl 1.2 and Growl 1.3 notifier
CSSTidy: New option Remove last ; – control if the last ; in a block is removed or not
CSSTidy: Workaround for wrong @import behavior
JSHint: Doesn’t report useless strict warnings anymore
JSHint: Removed unused –safe option
JSHint: Added link to option documentation in the preferences
CSSTidy/JSMinify: CR/LF handling improved
PHPTidy won’t try to format php files with syntax errors
Rewritten launching of php based tools, more robust now
Refactoring PHP error display
Preferences layout improved, added Google+ link
“Unified” version for Coda 1 and Coda 2
Checks automatically if accidentally more than one plugin is installed
New function: PHP validate on save (Coda 2 only)
CSS Tidy: Update to latest version, CR/LF handling correctly now
Performance improvements (loading time, js functions)
New version notification now shows the new version number…
Plugin path is now correct for Coda 1 and Coda 2
Coda 2 compatible version
New preference setting for JSHint: Use smart tabs
“Go to line” (for PHP errors) now uses the API function in Coda 2, so it scrolls to the error location
Automatic update should now work correctly with Coda 1 and Coda 2
Remove proCSSor because the API service has been cancelled
Small bugfix for Prefs window layout
Internal structure improvement
Fix (improbable) memory leak
Validate PHP syntax before performing PHPtidy
Preferences window improved (links to twitter/fb/donate)
JS Hint: Many more options
JS Hint: Respect line endings, whitespace warnings now correct
JS Tidy: Respect line endings
JS Tidy now also configurable
Respect Tabs/Spaces where available
Automatic Update (finally..!!)
Improved validation results
JS Hint updated
JS Hint: Remove (quite useless) “unsafe character” warning
Result window looks cooler now
Modularized the code
Modularized the code
Prefs window improved
Growl (and growl-like) notifications
Results as floating window
More preferences for PHPTidy
HTML online validation: Included three validator settings
Drop curl, use cocoa instead
Use JSC call instead of shell script
Improved preferences layout
Bugfixes, lots of
Nearly complete code rewrite
Show an short message after updating (only once)
Updated CSSTidy to 1.3.1
HTML Validate output improved
support aka workaround for tidy
JSLint replace by JSHint (upgrade, kind of)
Preference for PHPTidy: Fix statement brackets
Preferences for PHPTidy: New lines, Whitespaces, Comma spacing
Bugfix for umlaut conversion with JSTidy
Set CSS Level for validation (2, 2.1, 3)
Configure PHPTidy braces placement
Warning message (incompatible plugin) improved
Before accessing proCSSor, check if incompatible plugin present
TidyCSS update (current SVN)
W3C online response much more readable
Check for incompatible SBJsonParser
Error messages improved
Updatecheck circumvents cache now
New: Beep only for PHP validation
Preferences window now remembers the open tab
Preferences window revamped (again..)
Shortcuts also shown in the preferences
HTML Tidy version in about window now modified if “use internal” is changed
Improved some tooltips in the preferences
New: procssor.com configurable
New: JSBeautifier included
About window now part of the preferences
Preferences window revamped
Shortcut for JS Beautifier
New: Encoding automatically selected
New: Custom HTML tidy configuration
New: Included a more recent HTML tidy binary
New: procssor.com online service included (experimental)
Goto line now works correctly with different line endings
Line endings now respected in HTML tidy, CSS tidy and PHP tidy
HTML tidy version shown in the about page
Preferences window new layout
JS lint now correctly handles backslashes
Error messages improved
Message sheet layout improved
New: JS Minify
HTML Validation report window now can be close without the annoying “Save Changes”-question
“Reveal in Finder” bugfix at preferences page
Donation button in the about window (Hint: click it :)
CSS tidy now handles CSS3 values starting with a dash (-)
Keyboard shortcuts for CSS tidy and Preferences
Some code clean-up
Update check now daily instead of each time Coda starts
New CSS tidy configuration: Sort attributes
HTML tidy now configurable (in the Preferences) !
Preferences are automatically saved
Bugfix when saving Coda Prefs
Automatic update check now in the background (asynchronous)
CSS tidy now configurable (in the Preferences) !
Less intrusive error-messages on connection failures
Automatic check for updates
CSS tidy integrated
Structured Menu (aka Submenus)
Using the HTML-tidy version delivered with OSX (PowerPC compatible)
Redesigned the error- and “validation okay”-sheets XCode-like
More encodings: ASCII, UTF-16, Windows CP-1252
All functions use the current buffer contents now
Error messages not explicitely state their origin
Updated phptidy to current version 2.10
W3C-Validation online for HTML-files
W3C-Validation online for CSS-files
Help button (on the about sheet) now opens this page
W3C-Validation service, 1st try
Improved Sheet display
Validate HTML (via tidy)
Jump to error line – if PHP validation finds an error
Check for Updates (in the about-box)
File encoding can be chosen
Nice sheets, no more of those ugly alert-boxes
Menu items are only available if they should be
Lots of code cleanup
More useful “About”-dialogue, link to the plugin homepage
Improved exception handling
New features: HTML tidy, Strip PHP, PHP tidy
Included HTML Tidy
Bugfixes, dialogs updated
First have a look here » – if that doesn’t help, please write a comment below.
Enjoy using this plugin?
Just leave a comment or donate (via paypal) ».
For German users I can only recommend all-inkl.com (Partnerlink).
Apply some functions only to the selected area if desired (DONE – in the current beta) Floating result windows/Growl-like notification/Use Growl (DONE – in the current beta) Switch online validators more easy (DONE – in the current beta) Rewrite curl methods in cocoa Add configuration options for JSTidy Automatically install updates Use Coda 2 API for go to line (DONE – in the current beta) Use Coda 2 API for automatic PHP validation before saving Up next: Minify JS/CSS automatically on publishing CSS minify: Check other minifier
- Respect spaces per indent (in different cases)
- PHP tidy: Preserve whitespaces, if possible
- Minification: Upload .min.css or similar, if possible
- Check new HTML5 tidy
- Make PHP tidy more configurable
795 Replies to “Coda PHP & Web Toolkit”
I noticed that after installed, in a mixed php/html document, the search works only in the html code, and if I search for something inside the <?php tags, I cannot find it!
The plugin has no connection to the search function, I assume the problem lies somewhere else.
UPDATE: I also checked the search function – works without problems. Check the search configuration by clicking on the magnifier icon on the left, maybe you selected “Find within selection” or unchecked “Wrap around”.
I really like the html tidy, very handy. It does however convert my html 5 doc into a transtional:
anything happening on that or do we just need to keep converting them back after tidy?
I think there is a bug when minifying CSS, something with a negative margin, for example… margin:0 0 0 -20px; removes the space from the dash, and it becomes margin:0 0 0-20px;
When I said “space from the dash” I meant “space before the dash”
Firefox, Safari and Chrome seem to interpret the CSS in this case correctly – even though the minus sign is missing. So I’m not exactly sure if this is a bug or just an ugly but valid formatting. Is the margin interpreted correctly in your minified CSS?
I am on Chrome v.22 on Mac and it did NOT work, however I did not check other browsers, because I quickly found the minus sign fixed and just went ahead and entered the space manually.
I tried this small snippet, works here in Chrome/Mac:
Ok, I went back to the original code. My mistake as I typed my example wrong. It looks like the below will work
margin:0-17px 0 0;
However, this will not work below (I guess when you have the px before the minus it does not)… That is the same snippet from my CSS.
margin:40px-17px 0 0;
I see, without “px” or just one “px” at the end it works. Nevertheless it’s a bug – is on the todo list for the next version. Thanks!
Love it thank you! I love the cleanup HTML feature :)
Is there a way to run HTML tidy on multiple files, rather than opening them individually?
that’s currently not possible, the API from Coda is focused on the current editor.
Has anyone found a way to keep the indenting, but remove the empty line breaks that the custom html tidy creates?
Is there any way we could use this plug in with OSX 10.5.8 ?
I’m afraid I can’t compile it for 10.5.8 with the current version of Xcode. Do you use Coda 1 or 2?
I use Coda 1.6.3
You can try a previous version, IMHO older versions should work with 10.5 but currently I can’t check this.
First try this one: http://www.chipwreck.de/downloads/php-codaplugin-2.5.zip
If it does not work, use http://www.chipwreck.de/downloads/php-codaplugin-2.4.zip http://www.chipwreck.de/downloads/php-codaplugin-2.3.zip .. until 1.4.
Hope that helps.
I must have misunderstood something because even version 1.4 isn’t working. I just put the plug in file into the Coda folder, like every other plug in I use, but I can’t see it appearing in the plug in menu…
Are there any error messages in console when starting Coda?
I just installed the plugin in coda 2.04 in mac os 10.7.5. It installed fine and worked for a few hours but now all the actions are just gray and un-clickable making the plugin unworkable.
I love the plugin and really want to continue using it.
This usually should only happen if the editor pane is empty.. might this be the case?
Thanks for this plugin. More power…
It would be nice if Tidy HTML avoided to create a line break when on empty sections. Especially in the cases where you would have the following code:
The tidy html function will give this result:
your HTML snippets were removed by wordpress.. Have a look at the HTML tidy documentation (see the plugin settings, HTML and the button at the bottom). There you can see all configuration settings which you can try out using the “Custom”-configuration.
When I try to do PHP validation or tidy I get :
PHP returned nothing
Make sure the file has no errors, try using UTF-8 encoding.
This usually has to do with a wrong php installation. Check in the advanced preferences of the plugin if the path to php is correct. If that does not help, turn on the debug mode there and try again and send me the corresponding log messages (using console, all messages starting with “[Coda PHP Toolkit]..”
I’ve found the problem.
For some reason I had to do:
sudo ln -s /usr/lib/libpq.5.3.dylib /usr/lib/libpq.5.dylib
I think the simlink disappeared after repairing permissions.
Thanks for your help!
Notice: Undefined offset: 595 in /Users/foobar/Library/Application Support/Coda 2/Plug-ins/PhpPlugin.codaplugin/Contents/Resources/phptidy-coda.php on line 1271
as additional Line/s on the File if I enable Brace Style Always on new line and Add blank lines in the Prefs and try to use PHP Tidy.
is fixed now, I’ll release the next update with a bugfix soon.
Thats fast service! Thank you!
Plugin v3.8 in Coda 2 works great except I think the “Require ‘use strict'” checkbox in the JSHint preferences is not being saved or passed along to JSHint. No matter how I set that checkbox I get a warning about missing use strict in every function.
Idea for an upgrade: have an option to run JSHint on every save of a js file just like it’s an option to run validate on PHP files on every save. I love that validation of mny PHP code happens automatically on every save!
I’ll have a look at the “use script”-setting.
About the auto-validation: This should be possible, I’ll try to include it in the next update.
About “use strict”: You also have to uncheck “allow global use strict”, because this setting automatically enables strict mode. This should help :)
Indeed that does help. Thanks! I didn’t realize one had anything to do with the other.
How can I prevent HTML Tidy from stripping my PHP?
Usually HTML tidy does not strip PHP, you should use full php tags ( ).
PLEASE add support for PHP 5.4 syntax!
Sorry.. but my plugin just does validation/reformatting/compression of PHP. Things like autocompletion and syntax highlighting are inside Coda itself. (If you’re talking about validation that does not work with php 5.4: You can install another php version, via Macports i.e and switch to an alternate php interpreter for validation in the plugin preferences.)
thank you very very helpful!!
It seems that html tidy is inserting 4 spaces instead of tabs, is it possible to configure it to use tabs?
Thanks for a great plugin, I hope the donation arrived!
thanks a lot for the donation, very much appreciated.
Regarding tabs: HTML tidy has no option to use tabs. Quote from the documentation “Tidy never outputs tabs.”. See here: http://tidy.sourceforge.net/docs/quickref.html#tab-size
So using “Entab” (in the Coda menu) is currently the only way to make sure the output still uses tabs.
Cool, thanks for the info. I guess I can just search and replace 4 spaces for a tab after running html tidy.
You save my day! :) thank you!
Is there a setting so that when you run html tidy it only does it on a selection or if on a whole document it does not add tags. I am using a page with require_once (similar to a wordpress theme) for the header and footer so the html and body tags are in another file, and it keeps adding it to the file that i am working on.
Use “body only” as setting in the plugin preferences.
Absolute lifesaver. I cannot thank you enough!
Nice to hear!
Is there any plans for having the plugin just tidy code? I have run into issues where it strips out things I need and adds things I don’t. I mainly want it to just fix my alignments.
The plugin uses HTML tidy for validating and reformatting HTML – it’s free, open source and can be integrated quite well, but it has of course some drawbacks. As soon as I know of a better tool I’d integrate it of course. So if you know a HTML reformatting tool which is open source, free and runs without problems on a default OS X setup…
Thank you! I use shift-command-v all the time.
I’ve long loved the Validate and then save feature for my PHP… but now I find myself also loving Coda 2’s new publish feature when I’m working between my local and staging server…
Currently I just cmd-shift-V and then cmd-ctrl-P which isn’t SOooo bad, but for me and maybe others it’d be handy to have a single shortcut to do it all “validate, save and publish”
I’ll have a look for the next beta if this is possible. Might only be somewhat dangerous if you forget about this feature and suddenly find yourself having published all your test code to the live platform….
UPDATE: Unfortunately currently not possible with the Coda API.
That’s a good point… and just noticed your not about it not being possible with the current API as well.
As I make my workflow “better”, I no longer put live remote sites into Coda, I only link Coda up with my staging servers and deploy to live by other means (git mostly)… and I _always_ have a staging server (not really… but I try to).
Brilliant job Mario!
Was looking for this desperately.
Tried out the 3.7 beta. and have to look at it deeper.
Keep up the good work!
For me, this plugin only seems to work with files that are opened directly, and does not work with files opened from a “site”. The plugin still shows up, however the functions of it are greyed out.
I can’t reproduce this here. Functions are greyed out only if no file is opened or the open file is empty [or has less than 5 characters]. Please try if the current beta [see above] solves this problem..
Great plugin, Mario.
This is already included in the current beta :)
I can’t seem to get Growl notifications to work, they are enabled in the preferences pane. If I put a purposeful syntax error into the file, the notification appears within Coda 2 asking if I want to go to the line with the error, but no notification appears.
Coda 2 is available in Growl preferences and notifications are enabled.
Growl version is 1.4, Coda 2.0 (MAS) and PHP & Web Toolkit 3.6 (3.7 beta didn’t work, either).
11/06/12 12:34:45.977 PM Coda 2: [Coda PHP Toolkit] Executing at path /usr/bin/php with (
11/06/12 12:34:46.069 PM Coda 2: [Coda PHP Toolkit] Executing at path /Users/michael/Library/Application Support/Coda 2/Plug-ins/PhpPlugin.codaplugin/Contents/Resources/growlnotify with (
“No PHP syntax errors”,
“File: PlanTypes_to_Products.php\nFile was automatically saved.”,
“Coda PHP & Web Toolkit”,
“/Users/michael/Library/Application Support/Coda 2/Plug-ins/PhpPlugin.codaplugin/Contents/Resources/codaphp-plugin-icon.png”
If I execute growlnotify with the parameters as above, nothing happens either.
If I disable Growl notifications, the regular popover works. Any help you can offer would be great.
I assume this depends on the Growl version – with the same parameters and Growl 1.2.2 [free version] it works here. As I see on the growl-homepage 1.4 doesn’t have the commandline tool growlnotify anymore but there’s a version for Growl 1.3. I’ll include this in the next update, maybe this works with 1.4.
Hey guys just wanted to point out that growlnotify is a separate download you can find on their site: http://growl.info/downloads
Hello, thank you for this plugin, helps keeping the code clean and compliant to a certain style :)
I have an error to report:
Notice: Undefined offset: 368 in /Users/johnsardine/Library/Application Support/Coda 2/Plug-ins/PhpPlugin.codaplugin/Contents/Resources/phptidy-coda.php on line 1272
In PHP Tidy options i have “PEAR style” selected and all checkboxes selected but the “Replace shell comments”
Could you send me the php-file which makes those problems? Just mail to mario at chipwreck dot de, thanks.
I don’t remember which file it was, but I found the cause (or i thought i did), it was an all php file, with no closing php ?>, i added it, the error disapeared, but im testing right now, removing the closing tag and optimizing, but it works fine, i’ll let you know if the problem occurs again and will provide more details, thanks
I love you!
My Favorite Coda Plugin!
Worked great in Coda2, but now doesn’t appear in the plugin menu in Coda2.0.1.
Tried it with the current 2.0.1 – without problems. Make sure the plugin was copied to [your user folder]/Library/Application Support/Coda 2/Plug-Ins/ – could be that double-clicking put it into Coda 1 oder started Coda Plugin-Creator.
Looks like after the Coda2 update I needed to re-install and then restart Coda2 again. Works great now. Thanks again for the great plugin and you’re reply!
I noticed a large error, that in code folding the tidy feature deletes your html that is folded.
Yes, see the other comments – a bug in coda 2, which will be fixed in their next update.
I have updated to Coda 2.0.1, but I still have issues. It seems like the tidy adds the beginning and ending tags to your html. I am working on include files that don’t need this and it gets very tedious to go and delete them every time. Any way to stop this? And I also work within XSLT sheets and when I tidy it removes things, like the / at the end of an image, this causes the page to break.
use the preset “body only” for html tidy to avoid this. XSLT sheets are not supported by html tidy.
Mario, looks like if an error is inside folded code, the plugin will still validate and not find the syntax errors.
Using Coda 2 and plugin v3.6
Yes, this is a bug in Coda 2 – reported it to Panic, will probably be fixed in the next update.
Like it, a lot.
Frustrated at the same time.
1. In the head I have:
and HTML Tidy rewrites as:
[meta name=…][!–#include virtual…–]
A line break is removed.
2. After I use HTML Tidy, I have many blank lines. But, I have vertical-space: no explicitly in my custom settings.
I don’t want these extra vertical lines.
How do I stop this?
3. In the body I have:
and HTML Tidy removes the line break so I wind up with:
1. Here I currently don’t know if this is possible with HTML tidy.
2. If you use “indent: yes” there are no empty lines, but contents of the P-tag are indented..
3. Use “break-before-br: yes”.
#3 I added
to my preferences and then I manually changed the code to:
and HTML Tidy removes the line break so I wind up with:
The behavior of HTML Tidy is still the same and not as desired.
With these settings it works for me:
// Change these only if you need to debug a problem with Tidy