WordPress Template Modification Tips for Non-Programmers - Robustness wordpress 템플릿을 수정하기위한 도움말 아닌 - 프로그래머 - 견고성
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 플러그 접속합니다.
Filed under 밑에 CMS Software cms 소프트웨어를 , Headline News 헤드 라인 뉴스 , How To 하는 방법을 , PHP php , Pro Blogging 직업적인 블로깅 , Tech Note 기술 참고 사항 , Web 웹 , Web Services 웹 서비스 , WordPress wordpress | |
| |
RSS 2.0 rss 2.0 | |
Email this Article 전자 우편이 문서
You may also like to read 같은를 읽을 수있습니다 |




December 29th, 2005 at 1:37 am 2005년 12월 29일에서 오전 1시 37분
[...] Thanks to Simple Thoughts for this simple way to keep things from breaking if and when I have to turn off a plugin in the future. [...] 덕분에 간단한 생각을 위반하면 물건의 주인이 간단한 방법을 유지하고 해제해야 할 때 미래에 플러그를합니다. [...]
December 30th, 2005 at 12:40 pm 2005년 12월 30일에서 오후 12시 40분
[...] Despite all the warnings above if you still want to upgrade then please please please (repeatation intentional) backup the database and harden your templates against plugins before you upgrade. [...] 경고에도 불구하고 여전히 필요 이상으로 업그레이 드하는 경우 그렇다면 제발 제발 (repeatation 고의적인) 백업 데이터베이스 및 플러그인을 강화를 업그레이 드하기 전에 귀하의 템플릿을 반대합니다. [...]
January 3rd, 2006 at 1:41 pm 2006년 1월 3일에서 오후 1시 41분
[...] Couple that with php’s “silent treatment” of errors. 당신과 함께 커플 [...] php의 "침묵 치료"의 오류합니다. In other words you and your viewers are greeted with a nice looking, white in color web page, whenever any (plugin) error occurs. 즉 당신과 당신의 시청자가 인사를 잘보고, 흰색의 색상 웹 페이지를 언제 어떠한 (플러그 접속식) 오류가 발생합니다. Plugin errors could be as simple as having blank spaces at the end of plugin files after ?> to more complex ones like invalid argument to methods. 플러그 접속 오류가있을 것으로 판단 간단한 플러그인 파일의 끝에 공백 후에 는요?> 잘못된 인수 방법 같은 것들이 더 복잡합니다. Update: Please check tips on making your plugins robust. 업데이트 : 귀하의 플러그인 만드는 방법에 확인하시기 바랍니다 강력합니다. [...]
September 5th, 2006 at 2:54 pm 2006년 9월 5일에서 오후 2시 54분
[...] WordPress Template Modification Tips for Non-Programmers - Robustness -Simple Thoughts - Java and Web Technology Blog Hoe je wordpress-site bestand maken tegen crashende of niet geactiveerde plugins. [...] wordpress 템플릿을 수정하기위한 도움말 아닌 - 프로그래머 - 견고성 - 간단한 생각 - 자바와 웹 기술 블로그 괭이 je tegen wordpress - crashende의 사이트를 bestand 니얻 그걸 geactiveerde 플러그 접속합니다. Nu het nog overal inbouwen… (tags: howto PHP wordpress plugins) [...] 뉴 het 노그 overal inbouwen… (꼬리표 : 하우투 php wordpress 플러그인) [...]