vindi/vindi-woocommerce

View on GitHub
src/includes/admin/CouponsMetaBox.php

Summary

Maintainability
A
0 mins
Test Coverage

Showing 13 of 13 total issues

save accesses the super-global variable $_POST.
Open

public static function save($post_id, $post)
{
// Check the nonce (again).
if (empty(VindiHelpers::sanitize_xss($_POST['woocommerce_meta_nonce'])) ||
!wp_verify_nonce(VindiHelpers::sanitize_xss($_POST['woocommerce_meta_nonce']), 'woocommerce_save_data')) {
Severity: Minor
Found in src/includes/admin/CouponsMetaBox.php by phpmd

save accesses the super-global variable $_POST.
Open

public static function save($post_id, $post)
{
// Check the nonce (again).
if (empty(VindiHelpers::sanitize_xss($_POST['woocommerce_meta_nonce'])) ||
!wp_verify_nonce(VindiHelpers::sanitize_xss($_POST['woocommerce_meta_nonce']), 'woocommerce_save_data')) {
Severity: Minor
Found in src/includes/admin/CouponsMetaBox.php by phpmd

save accesses the super-global variable $_POST.
Open

public static function save($post_id, $post)
{
// Check the nonce (again).
if (empty(VindiHelpers::sanitize_xss($_POST['woocommerce_meta_nonce'])) ||
!wp_verify_nonce(VindiHelpers::sanitize_xss($_POST['woocommerce_meta_nonce']), 'woocommerce_save_data')) {
Severity: Minor
Found in src/includes/admin/CouponsMetaBox.php by phpmd

Avoid using static access to class 'VindiPaymentGateways\VindiHelpers' in method 'save'.
Open

!wp_verify_nonce(VindiHelpers::sanitize_xss($_POST['woocommerce_meta_nonce']), 'woocommerce_save_data')) {
Severity: Minor
Found in src/includes/admin/CouponsMetaBox.php by phpmd

Avoid using static access to class 'VindiPaymentGateways\VindiHelpers' in method 'save'.
Open

if (empty(VindiHelpers::sanitize_xss($_POST['woocommerce_meta_nonce'])) ||
Severity: Minor
Found in src/includes/admin/CouponsMetaBox.php by phpmd

Avoid unused parameters such as '$post'.
Open

public static function save($post_id, $post)
Severity: Minor
Found in src/includes/admin/CouponsMetaBox.php by phpmd

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 14 and the first side effect is on line 8.
Open

<?php

Expected 0 spaces before closing bracket; 1 found
Open

if ( ! defined( 'ABSPATH' ) ) {

Opening brace of a class must be on the line after the definition
Open

class CouponsMetaBox {

Spaces must be used to indent lines; tabs are not allowed
Open

exit; // Exit if accessed directly

Expected 0 spaces after opening bracket; 1 found
Open

if ( ! defined( 'ABSPATH' ) ) {

Expected 0 spaces before closing bracket; 1 found
Open

if ( ! defined( 'ABSPATH' ) ) {

Space after opening parenthesis of function call prohibited
Open

if ( ! defined( 'ABSPATH' ) ) {

There are no issues that match your filters.

Category
Status