Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/wordpres.../includes/admin
File: class-wws-admin-ajax.php
<?php
[0] Fix | Delete
[1] Fix | Delete
// Preventing to direct access
[2] Fix | Delete
defined( 'ABSPATH' ) OR die( 'Direct access not acceptable!' );
[3] Fix | Delete
[4] Fix | Delete
class WWS_Admin_Ajax {
[5] Fix | Delete
[6] Fix | Delete
public function __construct() {
[7] Fix | Delete
[8] Fix | Delete
add_action( "wp_ajax_wws_edit_multi_support_person", array( $this, 'edit_multi_support_person' ) );
[9] Fix | Delete
add_action( "wp_ajax_nopriv_wws_edit_multi_support_person", array( $this, 'edit_multi_support_person' ) );
[10] Fix | Delete
[11] Fix | Delete
add_action( "wp_ajax_wws_add_multi_support_person", array( $this, 'add_multi_support_person' ) );
[12] Fix | Delete
add_action( "wp_ajax_nopriv_wws_add_multi_support_person", array( $this, 'add_multi_support_person' ) );
[13] Fix | Delete
[14] Fix | Delete
add_action( "wp_ajax_wws_admin_qr_generator", array( $this, 'admin_qr_generator' ) );
[15] Fix | Delete
add_action( "wp_ajax_nopriv_wws_admin_qr_generator", array( $this, 'admin_qr_generator' ) );
[16] Fix | Delete
[17] Fix | Delete
}
[18] Fix | Delete
[19] Fix | Delete
[20] Fix | Delete
public function edit_multi_support_person() {
[21] Fix | Delete
if ( ! isset( $_GET['action'] ) && 'wws_edit_multi_support_person' !== $_GET['action']) {
[22] Fix | Delete
return;
[23] Fix | Delete
}
[24] Fix | Delete
[25] Fix | Delete
$person_id = $_GET['person_id'];
[26] Fix | Delete
$setting = get_option( 'wws_multi_support_persons', array() );
[27] Fix | Delete
[28] Fix | Delete
require_once WWS_PLUGIN_PATH . 'includes/admin/views/multiperson-support/admin-edit-multiperson-support.php';
[29] Fix | Delete
[30] Fix | Delete
wp_die();
[31] Fix | Delete
}
[32] Fix | Delete
[33] Fix | Delete
[34] Fix | Delete
public function add_multi_support_person() {
[35] Fix | Delete
if ( ! isset( $_GET['action'] ) && 'wws_add_multi_support_person' !== $_GET['action'] ) {
[36] Fix | Delete
return;
[37] Fix | Delete
}
[38] Fix | Delete
[39] Fix | Delete
require_once WWS_PLUGIN_PATH . 'includes/admin/views/multiperson-support/admin-add-multiperson-support.php';
[40] Fix | Delete
wp_die();
[41] Fix | Delete
}
[42] Fix | Delete
[43] Fix | Delete
[44] Fix | Delete
public function admin_qr_generator() {
[45] Fix | Delete
[46] Fix | Delete
$response = array();
[47] Fix | Delete
[48] Fix | Delete
$support_number = sanitize_text_field( $_POST['support_number'] );
[49] Fix | Delete
$pre_message = sanitize_textarea_field( $_POST['pre_message'] );
[50] Fix | Delete
$qr_size = sanitize_text_field( $_POST['qr_size'] );
[51] Fix | Delete
[52] Fix | Delete
$url = "https://api.whatsapp.com/send?phone={$support_number}";
[53] Fix | Delete
[54] Fix | Delete
$image_name = WWS_QR_Generator::generate( $url, $qr_size );
[55] Fix | Delete
[56] Fix | Delete
$upload_dir = wp_upload_dir();
[57] Fix | Delete
$qr = $upload_dir['baseurl'] . '/wws-qr-images/' . $image_name;
[58] Fix | Delete
[59] Fix | Delete
$response['shortcode'] = "[wws-qr qr='{$image_name}' size='{$qr_size} text='{$pre_message}']";
[60] Fix | Delete
$response['generatedQR'] = $qr;
[61] Fix | Delete
$response['preMessage'] = $pre_message;
[62] Fix | Delete
[63] Fix | Delete
echo json_encode( $response );
[64] Fix | Delete
[65] Fix | Delete
wp_die();
[66] Fix | Delete
}
[67] Fix | Delete
[68] Fix | Delete
} // end of WWS_Admin_Ajax class
[69] Fix | Delete
[70] Fix | Delete
$wws_admin_ajax = new WWS_Admin_Ajax;
[71] Fix | Delete
[72] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function