Plugin Directory

Changeset 3177662


Ignore:
Timestamp:
10/29/2024 05:35:59 AM (17 months ago)
Author:
urlslab
Message:

Upload v2.130.9

Location:
urlslab/trunk
Files:
75 added
75 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • urlslab/trunk/admin/js/urlslab-wpml.js

    r3156110 r3177662  
    11const { __ } = wp.i18n;
    2 
    32window.addEventListener( 'load', () => {
    43    if ( typeof window.WPML_TM !== 'undefined' && typeof window.WPML_TM.editorJobFieldView !== 'undefined' ) {
     
    5655
    5756            if ( orig.classList.contains( 'mce_editor_origin' ) ) {
    58                 tinymceOrigId = orig.querySelector( 'textarea.original_value' ).getAttribute( 'name' );
    59                 origFieldValue = window.tinyMCE.get( tinymceOrigId ).getContent();
     57                const textareaOriginal = orig.querySelector( 'textarea.original_value' );
     58                tinymceOrigId = textareaOriginal.getAttribute( 'name' );
    6059                tinymceTransId = tinymceOrigId.replace( '_original', '' );
    61                 tinymceTransIdValue = window.tinyMCE.get( tinymceTransId ).getContent();
     60                const textareaTranslated = row.querySelector( `textarea#${ tinymceTransId }` );
     61
     62                // if tinyMCE editors not initialized by click on "Visual" tab or editors not stored in window object, fallback to default textarea
     63                if ( window.tinyMCE ) {
     64                    if ( window.tinyMCE.get( tinymceOrigId ) ) {
     65                        origFieldValue = window.tinyMCE.get( tinymceOrigId ).getContent();
     66                    } else {
     67                        origFieldValue = textareaOriginal.value;
     68                    }
     69
     70                    if ( window.tinyMCE.get( tinymceTransId ) ) {
     71                        tinymceTransIdValue = window.tinyMCE.get( tinymceTransId ).getContent();
     72                    } else {
     73                        tinymceTransIdValue = textareaTranslated.value;
     74                    }
     75                }
    6276
    6377                if ( tinymceTransIdValue ) {
     
    6680
    6781                if ( ! isTranslated ) {
    68                     window.tinyMCE.get( tinymceTransId ).setContent( isTranslating );
     82                    if ( window.tinyMCE?.get( tinymceTransId ) ) {
     83                        window.tinyMCE.get( tinymceTransId ).setContent( isTranslating );
     84                    } else {
     85                        textareaTranslated.value = isTranslating;
     86                    }
    6987                }
    7088
     
    151169            } ).then( ( data ) => {
    152170                if ( type && type === 'tinymce' ) {
    153                     window.tinyMCE.get( translateField ).setContent( data?.translation || '' );
     171                    if ( window.tinyMCE?.get( translateField ) ) {
     172                        window.tinyMCE.get( translateField ).setContent( data?.translation || '' );
     173                    } else if ( document.getElementById( translateField ) ) {
     174                        document.getElementById( translateField ).value = data?.translation || '';
     175                    }
     176
    154177                    return data;
    155178                }
  • urlslab/trunk/admin/src/assets/styles/components/_Panel.scss

    r3027290 r3177662  
    314314        }
    315315    }
     316
     317
     318    // Corrections for AI Content -> Results edit row modal
     319    &-wrap[data-table="generator/result"] {
     320
     321        .urlslab-panel {
     322            height: 90vh;
     323            display: flex;
     324            flex-direction: column;
     325
     326            &-content {
     327                height: 100%;
     328                display: flex;
     329                flex-wrap: nowrap;
     330                flex-direction: column;
     331                justify-content: flex-start;
     332                padding: 0;
     333                padding-right: 0.5rem;
     334
     335                .fullHeight {
     336
     337                    textarea {
     338                        min-height: 150px;
     339                    }
     340                }
     341            }
     342        }
     343    }
    316344}
  • urlslab/trunk/admin/src/components/EditRowPanel.jsx

    r3156110 r3177662  
    1 import { memo, useMemo, useRef } from 'react';
     1import { memo, useCallback, useEffect, useMemo, useRef } from 'react';
    22import { useI18n } from '@wordpress/react-i18n';
    33
     
    106106
    107107    return (
    108         <div className={ `urlslab-panel-wrap urlslab-panel-modal ${ ! notWide ? 'ultrawide' : '' } fadeInto` }>
     108        <div className={ `urlslab-panel-wrap urlslab-panel-modal ${ ! notWide ? 'ultrawide' : '' } fadeInto` } data-table={ activeTable } >
    109109            <div className="urlslab-panel">
    110110                <div className="urlslab-panel-header">
    111                     <h3>{ editorMode ? __( 'Edit row', 'urlslab' ) : title }</h3>
     111                    <h3>{ editorMode ? __( 'Edit row', 'urlslab' ) : title } { activeTable }</h3>
    112112                    <button className="urlslab-panel-close" onClick={ hidePanel }>
    113113                        <CloseIcon />
     
    120120                        cellsFinal && Object.values( cellsFinal ).map( ( cell ) => {
    121121                            return ! cell.props.hidden &&
    122                                 <>
    123                                     { cell.props.section && <h4>{ cell.props.section }</h4> }
    124                                     <div className={ `mb-l urlslab-panel-content__item ${ cell.props.hidden ? 'hidden' : '' } ${ cell.props.fullWidth ? 'fullWidth' : '' }` }>
    125                                         { cell }
    126                                     </div>
    127                                 </>;
     122                            <OptionItem cell={ cell } />;
    128123                        } )
    129124                    }
     
    143138}
    144139
     140const OptionItem = memo( ( { cell } ) =>    {
     141    const ref = useRef( null );
     142
     143    const handleResizeFullHeightOption = useCallback( ( panel, optionItem ) => {
     144        const textarea = optionItem.querySelector( 'textarea.urlslab-input' );
     145        if ( textarea ) {
     146            const panelHeight = panel.clientHeight;
     147            const options = panel.querySelectorAll( '.urlslab-panel-content__item' );
     148
     149            let optionsHeight = 0;
     150            if ( options ) {
     151                options.forEach( ( element ) => {
     152                    if ( ! element.classList.contains( 'fullHeight' ) ) {
     153                        optionsHeight += ( element.offsetHeight + ( 1.5 * 16 ) ); // + bottom margin
     154                    }
     155                } );
     156            }
     157            const label = optionItem.querySelector( '.urlslab-inputField-label' );
     158
     159            textarea.style.height = `calc(${ panelHeight - ( optionsHeight ? optionsHeight : 0 ) - ( label ? label.offsetHeight : 0 ) }px - 2rem)`;
     160        }
     161    }, [] );
     162
     163    useEffect( () => {
     164        let wrapperResizeObserver = null;
     165        let panel = null;
     166        if ( cell.props.fullHeight ) {
     167            const optionItem = ref.current;
     168            panel = optionItem?.closest( '.urlslab-panel-content' );
     169            if ( panel ) {
     170                wrapperResizeObserver = new ResizeObserver( () => handleResizeFullHeightOption( panel, optionItem ) );
     171                wrapperResizeObserver.observe( panel );
     172            }
     173        }
     174        return () => {
     175            if ( wrapperResizeObserver && panel ) {
     176                wrapperResizeObserver.unobserve( panel );
     177                wrapperResizeObserver.disconnect();
     178            }
     179        };
     180    }, [ cell.props.fullHeight, handleResizeFullHeightOption ] );
     181
     182    return (
     183        <>
     184            { cell.props.section && <h4>{ cell.props.section }</h4> }
     185            <div ref={ ref } className={ `mb-l urlslab-panel-content__item ${ cell.props.hidden ? 'hidden' : '' } ${ cell.props.fullWidth ? 'fullWidth' : '' } ${ cell.props.fullHeight ? 'fullHeight' : '' }` }>
     186                { cell }
     187            </div>
     188        </>
     189    );
     190} );
    145191export default memo( EditRowPanel );
  • urlslab/trunk/admin/src/tables/GeneratorResultTable.jsx

    r3156110 r3177662  
    214214
    215215    const rowEditorCells = useMemo( () => ( {
    216         status: <SingleSelectMenu autoClose defaultAccept description=""
     216        result: <TextArea rows="5" allowResize description=""
     217            liveUpdate fullWidth fullHeight defaultValue="" label={ header.result } onChange={ ( val ) => setRowToEdit( { result: val } ) } />,
     218
     219        status: <SingleSelectMenu autoClose defaultAccept fullWidth description=""
    217220            items={ columnTypes?.status.values } name="statusTypes" defaultValue="W" onChange={ ( val ) => setRowToEdit( { status: val } ) }>{ header.status }</SingleSelectMenu>,
    218221
    219         result: <TextArea rows="5" description=""
    220             liveUpdate defaultValue="" label={ header.result } onChange={ ( val ) => setRowToEdit( { result: val } ) } />,
    221222    } ), [ columnTypes?.status, setRowToEdit ] );
    222223
  • urlslab/trunk/blocks/includes/blocks/class-urlslab-blocks-ai-content.php

    r3043499 r3177662  
    66
    77    public function render( $attributes ) {
    8         global $post;
    98        $shortcode_atts = array(
    10             'id' => $attributes['shortcodeId'],
     9            'id'    => $attributes['shortcodeId'],
     10            'input' => isset( $attributes['input'] ) ? $attributes['input'] : '',
    1111        );
    12         if ( $attributes['shortcodeVideoId'] ) {
    13             $shortcode_atts = array(
    14                 'id'      => $attributes['shortcodeId'],
    15                 'videoid' => $attributes['shortcodeVideoId'],
    16             );
    17         }
    1812
    1913        $shortcode_params = Urlslab_Blocks::shortcode_params( $shortcode_atts );
  • urlslab/trunk/blocks/yarn.lock

    r3156110 r3177662  
    41134113
    41144114axios@^1.6.1:
    4115   version "1.6.2"
    4116   resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.2.tgz#de67d42c755b571d3e698df1b6504cde9b0ee9f2"
    4117   integrity sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==
    4118   dependencies:
    4119     follow-redirects "^1.15.0"
     4115  version "1.7.7"
     4116  resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.7.tgz#2f554296f9892a72ac8d8e4c5b79c14a91d0a47f"
     4117  integrity sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==
     4118  dependencies:
     4119    follow-redirects "^1.15.6"
    41204120    form-data "^4.0.0"
    41214121    proxy-from-env "^1.1.0"
     
    63446344  integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==
    63456345
    6346 follow-redirects@^1.0.0, follow-redirects@^1.15.0:
     6346follow-redirects@^1.0.0, follow-redirects@^1.15.6:
    63476347  version "1.15.6"
    63486348  resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b"
     
    69026902
    69036903http-proxy-middleware@^2.0.3:
    6904   version "2.0.6"
    6905   resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz#e1a4dd6979572c7ab5a4e4b55095d1f32a74963f"
    6906   integrity sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==
     6904  version "2.0.7"
     6905  resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz#915f236d92ae98ef48278a95dedf17e991936ec6"
     6906  integrity sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA==
    69076907  dependencies:
    69086908    "@types/http-proxy" "^1.17.8"
  • urlslab/trunk/includes/api/class-urlslab-api-generators.php

    r3168189 r3177662  
    11<?php
     2
    23use FlowHunt_Vendor\OpenAPI\Client\Model\FlowInvokeRequest;
    34
     
    139140                    ),
    140141                    'args'                => array(
    141                         'user_prompt'      => array(
     142                        'user_prompt'   => array(
    142143                            'required'          => true,
    143144                            'validate_callback' => function ( $param ) {
     
    145146                            },
    146147                        ),
    147                         'model'            => array(
    148                             'required'          => true,
    149                             'validate_callback' => function ( $param ) {
    150                                 return is_string( $param );
    151                             },
    152                         ),
    153                         'domain_filter'    => array(
     148                        'model'         => array(
     149                            'required'          => true,
     150                            'validate_callback' => function ( $param ) {
     151                                return is_string( $param );
     152                            },
     153                        ),
     154                        'domain_filter' => array(
    154155                            'required'          => false,
    155156                            'validate_callback' => function ( $param ) {
     
    174175                    ),
    175176                    'args'                => array(
    176                         'user_prompt'      => array(
    177                             'required'          => true,
    178                             'validate_callback' => function ( $param ) {
    179                                 return is_string( $param );
    180                             },
    181                         ),
    182                         'tone'             => array(
    183                             'required'          => false,
    184                             'validate_callback' => function ( $param ) {
    185                                 return is_string( $param );
    186                             },
    187                         ),
    188                         'model'            => array(
    189                             'required'          => false,
    190                             'validate_callback' => function ( $param ) {
    191                                 return is_string( $param );
    192                             },
    193                         ),
    194                         'lang'             => array(
    195                             'required'          => false,
    196                             'validate_callback' => function ( $param ) {
    197                                 return is_string( $param );
    198                             },
    199                         ),
    200                         'domain_filter'    => array(
     177                        'user_prompt'   => array(
     178                            'required'          => true,
     179                            'validate_callback' => function ( $param ) {
     180                                return is_string( $param );
     181                            },
     182                        ),
     183                        'tone'          => array(
     184                            'required'          => false,
     185                            'validate_callback' => function ( $param ) {
     186                                return is_string( $param );
     187                            },
     188                        ),
     189                        'model'         => array(
     190                            'required'          => false,
     191                            'validate_callback' => function ( $param ) {
     192                                return is_string( $param );
     193                            },
     194                        ),
     195                        'lang'          => array(
     196                            'required'          => false,
     197                            'validate_callback' => function ( $param ) {
     198                                return is_string( $param );
     199                            },
     200                        ),
     201                        'domain_filter' => array(
    201202                            'required'          => false,
    202203                            'validate_callback' => function ( $param ) {
     
    425426                        case \FlowHunt_Vendor\OpenAPI\Client\Model\TaskStatus::SUCCESS:
    426427                            $result      = json_decode( $response->getResult() );
    427                             $translation = $result->output;
     428                            $translation = trim( $result->outputs[0]->outputs[0]->results->message->result );
    428429                            break;
    429430                        case \FlowHunt_Vendor\OpenAPI\Client\Model\TaskStatus::PENDING:
     
    444445        }
    445446
    446 
    447447        return new WP_REST_Response( (object) array( 'translation' => $translation ), 200 );
    448448    }
  • urlslab/trunk/includes/data/class-urlslab-data-url.php

    r3171336 r3177662  
    602602
    603603    public function request_rel_schedule() {
    604         if ( empty( $this->get_rel_schedule() ) ) {
     604        if ( empty( $this->get_rel_schedule() ) || self::REL_NOT_REQUESTED_SCHEDULE === $this->get_rel_schedule() ) {
    605605            if ( $this->get_url()->is_blacklisted() ) {
    606606                $this->set_rel_schedule( Urlslab_Data_Url::REL_ERROR );
  • urlslab/trunk/includes/widget/class-urlslab-widget-content-generator.php

    r3171336 r3177662  
    122122        if ( $this->is_edit_mode() ) {
    123123            return $this->get_placeholder_html( $atts, self::SLUG );
     124        }
     125
     126        if ( Urlslab_Url::get_current_page_url()->is_blacklisted() ) {
     127            return '<!-- DEBUG: URL is blacklisted -->';
    124128        }
    125129
  • urlslab/trunk/includes/widget/class-urlslab-widget-faq.php

    r3156110 r3177662  
    157157        }
    158158
     159        if ( Urlslab_Url::get_current_page_url()->is_blacklisted() ) {
     160            return '<!-- DEBUG: URL is blacklisted -->';
     161        }
     162
    159163        $urlslab_atts = $this->get_attribute_values( $atts, $shortcode_content, $tag );
    160164        $content      = '';
  • urlslab/trunk/includes/widget/class-urlslab-widget-media-offloader.php

    r3043499 r3177662  
    261261            'offloading'
    262262        );
    263 
    264         //      $this->add_option_definition(
    265         //          self::SETTING_NAME_TRANSFER_FROM_DRIVER_S3,
    266         //          self::SETTING_DEFAULT_TRANSFER_FROM_DRIVER_S3,
    267         //          false,
    268         //          __( 'Transfer Media From S3 to the Default Driver', 'urlslab' ),
    269         //          __( 'Transfer all media from AWS S3 to the currently selected default driver in the background.', 'urlslab' ),
    270         //          self::OPTION_TYPE_CHECKBOX,
    271         //          false,
    272         //          null,
    273         //          'offloading'
    274         //      );
    275263
    276264        $this->add_option_definition(
  • urlslab/trunk/includes/widget/class-urlslab-widget-related-resources.php

    r3160227 r3177662  
    115115        }
    116116
     117        if ( Urlslab_Url::get_current_page_url()->is_blacklisted() ) {
     118            return '<!-- DEBUG: URL is blacklisted -->';
     119        }
     120
    117121        $urlslab_atts = $this->get_attribute_values( $atts, $content, $tag );
    118122        $content      = '';
     
    120124        try {
    121125            $shortcode_url = new Urlslab_Url( trim( $urlslab_atts['url'] ), true );
     126
     127            if ( $shortcode_url->is_blacklisted() ) {
     128                return '<!-- DEBUG: URL is blacklisted: ' . esc_html( $shortcode_url->get_url() ) . ' -->';
     129            }
     130
    122131            $result        = $this->load_related_urls( $shortcode_url->get_url_id(), $urlslab_atts['related-count'] );
    123132            if ( empty( $result ) && Urlslab_User_Widget::get_instance()->get_widget( Urlslab_Widget_General::SLUG )->get_option( Urlslab_Widget_General::SETTING_NAME_DEBUG ) ) {
  • urlslab/trunk/includes/widget/class-urlslab-widget.php

    r3156110 r3177662  
    448448    public function get_placeholder_txt( array $atts, $shortcode_name ): string {
    449449        $html_attributes = array();
     450        if ( ! isset( $html_attributes['input'] ) ) {
     451            $html_attributes['input'] = '';
     452        }
    450453        foreach ( $atts as $id => $val ) {
    451454            $html_attributes[] = $id . '="' . $val . '"';
  • urlslab/trunk/readme.txt

    r3171365 r3177662  
    33Tags: seo, ai, gpt, performance, cache, database, optimizer, faq, serp
    44Requires at least: 6.0
    5 Tested up to: 6.5
     5Tested up to: 6.7
    66Requires PHP: 7.4
    7 Stable tag: 2.130.7
     7Stable tag: 2.130.9
    88License: GPLv2
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    144144== Changelog ==
    145145
     146= 2.130.9 - 2024-10-29 =
     147
     148* minor patches
     149
     150= 2.130.8 - 2024-10-21 =
     151
     152* Fixed translations in WPML
     153
    146154= 2.130.7 - 2024-10-18 =
    147155
  • urlslab/trunk/urlslab.php

    r3171365 r3177662  
    1717 * Plugin URI:        https://github.com/QualityUnit/wp-urlslab
    1818 * Description:       URLsLab WordPress Plugin to optimize your website for search engines and enhance automatically content
    19  * Version: 2.130.7
     19 * Version: 2.130.9
    2020 * Requires at least: 6.0
    2121 * Requires PHP:      7.4
     
    3131}
    3232
    33 define( 'URLSLAB_VERSION', '2.130.7' );
     33define( 'URLSLAB_VERSION', '2.130.9' );
    3434define( 'URLSLAB_VERSION_SETTING', 'urlslab_ver' );
    3535define( 'URLSLAB_PLUGIN', __FILE__ );
  • urlslab/trunk/vendor_prefixed/composer/installed.php

    r3171365 r3177662  
    44        'pretty_version' => 'dev-main',
    55        'version' => 'dev-main',
    6         'reference' => 'ddf5f3dcdc29108be0f1c28acf845a220ea961bc',
     6        'reference' => 'cae7ab5cfefc1a56faa9ad8546d175235400284b',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../',
     
    1414            'pretty_version' => 'dev-main',
    1515            'version' => 'dev-main',
    16             'reference' => 'ddf5f3dcdc29108be0f1c28acf845a220ea961bc',
     16            'reference' => 'cae7ab5cfefc1a56faa9ad8546d175235400284b',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../',
Note: See TracChangeset for help on using the changeset viewer.