khi ta upload plugins lên wordpress.org ta hay mắc các lỗi do thói quen lập trình sau khi wordpress review sẽ báo cho ta các lỗi cần sửa :
Error 1
lỗi trên là do tên hàm phải là duy nhất ví dụ function wp_ads_themes() ta nên chuyển nó thành
shimi_pop_ads_themes()
E2
There are issues with your plugin code. Please read this ENTIRE email, address all listed issues, and reply to this email with your corrected code attached. It is required for you to read and reply to these emails, and failure to do so will result in significant delays with your plugin being accepted.
## Generic function (and/or define) names
All plugins should have unique function names, defines, and classnames. This will prevent your plugin from conflicting with other plugins or themes.
For example, if your plugin is called "Easy Custom Post Types", then you might prefix your functions with ecpt_{your function name here}. Similarly a define of LICENSE would be better done as ECPT_LICENSE. You can use namespaces instead, however make sure that those also are unique. A namespace or class of 'MyPlugin' is NOT actually all that unique, you see.
lỗi trên là do tên hàm phải là duy nhất ví dụ function wp_ads_themes() ta nên chuyển nó thành
shimi_pop_ads_themes()
E2
This extends to anything in a define. For example ...
define( 'PLUGIN_PATH', plugins_url( __FILE__ ) );
That define is a global, so PLUGIN_PATH could conflict with a number of other things.
lỗi trên do trùng PLUGIN_PATH nên thay PLUGIN_PATH bằng SHIMI_POP_PLUGIN_PATH
E3
Don't try to use two letter slugs anymore. As of 2016, all the good ones are taken. Instead consider easy_cpts_ (from the first example).Similarly, don't use __ to prefix, as the double underscore should be reserved for WordPress itself.
có lẽ wordpress đã bỏ __FILE__ ta không nên sử dụng nhiều nữa
E4
## Not using Nonces and/or checking permissions
Please add a nonce to your POST calls to prevent unauthorized access.
Keep in mind, check_admin_referer alone is NOT bulletproof security. Do not rely on nonces for authorization purposes. Use current_user_can() in order to prevent users without the right permissions from accessing things.
https://codex.wordpress.org/WordPress_Nonces
See function wp_ads_setting_page()
nên dùng ít nhất 1 hàm current_user_can để check quyền
E5
## Including jquery files (or calling them remotely)
Your plugin has included your own copy of a core jQuery file (or called it remotely, probably from Google or jquery.com).
do folder mình có dùng jquery nên wordpress khuyến cáo nên dùng link
E6
ads-is-active is not unique. shims-ads-is-active would be.
wordpress khuyến cáo nên dùng tên biến là duy nhất và cho ta 1 vài gợi ý
Lần đầu upload lên plugins mà kha khá lỗi
tạm thế đã ,sau khi sửa xong các lỗi trên ta reply lại kèm attach file .zip có chứa folder plugins
Using YOUR link is SEO spamming. Don't do that.
không nên gửi link trang cá nhân
Lần đầu upload lên plugins mà kha khá lỗi
tạm thế đã ,sau khi sửa xong các lỗi trên ta reply lại kèm attach file .zip có chứa folder plugins
Using YOUR link is SEO spamming. Don't do that.
không nên gửi link trang cá nhân
No comments: