Plugin Directory

Changeset 3126638


Ignore:
Timestamp:
07/27/2024 09:26:18 PM (20 months ago)
Author:
dashcommerce
Message:

version 1.2.2

  • connect directly to the app
  • general improvements and bug fixes
Location:
dashcommerce/trunk
Files:
3 added
2 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • dashcommerce/trunk/dashcommerce.php

    r3116743 r3126638  
    1212 * Plugin Name: DashCommerce
    1313 * Description: DashCommerce plugin for WordPress.
    14  * Version: 1.2.0
     14 * Version: 1.2.1
    1515 * Author: DashCommerce
    1616 * License: GPL v2
     
    4242}
    4343
     44require_once plugin_dir_path( __FILE__ ) . 'utils/class-environment.php';
    4445require_once plugin_dir_path( __FILE__ ) . 'features/settings-page/class-settings-page.php';
    4546require_once plugin_dir_path( __FILE__ ) . 'features/product-metabox/class-product-metabox.php';
  • dashcommerce/trunk/features/analytics/class-analytics-charts.php

    r3116743 r3126638  
    11<?php // phpcs:ignore
     2
     3if ( ! defined( 'ABSPATH' ) ) {
     4    exit; // Exit if accessed directly.
     5}
     6
    27/**
    38 * This file is part of the DashCommerce Plugin for WordPress.
     
    4853
    4954        ?>
    50         <style>
    51             table {
    52                 border-collapse: collapse; /* Shared borders */
    53                 width: max-content;
    54                 line-height: 1.2; /* Tighter line spacing */
    55             }
    56             th, td {
    57                 padding: 2px; /* Reduced padding */
    58                 border: 1px solid #ccc; /* Thinner borders */
    59             }
    60         </style>
    61 
    6255        <div>
    63             <table>
     56            <table class="dashcommerce-utm-table">
    6457                <thead>
    6558                    <tr>
  • dashcommerce/trunk/features/analytics/class-analytics-tabs.php

    r3098201 r3126638  
    11<?php // phpcs:ignore
     2
     3if ( ! defined( 'ABSPATH' ) ) {
     4    exit; // Exit if accessed directly.
     5}
     6
    27/**
    38 * This file is part of the DashCommerce Plugin for WordPress.
  • dashcommerce/trunk/features/analytics/class-analytics-values.php

    r3116743 r3126638  
    11<?php // phpcs:ignore
     2
     3if ( ! defined( 'ABSPATH' ) ) {
     4    exit; // Exit if accessed directly.
     5}
     6
    27/**
    38 * This file is part of the DashCommerce Plugin for WordPress.
  • dashcommerce/trunk/features/analytics/class-analytics.php

    r3116743 r3126638  
    11<?php // phpcs:ignore
     2
     3if ( ! defined( 'ABSPATH' ) ) {
     4    exit; // Exit if accessed directly.
     5}
     6
    27/**
    38 * This file is part of the DashCommerce Plugin for WordPress.
  • dashcommerce/trunk/features/api/class-api.php

    r3116743 r3126638  
    161161                    'env'      => $this->utils->get_env(),
    162162                    'timezone' => $this->utils->get_wp_timezone(),
     163                    'has_woo'  => $this->utils->is_woocommerce_active(),
    163164                ),
    164165                'settings'     => $this->settings->get_settings(),
  • dashcommerce/trunk/features/product-metabox/class-product-metabox.php

    r3116743 r3126638  
    222222        try {
    223223            $result = $dashcommerce_utils->http_get(
    224                 $dashcommerce_env['EP_GENERATE_PRODUCT_DESCRIPTION'],
     224                $dashcommerce_env['EP_GENERATE_PRODUCT_DESC'],
    225225                array(
    226226                    'language'      => $language,
  • dashcommerce/trunk/features/settings-page/class-settings-page.php

    r3116743 r3126638  
    404404        }
    405405
    406         $home = home_url();
    407 
    408406        try {
    409407            $result = $dashcommerce_utils->http_post(
  • dashcommerce/trunk/readme.txt

    r3116743 r3126638  
    33Tags: e-commerce, dashcommerce, description generation, ai
    44Requires at least: WordPress 5.0
    5 Tested up to: 6.4.3
    6 Stable tag: 1.2.0
     5Tested up to: 6.5.5
     6Stable tag: 1.2.1
    77Requires PHP: 8.1
    88License: GPL v2
     
    2727- - To save a user-provided OpenAI API key, which is used to access the AI-related features of the plugin.
    2828- This plugin relies, indirectly and through our own API, on the OpenAI API for AI-related features. Their Privacy Policy is available at https://openai.com/enterprise-privacy
     29- This plugin records data related to the accesses to your website. This data is used to provide analytics and statistics.
    2930
    3031- For support, visit https://dashcommerce.app/contact or contact info@dashcommerce.app.
  • dashcommerce/trunk/styles.css

    r3098201 r3126638  
    9898    display: none;
    9999}
     100
     101.dashcommerce-utm-table {
     102    border-collapse: collapse; /* Shared borders */
     103    width: max-content;
     104    line-height: 1.2; /* Tighter line spacing */
     105}
     106
     107.dashcommerce-utm-table th, td {
     108    padding: 2px; /* Reduced padding */
     109    border: 1px solid #ccc; /* Thinner borders */
     110}
  • dashcommerce/trunk/tables/class-access-logs.php

    r3116743 r3126638  
    11<?php // phpcs:ignore
     2
     3if ( ! defined( 'ABSPATH' ) ) {
     4    exit; // Exit if accessed directly.
     5}
    26
    37/**
     
    141145        arsort( $page_counts );
    142146
    143         if ( count( $page_counts ) > 9 ) {
    144             $top_items   = array_slice( $page_counts, 0, 9, true );
    145             $other_items = array_slice( $page_counts, 9, null, true );
    146             $others_sum  = array_sum( $other_items );
    147 
    148             $top_items['others'] = $others_sum;
    149 
    150             return $top_items;
    151         } else {
    152             return $page_counts;
    153         }
     147        return $page_counts;
    154148    }
    155149
     
    222216     * Checks if the access logs table is empty.
    223217     *
    224      * @return bool True if the table is empty, false otherwise.
     218     * @return bool `true` if the table is empty, `false` otherwise.
    225219     */
    226220    public function is_empty() {
  • dashcommerce/trunk/utils/class-utils.php

    r3116743 r3126638  
    2121    public function __construct() {
    2222        add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
    23     }
    24 
    25     /**
    26      * Reference to global variable dashcommerce_env. It should be defined in load_environment().
     23
     24        global $dashcommerce_env;
     25
     26        $this->env = $dashcommerce_env;
     27    }
     28
     29    /**
     30     * Reference to global variable dashcommerce_env, which contains the plugin's environment variables.
    2731     *
    2832     * @var array
     
    186190            return false;
    187191        }
    188     }
    189 
    190     /**
    191      * Loads environment variables from a .env file.
    192      *
    193      * This function reads the contents of a .env file located at the specified path and sets the environment variables accordingly.
    194      * Each line in the .env file should be in the format "NAME=VALUE", where NAME is the name of the environment variable and VALUE is its corresponding value.
    195      * Lines starting with '#' are considered comments and are ignored.
    196      * If an environment variable with the same name already exists in $_SERVER or $_ENV, it will not be overwritten.
    197      *
    198      * @return void
    199      */
    200     public function load_environment() {
    201         global $dashcommerce_env;
    202 
    203         $env_path = __DIR__ . '/../env/.env';
    204 
    205         if ( ! file_exists( $env_path ) ) {
    206             return;
    207         }
    208 
    209         $lines = file( $env_path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES );
    210 
    211         foreach ( $lines as $line ) {
    212             if ( strpos( trim( $line ), '#' ) === 0 ) {
    213                 continue;
    214             }
    215 
    216             list($name, $value) = explode( '=', $line, 2 );
    217             $name               = trim( $name );
    218             $value              = trim( $value );
    219 
    220             if ( ! isset( $dashcommerce_env ) ) {
    221                 $dashcommerce_env = array();
    222             }
    223 
    224             if ( ! array_key_exists( $name, $dashcommerce_env ) ) {
    225                 $dashcommerce_env[ $name ] = $value;
    226             }
    227         }
    228 
    229         $this->env = $dashcommerce_env;
    230192    }
    231193
     
    598560
    599561$dashcommerce_utils = new Dashcommerce_Utils();
    600 
    601 $dashcommerce_utils->load_environment();
Note: See TracChangeset for help on using the changeset viewer.