Plugin Directory

Changeset 2789730


Ignore:
Timestamp:
09/24/2022 08:36:17 PM (3 years ago)
Author:
uqrate
Message:

v1.0.0 build 2022-09-24T20.30.44Z to trunk

Location:
uqrate/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • uqrate/trunk/class.core.php

    r2789063 r2789730  
    101101            global $post;
    102102            $state->comment_status = $post->comment_status;
     103            $state->guid = $post->guid;
     104            $state->uri = self::reqURI();
    103105        }
    104106        return $content
    105107                . self::preObj( $state, 'state' );
     108    }
     109    protected static function reqURI() {
     110        return sanitize_url( $_SERVER['REQUEST_URI'] );
    106111    }
    107112    private static function okayCommentsSection() {
  • uqrate/trunk/class.sync.php

    r2789063 r2789730  
    6161            }
    6262        } else {
    63             if ( self::getMID( $post->guid, $post->post_date_gmt ) ) {
     63            if ( self::getMID() ) {
    6464                $mid = self::cfg('mid');
    6565                $sql = "INSERT IGNORE INTO $table_name (
     
    167167            'body'        => $post->post_content,
    168168            'date_update' => $date,
    169             'host_url'    => get_permalink(),
     169            'uri'         => self::reqURI(),
    170170        ];
    171171        if ( $post->post_excerpt ) $msg['summary'] = $post->post_excerpt;
     
    225225        return true;
    226226    }
    227     private static function getMID( $post_guid, $post_date_gmt ) {
     227    private static function getMID() {
    228228        /**********************************************************************
    229229         * Get the cross-app message id (MID) : UUIDv5 of OID namespace
     
    242242        $mid = 'UUID_NAME_FAIL';
    243243        if ( ! self::GetChnKey() ) return false;
    244         if ( ! ( $post_date_gmt && self::cfg('chn_key')['chn_id'] ) ) {
     244        $cid = self::cfg('chn_key')['chn_id'];
     245        $uri = self::reqURI();
     246        if ( ! ( $cid && $uri ) ) {
    245247            self::cfg()['mid'] = $mid;
    246248            self::errWrap( 'missing source(s)', __FUNCTION__ );
     
    249251        $mid = 'UUID_MALFORMED';
    250252        $code = 0;
    251         /********************************************************
    252          * Set a site-unique, static source (name) for UUIDv5
    253          *
    254          *  name : <REQUEST_URI><CHANNEL_ID>/<TIMESTAMPz>
    255          *
    256          * The MID may be generated by any UUIDv5-encoding
    257          * function that knows to decode the url-encoded name
    258          * and use the OID namespace.
    259          *******************************************************/
    260         $name = sanitize_url( $_SERVER['REQUEST_URI'] )
    261                 . self::cfg('chn_key')['chn_id'] . '/'
    262                 . self::rfc3339z( $post_date_gmt );
    263         $url = self::cfg('base_mid_url') . urlencode( $name );
     253        $url = self::cfg('base_mid_url') . urlencode( $cid . $uri );
    264254        self::cfg()['url'] = $url;
    265255        $resp = wp_remote_get( $url );
  • uqrate/trunk/uqrate.php

    r2789063 r2789730  
    2929define( 'UQRATE_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
    3030$_UQRATE_ENV = [
    31     'build'                 => "2022-09-22T19.47.58Z",
     31    'build'                 => "2022-09-24T20.30.44Z",
    3232    'mode_debug'            => false,
    3333    'mode_local'            => false,
  • uqrate/trunk/views/js/a.base.js

    r2786655 r2789730  
    88            ver = '1.0.0'
    99            ,debug = true
    10             ,log_ctx = `𝕎 [${(new Date()).toISOString().substring(17)}] [v${ver}]`
    11             ,log = (arg, ...args) => debug && console.log(log_ctx, arg, ...args)
     10            ,log = (arg, ...args) => debug && console.log(
     11                `𝕎 [${(new Date()).toISOString().substring(17)}] [v${ver}]`
     12                ,arg, ...args
     13            )
    1214            ,css = (selector, root) => {
    1315                root = root ? root : document
  • uqrate/trunk/views/js/p.base.js

    r2786655 r2789730  
    88            ver = '1.0.0'
    99            ,debug = true
    10             ,log_ctx = `𝐖 [${(new Date()).toISOString().substring(17)}] [v${ver}]`
    11             ,log = (arg, ...args) => debug && console.log(log_ctx, arg, ...args)
     10            ,log = (arg, ...args) => debug && console.log(
     11                `𝐖 [${(new Date()).toISOString().substring(17)}] [v${ver}]`
     12                ,arg, ...args
     13            )
    1214            ,id = (id) => document.getElementById(id)
    1315            ,css = (selector, root) => {
Note: See TracChangeset for help on using the changeset viewer.