android-com-pl / wp-ai-alt-generator

WordPress plugin that leverages OpenAI's Vision API to automatically generate descriptive alt text for images, enhancing accessibility and SEO.
https://wordpress.org/plugins/alt-text-generator-gpt-vision/
GNU General Public License v3.0
8 stars 2 forks source link

Apply fixes requested by WordPress Plugin Review Team #2

Closed rafaucau closed 5 months ago

rafaucau commented 6 months ago

Mail content:

Hello,

There are issues with your plugin code preventing it from being approved immediately. We have pended your submission in order to help you correct all issues so that it may be approved and published.

We ask you read this email in its entirety, address all listed issues, and reply to this email with your corrected code attached (or linked). You have three (3) months to make all corrections, before your plugin will be rejected. Even so, as long as you reply to this email, we will be able to continue with your review and eventually publish your code.

Remember in addition to code quality, security and functionality, we require all plugins adhere to our guidelines. If you have not yet, please read them:

https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/

We know it can be long, but you must follow the directions at the end as not doing so will result in your review being delayed. 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.

Finally, should you at any time wish to alter your permalink (aka the plugin slug), you must explicitly tell us what you want it to be. Just changing the display name is not sufficient, and we require to you clearly state your desired permalink. Remember, permalinks cannot be altered after approval.

Be aware that you will not be able to submit another plugin while this one is being reviewed.

Display Name Infringes on Trademarks

Your plugin's display name is infringing on someone's trademark or commonly known brand.

ChatGPT

This can be a little long, so please read carefully. Most of your questions are answered.

The tl;dr is this:

Your plugin display name may not begin with nor use the following term(s) in a manner that is confusing or implies a relationship: GPT Vision Alt Text Generator We recommend you use the following Display Name instead: Vision Alt Text Generator for GPT

Trademarks apply to the following aspects of your plugin:

The Display Name - You may not begin the display name with someone else's trademarked (or commonly recognized) term All Images - You may not use trademarked logos/images in your banner, screenshots, logos, etc Permalinks - URLs may not contain or misuse trademarked terms

In order to comply with trademark law, we need you to update the readme file and the main plugin file to no longer infringe on their trademark. If your banners or icons include official logos, now is the time to clean that up too.

At this moment, we believe your plugin's permalink safe to use.

We know this can be confusing. In many cases it’s acceptable to use the ’shortname’ of a project or company for the plugin permalink (i.e. “ga” for “Google Analytics” or “ms” for “Microsoft”). However even if you can use it in your permalink, you MAY NOT use that short term to begin the display name.

Another commonly misunderstood aspect of plugins is the difference between a permalink and a display name.

Your display name is how the directory displays your plugin name. This is set in your readme.txt and the main plugin file that has the plugin headers. You can change your display name at any time.

Your permalink has to do with the URL people will use for people to find your plugin. A permalink cannot be changed once a plugin is approved.

These two things don't have to be the same. Your plugin permalink can be 'candyzone' with a display name of "Create the Sweetest Zone" and everything will work just fine. It won't impact your SEO at all.

And before you ask “But what about everyone ELSE…” and point out all the people out there who are doing this today, be aware that we're already talking to them. All of them. We have been mailing notifications to existing users in small batches, due to the amount of pushback from people. A high number of those other developers have ended up with their plugins permanently closed due to non-compliance with the guidelines.

We are obligated to notify you here that just because someone else is doing this wrong doesn't mean you can. If, after your plugin is approved, you revert the display name, we will close your plugins until you correct it. If it happens more than once, you will no longer be permitted to host code here.

Be aware, the approval email will use your original display name. Don't be concerned if that happens. As long as the code is correct, the plugin directory will fix itself.

The main file of the plugin has a name that does not follow the convention.

We expect the main plugin file (the file containing the plugin headers) to have the same name as the plugin folder, which is also the same name as the slug / permalink of the plugin.

For example, if your plugin slug is ecpt-social-manager we expect your main plugin filename to be ecpt-social-manager.php

Also, note that using some common names as the filename for the main plugin file can lead to issues in some configurations.

Please check out our tips on how to structure files and folders in a plugin.

The main file of this plugin is named plugin.php

Undocumented use of a 3rd Party or external service

We permit plugins to require the use of 3rd party (i.e. external) services, provided they are properly documented in a clear manner.

We require plugins that reach out to other services to disclose this, in clear and plain language, so users are aware of where data is being sent. This allows them to ensure that any legal issues with data transmissions are covered. This is true even if you are the 3rd party service.

In order to do so, you must update your readme to do the following: Clearly explain that your plugin is relying on a 3rd party as a service and under what circumstances Provide a link to the service . Provide a link to the service terms of use and/or privacy policies. Remember, this is for your own legal protection. Use of services must be upfront and well documented.

Example(s) from your plugin:

Domain(s) mentioned in the readme file. Links to service terms and privacy policy not found.

wp-gpt-vision-img-alt-generator-main/includes/AltGenerator.php:9 const API_URL = 'https://api.openai.com/v1/chat/completions';

Generic function/class/define/namespace/option names

All plugins must have unique function names, namespaces, defines, class and option names. 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 ECPT; update_option( 'ecpt_settings', $settings );

Don't try to use two (2) or three (3) letter prefixes anymore. We host nearly 100-thousand plugins on WordPress.org alone. There are tens of thousands more outside our servers. Believe us, you’re going to run into conflicts.

You also need to avoid the use of _ (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.

Please remember, if you're using _n() or __() for translation, that's fine. We're only talking about functions you've created for your plugin, not the core functions from WordPress. In fact, those core features are why you need to not use those prefixes in your own plugin! You don't want to break WordPress for your users.

Related to this, using if (!function_exists('NAME')) { around all your functions and classes sounds like a great idea until you realize the fatal flaw. If something else has a function with the same name and their code loads first, your plugin will break. Using if-exists should be reserved for shared libraries only.

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

Analysis result:

This plugin is using the prefix "acp" for 8 element(s).

The prefix "acp" is too short, we require prefixes at least over 4 characters.

wp-gpt-vision-img-alt-generator-main/plugin.php:27 define('ACP_AI_ALT_PLUGIN_FILE', FILE); wp-gpt-vision-img-alt-generator-main/plugin.php:28 define('ACP_AI_ALT_PLUGIN_PATH', plugin_dir_path(FILE)); wp-gpt-vision-img-alt-generator-main/plugin.php:29 define('ACP_AI_ALT_PLUGIN_URL', plugin_dir_url(FILE)); wp-gpt-vision-img-alt-generator-main/plugin.php:18 namespace ACP\AiAltGenerator wp-gpt-vision-img-alt-generator-main/includes/AltGenerator.php:3 namespace ACP\AiAltGenerator wp-gpt-vision-img-alt-generator-main/includes/Enum/ErrorCodes.php:3 namespace ACP\AiAltGenerator\Enum wp-gpt-vision-img-alt-generator-main/includes/Api.php:3 namespace ACP\AiAltGenerator wp-gpt-vision-img-alt-generator-main/includes/Admin.php:54 add_settings_field('acp_ai_alt_generator_api_key', ('OpenAI API Key', 'gpt-vision-img-alt-generator'), function () use($options) { printf('', esc_attr(AltGeneratorPlugin::OPTION_NAME), esc_attr($options['api_key'] ?? '')); echo '

' . wp_kses(sprintf( // translators: %s is for link attributes. ('Enter your OpenAI API key here. You can find it in your <a href="https://platform.openai.com/account/api-keys" %s>OpenAI account settings.', 'gpt-vision-img-alt-generator'), 'target="_blank" rel="noopener noreferrer"' ), ['a' => ['href' => [], 'target' => [], 'rel' => []]]) . '

'; }, 'media', self::SETTINGS_SECTION_ID, ['label_for' => 'openai_api_key']); wp-gpt-vision-img-alt-generator-main/includes/Admin.php:91 add_settings_field('acp_ai_alt_generator_auto_generate', __('Auto generate alt text on image upload', 'gpt-vision-img-alt-generator'), function () use($options) { printf('<input type="checkbox" id="auto_generate_alt" name="%1$s[auto_generate]" %2$s/>', esc_attr(AltGeneratorPlugin::OPTION_NAME), checked($options['auto_generate'] ?? false, true, false)); echo '

' . esc_html('Enable this option to automatically generate alt text when images are uploaded. Please review generated alt texts as GPT can sometimes produce inaccurate descriptions.', 'gpt-vision-img-alt-generator') . '

'; }, 'media', self::SETTINGS_SECTION_ID, ['label_for' => 'auto_generate_alt']); wp-gpt-vision-img-alt-generator-main/includes/Admin.php:115 add_settings_field('acp_ai_alt_generator_img_size', ('Detail level', 'gpt-vision-img-alt-generator'), function () use($options) { $detail_levels = ['high' => _x('High', 'Detail level', 'gpt-vision-img-alt-generator'), 'low' => _x('Low', 'Detail level', 'gpt-vision-img-alt-generator')]; printf(''; echo '

' . wp_kses(sprintf( // translators: %s is for link attributes. __('Choose "Low" detail to minimize token usage and costs for image processing, which should be sufficient for most use cases and is significantly cheaper. "High" detail will use more tokens but provides finer detail. For precise token calculations and cost implications, refer to the <a href="https://platform.openai.com/docs/guides/vision/calculating-costs" %s>OpenAI documentation on calculating costs.', 'gpt-vision-img-alt-generator'), 'target="_blank" rel="noopener noreferrer"' ), ['a' => ['href' => [], 'target' => [], 'rel' => []]]) . '

'; }, 'media', self::SETTINGS_SECTION_ID, ['label_for' => 'detail_level']); wp-gpt-vision-img-alt-generator-main/includes/Admin.php:3 namespace ACP\AiAltGenerator wp-gpt-vision-img-alt-generator-main/uninstall.php:3 namespace ACP\AiAltGenerator

Errors on site when testing with WP_DEBUG

Please re-test your plugin with WP_DEBUG set to true. When we tested your plugin, it came up with numerous errors and alerts, which would cause problems for users.

You should review the following link for more information:

https://developer.wordpress.org/plugins/developer-tools/debug-bar-and-add-ons/

Example(s) from your plugin: Plugin could not be activated because it triggered a fatal error.


Please note that due to the significant backlog the Plugin Review team is facing, we have only done a basic review of your plugin. Once the issues we shared above are fixed, we will do a more in-depth review that might surface other issues. In order to prevent further delays, we strongly urge you to review the guidelines again before you resubmit it.

If the corrections we requested in this initial review are not completed within 3 months (90 days), we will reject this submission in order to keep our queue manageable and you will need to resubmit the plugin from scratch.

Your next steps are:

Make all the corrections related to the issues we listed. Review your entire code following the guidelines to ensure there are no other related concerns. Attach your corrected plugin as a zip file OR provide a link to a public location (Dropbox, GitHub, etc) from where we can download the code. A direct link to the zip is best. Please do not send it using services where the download expires after a short period of time (such as WeTransfer-Free). Once we receive your updated code, we will re-review it from top down.

Be aware that if your zip contains JavaScript files, you may not be able to email it as many hosts block that in the interests of security. Keep in mind, all version control directories (like GitHub) will auto-generate a zip for you, so you do not need to upload a zip file to their systems. You can just link to the repository.

We again remind you that should you wish to alter your permalink (not the display name, the plugin slug), you must explicitly tell us what you want it to be. We require to you clearly state in the body of your email what your desired permalink is. Permalinks cannot be altered after approval, and we generally do not accept requests to rename should you fail to inform us during the review.

If you previously asked for a permalink change and got a reply that is has been processed, you’re all good! While these emails will still use the original display name, you don’t need to panic. If you did not get a reply that we processed the permalink, let us know immediately. While we have tried to make this review as exhaustive as possible we, like you, are humans and may have missed things. As such, we will re-review the entire plugin when you send it back to us. We appreciate your patience and understanding.

rafaucau commented 5 months ago

https://github.com/android-com-pl/wp-ai-alt-generator/releases/tag/v2.0.0-rc.1 has been submitted for review.

rafaucau commented 5 months ago

Released: https://wordpress.org/plugins/alt-text-generator-gpt-vision/