Plugin Directory

Changeset 3108482


Ignore:
Timestamp:
06/27/2024 08:33:31 AM (21 months ago)
Author:
xmic
Message:

Update to version 1.4.0 from GitHub

Location:
timestamps
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • timestamps/tags/1.4.0/composer.json

    r3074313 r3108482  
    1212  ],
    1313  "require": {
    14     "php": ">=8.0"
     14    "php": ">=7.4"
    1515  },
    1616  "minimum-stability": "dev",
  • timestamps/tags/1.4.0/includes/classes/Feature/WooCommerce/Orders.php

    r3106064 r3108482  
    5858            add_action( 'woocommerce_new_order', array( $this, 'woocommerce_new_order' ) );
    5959            add_action( 'woocommerce_update_order', array( $this, 'woocommerce_update_order' ) );
     60            add_action( 'woocommerce_before_delete_order', array( $this, 'woocommerce_before_delete_order' ), 10, 2 );
    6061            add_filter( 'manage_woocommerce_page_wc-orders_columns', array( $this, 'add_order_timestamps_column' ), 30 );
    6162            add_action( 'manage_woocommerce_page_wc-orders_custom_column', array( $this, 'order_timestamps_column' ), 30, 2 );
     
    244245            error_log( 'An error occurred: ' . $e->getMessage() );
    245246        }
     247    }
     248
     249    /**
     250     * Deletes a certificate for a WooCommerce order when the order is permanently deleted (not in trash).
     251     *
     252     * This does not delete the blockchain transaction. It only deletes the certificate from the API.
     253     * This is because the blockchain transaction can never be deleted, as written in the smart contract.
     254     *
     255     * This will clear up unused certificates and help save money for you by giving more space for more certificates.
     256     *
     257     * We recommend visiting the certificate URL and saving to PDF / printing it, before deleting it.
     258     *
     259     * You can also visit https://docs.scoredetect.com/certificates/how-can-i-download-export-my-certificates to bulk export your certificates.
     260     *
     261     * @param int       $order_id The order ID.
     262     * @param \WC_Order $order The order object.
     263     * @since 1.4.0
     264     * @return void
     265     */
     266    public function woocommerce_before_delete_order( $order_id, $order ) {
     267
     268        // Bail early if the order is not valid.
     269        if ( ! $order instanceof \WC_Order ) {
     270            return;
     271        }
     272
     273        $sdcom_previous_certificate_id = $order->get_meta( 'sdcom_previous_certificate_id' );
     274
     275        // Bail early if there is no previous certificate id.
     276        if ( empty( $sdcom_previous_certificate_id ) ) {
     277            return;
     278        }
     279
     280        // Delete the certificate from the API.
     281        $this->delete_certificates( [ $sdcom_previous_certificate_id ] );
    246282    }
    247283
     
    599635     * Retrieves old WooCommerce orders with certificates.
    600636     *
    601      * @since 1.3.0
    602      * @return array|object of WC_Order objects
    603      */
    604     public function get_old_orders_with_certificates(): array|object {
     637     * @since 1.4.0
     638     * @return \WC_Order[] An array of old WooCommerce orders with certificates.
     639     */
     640    public function get_old_orders_with_certificates(): array {
    605641
    606642        // Bail early if the WooCommerce plugin is not active.
     
    646682     * Deletes certificates from a list of certificate IDs.
    647683     *
     684     * We recommend visiting the certificate URL and saving to PDF / printing it, before deleting it.
     685     *
     686     * You can also visit https://docs.scoredetect.com/certificates/how-can-i-download-export-my-certificates to bulk export your certificates.
     687     *
    648688     * @param array $certificate_ids The certificate ids to delete.
    649689     * @since 1.3.0
  • timestamps/tags/1.4.0/package-lock.json

    r3106070 r3108482  
    11{
    22  "name": "timestamps-plugin",
    3   "version": "1.3.1",
     3  "version": "1.4.0",
    44  "lockfileVersion": 3,
    55  "requires": true,
     
    77    "": {
    88      "name": "timestamps-plugin",
    9       "version": "1.3.1",
     9      "version": "1.4.0",
    1010      "dependencies": {
    1111        "@supabase/supabase-js": "^2.39.3",
  • timestamps/tags/1.4.0/package.json

    r3106070 r3108482  
    11{
    22  "name": "timestamps-plugin",
    3   "version": "1.3.1",
     3  "version": "1.4.0",
    44  "description": "Timestamp your WordPress content to empower your content authenticity and increase user trust with our blockchain timestamping solution.",
    55  "homepage": "https://www.scoredetect.com/",
  • timestamps/tags/1.4.0/readme.txt

    r3106070 r3108482  
    33Tags: timestamp, blockchain, content, authenticity, copyright, timestamps, protection, verification, proof, timestamping
    44Requires at least: 6.0.0
    5 Tested up to: 6.5.2
     5Tested up to: 6.6
    66Requires PHP: 7.4
    7 Stable tag: 1.3.1
     7Stable tag: 1.4.0
    88License: AGPL-3.0-only
    99License URI: https://spdx.org/licenses/AGPL-3.0-only.html
  • timestamps/tags/1.4.0/timestamps.php

    r3106070 r3108482  
    99 *
    1010 * @link              https://www.scoredetect.com/
    11  * @since             1.3.1
     11 * @since             1.4.0
    1212 * @package           SDCOM_Timestamps
    1313 *
     
    1515 * Plugin Name:       Timestamps
    1616 * Description:       Timestamp your WordPress content to empower your content authenticity and increase user trust. No blockchain skills needed.
    17  * Version:           1.3.1
     17 * Version:           1.4.0
    1818 * Author:            ScoreDetect.com
    1919 * Author URI:        https://www.scoredetect.com/
     
    3232
    3333// Useful global constants.
    34 define( 'SDCOM_TIMESTAMPS_VERSION', '1.3.1' );
     34define( 'SDCOM_TIMESTAMPS_VERSION', '1.4.0' );
    3535define( 'SDCOM_TIMESTAMPS_OPTIONS', 'sdcom_timestamps' );
    3636define( 'SDCOM_TIMESTAMPS_URL', plugin_dir_url( __FILE__ ) );
  • timestamps/trunk/composer.json

    r3074313 r3108482  
    1212  ],
    1313  "require": {
    14     "php": ">=8.0"
     14    "php": ">=7.4"
    1515  },
    1616  "minimum-stability": "dev",
  • timestamps/trunk/includes/classes/Feature/WooCommerce/Orders.php

    r3106064 r3108482  
    5858            add_action( 'woocommerce_new_order', array( $this, 'woocommerce_new_order' ) );
    5959            add_action( 'woocommerce_update_order', array( $this, 'woocommerce_update_order' ) );
     60            add_action( 'woocommerce_before_delete_order', array( $this, 'woocommerce_before_delete_order' ), 10, 2 );
    6061            add_filter( 'manage_woocommerce_page_wc-orders_columns', array( $this, 'add_order_timestamps_column' ), 30 );
    6162            add_action( 'manage_woocommerce_page_wc-orders_custom_column', array( $this, 'order_timestamps_column' ), 30, 2 );
     
    244245            error_log( 'An error occurred: ' . $e->getMessage() );
    245246        }
     247    }
     248
     249    /**
     250     * Deletes a certificate for a WooCommerce order when the order is permanently deleted (not in trash).
     251     *
     252     * This does not delete the blockchain transaction. It only deletes the certificate from the API.
     253     * This is because the blockchain transaction can never be deleted, as written in the smart contract.
     254     *
     255     * This will clear up unused certificates and help save money for you by giving more space for more certificates.
     256     *
     257     * We recommend visiting the certificate URL and saving to PDF / printing it, before deleting it.
     258     *
     259     * You can also visit https://docs.scoredetect.com/certificates/how-can-i-download-export-my-certificates to bulk export your certificates.
     260     *
     261     * @param int       $order_id The order ID.
     262     * @param \WC_Order $order The order object.
     263     * @since 1.4.0
     264     * @return void
     265     */
     266    public function woocommerce_before_delete_order( $order_id, $order ) {
     267
     268        // Bail early if the order is not valid.
     269        if ( ! $order instanceof \WC_Order ) {
     270            return;
     271        }
     272
     273        $sdcom_previous_certificate_id = $order->get_meta( 'sdcom_previous_certificate_id' );
     274
     275        // Bail early if there is no previous certificate id.
     276        if ( empty( $sdcom_previous_certificate_id ) ) {
     277            return;
     278        }
     279
     280        // Delete the certificate from the API.
     281        $this->delete_certificates( [ $sdcom_previous_certificate_id ] );
    246282    }
    247283
     
    599635     * Retrieves old WooCommerce orders with certificates.
    600636     *
    601      * @since 1.3.0
    602      * @return array|object of WC_Order objects
    603      */
    604     public function get_old_orders_with_certificates(): array|object {
     637     * @since 1.4.0
     638     * @return \WC_Order[] An array of old WooCommerce orders with certificates.
     639     */
     640    public function get_old_orders_with_certificates(): array {
    605641
    606642        // Bail early if the WooCommerce plugin is not active.
     
    646682     * Deletes certificates from a list of certificate IDs.
    647683     *
     684     * We recommend visiting the certificate URL and saving to PDF / printing it, before deleting it.
     685     *
     686     * You can also visit https://docs.scoredetect.com/certificates/how-can-i-download-export-my-certificates to bulk export your certificates.
     687     *
    648688     * @param array $certificate_ids The certificate ids to delete.
    649689     * @since 1.3.0
  • timestamps/trunk/package-lock.json

    r3106070 r3108482  
    11{
    22  "name": "timestamps-plugin",
    3   "version": "1.3.1",
     3  "version": "1.4.0",
    44  "lockfileVersion": 3,
    55  "requires": true,
     
    77    "": {
    88      "name": "timestamps-plugin",
    9       "version": "1.3.1",
     9      "version": "1.4.0",
    1010      "dependencies": {
    1111        "@supabase/supabase-js": "^2.39.3",
  • timestamps/trunk/package.json

    r3106070 r3108482  
    11{
    22  "name": "timestamps-plugin",
    3   "version": "1.3.1",
     3  "version": "1.4.0",
    44  "description": "Timestamp your WordPress content to empower your content authenticity and increase user trust with our blockchain timestamping solution.",
    55  "homepage": "https://www.scoredetect.com/",
  • timestamps/trunk/readme.txt

    r3106070 r3108482  
    33Tags: timestamp, blockchain, content, authenticity, copyright, timestamps, protection, verification, proof, timestamping
    44Requires at least: 6.0.0
    5 Tested up to: 6.5.2
     5Tested up to: 6.6
    66Requires PHP: 7.4
    7 Stable tag: 1.3.1
     7Stable tag: 1.4.0
    88License: AGPL-3.0-only
    99License URI: https://spdx.org/licenses/AGPL-3.0-only.html
  • timestamps/trunk/timestamps.php

    r3106070 r3108482  
    99 *
    1010 * @link              https://www.scoredetect.com/
    11  * @since             1.3.1
     11 * @since             1.4.0
    1212 * @package           SDCOM_Timestamps
    1313 *
     
    1515 * Plugin Name:       Timestamps
    1616 * Description:       Timestamp your WordPress content to empower your content authenticity and increase user trust. No blockchain skills needed.
    17  * Version:           1.3.1
     17 * Version:           1.4.0
    1818 * Author:            ScoreDetect.com
    1919 * Author URI:        https://www.scoredetect.com/
     
    3232
    3333// Useful global constants.
    34 define( 'SDCOM_TIMESTAMPS_VERSION', '1.3.1' );
     34define( 'SDCOM_TIMESTAMPS_VERSION', '1.4.0' );
    3535define( 'SDCOM_TIMESTAMPS_OPTIONS', 'sdcom_timestamps' );
    3636define( 'SDCOM_TIMESTAMPS_URL', plugin_dir_url( __FILE__ ) );
Note: See TracChangeset for help on using the changeset viewer.