Plugin Directory

Changeset 2757048


Ignore:
Timestamp:
07/15/2022 04:13:35 PM (4 years ago)
Author:
wphosthub
Message:
  • Small fix and Improvement
  • Added tracking template record
Location:
elekits
Files:
91 added
4 edited

Legend:

Unmodified
Added
Removed
  • elekits/trunk/README.txt

    r2755956 r2757048  
    66Tested up to: 6.0
    77Requires PHP: 7.4
    8 Stable tag: 0.0.7
     8Stable tag: 0.0.8
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3131== Changelog ==
    3232
     33= 0.0.8 - 2022-07-15 =
     34* Small fix and Improvement
     35* Added tracking template record
     36
    3337= 0.0.7 - 2022-07-13 =
    3438* Small fix and Improvement
  • elekits/trunk/admin/elementor/assets/js/elementor-admin-page.js

    r2754934 r2757048  
    819819                })
    820820                    .fail(function (jqXHR) {
     821                        $elscope_elekits.find('#elekits-sites-floating-notice-wrap-id').show().removeClass('error');
     822                        $elscope_elekits.find('#elekits-sites-floating-notice-wrap-id').removeClass('refreshed-notice').addClass("refreshed-failed-notice").find('.elekits-sites-floating-notice').html('<span class="message">' + elekitsElementorSites.failedTrackingImportTemplateMessage + '</span><button type="button" class="notice-dismiss"><span class="screen-reader-text">' + elekitsElementorSites.dismiss_text + '</span></button>');
     823                        $elscope_elekits.find('#elekits-sites-floating-notice-wrap-id').addClass('slide-in');
     824                        $elscope_elekits.find('.elekits-library-template-insert').removeClass('installing');
     825                        $elscope_elekits.find('.elekits-library-template-insert').text(elekitsElementorSites.insertTemplateText);
     826                        $elscope_elekits.find('.elementor-template-library-template-insert .elementor-button-title').text(elekitsElementorSites.insert);
     827                        EleKitsElementorSitesAdmin.canInsert = true;
     828                        EleKitsElementorSitesAdmin.processing = false;
     829                        EleKitsElementorSitesAdmin.canImport = true;
     830                        EleKitsElementorSitesAdmin.action = '';
    821831                        console.log(jqXHR);
    822832                        console.groupEnd();
     
    824834                    .done(function (response) {
    825835                        console.groupEnd();
     836                        console.log(response);
    826837                        if (response.success) {
    827                             if (typeof response.data.data !=="undefined" && response.data.data.valid) {
    828                                 EleKitsElementorSitesAdmin.insertData = EleKitsElementorSitesAdmin.templateData;
    829                                 EleKitsElementorSitesAdmin._insertDemo(EleKitsElementorSitesAdmin.insertData);
    830                             } else {
     838                            if (typeof response.data !== "undefined"){
     839                                if (response.data.tracking_record && response.data.import_templated) {
     840                                    EleKitsElementorSitesAdmin.insertData = EleKitsElementorSitesAdmin.templateData;
     841                                    EleKitsElementorSitesAdmin._insertDemo(EleKitsElementorSitesAdmin.insertData);
     842                                }else{
     843                                    if(!response.data.tracking_record && !response.data.import_templated) {
     844                                        $elscope_elekits.find('#elekits-sites-floating-notice-wrap-id').show().removeClass('error');
     845                                        $elscope_elekits.find('#elekits-sites-floating-notice-wrap-id').removeClass('refreshed-notice').addClass("refreshed-failed-notice").find('.elekits-sites-floating-notice').html('<span class="message">' + elekitsElementorSites.failedTrackingImportTemplateMessage + '</span><button type="button" class="notice-dismiss"><span class="screen-reader-text">' + elekitsElementorSites.dismiss_text + '</span></button>');
     846                                        $elscope_elekits.find('#elekits-sites-floating-notice-wrap-id').addClass('slide-in');
     847                                        $elscope_elekits.find('.elekits-library-template-insert').removeClass('installing');
     848                                        $elscope_elekits.find('.elekits-library-template-insert').text(elekitsElementorSites.insertTemplateText);
     849                                        $elscope_elekits.find('.elementor-template-library-template-insert .elementor-button-title').text(elekitsElementorSites.insert);
     850                                        EleKitsElementorSitesAdmin.canInsert = true;
     851                                        EleKitsElementorSitesAdmin.processing = false;
     852                                        EleKitsElementorSitesAdmin.canImport = true;
     853                                        EleKitsElementorSitesAdmin.action = '';
     854                                    }else if(!response.data.tracking_record) {
     855                                        $elscope_elekits.find('#elekits-sites-floating-notice-wrap-id').show().removeClass('error');
     856                                        $elscope_elekits.find('#elekits-sites-floating-notice-wrap-id').removeClass('refreshed-notice').addClass("refreshed-failed-notice").find('.elekits-sites-floating-notice').html('<span class="message">' + elekitsElementorSites.failedTrackingImportTemplateMessage + '</span><button type="button" class="notice-dismiss"><span class="screen-reader-text">' + elekitsElementorSites.dismiss_text + '</span></button>');
     857                                        $elscope_elekits.find('#elekits-sites-floating-notice-wrap-id').addClass('slide-in');
     858                                        $elscope_elekits.find('.elekits-library-template-insert').removeClass('installing');
     859                                        $elscope_elekits.find('.elekits-library-template-insert').text(elekitsElementorSites.insertTemplateText);
     860                                        $elscope_elekits.find('.elementor-template-library-template-insert .elementor-button-title').text(elekitsElementorSites.insert);
     861                                        EleKitsElementorSitesAdmin.canInsert = true;
     862                                        EleKitsElementorSitesAdmin.processing = false;
     863                                        EleKitsElementorSitesAdmin.canImport = true;
     864                                        EleKitsElementorSitesAdmin.action = '';
     865                                    }else if(!response.data.import_templated) {
     866                                        $elscope_elekits.find('#elekits-sites-floating-notice-wrap-id').show().removeClass('error');
     867                                        $elscope_elekits.find('#elekits-sites-floating-notice-wrap-id').removeClass('refreshed-notice').addClass("refreshed-failed-notice").find('.elekits-sites-floating-notice').html('<span class="message">' + elekitsElementorSites.subcriptionMessage + '</span><button type="button" class="notice-dismiss"><span class="screen-reader-text">' + elekitsElementorSites.dismiss_text + '</span></button>');
     868                                        $elscope_elekits.find('#elekits-sites-floating-notice-wrap-id').addClass('slide-in');
     869                                        $elscope_elekits.find('.elekits-library-template-insert').removeClass('installing');
     870                                        $elscope_elekits.find('.elekits-library-template-insert').text(elekitsElementorSites.insertTemplateText);
     871                                        $elscope_elekits.find('.elementor-template-library-template-insert .elementor-button-title').text(elekitsElementorSites.insert);
     872                                        EleKitsElementorSitesAdmin.canInsert = true;
     873                                        EleKitsElementorSitesAdmin.processing = false;
     874                                        EleKitsElementorSitesAdmin.canImport = true;
     875                                        EleKitsElementorSitesAdmin.action = '';
     876                                    }
     877                                }
     878                            }else{
    831879                                $elscope_elekits.find('#elekits-sites-floating-notice-wrap-id').show().removeClass('error');
    832                                 $elscope_elekits.find('#elekits-sites-floating-notice-wrap-id').addClass('refreshed-notice').find('.elekits-sites-floating-notice').html('<span class="message">' + elekitsElementorSites.subcriptionMessage + '</span><button type="button" class="notice-dismiss"><span class="screen-reader-text">' + elekitsElementorSites.dismiss_text + '</span></button>');
     880                                $elscope_elekits.find('#elekits-sites-floating-notice-wrap-id').removeClass('refreshed-notice').addClass("refreshed-failed-notice").find('.elekits-sites-floating-notice').html('<span class="message">' + elekitsElementorSites.failedTrackingImportTemplateMessage + '</span><button type="button" class="notice-dismiss"><span class="screen-reader-text">' + elekitsElementorSites.dismiss_text + '</span></button>');
    833881                                $elscope_elekits.find('#elekits-sites-floating-notice-wrap-id').addClass('slide-in');
    834882                                $elscope_elekits.find('.elekits-library-template-insert').removeClass('installing');
     
    840888                                EleKitsElementorSitesAdmin.action = '';
    841889                            }
    842                         } else {
     890                        }else{
    843891                            $elscope_elekits.find('#elekits-sites-floating-notice-wrap-id').show().removeClass('error');
    844                             $elscope_elekits.find('#elekits-sites-floating-notice-wrap-id').addClass('refreshed-notice').find('.elekits-sites-floating-notice').html('<span class="message">' + elekitsElementorSites.subcriptionMessage + '</span><button type="button" class="notice-dismiss"><span class="screen-reader-text">' + elekitsElementorSites.dismiss_text + '</span></button>');
     892                            $elscope_elekits.find('#elekits-sites-floating-notice-wrap-id').removeClass('refreshed-notice').addClass("refreshed-failed-notice").find('.elekits-sites-floating-notice').html('<span class="message">' + elekitsElementorSites.subcriptionMessage + '</span><button type="button" class="notice-dismiss"><span class="screen-reader-text">' + elekitsElementorSites.dismiss_text + '</span></button>');
    845893                            $elscope_elekits.find('#elekits-sites-floating-notice-wrap-id').addClass('slide-in');
    846894                            $elscope_elekits.find('.elekits-library-template-insert').removeClass('installing');
     
    885933                let page_settings = '';
    886934                let api_url = '';
    887 
    888 
    889935                api_url = EleKitsElementorSitesAdmin.templateData['elekits-page-api-url'] + '/';
     936                if(!EleKitsElementorSitesAdmin.templateData['elekits-page-api-url']){
     937                    $elscope_elekits.find('#elekits-sites-floating-notice-wrap-id').show().removeClass('error');
     938                    $elscope_elekits.find('#elekits-sites-floating-notice-wrap-id').removeClass('refreshed-notice').addClass("refreshed-failed-notice").find('.elekits-sites-floating-notice').html('<span class="message">' + elekitsElementorSites.failedImportNoDemoTemplateMessage + '</span><button type="button" class="notice-dismiss"><span class="screen-reader-text">' + elekitsElementorSites.dismiss_text + '</span></button>');
     939                    $elscope_elekits.find('#elekits-sites-floating-notice-wrap-id').addClass('slide-in');
     940                    $elscope_elekits.find('.elekits-library-template-insert').removeClass('installing');
     941                    $elscope_elekits.find('.elekits-library-template-insert').text(elekitsElementorSites.insertTemplateText);
     942                    $elscope_elekits.find('.elementor-template-library-template-insert .elementor-button-title').text(elekitsElementorSites.insert);
     943                    EleKitsElementorSitesAdmin.canInsert = true;
     944                    EleKitsElementorSitesAdmin.processing = false;
     945                    EleKitsElementorSitesAdmin.canImport = true;
     946                    EleKitsElementorSitesAdmin.action = '';
     947                    return;
     948                }
    890949
    891950
     
    920979                    })
    921980                    .done(function (response) {
    922 
    923981                        EleKitsElementorSitesAdmin.processing = false;
    924982                        $elscope_elekits.find('.elekits-sites-content-wrap').removeClass('processing');
    925983                        $elscope_elekits.find('#elekits-sites-floating-notice-wrap-id').removeClass("refreshed-failed-notice").addClass('refreshed-notice').find('.elekits-sites-floating-notice').html('<span class="message">' + elekitsElementorSites.successImportTemplateMessage + '</span><button type="button" class="notice-dismiss"><span class="screen-reader-text">' + elekitsElementorSites.dismiss_text + '</span></button>');
    926984                        page_content = response.data;
    927 
    928985                        page_content = page_content.map(function (item) {
    929986                            item.id = Math.random().toString(36).substr(2, 7);
  • elekits/trunk/admin/elementor/class-elekits-site.php

    r2755956 r2757048  
    222222            }else{
    223223                return false;
     224            }
     225
     226            if(isset($response->data)){
     227                if(isset($response->data->valid)){
     228                    $response = $response->data->valid;
     229                }
    224230            }
    225231            return $response;
     
    622628                    'syncCompleteMessage'        => self::get_instance()->get_sync_complete_message(),
    623629                    'syncProcessingMessage'        => self::get_instance()->get_sync_prosessing_message(),
    624                     'processingImportTemplateMessage'        => self::get_instance()->get_sync_prosessing_import_template_message(),
    625                     'successImportTemplateMessage'        => self::get_instance()->get_sync_success_import_template_message(),
    626                     'failedImportTemplateMessage'        => self::get_instance()->get_sync_failed_import_template_message(),
     630                    'processingImportTemplateMessage'        => self::get_instance()->get_prosessing_import_template_message(),
     631                    'successImportTemplateMessage'        => self::get_instance()->get_success_import_template_message(),
     632                    'failedImportTemplateMessage'        => self::get_instance()->get_failed_import_template_message(),
     633                    'failedImportNoDemoTemplateMessage'        => self::get_instance()->get_failed_import_no_demo_template_message(),
     634                    'failedTrackingImportTemplateMessage'        => self::get_instance()->get_failed_tracking_import_template_message(),
    627635                    'syncFailedMessage'        => self::get_instance()->get_sync_failed_message(),
    628636                    'subcriptionMessage'        => self::get_instance()->get_sync_subscription_message(),
     
    750758         * @return mixed
    751759         */
    752         public function get_sync_prosessing_import_template_message( $echo = false ) {
     760        public function get_prosessing_import_template_message( $echo = false ) {
    753761            $message = __( 'Importing template, please wait...', 'elekits-sites' );
    754762
     
    766774         * @return mixed
    767775         */
    768         public function get_sync_success_import_template_message( $echo = false ) {
     776        public function get_success_import_template_message( $echo = false ) {
    769777            $message = __( 'Success importing template', 'elekits-sites' );
    770778
     
    782790         * @return mixed
    783791         */
    784         public function get_sync_failed_import_template_message( $echo = false ) {
     792        public function get_failed_import_template_message( $echo = false ) {
    785793            $message = __( 'Failed importing template, please try again.', 'elekits-sites' );
     794
     795            if ( $echo ) {
     796                echo esc_html( $message );
     797            } else {
     798                return esc_html( $message );
     799            }
     800        }
     801        /**
     802         * Get Sync Failed Importing Template Message
     803         *
     804         * @since 0.0.3
     805         * @param  boolean $echo Echo the message.
     806         * @return mixed
     807         */
     808        public function get_failed_import_no_demo_template_message( $echo = false ) {
     809            $message = sprintf(__( 'Failed importing demo template, please contact our %s.', 'elekits-sites'),"<a href='https://wphosthub.com/support/' target='_blank'>".__('support','elekits-sites')."</a>");
     810
     811            if ( $echo ) {
     812                echo esc_html( $message );
     813            } else {
     814                return esc_html( $message );
     815            }
     816        }
     817        /**
     818         * Get Sync Failed Tracking Importing Template Message
     819         *
     820         * @since 0.0.3
     821         * @param  boolean $echo Echo the message.
     822         * @return mixed
     823         */
     824        public function get_failed_tracking_import_template_message( $echo = false ) {
     825            $message = __( 'Import failed, please try again.', 'elekits-sites' );
    786826
    787827            if ( $echo ) {
  • elekits/trunk/elekits.php

    r2755956 r2757048  
    1717 * Plugin URI:        https://wphosthub.com
    1818 * Description:       Responsive and high-converting Elementor landing page templates.
    19  * Version:           0.0.7
     19 * Version:           0.0.8
    2020 * Author:            WPhostHub
    2121 * Author URI:        https://profiles.wordpress.org/wphosthub/
     
    3636 * Rename this for your plugin and update it as you release new versions.
    3737 */
    38 define( 'ELEKITS_VERSION', '0.0.7' );
     38define( 'ELEKITS_VERSION', '0.0.8' );
    3939define( 'ELEKITS_FILE', __FILE__ );
    4040define( 'ELEKITS_DIR_PATH', plugin_dir_path( __FILE__ ) );
Note: See TracChangeset for help on using the changeset viewer.