Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #9 from homescriptone/develop
Browse files Browse the repository at this point in the history
Prepare version 1.9.8.3
  • Loading branch information
manutheblacker authored Nov 28, 2022
2 parents 665b15d + 2cff20c commit 94f94f8
Show file tree
Hide file tree
Showing 245 changed files with 230 additions and 236 deletions.
2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: orders notifications, woocommerce whatsapp, whatsapp automations, woocomme
Donate link: https://buymeacoffee.com/homescriptone/
Requires at least: 4.4
Tested up to: 6.1
Stable tag: 1.9.8.2
Stable tag: 1.9.8.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.txt

Expand Down
2 changes: 1 addition & 1 deletion abstract/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* All the constants related to the plugin are defined here.
*/
define( 'WOO_USN_VERSION', '1.9.8.2' );
define( 'WOO_USN_VERSION', '1.9.8.3' );
define( 'WOO_USN_PATH', plugin_dir_path( __FILE__ ) );
define( 'WOO_USN_URL', plugins_url( '/', __FILE__ ) );
define( 'WOO_USN_PLUGIN_ID', '6855' );
Expand Down
Empty file modified abstract/globals.php
100755 → 100644
Empty file.
Empty file modified abstract/premium_loading.php
100755 → 100644
Empty file.
7 changes: 3 additions & 4 deletions admin/class-woo-usn-admin-menu.php
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

// phpcs:ignorefile
class Woo_Usn_Admin_Menu
{
/**
Expand Down Expand Up @@ -55,12 +54,12 @@ public static function add_menus()
$submenu['ultimate-sms-notifications'][22] = array( '<div class="woo-usn-links">' . __( 'Knowledge Base', 'ultimate-sms-notifications' ) . '</div>', 'manage_options', 'https://help.ultimatesmsnotifications.com/?utm_source=' . get_site_url() );
$submenu['ultimate-sms-notifications'][23] = array( '<div class="woo-usn-links">' . __( 'Contact us', 'ultimate-sms-notifications' ) . '</div>', 'manage_options', 'https://chatting.page/homescriptone?utm_source=' . get_site_url() );
$first_menu = $submenu['ultimate-sms-notifications'][0];
$new_menu = array( '<div>' . __( 'Logs', 'ultimate-sms-notifications' ) . '</div>', 'manage_options', admin_url( "admin.php?page=ultimate-sms-notifications-pricing" ) );
$new_menu = array( '<div>' . __( 'Logs', 'ultimate-sms-notifications' ) . '</div>', 'manage_options', admin_url( 'admin.php?page=ultimate-sms-notifications-pricing' ) );
$bm = array( $first_menu, $new_menu );
$setting_menu = array_slice( $submenu['ultimate-sms-notifications'], 1 );
$submenu['ultimate-sms-notifications'] = array_merge_recursive( $bm, $setting_menu );
$submenu['ultimate-sms-notifications'][3][2] = admin_url( "admin.php?page=ultimate-sms-notifications-pricing" );
$submenu['ultimate-sms-notifications'][4][2] = admin_url( "admin.php?page=ultimate-sms-notifications-pricing" );
$submenu['ultimate-sms-notifications'][3][2] = admin_url( 'admin.php?page=ultimate-sms-notifications-pricing' );
$submenu['ultimate-sms-notifications'][4][2] = admin_url( 'admin.php?page=ultimate-sms-notifications-pricing' );
}

}
241 changes: 121 additions & 120 deletions admin/class-woo-usn-admin-settings.php
100755 → 100644

Large diffs are not rendered by default.

112 changes: 53 additions & 59 deletions admin/class-woo-usn-admin-subscribers.php
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?php
// phpcs:ignorefile

use Faker\Provider\DateTime;

if ( ! class_exists( 'WP_List_Table' ) ) {
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
Expand All @@ -20,9 +17,12 @@ public function __construct() {
)
);

add_action('admin_enqueue_scripts', function() {
wp_enqueue_script( 'fontawesome','https://kit.fontawesome.com/a076d05399.js', array(), uniqid(), true );
});
add_action(
'admin_enqueue_scripts',
function() {
wp_enqueue_script( 'fontawesome', 'https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.2.0/js/fontawesome.min.js', array(), uniqid(), true );
}
);

}

Expand Down Expand Up @@ -52,7 +52,7 @@ public static function get_customers( $per_page = 5, $page_number = 1, $paginati
return $wpdb->get_results( $sql, 'ARRAY_A' );
}

public static function get_customer_choices( $choice='on' ) {
public static function get_customer_choices( $choice = 'on' ) {

global $wpdb;

Expand Down Expand Up @@ -94,7 +94,7 @@ public static function record_count() {

/** Text displayed when no customer data is available */
public function no_items() {
_e( 'No logs avaliable.', 'sp' );
esc_html_e( 'No logs avaliable.', 'ultimate-sms-notifications' );
}


Expand All @@ -108,34 +108,33 @@ public function no_items() {
*/
public function column_default( $item, $column_name ) {
switch ( $column_name ) {
case 'customer_id':
$customer_id = $item['customer_id'];
$customer = new WC_Customer( $customer_id );
$fname = $customer->get_billing_first_name() . " " . $customer->get_billing_last_name();
echo wp_kses_post( '<a href="'.admin_url( 'user-edit.php?user_id='.$customer_id ) . '">'. $fname . '</a>' );
break;

case 'customer_registered_page':
echo ucfirst( $item['customer_registered_page']);
break;

case 'customer_consent':
$consent = $item['customer_consent'];
if ( 'on' == $consent ) {
echo '<i class="fa fa-check" style="color:green;"></i>' . __( 'Subscribed', 'ultimate-sms-notifications' );
} else {
echo '<i class="fa fa-times-circle" style="color:red;"></i> ' . __( 'Unsubscribed', 'ultimate-sms-notifications' );
}

break;


case 'date':
echo wp_date('m/d/Y H:i:s', strtotime( $item['date'] ));
break;
case 'customer_id':
$customer_id = $item['customer_id'];
$customer = new WC_Customer( $customer_id );
$fname = $customer->get_billing_first_name() . ' ' . $customer->get_billing_last_name();
echo wp_kses_post( '<a href="' . admin_url( 'user-edit.php?user_id=' . $customer_id ) . '">' . $fname . '</a>' );
break;

case 'customer_registered_page':
echo esc_attr( ucfirst( $item['customer_registered_page'] ) );
break;

case 'customer_consent':
$consent = $item['customer_consent'];
if ( 'on' == $consent ) {
echo '<i class="fa fa-check" style="color:green;"></i>' . esc_html__( 'Subscribed', 'ultimate-sms-notifications' );
} else {
echo '<i class="fa fa-times-circle" style="color:red;"></i> ' . esc_html__( 'Unsubscribed', 'ultimate-sms-notifications' );
}

break;

case 'date':
echo wp_date( 'm/d/Y H:i:s', strtotime( $item['date'] ) );
break;

default:
return print_r( $item, true ); // Show the whole array for troubleshooting purposes
return print_r( $item, true );
}
}

Expand Down Expand Up @@ -182,11 +181,11 @@ function column_name( $item ) {
*/
function get_columns() {
$columns = array(
'cb' => '<input type="checkbox" />',
'customer_id' => __( 'Customer Name', 'ultimate-sms-notifications' ),
'customer_registered_page' => __( 'Customer Registration Page', 'ultimate-sms-notifications' ),
'customer_consent' => __( 'Customer consent', 'ultimate-sms-notifications' ),
'date' => __( 'Date', 'ultimate-sms-notifications' ),
'cb' => '<input type="checkbox" />',
'customer_id' => __( 'Customer Name', 'ultimate-sms-notifications' ),
'customer_registered_page' => __( 'Customer Registration Page', 'ultimate-sms-notifications' ),
'customer_consent' => __( 'Customer consent', 'ultimate-sms-notifications' ),
'date' => __( 'Date', 'ultimate-sms-notifications' ),
);

return $columns;
Expand Down Expand Up @@ -223,8 +222,8 @@ public function prepare_items() {

$this->set_pagination_args(
array(
'total_items' => $total_items, // WE have to calculate the total number of items
'per_page' => $per_page, // WE have to determine how many items to show on a page
'total_items' => $total_items, // WE have to calculate the total number of items.
'per_page' => $per_page, // WE have to determine how many items to show on a page.
)
);

Expand All @@ -242,45 +241,40 @@ public function process_bulk_action() {
if ( ! wp_verify_nonce( $nonce, 'woo_usn_sms_logs_delete_nonce' ) ) {
die( 'Go get a life script kiddies' );
} else {
self::delete_customer( absint( $_GET['customer'] ) );

// esc_url_raw() is used to prevent converting ampersand in url to "#038;"
// add_query_arg() return the current url
wp_redirect( esc_url_raw( add_query_arg() ) );
exit;
if ( isset( $_GET['customer'] ) ) {
self::delete_customer( absint( $_GET['customer'] ) );
wp_safe_redirect( esc_url_raw( add_query_arg() ) );
exit;
}
}
}

// If the delete bulk action is triggered
// If the delete bulk action is triggered.
if ( ( isset( $_POST['action'] ) && $_POST['action'] == 'bulk-delete' )
|| ( isset( $_POST['action2'] ) && $_POST['action2'] == 'bulk-delete' )
) {

$delete_ids = esc_sql( $_POST['bulk-delete'] );

// loop over the array of record IDs and delete them
foreach ( $delete_ids as $id ) {
$delete_ids = filter_input_array( INPUT_POST );
// loop over the array of record IDs and delete them.
foreach ( $delete_ids['bulk-delete'] as $id ) {
self::delete_customer( $id );

}

// esc_url_raw() is used to prevent converting ampersand in url to "#038;"
// add_query_arg() return the current url
wp_redirect( esc_url_raw( add_query_arg() ) );
wp_safe_redirect( esc_url_raw( add_query_arg() ) );
exit;
}
}
}

class Woo_Usn_Subscribers_Loader {

// class instance
// class instance.
static $instance;

// customer WP_List_Table object
// customer WP_List_Table object.
public $customers_obj;

// class constructor
// class constructor.
public function __construct() {
add_filter( 'set-screen-option', array( __CLASS__, 'set_screen' ), 10, 3 );
}
Expand Down
Loading

0 comments on commit 94f94f8

Please sign in to comment.