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. 플러그 접속하는 기능을 나타냅니다 the func_name 분명 저자들이 당신을 포함; 인수는 그 기능을 필요로합니다.

This can create two major issues. 이 두 가지 주요 문제를 만들 수있습니다.
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. 우리는 두 개의 작은 변화 봐 코드 템플릿을 만들 수있습니다 둘 이상의 문제점을 돌봐 위에서 설명한합니다. 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 또 다른 템플릿 시스템을 사용하는 코드.

Carefully make the changes following the template above to make your site more robust against WordPress plugins. 상기의 변경 사항을 신중하게 다음과 같은 서식 파일을 귀하의 사이트에 대해보다 강력한 wordpress 플러그 접속합니다.