Skip to content

Commit 42bc1b8

Browse files
committed
👌 IMPROVE: General code cleanup
1 parent 363199a commit 42bc1b8

File tree

114 files changed

+20
-18
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+20
-18
lines changed

customer-loyalty-for-woocommerce.php

+20-5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@
3131
// Current plugin version.
3232
define( 'CUSTOMER_LOYALTY_VERSION', '2.0.0' );
3333

34+
require 'vendor/plugin-update-checker/plugin-update-checker.php';
35+
use YahnisElsts\PluginUpdateChecker\v5\PucFactory;
36+
37+
$myUpdateChecker = PucFactory::buildUpdateChecker(
38+
'https://github.com/robertdevore/customer-loyalty-for-woocommerce/',
39+
__FILE__,
40+
'customer-loyalty-for-woocommerce'
41+
);
42+
43+
// Set the branch that contains the stable release.
44+
$myUpdateChecker->setBranch( 'main' );
45+
3446
// Check if Composer's autoloader is already registered globally.
3547
if ( ! class_exists( 'RobertDevore\WPComCheck\WPComPluginHandler' ) ) {
3648
require_once __DIR__ . '/vendor/autoload.php';
@@ -46,8 +58,8 @@
4658
* This function creates a table for storing loyalty log entries in the database.
4759
* It includes fields for storing the customer ID, name, email, points, action details, and date.
4860
*
49-
* @package CLWC
50-
* @since 2.0.0
61+
* @package CLWC
62+
* @since 2.0.0
5163
*/
5264
function clwc_create_loyalty_log_table() {
5365
global $wpdb;
@@ -82,6 +94,7 @@ function clwc_create_loyalty_log_table() {
8294
* The code that runs during plugin activation.
8395
* This action is documented in includes/class-clwc-activator.php
8496
*
97+
* @since 1.0.0
8598
* @return void
8699
*/
87100
function activate_clwc() {
@@ -93,6 +106,7 @@ function activate_clwc() {
93106
* The code that runs during plugin deactivation.
94107
* This action is documented in includes/class-clwc-deactivator.php
95108
*
109+
* @since 1.0.0
96110
* @return void
97111
*/
98112
function deactivate_clwc() {
@@ -116,7 +130,7 @@ function deactivate_clwc() {
116130
* then kicking off the plugin from this point in the file does
117131
* not affect the page life cycle.
118132
*
119-
* @since 1.0
133+
* @since 1.0.0
120134
* @return void
121135
*/
122136
function run_clwc() {
@@ -160,7 +174,7 @@ function clwc_activate() {
160174
* Redirect to the Customer Loyalty for WooCommerce Settings page
161175
* on single plugin activation
162176
*
163-
* @since 1.0
177+
* @since 1.0.0
164178
* @return void
165179
*/
166180
function clwc_redirect() {
@@ -259,6 +273,7 @@ function clwc_redeem_points_callback() {
259273
$user_info = get_userdata( $user_id );
260274
$user_name = $user_info ? $user_info->display_name : '';
261275
$user_email = $user_info ? $user_info->user_email : '';
276+
262277
// Generate the WooCommerce Orders link for the specific user.
263278
$orders_link = admin_url( 'edit.php?post_type=shop_order&s=' . urlencode( $user_email ) );
264279

@@ -291,7 +306,7 @@ function clwc_redeem_points_callback() {
291306
/**
292307
* AJAX handler to update loyalty points for a specific user.
293308
*
294-
* @since 2.0.0
309+
* @since 2.0.0
295310
* @return void
296311
*/
297312
function clwc_update_loyalty_points_callback() {

includes/class-clwc.php

-13
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,6 @@
1414
* @since 1.0.0
1515
*/
1616

17-
// Add the Plugin Update Checker.
18-
require 'vendor/plugin-update-checker/plugin-update-checker.php';
19-
use YahnisElsts\PluginUpdateChecker\v5\PucFactory;
20-
21-
$myUpdateChecker = PucFactory::buildUpdateChecker(
22-
'https://github.com/deviodigital/customer-loyalty-fort-woocommerce/',
23-
__FILE__,
24-
'customer-loyalty-for-woocommerce'
25-
);
26-
27-
// Set the branch that contains the stable release.
28-
$myUpdateChecker->setBranch( 'main' );
29-
3017
/**
3118
* The core plugin class.
3219
*

0 commit comments

Comments
 (0)