Kalpa-Services / mmg-wp-plugin

WooCommerce Gateway that uses the MMG Checkout API to process payments
https://mmg-plugin.kalpa.dev
GNU General Public License v2.0
4 stars 2 forks source link

Conform to WP standards #60

Open carlHandy opened 1 month ago

carlHandy commented 1 month ago

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

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 main.php

Use wp_enqueue commands

Your plugin is not correctly including JS and/or CSS. You should be using the built in functions for this:

When including JavaScript code you can use: wp_register_script() and wp_enqueue_script() to add JavaScript code from a file. wp_add_inline_script() to add inline JavaScript code to previous declared scripts.

When including CSS you can use: wp_register_style() and wp_enqueue_style() to add CSS from a file. wp_add_inline_style() to add inline CSS to previously declared CSS.

Note that as of WordPress 5.7, you can pass attributes like async, nonce, and type by using new functions and filters: https://make.wordpress.org/core/2021/02/23/introducing-script-attributes-related-functions-in-wordpress-5-7/

If you're trying to enqueue on the admin pages you'll want to use the admin enqueues.

https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/ https://developer.wordpress.org/reference/hooks/admin_print_scripts/ https://developer.wordpress.org/reference/hooks/admin_print_styles/

Example(s) from your plugin:

07_03-09-01_mmg-checkout-payment/includes/class-mmg-checkout-settings.php:190 Githubissues.

  • Githubissues is a development platform for aggregating issues.