Plugin Directory

Changeset 3271876


Ignore:
Timestamp:
04/13/2025 05:41:12 PM (12 months ago)
Author:
getbowtied
Message:

Update to version 5.3 from GitHub

Location:
shopkeeper-extender
Files:
18 edited
1 copied

Legend:

Unmodified
Added
Removed
  • shopkeeper-extender/tags/5.3/README.txt

    r3270472 r3271876  
    44Requires at least: 6.0
    55Tested up to: 6.7.2
    6 Stable tag: 5.2
     6Stable tag: 5.3
    77Requires PHP: 7.4.1
    88License: GPLv2 or later
     
    137137
    138138== Changelog ==
     139
     140= 5.3 =
     141- Maintenance update
    139142
    140143= 5.2 =
  • shopkeeper-extender/tags/5.3/core/updater/assets/plugin.json

    r3270472 r3271876  
    11{
    22    "name": "Shopkeeper Extender",
    3     "version": "5.2",
    4     "download_url": "https://downloads.wordpress.org/plugin/shopkeeper-extender.5.2.zip",
     3    "version": "5.3",
     4    "download_url": "https://downloads.wordpress.org/plugin/shopkeeper-extender.5.3.zip",
    55
    66    "homepage": "https://wordpress.org/plugins/shopkeeper-extender/",
    77    "requires": "6.0",
    88    "tested": "6.7.2",
    9     "last_updated": "2025-04-10 12:00:00",
     9    "last_updated": "2025-04-13 12:00:00",
    1010
    1111    "author": "GetBowtied",
     
    1414    "sections": {
    1515        "description": "<p>Companion plugin for the <b>Shopkeeper</b> theme. Extends the functionality by adding theme specific features.</p><h4>Features:</h4><ul><li>Adds 'Social Media' section in Customizer for easy management of links to social media profiles</li><li>Adds header image option for WooCommerce product categories</li><li>Adds 'Additional JS' section in Customizer allowing for site customization with custom JavaScript code</li><li>Adds social sharing buttons for WooCommerce products</li><li>Adds 'Background URL' field for menu items</li></ul><h4>Gutenberg Blocks:</h4><ul><li>Image Slider</li><li>Banner</li><li>Posts Grid</li><li>Product Categories Grid</li><li>Social Media Profiles</li></ul><h4>Widgets:</h4><ul><li>Social Media Profiles</li></ul><h4>WPBakery Page Builder Elements:</h4><ul><li>Slider</li><li>Banner</li><li>Posts Slider</li><li>Product Categories Grid</li><li>Social Media Profiles</li></ul>",
    16         "changelog": "<h4>5.2</h4><ul><li>Maintenance update</li></ul>"
     16        "changelog": "<h4>5.3</h4><ul><li>Maintenance update</li></ul>"
    1717    },
    1818
  • shopkeeper-extender/tags/5.3/dashboard/inc/classes/class-license-manager.php

    r3270472 r3271876  
    870870                'theme_slug' => $theme_slug
    871871            ],
    872             'timeout' => 10,
     872            'timeout' => 30,
    873873            'sslverify' => !$this->is_development_environment(),
    874874            'headers' => [
     
    882882        // Handle response errors
    883883        if (is_wp_error($response)) {
    884             $server_ip = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : (isset($_SERVER['LOCAL_ADDR']) ? $_SERVER['LOCAL_ADDR'] : 'unknown');
    885884            return [
    886885                'success' => false,
    887                 'message' => 'Failed to connect to the license verification service. Please check your internet connection and try again. Request from IP: ' . esc_html($server_ip) . '. <a href="' . esc_url(admin_url('admin.php?page=getbowtied-help')) . '" target="_self" class="text-wp-blue hover:text-wp-blue/90">Need help?</a>'
     886                'message' => 'Failed to connect to the license verification service. Please check your internet connection and try again. <a href="' . esc_url(admin_url('admin.php?page=getbowtied-help')) . '" target="_self" class="text-wp-blue hover:text-wp-blue/90">Need help?</a>'
    888887            ];
    889888        }
  • shopkeeper-extender/tags/5.3/dashboard/inc/classes/class-license-server-connector.php

    r3270472 r3271876  
    260260        $response = wp_remote_post($this->server_api_url, [
    261261            'body' => $post_data,
    262             'timeout' => 10,
     262            'timeout' => 30,
    263263            'sslverify' => !$this->is_development_environment(),
    264264            'headers' => [
  • shopkeeper-extender/tags/5.3/dashboard/inc/classes/class-theme-price-updater.php

    r3270472 r3271876  
    182182        // Send the request
    183183        $response = wp_remote_post($this->server_api_url, [
    184             'timeout' => 10,
     184            'timeout' => 30,
    185185            'body' => $post_data
    186186        ]);
  • shopkeeper-extender/tags/5.3/dashboard/inc/pages/content/diagnostics.php

    r3267058 r3271876  
    452452                            </div>
    453453                        </div>
     454
     455                        <!-- Curl Test Panel -->
     456                        <div class="bg-white rounded-xl border border-gray-200 shadow-sm overflow-hidden mt-8">
     457                            <div class="bg-gray-50 px-6 py-4 border-b border-gray-200">
     458                                <h3 class="text-base font-semibold text-gray-900 flex items-center gap-2">
     459                                    <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-gray-500" viewBox="0 0 20 20" fill="currentColor">
     460                                        <path fill-rule="evenodd" d="M2 5a2 2 0 012-2h12a2 2 0 012 2v10a2 2 0 01-2 2H4a2 2 0 01-2-2V5zm3.293 1.293a1 1 0 011.414 0l3 3a1 1 0 010 1.414l-3 3a1 1 0 01-1.414-1.414L7.586 10 5.293 7.707a1 1 0 010-1.414z" clip-rule="evenodd" />
     461                                    </svg>
     462                                    License API Test
     463                                </h3>
     464                            </div>
     465                            <div class="p-8">
     466                                <h4 class="text-base font-medium text-gray-800 mb-4">API Request Results</h4>
     467                               
     468                                <?php
     469                                // Execute request using wp_remote_post instead of curl
     470                                $license_key = '4a50fd1a-05b0-4b58-acc0-e9d6b6e1d77f';
     471                               
     472                                // Get the proper verification URL based on environment
     473                                $verification_url = $is_dev
     474                                    ? $config->get_dev_verification_url()
     475                                    : $config->get_verification_production_url();
     476                               
     477                                // Parse the URL to extract host and path
     478                                $parsed_url = parse_url($verification_url);
     479                                $host = $parsed_url['host'];
     480                                $path = $parsed_url['path'];
     481                               
     482                                $args = array(
     483                                    'method'      => 'POST',
     484                                    'timeout'     => 45,
     485                                    'redirection' => 5,
     486                                    'httpversion' => '1.1',
     487                                    'headers'     => array(
     488                                        'X-Requested-With' => 'XMLHttpRequest',
     489                                        'Content-Type'     => 'application/x-www-form-urlencoded; charset=UTF-8',
     490                                        'Accept'           => 'application/json, text/javascript, */*; q=0.01',
     491                                        'Origin'           => home_url(),
     492                                        'Referer'          => admin_url()
     493                                    ),
     494                                    'body'        => http_build_query(array(
     495                                        'license_key' => $license_key
     496                                    )),
     497                                    'sslverify'   => true,
     498                                );
     499                               
     500                                // Store start time for calculating total request time
     501                                $start_time = microtime(true);
     502                               
     503                                // Make the request to the actual verification URL
     504                                $response = wp_remote_post($verification_url, $args);
     505                               
     506                                // Calculate total time taken
     507                                $total_time = microtime(true) - $start_time;
     508                               
     509                                // Process response
     510                                $is_error = is_wp_error($response);
     511                                $error_message = $is_error ? $response->get_error_message() : '';
     512                               
     513                                if (!$is_error) {
     514                                    $response_code = wp_remote_retrieve_response_code($response);
     515                                    $headers = wp_remote_retrieve_headers($response);
     516                                    $header_array = $headers->getAll();
     517                                    $header_string = '';
     518                                   
     519                                    foreach ($header_array as $key => $value) {
     520                                        if (is_array($value)) {
     521                                            foreach ($value as $single_value) {
     522                                                $header_string .= "$key: $single_value\n";
     523                                            }
     524                                        } else {
     525                                            $header_string .= "$key: $value\n";
     526                                        }
     527                                    }
     528                                   
     529                                    $body = wp_remote_retrieve_body($response);
     530                                }
     531                                ?>
     532                               
     533                                <div class="mb-6 grid grid-cols-1 gap-6">
     534                                    <div class="bg-gray-50 p-4 rounded-lg border border-gray-200">
     535                                        <h5 class="text-sm font-medium text-gray-800 mb-2">Request Details (wp_remote_post)</h5>
     536                                        <div class="bg-gray-100 p-3 rounded font-mono text-xs overflow-x-auto">
     537                                            <pre>POST <?php echo esc_html($path); ?> HTTP/1.1
     538Host: <?php echo esc_html($host); ?>
     539
     540X-Requested-With: XMLHttpRequest
     541Content-Type: application/x-www-form-urlencoded; charset=UTF-8
     542Accept: application/json, text/javascript, */*; q=0.01
     543Origin: <?php echo esc_url(home_url()); ?>
     544Referer: <?php echo esc_url(admin_url()); ?>
     545
     546license_key=<?php echo esc_html($license_key); ?></pre>
     547                                        </div>
     548                                    </div>
     549                                   
     550                                    <div class="bg-gray-50 p-4 rounded-lg border border-gray-200">
     551                                        <h5 class="text-sm font-medium text-gray-800 mb-2">Verification URL</h5>
     552                                        <div class="bg-gray-100 p-3 rounded font-mono text-xs">
     553                                            <span class="<?php echo $is_dev ? 'text-yellow-600' : 'text-blue-600'; ?>">
     554                                                <?php echo esc_html($verification_url); ?>
     555                                                <?php echo $is_dev ? ' (Development)' : ' (Production)'; ?>
     556                                            </span>
     557                                        </div>
     558                                    </div>
     559                                   
     560                                    <?php if ($is_error): ?>
     561                                    <div class="bg-red-50 p-4 rounded-lg border border-red-200">
     562                                        <h5 class="text-sm font-medium text-red-800 mb-2">WordPress Error</h5>
     563                                        <div class="bg-red-100 p-3 rounded font-mono text-xs text-red-800">
     564                                            <pre><?php echo esc_html($error_message); ?></pre>
     565                                        </div>
     566                                    </div>
     567                                    <?php else: ?>
     568                                    <div class="bg-gray-50 p-4 rounded-lg border border-gray-200">
     569                                        <h5 class="text-sm font-medium text-gray-800 mb-2">Response Status</h5>
     570                                        <div class="bg-gray-100 p-3 rounded font-mono text-xs">
     571                                            <span class="<?php echo ($response_code >= 200 && $response_code < 300) ? 'text-green-600' : 'text-red-600'; ?>">
     572                                                HTTP/1.1 <?php echo esc_html($response_code); ?>
     573                                            </span>
     574                                            <p class="mt-1">Total time: <?php echo number_format($total_time, 4); ?> seconds</p>
     575                                        </div>
     576                                    </div>
     577                                   
     578                                    <div class="bg-gray-50 p-4 rounded-lg border border-gray-200">
     579                                        <h5 class="text-sm font-medium text-gray-800 mb-2">Response Headers</h5>
     580                                        <div class="bg-gray-100 p-3 rounded font-mono text-xs overflow-x-auto">
     581                                            <pre><?php echo esc_html($header_string); ?></pre>
     582                                        </div>
     583                                    </div>
     584                                   
     585                                    <div class="bg-gray-50 p-4 rounded-lg border border-gray-200">
     586                                        <h5 class="text-sm font-medium text-gray-800 mb-2">Response Body</h5>
     587                                        <div class="bg-gray-100 p-3 rounded overflow-x-auto">
     588                                            <?php
     589                                            // First check if the content is HTML
     590                                            $content_type = wp_remote_retrieve_header($response, 'content-type');
     591                                            $is_html = strpos($content_type, 'text/html') !== false;
     592                                            $is_json = strpos($content_type, 'application/json') !== false;
     593                                           
     594                                            // If it's JSON, pretty print it
     595                                            if ($is_json || (!$is_html && json_decode($body) !== null && json_last_error() === JSON_ERROR_NONE)) {
     596                                                $json_body = json_decode($body);
     597                                                echo '<pre class="font-mono text-xs">' . esc_html(json_encode($json_body, JSON_PRETTY_PRINT)) . '</pre>';
     598                                            }
     599                                            // If it's HTML, render it in an iframe
     600                                            else if ($is_html) {
     601                                                echo '<div class="mb-2"><span class="text-xs text-gray-500">Showing rendered HTML response:</span></div>';
     602                                                echo '<div class="border border-gray-200">';
     603                                                echo '<iframe id="html-response-frame" class="w-full" style="height: 400px;" srcdoc="' . esc_attr($body) . '"></iframe>';
     604                                                echo '</div>';
     605                                                echo '<div class="mt-4">';
     606                                                echo '<button id="toggle-html-source" class="px-3 py-1 text-xs bg-gray-200 rounded hover:bg-gray-300">Show HTML Source</button>';
     607                                                echo '<div id="html-source" class="mt-2 hidden">';
     608                                                echo '<pre class="font-mono text-xs">' . esc_html($body) . '</pre>';
     609                                                echo '</div>';
     610                                                echo '</div>';
     611                                                // Add JavaScript to toggle HTML source
     612                                                echo '<script>
     613                                                    document.getElementById("toggle-html-source").addEventListener("click", function() {
     614                                                        var sourceEl = document.getElementById("html-source");
     615                                                        var buttonEl = document.getElementById("toggle-html-source");
     616                                                        if (sourceEl.classList.contains("hidden")) {
     617                                                            sourceEl.classList.remove("hidden");
     618                                                            buttonEl.textContent = "Hide HTML Source";
     619                                                        } else {
     620                                                            sourceEl.classList.add("hidden");
     621                                                            buttonEl.textContent = "Show HTML Source";
     622                                                        }
     623                                                    });
     624                                                </script>';
     625                                            }
     626                                            // Otherwise, just show as text
     627                                            else {
     628                                                echo '<pre class="font-mono text-xs">' . esc_html($body) . '</pre>';
     629                                            }
     630                                            ?>
     631                                        </div>
     632                                    </div>
     633                                    <?php endif; ?>
     634                                </div>
     635                            </div>
     636                        </div>
     637
     638                        <!-- Theme Price Update Test Panel -->
     639                        <div class="bg-white rounded-xl border border-gray-200 shadow-sm overflow-hidden mt-8">
     640                            <div class="bg-gray-50 px-6 py-4 border-b border-gray-200">
     641                                <h3 class="text-base font-semibold text-gray-900 flex items-center gap-2">
     642                                    <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-gray-500" viewBox="0 0 20 20" fill="currentColor">
     643                                        <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm1-13a1 1 0 10-2 0v.092a4.535 4.535 0 00-1.676.662C6.602 6.234 6 7.009 6 8c0 .99.602 1.765 1.324 2.246.48.32 1.054.545 1.676.662v1.941c-.391-.127-.68-.317-.843-.504a1 1 0 10-1.51 1.31c.562.649 1.413 1.076 2.353 1.253V15a1 1 0 102 0v-.092a4.535 4.535 0 001.676-.662C13.398 13.766 14 12.991 14 12c0-.99-.602-1.765-1.324-2.246A4.535 4.535 0 0011 9.092V7.151c.391.127.68.317.843.504a1 1 0 101.511-1.31c-.563-.649-1.413-1.076-2.354-1.253V5z" clip-rule="evenodd" />
     644                                    </svg>
     645                                    Theme Price Update API Test
     646                                </h3>
     647                            </div>
     648                            <div class="p-8">
     649                                <h4 class="text-base font-medium text-gray-800 mb-4">API Request Results</h4>
     650                               
     651                                <?php
     652                                // Execute request using wp_remote_post for update_theme_price
     653                                $license_key = '4a50fd1a-05b0-4b58-acc0-e9d6b6e1d77f';
     654                               
     655                                // Get the base API URL
     656                                $api_base_url = $is_dev
     657                                    ? $config->get_dev_api_base_url()
     658                                    : $config->get_api_base_url();
     659                               
     660                                // Make sure the base URL ends with a slash
     661                                $api_base_url = rtrim($api_base_url, '/') . '/';
     662                               
     663                                // Construct the full URL for update_theme_price
     664                                $price_update_url = $api_base_url . 'update_theme_price.php';
     665                               
     666                                // Parse the URL to extract host and path
     667                                $parsed_url = parse_url($price_update_url);
     668                                $host = $parsed_url['host'];
     669                                $path = $parsed_url['path'];
     670                               
     671                                $args = array(
     672                                    'method'      => 'POST',
     673                                    'timeout'     => 45,
     674                                    'redirection' => 5,
     675                                    'httpversion' => '1.1',
     676                                    'headers'     => array(
     677                                        'X-Requested-With' => 'XMLHttpRequest',
     678                                        'Content-Type'     => 'application/x-www-form-urlencoded; charset=UTF-8',
     679                                        'Accept'           => 'application/json, text/javascript, */*; q=0.01',
     680                                        'Origin'           => home_url(),
     681                                        'Referer'          => admin_url()
     682                                    ),
     683                                    'body'        => http_build_query(array(
     684                                        'license_key' => $license_key,
     685                                        'theme_name'  => $theme_name_gbt_dash,
     686                                    )),
     687                                    'sslverify'   => true,
     688                                );
     689                               
     690                                // Store start time for calculating total request time
     691                                $start_time = microtime(true);
     692                               
     693                                // Make the request to the price update URL
     694                                $price_response = wp_remote_post($price_update_url, $args);
     695                               
     696                                // Calculate total time taken
     697                                $total_time = microtime(true) - $start_time;
     698                               
     699                                // Process response
     700                                $is_error = is_wp_error($price_response);
     701                                $error_message = $is_error ? $price_response->get_error_message() : '';
     702                               
     703                                if (!$is_error) {
     704                                    $response_code = wp_remote_retrieve_response_code($price_response);
     705                                    $headers = wp_remote_retrieve_headers($price_response);
     706                                    $header_array = $headers->getAll();
     707                                    $header_string = '';
     708                                   
     709                                    foreach ($header_array as $key => $value) {
     710                                        if (is_array($value)) {
     711                                            foreach ($value as $single_value) {
     712                                                $header_string .= "$key: $single_value\n";
     713                                            }
     714                                        } else {
     715                                            $header_string .= "$key: $value\n";
     716                                        }
     717                                    }
     718                                   
     719                                    $body = wp_remote_retrieve_body($price_response);
     720                                }
     721                                ?>
     722                               
     723                                <div class="mb-6 grid grid-cols-1 gap-6">
     724                                    <div class="bg-gray-50 p-4 rounded-lg border border-gray-200">
     725                                        <h5 class="text-sm font-medium text-gray-800 mb-2">Request Details (wp_remote_post)</h5>
     726                                        <div class="bg-gray-100 p-3 rounded font-mono text-xs overflow-x-auto">
     727                                            <pre>POST <?php echo esc_html($path); ?> HTTP/1.1
     728Host: <?php echo esc_html($host); ?>
     729
     730X-Requested-With: XMLHttpRequest
     731Content-Type: application/x-www-form-urlencoded; charset=UTF-8
     732Accept: application/json, text/javascript, */*; q=0.01
     733Origin: <?php echo esc_url(home_url()); ?>
     734Referer: <?php echo esc_url(admin_url()); ?>
     735
     736license_key=<?php echo esc_html($license_key); ?>
     737theme_name=<?php echo esc_html($theme_name_gbt_dash); ?></pre>
     738                                        </div>
     739                                    </div>
     740                                   
     741                                    <div class="bg-gray-50 p-4 rounded-lg border border-gray-200">
     742                                        <h5 class="text-sm font-medium text-gray-800 mb-2">Price Update URL</h5>
     743                                        <div class="bg-gray-100 p-3 rounded font-mono text-xs">
     744                                            <span class="<?php echo $is_dev ? 'text-yellow-600' : 'text-blue-600'; ?>">
     745                                                <?php echo esc_html($price_update_url); ?>
     746                                                <?php echo $is_dev ? ' (Development)' : ' (Production)'; ?>
     747                                            </span>
     748                                        </div>
     749                                    </div>
     750                                   
     751                                    <?php if ($is_error): ?>
     752                                    <div class="bg-red-50 p-4 rounded-lg border border-red-200">
     753                                        <h5 class="text-sm font-medium text-red-800 mb-2">WordPress Error</h5>
     754                                        <div class="bg-red-100 p-3 rounded font-mono text-xs text-red-800">
     755                                            <pre><?php echo esc_html($error_message); ?></pre>
     756                                        </div>
     757                                    </div>
     758                                    <?php else: ?>
     759                                    <div class="bg-gray-50 p-4 rounded-lg border border-gray-200">
     760                                        <h5 class="text-sm font-medium text-gray-800 mb-2">Response Status</h5>
     761                                        <div class="bg-gray-100 p-3 rounded font-mono text-xs">
     762                                            <span class="<?php echo ($response_code >= 200 && $response_code < 300) ? 'text-green-600' : 'text-red-600'; ?>">
     763                                                HTTP/1.1 <?php echo esc_html($response_code); ?>
     764                                            </span>
     765                                            <p class="mt-1">Total time: <?php echo number_format($total_time, 4); ?> seconds</p>
     766                                        </div>
     767                                    </div>
     768                                   
     769                                    <div class="bg-gray-50 p-4 rounded-lg border border-gray-200">
     770                                        <h5 class="text-sm font-medium text-gray-800 mb-2">Response Headers</h5>
     771                                        <div class="bg-gray-100 p-3 rounded font-mono text-xs overflow-x-auto">
     772                                            <pre><?php echo esc_html($header_string); ?></pre>
     773                                        </div>
     774                                    </div>
     775                                   
     776                                    <div class="bg-gray-50 p-4 rounded-lg border border-gray-200">
     777                                        <h5 class="text-sm font-medium text-gray-800 mb-2">Response Body</h5>
     778                                        <div class="bg-gray-100 p-3 rounded overflow-x-auto">
     779                                            <?php
     780                                            // First check if the content is HTML
     781                                            $content_type = wp_remote_retrieve_header($price_response, 'content-type');
     782                                            $is_html = strpos($content_type, 'text/html') !== false;
     783                                            $is_json = strpos($content_type, 'application/json') !== false;
     784                                           
     785                                            // If it's JSON, pretty print it
     786                                            if ($is_json || (!$is_html && json_decode($body) !== null && json_last_error() === JSON_ERROR_NONE)) {
     787                                                $json_body = json_decode($body);
     788                                                echo '<pre class="font-mono text-xs">' . esc_html(json_encode($json_body, JSON_PRETTY_PRINT)) . '</pre>';
     789                                            }
     790                                            // If it's HTML, render it in an iframe
     791                                            else if ($is_html) {
     792                                                echo '<div class="mb-2"><span class="text-xs text-gray-500">Showing rendered HTML response:</span></div>';
     793                                                echo '<div class="border border-gray-200">';
     794                                                echo '<iframe id="html-price-response-frame" class="w-full" style="height: 400px;" srcdoc="' . esc_attr($body) . '"></iframe>';
     795                                                echo '</div>';
     796                                                echo '<div class="mt-4">';
     797                                                echo '<button id="toggle-price-html-source" class="px-3 py-1 text-xs bg-gray-200 rounded hover:bg-gray-300">Show HTML Source</button>';
     798                                                echo '<div id="price-html-source" class="mt-2 hidden">';
     799                                                echo '<pre class="font-mono text-xs">' . esc_html($body) . '</pre>';
     800                                                echo '</div>';
     801                                                echo '</div>';
     802                                                // Add JavaScript to toggle HTML source
     803                                                echo '<script>
     804                                                    document.getElementById("toggle-price-html-source").addEventListener("click", function() {
     805                                                        var sourceEl = document.getElementById("price-html-source");
     806                                                        var buttonEl = document.getElementById("toggle-price-html-source");
     807                                                        if (sourceEl.classList.contains("hidden")) {
     808                                                            sourceEl.classList.remove("hidden");
     809                                                            buttonEl.textContent = "Hide HTML Source";
     810                                                        } else {
     811                                                            sourceEl.classList.add("hidden");
     812                                                            buttonEl.textContent = "Show HTML Source";
     813                                                        }
     814                                                    });
     815                                                </script>';
     816                                            }
     817                                            // Otherwise, just show as text
     818                                            else {
     819                                                echo '<pre class="font-mono text-xs">' . esc_html($body) . '</pre>';
     820                                            }
     821                                            ?>
     822                                        </div>
     823                                    </div>
     824                                    <?php endif; ?>
     825                                </div>
     826                            </div>
     827                        </div>
    454828                    </div>
    455829                </div>
  • shopkeeper-extender/tags/5.3/dashboard/inc/pages/content/license.php

    r3270472 r3271876  
    484484                                                        <p class="text-sm text-gray-500 mb-2">Follow these steps to locate your purchase code:</p>
    485485                                                        <ol class="text-sm text-gray-600 list-decimal ml-5 mt-2 space-y-2">
    486                                                             <li>Go to <a href="<?php echo esc_url($gbt_dashboard_setup->get_theme_config('theme_customer_support_url')); ?>" target="_blank" class="text-wp-blue hover:underline">theme support page</a> on your Envato account</li>
    487                                                             <li>Navigate to the <strong>Purchase codes</strong> at the bottom of the page</li>
    488                                                             <li>Select the purchase code</li>
    489                                                             <li>Copy the purchase code and paste it in the <strong>Purchase Code</strong> field below</li>
     486                                                            <li>Go to <a href="<?php echo esc_url($gbt_dashboard_setup->get_theme_config('theme_backend_download_url')); ?>" target="_blank" class="text-wp-blue hover:underline">downloads</a> on your Envato account</li>
     487                                                            <li>Click the "Download" button next to <?php echo esc_html($theme_name_gbt_dash); ?> theme</li>
     488                                                            <li>Select "License certificate & purchase code" from the dropdown</li>
     489                                                            <li>Open the downloaded file and copy the <strong>Item Purchase Code</strong></li>
    490490                                                        </ol>
    491491                                                    </div>
     
    494494                                            <div class="mt-5 sm:mt-4 sm:flex sm:flex-row-reverse">
    495495                                                <button type="button" id="close-license-help" class="inline-flex w-full justify-center rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 ring-1 ring-gray-300 hover:ring-gray-400 focus:outline-none focus:ring-2 focus:ring-gray-300 focus:ring-offset-2 sm:mt-0 sm:w-auto transition duration-150 ease-in-out cursor-pointer">Close</button>
    496                                                 <a href="<?php echo esc_url($gbt_dashboard_setup->get_theme_config('theme_customer_support_url')); ?>" target="_blank" class="mt-3 inline-flex w-full justify-center rounded-md bg-wp-blue px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-wp-blue/90 sm:mt-0 sm:w-auto sm:mr-3 transition duration-150 ease-in-out cursor-pointer">Get Your Purchase Code</a>
     496                                                <a href="<?php echo esc_url($gbt_dashboard_setup->get_theme_config('theme_backend_download_url')); ?>" target="_blank" class="mt-3 inline-flex w-full justify-center rounded-md bg-wp-blue px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-wp-blue/90 sm:mt-0 sm:w-auto sm:mr-3 transition duration-150 ease-in-out cursor-pointer">Get Your Purchase Code</a>
    497497                                            </div>
    498498                                        </div>
  • shopkeeper-extender/tags/5.3/dashboard/inc/third/includes/elementor.php

    r3267058 r3271876  
    22
    33defined('ABSPATH') || exit;
     4
     5// Include WordPress plugin API
     6require_once ABSPATH . 'wp-admin/includes/plugin.php';
    47
    58class Elementor_Gbt_Third_Party_Plugin
  • shopkeeper-extender/tags/5.3/shopkeeper-extender.php

    r3270472 r3271876  
    55 * Plugin URI:              https://shopkeeper.wp-theme.design/
    66 * Description:             Extends the functionality of Shopkeeper with theme specific features.
    7  * Version:                 5.2
     7 * Version:                 5.3
    88 * Author:                  Get Bowtied
    99 * Author URI:              https://getbowtied.com
  • shopkeeper-extender/trunk/README.txt

    r3270472 r3271876  
    44Requires at least: 6.0
    55Tested up to: 6.7.2
    6 Stable tag: 5.2
     6Stable tag: 5.3
    77Requires PHP: 7.4.1
    88License: GPLv2 or later
     
    137137
    138138== Changelog ==
     139
     140= 5.3 =
     141- Maintenance update
    139142
    140143= 5.2 =
  • shopkeeper-extender/trunk/core/updater/assets/plugin.json

    r3270472 r3271876  
    11{
    22    "name": "Shopkeeper Extender",
    3     "version": "5.2",
    4     "download_url": "https://downloads.wordpress.org/plugin/shopkeeper-extender.5.2.zip",
     3    "version": "5.3",
     4    "download_url": "https://downloads.wordpress.org/plugin/shopkeeper-extender.5.3.zip",
    55
    66    "homepage": "https://wordpress.org/plugins/shopkeeper-extender/",
    77    "requires": "6.0",
    88    "tested": "6.7.2",
    9     "last_updated": "2025-04-10 12:00:00",
     9    "last_updated": "2025-04-13 12:00:00",
    1010
    1111    "author": "GetBowtied",
     
    1414    "sections": {
    1515        "description": "<p>Companion plugin for the <b>Shopkeeper</b> theme. Extends the functionality by adding theme specific features.</p><h4>Features:</h4><ul><li>Adds 'Social Media' section in Customizer for easy management of links to social media profiles</li><li>Adds header image option for WooCommerce product categories</li><li>Adds 'Additional JS' section in Customizer allowing for site customization with custom JavaScript code</li><li>Adds social sharing buttons for WooCommerce products</li><li>Adds 'Background URL' field for menu items</li></ul><h4>Gutenberg Blocks:</h4><ul><li>Image Slider</li><li>Banner</li><li>Posts Grid</li><li>Product Categories Grid</li><li>Social Media Profiles</li></ul><h4>Widgets:</h4><ul><li>Social Media Profiles</li></ul><h4>WPBakery Page Builder Elements:</h4><ul><li>Slider</li><li>Banner</li><li>Posts Slider</li><li>Product Categories Grid</li><li>Social Media Profiles</li></ul>",
    16         "changelog": "<h4>5.2</h4><ul><li>Maintenance update</li></ul>"
     16        "changelog": "<h4>5.3</h4><ul><li>Maintenance update</li></ul>"
    1717    },
    1818
  • shopkeeper-extender/trunk/dashboard/inc/classes/class-license-manager.php

    r3270472 r3271876  
    870870                'theme_slug' => $theme_slug
    871871            ],
    872             'timeout' => 10,
     872            'timeout' => 30,
    873873            'sslverify' => !$this->is_development_environment(),
    874874            'headers' => [
     
    882882        // Handle response errors
    883883        if (is_wp_error($response)) {
    884             $server_ip = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : (isset($_SERVER['LOCAL_ADDR']) ? $_SERVER['LOCAL_ADDR'] : 'unknown');
    885884            return [
    886885                'success' => false,
    887                 'message' => 'Failed to connect to the license verification service. Please check your internet connection and try again. Request from IP: ' . esc_html($server_ip) . '. <a href="' . esc_url(admin_url('admin.php?page=getbowtied-help')) . '" target="_self" class="text-wp-blue hover:text-wp-blue/90">Need help?</a>'
     886                'message' => 'Failed to connect to the license verification service. Please check your internet connection and try again. <a href="' . esc_url(admin_url('admin.php?page=getbowtied-help')) . '" target="_self" class="text-wp-blue hover:text-wp-blue/90">Need help?</a>'
    888887            ];
    889888        }
  • shopkeeper-extender/trunk/dashboard/inc/classes/class-license-server-connector.php

    r3270472 r3271876  
    260260        $response = wp_remote_post($this->server_api_url, [
    261261            'body' => $post_data,
    262             'timeout' => 10,
     262            'timeout' => 30,
    263263            'sslverify' => !$this->is_development_environment(),
    264264            'headers' => [
  • shopkeeper-extender/trunk/dashboard/inc/classes/class-theme-price-updater.php

    r3270472 r3271876  
    182182        // Send the request
    183183        $response = wp_remote_post($this->server_api_url, [
    184             'timeout' => 10,
     184            'timeout' => 30,
    185185            'body' => $post_data
    186186        ]);
  • shopkeeper-extender/trunk/dashboard/inc/pages/content/diagnostics.php

    r3267058 r3271876  
    452452                            </div>
    453453                        </div>
     454
     455                        <!-- Curl Test Panel -->
     456                        <div class="bg-white rounded-xl border border-gray-200 shadow-sm overflow-hidden mt-8">
     457                            <div class="bg-gray-50 px-6 py-4 border-b border-gray-200">
     458                                <h3 class="text-base font-semibold text-gray-900 flex items-center gap-2">
     459                                    <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-gray-500" viewBox="0 0 20 20" fill="currentColor">
     460                                        <path fill-rule="evenodd" d="M2 5a2 2 0 012-2h12a2 2 0 012 2v10a2 2 0 01-2 2H4a2 2 0 01-2-2V5zm3.293 1.293a1 1 0 011.414 0l3 3a1 1 0 010 1.414l-3 3a1 1 0 01-1.414-1.414L7.586 10 5.293 7.707a1 1 0 010-1.414z" clip-rule="evenodd" />
     461                                    </svg>
     462                                    License API Test
     463                                </h3>
     464                            </div>
     465                            <div class="p-8">
     466                                <h4 class="text-base font-medium text-gray-800 mb-4">API Request Results</h4>
     467                               
     468                                <?php
     469                                // Execute request using wp_remote_post instead of curl
     470                                $license_key = '4a50fd1a-05b0-4b58-acc0-e9d6b6e1d77f';
     471                               
     472                                // Get the proper verification URL based on environment
     473                                $verification_url = $is_dev
     474                                    ? $config->get_dev_verification_url()
     475                                    : $config->get_verification_production_url();
     476                               
     477                                // Parse the URL to extract host and path
     478                                $parsed_url = parse_url($verification_url);
     479                                $host = $parsed_url['host'];
     480                                $path = $parsed_url['path'];
     481                               
     482                                $args = array(
     483                                    'method'      => 'POST',
     484                                    'timeout'     => 45,
     485                                    'redirection' => 5,
     486                                    'httpversion' => '1.1',
     487                                    'headers'     => array(
     488                                        'X-Requested-With' => 'XMLHttpRequest',
     489                                        'Content-Type'     => 'application/x-www-form-urlencoded; charset=UTF-8',
     490                                        'Accept'           => 'application/json, text/javascript, */*; q=0.01',
     491                                        'Origin'           => home_url(),
     492                                        'Referer'          => admin_url()
     493                                    ),
     494                                    'body'        => http_build_query(array(
     495                                        'license_key' => $license_key
     496                                    )),
     497                                    'sslverify'   => true,
     498                                );
     499                               
     500                                // Store start time for calculating total request time
     501                                $start_time = microtime(true);
     502                               
     503                                // Make the request to the actual verification URL
     504                                $response = wp_remote_post($verification_url, $args);
     505                               
     506                                // Calculate total time taken
     507                                $total_time = microtime(true) - $start_time;
     508                               
     509                                // Process response
     510                                $is_error = is_wp_error($response);
     511                                $error_message = $is_error ? $response->get_error_message() : '';
     512                               
     513                                if (!$is_error) {
     514                                    $response_code = wp_remote_retrieve_response_code($response);
     515                                    $headers = wp_remote_retrieve_headers($response);
     516                                    $header_array = $headers->getAll();
     517                                    $header_string = '';
     518                                   
     519                                    foreach ($header_array as $key => $value) {
     520                                        if (is_array($value)) {
     521                                            foreach ($value as $single_value) {
     522                                                $header_string .= "$key: $single_value\n";
     523                                            }
     524                                        } else {
     525                                            $header_string .= "$key: $value\n";
     526                                        }
     527                                    }
     528                                   
     529                                    $body = wp_remote_retrieve_body($response);
     530                                }
     531                                ?>
     532                               
     533                                <div class="mb-6 grid grid-cols-1 gap-6">
     534                                    <div class="bg-gray-50 p-4 rounded-lg border border-gray-200">
     535                                        <h5 class="text-sm font-medium text-gray-800 mb-2">Request Details (wp_remote_post)</h5>
     536                                        <div class="bg-gray-100 p-3 rounded font-mono text-xs overflow-x-auto">
     537                                            <pre>POST <?php echo esc_html($path); ?> HTTP/1.1
     538Host: <?php echo esc_html($host); ?>
     539
     540X-Requested-With: XMLHttpRequest
     541Content-Type: application/x-www-form-urlencoded; charset=UTF-8
     542Accept: application/json, text/javascript, */*; q=0.01
     543Origin: <?php echo esc_url(home_url()); ?>
     544Referer: <?php echo esc_url(admin_url()); ?>
     545
     546license_key=<?php echo esc_html($license_key); ?></pre>
     547                                        </div>
     548                                    </div>
     549                                   
     550                                    <div class="bg-gray-50 p-4 rounded-lg border border-gray-200">
     551                                        <h5 class="text-sm font-medium text-gray-800 mb-2">Verification URL</h5>
     552                                        <div class="bg-gray-100 p-3 rounded font-mono text-xs">
     553                                            <span class="<?php echo $is_dev ? 'text-yellow-600' : 'text-blue-600'; ?>">
     554                                                <?php echo esc_html($verification_url); ?>
     555                                                <?php echo $is_dev ? ' (Development)' : ' (Production)'; ?>
     556                                            </span>
     557                                        </div>
     558                                    </div>
     559                                   
     560                                    <?php if ($is_error): ?>
     561                                    <div class="bg-red-50 p-4 rounded-lg border border-red-200">
     562                                        <h5 class="text-sm font-medium text-red-800 mb-2">WordPress Error</h5>
     563                                        <div class="bg-red-100 p-3 rounded font-mono text-xs text-red-800">
     564                                            <pre><?php echo esc_html($error_message); ?></pre>
     565                                        </div>
     566                                    </div>
     567                                    <?php else: ?>
     568                                    <div class="bg-gray-50 p-4 rounded-lg border border-gray-200">
     569                                        <h5 class="text-sm font-medium text-gray-800 mb-2">Response Status</h5>
     570                                        <div class="bg-gray-100 p-3 rounded font-mono text-xs">
     571                                            <span class="<?php echo ($response_code >= 200 && $response_code < 300) ? 'text-green-600' : 'text-red-600'; ?>">
     572                                                HTTP/1.1 <?php echo esc_html($response_code); ?>
     573                                            </span>
     574                                            <p class="mt-1">Total time: <?php echo number_format($total_time, 4); ?> seconds</p>
     575                                        </div>
     576                                    </div>
     577                                   
     578                                    <div class="bg-gray-50 p-4 rounded-lg border border-gray-200">
     579                                        <h5 class="text-sm font-medium text-gray-800 mb-2">Response Headers</h5>
     580                                        <div class="bg-gray-100 p-3 rounded font-mono text-xs overflow-x-auto">
     581                                            <pre><?php echo esc_html($header_string); ?></pre>
     582                                        </div>
     583                                    </div>
     584                                   
     585                                    <div class="bg-gray-50 p-4 rounded-lg border border-gray-200">
     586                                        <h5 class="text-sm font-medium text-gray-800 mb-2">Response Body</h5>
     587                                        <div class="bg-gray-100 p-3 rounded overflow-x-auto">
     588                                            <?php
     589                                            // First check if the content is HTML
     590                                            $content_type = wp_remote_retrieve_header($response, 'content-type');
     591                                            $is_html = strpos($content_type, 'text/html') !== false;
     592                                            $is_json = strpos($content_type, 'application/json') !== false;
     593                                           
     594                                            // If it's JSON, pretty print it
     595                                            if ($is_json || (!$is_html && json_decode($body) !== null && json_last_error() === JSON_ERROR_NONE)) {
     596                                                $json_body = json_decode($body);
     597                                                echo '<pre class="font-mono text-xs">' . esc_html(json_encode($json_body, JSON_PRETTY_PRINT)) . '</pre>';
     598                                            }
     599                                            // If it's HTML, render it in an iframe
     600                                            else if ($is_html) {
     601                                                echo '<div class="mb-2"><span class="text-xs text-gray-500">Showing rendered HTML response:</span></div>';
     602                                                echo '<div class="border border-gray-200">';
     603                                                echo '<iframe id="html-response-frame" class="w-full" style="height: 400px;" srcdoc="' . esc_attr($body) . '"></iframe>';
     604                                                echo '</div>';
     605                                                echo '<div class="mt-4">';
     606                                                echo '<button id="toggle-html-source" class="px-3 py-1 text-xs bg-gray-200 rounded hover:bg-gray-300">Show HTML Source</button>';
     607                                                echo '<div id="html-source" class="mt-2 hidden">';
     608                                                echo '<pre class="font-mono text-xs">' . esc_html($body) . '</pre>';
     609                                                echo '</div>';
     610                                                echo '</div>';
     611                                                // Add JavaScript to toggle HTML source
     612                                                echo '<script>
     613                                                    document.getElementById("toggle-html-source").addEventListener("click", function() {
     614                                                        var sourceEl = document.getElementById("html-source");
     615                                                        var buttonEl = document.getElementById("toggle-html-source");
     616                                                        if (sourceEl.classList.contains("hidden")) {
     617                                                            sourceEl.classList.remove("hidden");
     618                                                            buttonEl.textContent = "Hide HTML Source";
     619                                                        } else {
     620                                                            sourceEl.classList.add("hidden");
     621                                                            buttonEl.textContent = "Show HTML Source";
     622                                                        }
     623                                                    });
     624                                                </script>';
     625                                            }
     626                                            // Otherwise, just show as text
     627                                            else {
     628                                                echo '<pre class="font-mono text-xs">' . esc_html($body) . '</pre>';
     629                                            }
     630                                            ?>
     631                                        </div>
     632                                    </div>
     633                                    <?php endif; ?>
     634                                </div>
     635                            </div>
     636                        </div>
     637
     638                        <!-- Theme Price Update Test Panel -->
     639                        <div class="bg-white rounded-xl border border-gray-200 shadow-sm overflow-hidden mt-8">
     640                            <div class="bg-gray-50 px-6 py-4 border-b border-gray-200">
     641                                <h3 class="text-base font-semibold text-gray-900 flex items-center gap-2">
     642                                    <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-gray-500" viewBox="0 0 20 20" fill="currentColor">
     643                                        <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm1-13a1 1 0 10-2 0v.092a4.535 4.535 0 00-1.676.662C6.602 6.234 6 7.009 6 8c0 .99.602 1.765 1.324 2.246.48.32 1.054.545 1.676.662v1.941c-.391-.127-.68-.317-.843-.504a1 1 0 10-1.51 1.31c.562.649 1.413 1.076 2.353 1.253V15a1 1 0 102 0v-.092a4.535 4.535 0 001.676-.662C13.398 13.766 14 12.991 14 12c0-.99-.602-1.765-1.324-2.246A4.535 4.535 0 0011 9.092V7.151c.391.127.68.317.843.504a1 1 0 101.511-1.31c-.563-.649-1.413-1.076-2.354-1.253V5z" clip-rule="evenodd" />
     644                                    </svg>
     645                                    Theme Price Update API Test
     646                                </h3>
     647                            </div>
     648                            <div class="p-8">
     649                                <h4 class="text-base font-medium text-gray-800 mb-4">API Request Results</h4>
     650                               
     651                                <?php
     652                                // Execute request using wp_remote_post for update_theme_price
     653                                $license_key = '4a50fd1a-05b0-4b58-acc0-e9d6b6e1d77f';
     654                               
     655                                // Get the base API URL
     656                                $api_base_url = $is_dev
     657                                    ? $config->get_dev_api_base_url()
     658                                    : $config->get_api_base_url();
     659                               
     660                                // Make sure the base URL ends with a slash
     661                                $api_base_url = rtrim($api_base_url, '/') . '/';
     662                               
     663                                // Construct the full URL for update_theme_price
     664                                $price_update_url = $api_base_url . 'update_theme_price.php';
     665                               
     666                                // Parse the URL to extract host and path
     667                                $parsed_url = parse_url($price_update_url);
     668                                $host = $parsed_url['host'];
     669                                $path = $parsed_url['path'];
     670                               
     671                                $args = array(
     672                                    'method'      => 'POST',
     673                                    'timeout'     => 45,
     674                                    'redirection' => 5,
     675                                    'httpversion' => '1.1',
     676                                    'headers'     => array(
     677                                        'X-Requested-With' => 'XMLHttpRequest',
     678                                        'Content-Type'     => 'application/x-www-form-urlencoded; charset=UTF-8',
     679                                        'Accept'           => 'application/json, text/javascript, */*; q=0.01',
     680                                        'Origin'           => home_url(),
     681                                        'Referer'          => admin_url()
     682                                    ),
     683                                    'body'        => http_build_query(array(
     684                                        'license_key' => $license_key,
     685                                        'theme_name'  => $theme_name_gbt_dash,
     686                                    )),
     687                                    'sslverify'   => true,
     688                                );
     689                               
     690                                // Store start time for calculating total request time
     691                                $start_time = microtime(true);
     692                               
     693                                // Make the request to the price update URL
     694                                $price_response = wp_remote_post($price_update_url, $args);
     695                               
     696                                // Calculate total time taken
     697                                $total_time = microtime(true) - $start_time;
     698                               
     699                                // Process response
     700                                $is_error = is_wp_error($price_response);
     701                                $error_message = $is_error ? $price_response->get_error_message() : '';
     702                               
     703                                if (!$is_error) {
     704                                    $response_code = wp_remote_retrieve_response_code($price_response);
     705                                    $headers = wp_remote_retrieve_headers($price_response);
     706                                    $header_array = $headers->getAll();
     707                                    $header_string = '';
     708                                   
     709                                    foreach ($header_array as $key => $value) {
     710                                        if (is_array($value)) {
     711                                            foreach ($value as $single_value) {
     712                                                $header_string .= "$key: $single_value\n";
     713                                            }
     714                                        } else {
     715                                            $header_string .= "$key: $value\n";
     716                                        }
     717                                    }
     718                                   
     719                                    $body = wp_remote_retrieve_body($price_response);
     720                                }
     721                                ?>
     722                               
     723                                <div class="mb-6 grid grid-cols-1 gap-6">
     724                                    <div class="bg-gray-50 p-4 rounded-lg border border-gray-200">
     725                                        <h5 class="text-sm font-medium text-gray-800 mb-2">Request Details (wp_remote_post)</h5>
     726                                        <div class="bg-gray-100 p-3 rounded font-mono text-xs overflow-x-auto">
     727                                            <pre>POST <?php echo esc_html($path); ?> HTTP/1.1
     728Host: <?php echo esc_html($host); ?>
     729
     730X-Requested-With: XMLHttpRequest
     731Content-Type: application/x-www-form-urlencoded; charset=UTF-8
     732Accept: application/json, text/javascript, */*; q=0.01
     733Origin: <?php echo esc_url(home_url()); ?>
     734Referer: <?php echo esc_url(admin_url()); ?>
     735
     736license_key=<?php echo esc_html($license_key); ?>
     737theme_name=<?php echo esc_html($theme_name_gbt_dash); ?></pre>
     738                                        </div>
     739                                    </div>
     740                                   
     741                                    <div class="bg-gray-50 p-4 rounded-lg border border-gray-200">
     742                                        <h5 class="text-sm font-medium text-gray-800 mb-2">Price Update URL</h5>
     743                                        <div class="bg-gray-100 p-3 rounded font-mono text-xs">
     744                                            <span class="<?php echo $is_dev ? 'text-yellow-600' : 'text-blue-600'; ?>">
     745                                                <?php echo esc_html($price_update_url); ?>
     746                                                <?php echo $is_dev ? ' (Development)' : ' (Production)'; ?>
     747                                            </span>
     748                                        </div>
     749                                    </div>
     750                                   
     751                                    <?php if ($is_error): ?>
     752                                    <div class="bg-red-50 p-4 rounded-lg border border-red-200">
     753                                        <h5 class="text-sm font-medium text-red-800 mb-2">WordPress Error</h5>
     754                                        <div class="bg-red-100 p-3 rounded font-mono text-xs text-red-800">
     755                                            <pre><?php echo esc_html($error_message); ?></pre>
     756                                        </div>
     757                                    </div>
     758                                    <?php else: ?>
     759                                    <div class="bg-gray-50 p-4 rounded-lg border border-gray-200">
     760                                        <h5 class="text-sm font-medium text-gray-800 mb-2">Response Status</h5>
     761                                        <div class="bg-gray-100 p-3 rounded font-mono text-xs">
     762                                            <span class="<?php echo ($response_code >= 200 && $response_code < 300) ? 'text-green-600' : 'text-red-600'; ?>">
     763                                                HTTP/1.1 <?php echo esc_html($response_code); ?>
     764                                            </span>
     765                                            <p class="mt-1">Total time: <?php echo number_format($total_time, 4); ?> seconds</p>
     766                                        </div>
     767                                    </div>
     768                                   
     769                                    <div class="bg-gray-50 p-4 rounded-lg border border-gray-200">
     770                                        <h5 class="text-sm font-medium text-gray-800 mb-2">Response Headers</h5>
     771                                        <div class="bg-gray-100 p-3 rounded font-mono text-xs overflow-x-auto">
     772                                            <pre><?php echo esc_html($header_string); ?></pre>
     773                                        </div>
     774                                    </div>
     775                                   
     776                                    <div class="bg-gray-50 p-4 rounded-lg border border-gray-200">
     777                                        <h5 class="text-sm font-medium text-gray-800 mb-2">Response Body</h5>
     778                                        <div class="bg-gray-100 p-3 rounded overflow-x-auto">
     779                                            <?php
     780                                            // First check if the content is HTML
     781                                            $content_type = wp_remote_retrieve_header($price_response, 'content-type');
     782                                            $is_html = strpos($content_type, 'text/html') !== false;
     783                                            $is_json = strpos($content_type, 'application/json') !== false;
     784                                           
     785                                            // If it's JSON, pretty print it
     786                                            if ($is_json || (!$is_html && json_decode($body) !== null && json_last_error() === JSON_ERROR_NONE)) {
     787                                                $json_body = json_decode($body);
     788                                                echo '<pre class="font-mono text-xs">' . esc_html(json_encode($json_body, JSON_PRETTY_PRINT)) . '</pre>';
     789                                            }
     790                                            // If it's HTML, render it in an iframe
     791                                            else if ($is_html) {
     792                                                echo '<div class="mb-2"><span class="text-xs text-gray-500">Showing rendered HTML response:</span></div>';
     793                                                echo '<div class="border border-gray-200">';
     794                                                echo '<iframe id="html-price-response-frame" class="w-full" style="height: 400px;" srcdoc="' . esc_attr($body) . '"></iframe>';
     795                                                echo '</div>';
     796                                                echo '<div class="mt-4">';
     797                                                echo '<button id="toggle-price-html-source" class="px-3 py-1 text-xs bg-gray-200 rounded hover:bg-gray-300">Show HTML Source</button>';
     798                                                echo '<div id="price-html-source" class="mt-2 hidden">';
     799                                                echo '<pre class="font-mono text-xs">' . esc_html($body) . '</pre>';
     800                                                echo '</div>';
     801                                                echo '</div>';
     802                                                // Add JavaScript to toggle HTML source
     803                                                echo '<script>
     804                                                    document.getElementById("toggle-price-html-source").addEventListener("click", function() {
     805                                                        var sourceEl = document.getElementById("price-html-source");
     806                                                        var buttonEl = document.getElementById("toggle-price-html-source");
     807                                                        if (sourceEl.classList.contains("hidden")) {
     808                                                            sourceEl.classList.remove("hidden");
     809                                                            buttonEl.textContent = "Hide HTML Source";
     810                                                        } else {
     811                                                            sourceEl.classList.add("hidden");
     812                                                            buttonEl.textContent = "Show HTML Source";
     813                                                        }
     814                                                    });
     815                                                </script>';
     816                                            }
     817                                            // Otherwise, just show as text
     818                                            else {
     819                                                echo '<pre class="font-mono text-xs">' . esc_html($body) . '</pre>';
     820                                            }
     821                                            ?>
     822                                        </div>
     823                                    </div>
     824                                    <?php endif; ?>
     825                                </div>
     826                            </div>
     827                        </div>
    454828                    </div>
    455829                </div>
  • shopkeeper-extender/trunk/dashboard/inc/pages/content/license.php

    r3270472 r3271876  
    484484                                                        <p class="text-sm text-gray-500 mb-2">Follow these steps to locate your purchase code:</p>
    485485                                                        <ol class="text-sm text-gray-600 list-decimal ml-5 mt-2 space-y-2">
    486                                                             <li>Go to <a href="<?php echo esc_url($gbt_dashboard_setup->get_theme_config('theme_customer_support_url')); ?>" target="_blank" class="text-wp-blue hover:underline">theme support page</a> on your Envato account</li>
    487                                                             <li>Navigate to the <strong>Purchase codes</strong> at the bottom of the page</li>
    488                                                             <li>Select the purchase code</li>
    489                                                             <li>Copy the purchase code and paste it in the <strong>Purchase Code</strong> field below</li>
     486                                                            <li>Go to <a href="<?php echo esc_url($gbt_dashboard_setup->get_theme_config('theme_backend_download_url')); ?>" target="_blank" class="text-wp-blue hover:underline">downloads</a> on your Envato account</li>
     487                                                            <li>Click the "Download" button next to <?php echo esc_html($theme_name_gbt_dash); ?> theme</li>
     488                                                            <li>Select "License certificate & purchase code" from the dropdown</li>
     489                                                            <li>Open the downloaded file and copy the <strong>Item Purchase Code</strong></li>
    490490                                                        </ol>
    491491                                                    </div>
     
    494494                                            <div class="mt-5 sm:mt-4 sm:flex sm:flex-row-reverse">
    495495                                                <button type="button" id="close-license-help" class="inline-flex w-full justify-center rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 ring-1 ring-gray-300 hover:ring-gray-400 focus:outline-none focus:ring-2 focus:ring-gray-300 focus:ring-offset-2 sm:mt-0 sm:w-auto transition duration-150 ease-in-out cursor-pointer">Close</button>
    496                                                 <a href="<?php echo esc_url($gbt_dashboard_setup->get_theme_config('theme_customer_support_url')); ?>" target="_blank" class="mt-3 inline-flex w-full justify-center rounded-md bg-wp-blue px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-wp-blue/90 sm:mt-0 sm:w-auto sm:mr-3 transition duration-150 ease-in-out cursor-pointer">Get Your Purchase Code</a>
     496                                                <a href="<?php echo esc_url($gbt_dashboard_setup->get_theme_config('theme_backend_download_url')); ?>" target="_blank" class="mt-3 inline-flex w-full justify-center rounded-md bg-wp-blue px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-wp-blue/90 sm:mt-0 sm:w-auto sm:mr-3 transition duration-150 ease-in-out cursor-pointer">Get Your Purchase Code</a>
    497497                                            </div>
    498498                                        </div>
  • shopkeeper-extender/trunk/dashboard/inc/third/includes/elementor.php

    r3267058 r3271876  
    22
    33defined('ABSPATH') || exit;
     4
     5// Include WordPress plugin API
     6require_once ABSPATH . 'wp-admin/includes/plugin.php';
    47
    58class Elementor_Gbt_Third_Party_Plugin
  • shopkeeper-extender/trunk/shopkeeper-extender.php

    r3270472 r3271876  
    55 * Plugin URI:              https://shopkeeper.wp-theme.design/
    66 * Description:             Extends the functionality of Shopkeeper with theme specific features.
    7  * Version:                 5.2
     7 * Version:                 5.3
    88 * Author:                  Get Bowtied
    99 * Author URI:              https://getbowtied.com
Note: See TracChangeset for help on using the changeset viewer.