再レビュー結果

再レビューの結果が届きました。毎日チェックしていただけるのはありがたい。
自分だったら面倒くさくなって修正案だけ提示して「こう直せ」って言ってしまいそうなところ、丁寧に理由まで書いてある。(英語なので理解するのが大変だけど)

There are still some issues

## Unsafe Requiring of Common Libraries 
 
Since you're using a common library, it's important that you enqueue it safely. 
 
Example(s): 
 
require_once 'lib/Mbstring.php';

Since that is a common library, you need to detect IF the code is already included and not re-include it, as doing so will cause conflicts if two people call the same defines and functions. 
 
Please read these: 
 
http://php.net/manual/en/function.class-exists.php## Generic function (and/or define) names 
 
All plugins must have unique function names, namespaces, defines, and classnames. This prevents your plugin from conflicting with other plugins or themes. We need you to update your plugin to use more unique and distinct names.

A good way to do this is with a prefix. For example, if your plugin is called "Easy Custom Post Types" then you could use names like these:
 
function ecpt_save_post()
define( ‘ECPT_LICENSE’, true );
class ECPT_Admin{}
namespace EasyCustomPostTypes;
  
Don't try to use two letter slugs anymore. We have over 60 THOUSAND plugins on WordPress.org alone, you’re going to run into conflicts. 
 
Similarly, don't use __ (double underscores), wp_ , or _ (single underscore) as a prefix. Those are reserved for WordPress itself. You can use them inside your classes, but not as stand-alone function.

Remember: Good names are unique and distinct. This will help you and the next person in debugging, as well as prevent conflicts.
 
Some examples from your plugin:

const DOMAIN = 'dbmaker';

1.他のライブラリを使うときは、すでに読み込まれていないかチェックしろ

公開されているライブラリをローカールにおいて、require_onceでincludeしてたけど、これじゃダメ。class_existsかfunction_existsを使って定義済みかチェックしろ

2.定数名にprefixをつけろ

const DOMAIN = ‘dbmaker’;
DBM_DOMAINに変更する。

今回の指摘は軽めなので、サクッと修正して提出。これでいけるかな。
修正内容はこちら

Leave a comment

Your email address will not be published. Required fields are marked *

The maximum upload file size: 8 MB. You can upload: image, audio, video, document, spreadsheet, interactive, archive, other. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here

Translate »