Several WordPress plugins ask you to add certain code to the WordPress theme template files to make them work.いくつかのWordPressのプラグインを追加するようお願いする特定のコードをWordPressのテーマのテンプレートファイルを組み合わせて動作します。 If you are not a PHP developer or you don’t have time to code review the plugin and you decide to activate the plugin then the plugin can very easily cause your site to crash or worse. PHPの開発者ではない場合は、時間をコードする必要はありませんを決定した日の差込式と入力し、差込式のプラグインを有効にするには、お客様のサイトを非常に簡単に原因がクラッシュしたり、悪化している。 Often the errors are hard to detect (sporadic, happening only in certain conditions) and even harder to debug as you are not familiar with the code.多くの場合、エラーを検出するのは難しい(散発的、起きて、一定の条件下でのみ)や困難をデバッグするとしてもあなたが精通していないコードです。 Today we will talk about a simple step you can take to make your site robust against untested and buggy plugins.今日我々は、単純なステップについて話すすることができます。強固な反対に、お客様のサイトを作るとバギーの差込真価が問われています。

Normally most of the time you are asked to include a code block similar to this:通常、ほとんどの場合、あなたが求められるには、コードブロックに似て、この:

The func_name obviously represents a function which the plugin author wants you to include; the arguments are as required for that function. func_name明らかにする関数を表すのは、差込式著者は、お客様が含まれて;の引数には、その機能を必要とします。

This can create two major issues.これは2つの主要な問題を作成します。
Firstly if at any time you decide to disable the plugin then you will have to first remove the code from all your template files before you can safely de-activate / remove the plugin.第一の場合、いつでも無効にするにプラグインすることに決めたのを最初に入力し、必要がありますからコードを削除する前に、すべてのテンプレートファイルを安全にすることができますデ-アクティブ/削除して差込式です。 Otherwise the pages in the site will fail to load properly.サイト内の他のページの読み込みに失敗する適切です。

Secondly the plugin itself may fail in certain conditions or always.第二に、プラグイン自体が失敗する場合が特定の条件や、常にです。 In the worst case you will find certain pages on your site fails to load sometimes.で、最悪の場合には、お客様のサイトの特定のページの読み込みに失敗することもあります。 It could be long before you are aware of the problem.それが長いする前には、問題を認識しています。

We will look at two small changes you can make to the code template above to take care of both of the problems described above.我々は2つの小さな変化を見てmakeを実行することができます。上記のコードテンプレートの世話をし、上記の両方の問題が発生します。 First the modified code:最初に改変されたコード:

if(function_exists(’ func_name ‘) @ func_name( arg1,arg2 …); ?> もし( function_exists ( ' func_name ' ) @ func_name (値arg1 、値arg2 … ) ;ですか? >
Remember to replace func_name with the actual name of the function. func_nameに置き換えるのを忘れないでの実際の名前の関数です。

Testing the existence of the function ensures that the code isn’t executed when the plugin is inactive / disabled.この関数が存在するテストにより、コードが実行されるプラグインが非アクティブにする/無効になっています。 This prevents the first problem.これにより、最初の問題です。

Appending an @ before the function name ensures that errors, if any, while executing the function are ignored and do not cause further problems down the road and do not prevent the overall page from displaying.関数名に@付け加えることにより、エラーが発生する前に、もしあれば、実行中の機能は無視され、より詳細な問題が発生する原因はありません道路ではないからページを防ぐための全体を表示します。

This fix works against all versions of WordPress and also in any other templating system which uses php code.この修正プログラムのすべてのバージョンのWordPressの作品に対しても、他のテンプレートシステムを使用してPHPコードです。

Carefully make the changes following the template above to make your site more robust against WordPress plugins.慎重に次のように変更してサイトのテンプレートを作る上の他のロバスト反対WordPressの差込です。