<h2><?php_e('Patch Files Upload and Apply',$domain);?></h2>
<h3><?php_e('What you can do in this page',$domain);?></h3>
<p>
<?php_e('I made patch files for some plugins that are incompatible with SQLite Integration and need rewriting. And I wrote in the <a href="http://dogwood.skr.jp/wordpress/sqlite-integration">Plugin Page</a> about how to apply a patch file to the plugin. But the command line interface sometimes embarrasses some people, especially newbies.',$domain);?>
</p>
<p>
<?php_e('In this page, you can upload patch files and apply them automatically. But there are some requirements.',$domain)?>
</p>
<ol>
<li><?php_e('Think before you leap. Is the plugin to which you are going to apply patch really necessary for your site? Did you search in the <a href="http://wordpress.org/extend/plugins/">Plugin Directory</a> for the substitutes?',$domain)?></li>
<li><?php_e('Your PHP script has the permission to create a directory and write a file in it.',$domain);?></li>
<li><?php_e('Your PHP scripts can execute exec() function on the server.',$domain);?></li>
<li><?php_e('Your PHP script can execute "patch" shell command.(Script will check if it is executable or not.)',$domain);?></li>
</ol>
<p>
<?php_e('If uploading fails, it\' very likely that application will fail. When you try uploading with FTP client, the patch files must be put into the directory wp-content/uploads/patches/. When constant UPLOADS is defined, script follows it.',$domain)?>
</p>
<p>
<?php_e('You can create your patch file yourself. When you create one, please test it on your local server first and check if it works fine without PHP error or notice ( set error_reporting(E_ALL) ). If you use this utility, name your patch file as follows:',$domain);?>
</p>
<ol>
<li><?php_e('Use the file name beginning with the plugin directory name.',$domain);?></li>
<li><?php_e('Use the plugin version number after the directory name with underscore.',$domain);?></li>
<li><?php_e('Use the suffix .patch.',$domain);?></li>
<?php_e('For example, the patch file for the plugin "Debug Bar" is "debug-bar_0.8.patch". Script interprets "debug-bar" as the target directory and "0.8" as the target version. If the version number doesn\'t match with the target, script shows the error message and skip applying the patch file. And script will reject any other file name.',$domain);?>
</p>
<h3><?php_e('How to install, patch and activate plugins',$domain);?></h3>
<ol>
<li><?php_e('Install the plugin (not yet activate it)',$domain);?></li>
<li><?php_e('Upload the patch file (if any) to the server and ppply it in this page',$domain);?></li>
<li><?php_e('Back to the installed plugin page and activate it',$domain);?></li>
</ol>
<h3><?php_e('How to upgrade plugins',$domain);?></h3>
<p>
<?php_e('When upgrading the plugin, it will be safer to follow next steps.',$domain);?>
</p>
<ol>
<li><?php_e('Deactivate the plugin',$domain);?></li>
<li><?php_e('Upgrade the plugin',$domain);?></li>
<li><?php_e('Upload the patch file (if any) and apply it',$domain);?></li>
<li><?php_e('Reactivate the plugin',$domain);?></li>
</ol>
<p><?php_e('If there isn\'t a patch file to match with the newest version of the plugin, it won\'t work properly. Please wait for somebody to make one or rewrite the codes checking the patch file for the previous version (it\'s not so difficult a matter, I guess, for almost all the cases, you\'ll have only to replace the MySQL functions with the WordPress built-in functions).',$domain);?></p>
<labelfor="upload"><?php_e('Select file from your computer. If the file name is the same as existent file, this operation will override it.',$domain);?></label><br />
<labelfor="plugin_check"><?php_e('Select the file(s) you want to apply to the plugin(s) or you want to delete. You can select multiple files.',$domain);?></label>
<inputtype="submit"name="apply_patch"class="button-primary"value="<?php _e('Apply patch', $domain);?>"onclick="return confirm('<?php _e('Are you sure to apply patch files?\n\nClick [Cancel] to stop,[OK] to continue.', $domain);?>')"/>
<inputtype="submit"name="patch_file_delete"class="button-primary"value="<?php _e('Delete file', $domain);?>"onclick="return confirm('<?php _e('Are you sure to delete patch files?\n\nClick [Cancel] to stop,[OK] to continue.', $domain);?>')"/>
</p>
</form>
</td>
</tr>
</tbody>
</table>
</div>
<divclass="wrap"id="sqlite-admin-side-wrap">
<divclass="alert">
<?php_e('Caution about your patch file(s)',$domain);?>
</div>
<blockquoteclass="caution">
<p>
<?php_e('If you don\'t know where it comes from or who created it, I strongly recommend that you should see and check the contents of the file. If a person who created it secretly inserted a malicious codes, it will be executed by the plugin and may damage your site or your server, for which damage I don\'t incur any liability. If you don\'t understand well, you\'d better use the substitute plugins. Take your own risk, please.',$domain);?>