HTML-Optimizer is a versatile tool for managing your web site. It checks your web pages for broken hyperlinks and dangling tags and optimizes both web pages and images.
If you are managing more than one web site and/or if you want to drag and drop files or folders plus the ease of instant uploading to your web server, then consider HTML-OptimizerPlus.
HTML-Optimizer offers 5 functions:
1. Its main function is optimizing, i.e. saving space on your web pages by removing unnecessary characters and tags. Though the savings percentage (10 to 20%) may seem small, load time savings is much higher as your client's browser parses the pages more efficient. This program does not remove quotation marks from attribute values - as some other optimizers do to get impressive savings - because this actually would slow down the browser's parsing speed!
Client-side and server-side JavaScript can be optimized too.
See About Optimizing for more info.
The resource forks of graphic files can be deleted. See Deleting Resource Forks of Graphic Files for more info.
2. Another function is to check the tagged pair structure of your web pages. Any dangling tag will be reported. If you choose the extensive mode, IMG tags are checked for the presence of the Width, Height and Alt attributes.
The Width and Height attributes are needed by the browser to build up the page as fast as possible. At the Preferences you can choose to add missing Width and Height attributes with pixel values which are automatically detected (you need QuickTime™ 3 or later for this).
The Alt attributes make your page more user-friendly. At the Preferences you can choose to have the Alt attributes being checked or not. Moreover, you can decide to add missing Alt attributes and attach either a text string or the name of the picture. As text string you could type "FindMe" to enable you to easily find and replace the added Alt attributes in your Text Editor.
Note that changes are put in the original pages of your web folder, unless you choose at the Preferences the Include Checking Tags option, i.e. checking tags on-the-fly when optimizing.
Obsolete and browser-dependent tags are reported as well.
If you select HTML4 Compliant at the Preferences, deprecated tags according to HTML4, for example <FONT> and <CENTER>, are reported.
These functions work also if you choose the Fast & Simple mode.
3. You can choose to not only check the tagged pair structure and IMG tags, but also mark the dangling tags and incomplete IMG tags with the bullet character •, so that you can find them quickly. The marking within a nested tag structure is not always completely accurate, but still easy to interpret.
Saved files get • as prefix. Of course, you do not upload a marked page to a web server!
If a dangling tag is found, the 'smaller than' character < is replaced with • ; so if, for example, the tag </FORM> is missing, you see •FORM> instead of the accompanying <FORM> , or vice versa. Note that the Mark function is equivalent to the Extensive mode of the Check Tags function.
4. You can check the validity of your links, excluding those that start with 'http://', 'mailto:' or '#'. Web pages are checked for broken href, img src, lowsrc, img dynsrc, embed src and <script>.src links, to a depth of 8 levels of your web folder.
This function requires that a folder with its nested folders is analyzed for its content. HTML-Optimizer does this automatically when necessary.
5. Finally, you can check for special characters, such as é and §, and convert them to the appropriate &xxx; notation; all within the ASCII 128 to 255 range. Note that changes are put in the original pages of your web folder, unless you choose at the Preferences the Include Converting Special Characters option, i.e. checking tags on-the-fly when optimizing.
About Optimizing
During the optimizing process, your original pages remain untouched for later editing, which is quite useful since optimized pages are hard to read for humans (unless you have turned off 'Remove Returns' at the Preferences).
Optimized web pages are saved as new text files with only a data fork, by default with the Creator Type "R*ch" of BBEdit - see the Preferences - and put in the optimizer output folder, which is a folder with the same name as your web folder, with the file extension ".opt" added to it. Please note that "Optimizer Output folder" is the generic name for this folder used by this program in its dialogs.
When you optimize your entire web folder, this folder is duplicated and all optimized files copied by default from the optimizer output folder to this duplicate. The 'duplimized' web folder gets the file extension ".dup".
If you don't have BBEdit, download a free copy of BBEdit Lite from http://www.barebones.com/free/bbedit_lite.html
Warning: Do not replace your original pages by optimized ones! Keep your originals in a safe place!
At the time that you configured this program, an empty nested folder structure was created in the optimizer output folder, identical to the directory of the associated web folder.
Files that reside in a nested folder of a web folder and which are allowed to be optimized, are saved to the corresponding folder in the optimizer output folder.
If you choose Entire Web Folder, you don't get the usual Open Folder Dialog when you click the Start button. In that case, your entire web folder is dealt with, including nested folders, all in one pass. However, keep in mind that only optimized files will be saved to the optimizer output folder, so don't be surprised at empty folders there!
View the optimized pages in your browser before uploading them to a web server. You can simply click the View button for this purpose.
Do not open an optimized page with the HTML Editor that originally created it. This can undo most of the optimizing because the Editor adds its own formatting again! Using BBEdit is recommended. SimpleText is also possible but has a 32K limit.
The different logs - one for each function - are saved to the Logs folder in the HTML-Optimizer folder. You get a warning when a log approaches its 32K limit, so that you can save them to a backup file before you have to clear them. The logs are SimpleText documents; due to the limited size scrolling will never be a drag.
If you have hidden the Log and you want it back, you can choose Show Current Log from the File menu.
What is Duplimizing?
Duplimizing means duplicating plus optimizing. This word is invented by the author of this program. When you choose for duplimizing, your original web folder is duplicated and the optimized files in the Optimizer Output folder are then copied to the duplicate. So you end up with an optimized duplicate of your entire web folder, the ideal starting point for uploading folders (directories).
You can even make the duplicate folder more identical to the original web folder by selecting the Restore Finder Info option at the Preferences before you start optimizing, which restores the values for Creator Type, Creation Date, Modification Date and Finder Label. This may come in handy when you use an automatic backup program.
NOTE: You better not use the Restore Finder Info option if you only want to upload to your web server the recently optimized file(s). In that case, it's best to choose a label at the Preferences so that you can easily recognize which file is the most recent one.
If you check the Duplimize option at the Preferences, duplimizing will take place automatically after optimizing an entire web folder. If you want to duplimize later on, you can use the Duplimize command from the File menu.
The name of the duplimized folder gets the file extension ".dup".
Which tags and characters are removed by default (standard setting)?
HTML-Optimizer removes the following tags:
Optional end tags such as </OPTION> (not from XHTML files)
Forbidden end tags such as </IMG>
Redundant Editor tags such as X-CLARIS-USEIMAGEWIDTH
The following characters are removed:
Carriage returns, CRLFs and LFs
Tabs
Multiple whitespace
Redundant whitespace
Nothing is changed in code between the following tags:
<APPLET> and </APPLET>
<OBJECT> and </OBJECT>
<STYLE> and </STYLE>
<PRE> and </PRE>
<NOOP> and </NOOP>
The <NOOP> and </NOOP> custom tags - NOOP means No Optimizing - can be used by you to enclose a certain HTML code block that you don't want to be optimized.
Comments in HTML code and JavaScript code can be removed at choice. Note that comments and thus script code written as comment lines, e.g. cgi code, will not be removed from web pages whose file extension start with ".s", for example index.shtm.
Optimization of JavaScript and removing JavaScript comments can not only be executed on client-side scripts (between <SCRIPT> and </SCRIPT> tags) but also on server-side scripts (between <SERVER> and </SERVER> tags) for example in files with the .lasso file extension.
Incomplete URLs like "http://www.anyname.com" can be qualified, i.e. they will get a slash at the end which makes it twice as fast for a browser to go to that URL. Only select this option when you think it's necessary, to avoid needless waste of processing time.
Deleting Resource Forks of Graphic Files
You can choose to delete the resource forks of (copies of) graphic files whose file extensions have been allowed - see the Preferences. There is another input check on graphic files when selecting them: only files with the file type GIFf, JPEG, PNGf, MIE0, TIFF, SWFL or MooV are accepted by default (for web pages the allowed file type is TEXT). Advanced users may modify the graphic file type list at the Preferences.
Deleting the resource fork cuts down the size of the file, without any influence on the graphic content. A resource fork is of no use on the Internet.
The Configure menu
Under normal circumstances you don't have to use this menu.
However, if you wish to change the location of the optimizer output folder(s) or confirm it after an error message, or
if you have to confirm your current web folder or define another one, or
if you wish to confirm a different standard Internet browser (as set in Internet Config or the control panel Internet), or
if you need to update the current optimizer output directory because you changed the associated web folder's structure,
then you choose the appropriate menu command from the Configure menu.
The Select button
The Select button does the obvious: it shows an Open Dialog, with the current web folder as the default directory if you have Mac OS 8.5 or later. If you click the 'Entire Web Folder' button, the Select button changes its name into Start.
The Same Again button
If you click this button you start any desired action on the same file or folder that was recently selected, so you don't need to navigate through an Open… dialog again. You can repeat this action for as long as you wish, until you select another file or folder. This button comes in handy when you want to perform various consecutive actions on the same file or folder, e.g. checking tags, checking links and optimizing.
The View button
This button enables you to view a page or an image in your browser, to make sure that the item is OK after optimizing. You can also view a single image in your browser.
The Reveal button
This button enables you to reveal the selected file in the Finder.
Just select a line in the Log that refers to the file, to enable the button.
The View Code button
This button enables you to view the code of a page. Note that only the first 29000 characters of a file will be displayed (you can edit up to a size of 30000 characters).
Just select a line in the Log that refers to the file, to enable the button.
If you did an Optimize job, the name of the View Code button changes after clicking into Find String….
Instead of clicking this button you can also type F while holding down the Command Key. If a string is found, you can continue searching by pressing Return or Enter or typing Command-G. This Find option comes in handy when you are looking at HTML code from which the carriage returns have been removed.
If you did a Mark job, the name of the button changes after clicking into Find Bullets.
A found bullet changes into the character . If a bullet is found, you can continue searching by pressing Return or Enter or typing Command-G.
If you did a Convert job, the name of the button changes after clicking into Find &xxx; (only if you choose a file, in case of a folder the name will be Find String…).
If a converted character is found, the button is disabled and you can continue searching by pressing Return or Enter or typing Command-G.
After any of the jobs mentioned before, except marking, the name of the View button changes after clicking into Edit and the name of the Reveal button changes into Save…. In this way, you can edit the text in the Code field and save it. After an optimizing job the changes are saved to the optimized web page, so you can proceed in one pass, and in the other cases the changes are saved to the original web page. If you want to make an original web page identical to its edited optimized counterpart - what you should do - you have to edit it later on.
The Edit and Save… buttons also appear when you open a text file from the File menu.
Analyzing your Web Folder
When checking links, you may be confronted with the message 'Analyzing your web folder… please wait'. This happens when HTML-Optimizer has detected a change in the current web folder, for example, after you have edited or added a file or after Alt strings or Width and Height pixel values have been added when checking IMG tags.