Plugin Directory

Changeset 3757721


Ignore:
Timestamp:
10/21/2026 05:05:14 AM (3 weeks ago)
Author:
importify
Message:

Release 1.0.21: Plugin Version check with one-click update, install refusal reason shown on the setup page

Location:
importify/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • importify/trunk/importify.php

    r3756082 r3757721  
    88 * Plugin Name: Importify
    99 * Description: Easily import best-selling products, and automate your entire dropshipping process, all with a single click.
    10  * Version: 1.0.20
     10 * Version: 1.0.21
    1111 * Author: Importify
    1212 * Author URI: https://www.importify.com/
    … …  
    2424
    2525define("IMPORTIFY_API_URL", "https://app.importify.net/dashboard");
    26 define('IMPORTIFY_VERSION', '1.0.20');
     26define('IMPORTIFY_VERSION', '1.0.21');
     27define('IMPORTIFY_BASENAME', plugin_basename(__FILE__));
    2728define('IMPORTIFY_PATH', dirname(__FILE__));
    2829define('IMPORTIFY_FOLDER', basename(IMPORTIFY_PATH));
    … …  
    176177        delete_option('importify_error');
    177178        delete_option('importify_error_message');
     179        delete_option('importify_install_message');
    178180        importify_save_api_key(isset($response['api_key']) ? $response['api_key'] : '');
    179181
    … …  
    190192    if ($response) {
    191193        update_option('importify_error_message', isset($response['message']) ? $response['message'] : 'Error activation plugin!');
     194        // 1.0.21: Importify's reason for refusing the install, shown on the setup page (the status check
     195        // overwrites importify_error_message on every load)
     196        if (!empty($response['message'])) update_option('importify_install_message', sanitize_text_field($response['message']));
    192197    } else {
    193198        update_option('importify_error_message', 'Could not connect to Importify server. Please check your internet connection and try again.');
    … …  
    217222    delete_option('importify_last_error');
    218223    delete_option('importify_wc_key_id');
     224    delete_option('importify_install_message');
    219225    delete_transient('importify_status');
    220226
    … …  
    280286        delete_option('importify_error');
    281287        delete_option('importify_error_message');
     288        delete_option('importify_install_message');
    282289        importify_save_api_key(isset($response['api_key']) ? $response['api_key'] : '');
    283290        $status['account'] = 'ok';
    … …  
    312319    set_transient('importify_status', $status, IMPORTIFY_STATUS_TTL);
    313320    return $status;
     321}
     322
     323/**
     324 * 1.0.21: the newer Importify version WordPress already knows about (its own plugin update check),
     325 * or null when this copy is up to date. No request to Importify.
     326 */
     327function importify_update_info()
     328{
     329    $updates = get_site_transient('update_plugins');
     330    if (!is_object($updates) || empty($updates->response[IMPORTIFY_BASENAME])) return null;
     331    $u = $updates->response[IMPORTIFY_BASENAME];
     332    $new = is_object($u) && !empty($u->new_version) ? (string)$u->new_version : '';
     333    if ($new === '' || version_compare($new, IMPORTIFY_VERSION, '<=')) return null;
     334    $url = current_user_can('update_plugins')
     335        ? wp_nonce_url(self_admin_url('update.php?action=upgrade-plugin&plugin=' . rawurlencode(IMPORTIFY_BASENAME)), 'upgrade-plugin_' . IMPORTIFY_BASENAME)
     336        : '';
     337    return array('version' => $new, 'url' => $url);
    314338}
    315339
  • importify/trunk/readme.txt

    r3756082 r3757721  
    55Requires PHP: 7.2
    66Tested up to: 7.0
    7 Stable tag: 1.0.20
     7Stable tag: 1.0.21
    88Plugin URI: https://importify.com
    99License: GPLv2 or later
    … …  
    383383== Changelog ==
    384384
     385= 1.0.21 =
     386* NEW: The setup page shows a Plugin Version check. When a newer Importify is available, it says so and links to the one-click update.
     387* NEW: When Importify can't reconnect a reinstalled store (for example, the WordPress admin email changed), the API Connection check shows Importify's reason and the next step, such as approving the store from the email sent to the account owner.
     388
    385389= 1.0.20 =
    386390* SECURITY: The settings page now proves which Importify account it belongs to before Importify answers with account details, and reconnecting after a reinstall is verified with WooCommerce keys that work on your store.
  • importify/trunk/views/importify_admin_page.php

    r3756082 r3757721  
    55/**
    66 * Importify settings page, 1.0.20 (Claude Design "Importify WooCommerce Plugin Settings").
    7  * Header, account strip, one card with seven checks, footer actions. System fonts and inline SVG icons.
     7 * Header, account strip, one card with eight checks, footer actions. System fonts and inline SVG icons.
    88 * Inputs: $importify_status (importify_get_status) and the importify_check option, both set by
    99 * importify_admin_menu_page_html().
    … …  
    3333    'cf'   => 'M7 18h10.5a4 4 0 00.6-7.95A6 6 0 006.3 9.5 4.3 4.3 0 007 18z',
    3434    'api'  => 'M9 3v5M15 3v5M6 8h12v3a6 6 0 01-12 0zM12 17v4',
     35    'ver'  => 'M4 12a8 8 0 0114-5.3L20 9M20 4v5h-5M20 12a8 8 0 01-14 5.3L4 15M4 20v-5h5',
    3536);
    3637$importify_pill_icons = array('pass' => 'M3.5 8.3l3 3 6-6.6', 'fail' => 'M4.5 4.5l7 7M11.5 4.5l-7 7', 'info' => 'M8 7.2v4.6M8 4.4v.1');
    … …  
    4041}
    4142
    42 /* ── The seven checks: [id, name, state pass|fail|info, description, pill (null = Passed/Failed), steps, guide] ── */
     43/* ── The eight checks: [id, name, state pass|fail|info, description, pill (null = Passed/Failed), steps, guide] ── */
    4344$checks = array();
    4445
    … …  
    9495    $conn = array('fail', 'No answer');
    9596} elseif ($st['account'] === 'not_found') {
    96     $api = array('fail', 'Importify couldn’t find an account for this store’s plugin key.', 'Account not found', $reconnect_steps);
    97     $conn = array('fail', 'Account not found');
     97    // 1.0.21: when Importify refused the install, show its reason (e.g. the approval email it sent)
     98    $install_msg = (string)get_option('importify_install_message', '');
     99    if ($install_msg !== '') {
     100        $api = array('fail', $install_msg, 'Not connected', stripos($install_msg, 'emailed') !== false
     101            ? array('Open the email sent to the account owner and click Approve this store.', 'Go to Plugins → Installed Plugins, click Deactivate under Importify, then Activate.', 'Come back here and re-run the checks.')
     102            : array('Contact us at <a href="https://www.importify.com/contact/" target="_blank" rel="noopener noreferrer">importify.com/contact</a> and we’ll reconnect this store.'));
     103    } else {
     104        $api = array('fail', 'Importify couldn’t find an account for this store’s plugin key.', 'Account not found', $reconnect_steps);
     105    }
     106    $conn = array('fail', $install_msg !== '' ? 'Not connected' : 'Account not found');
    98107} elseif ($st['connected'] !== 'yes') {
    99108    $api = array('fail', 'Importify doesn’t have access to your WooCommerce store yet.', 'Not connected',
    … …  
    113122$checks[] = array('api', 'API Connection', $api[0], $api[1], $api[2], $api[3], $api[0] === 'fail' ? $guide_connection : '');
    114123
     124// 1.0.21: plugin version, from WordPress's own update check (importify_update_info)
     125$upd = importify_update_info();
     126$checks[] = array('ver', 'Plugin Version', $upd ? 'info' : 'pass',
     127    $upd ? sprintf('Version %s is available. You have %s.', $upd['version'], IMPORTIFY_VERSION) : sprintf('Importify %s is the latest version.', IMPORTIFY_VERSION),
     128    $upd ? 'Update available' : null,
     129    $upd ? ($upd['url'] !== ''
     130        ? array('<a href="' . esc_url($upd['url']) . '">Update Importify now</a>. It takes a few seconds and keeps your settings.', 'Come back here and re-run the checks.')
     131        : array('Ask a site administrator to update Importify in Plugins → Installed Plugins.'))
     132        : array(),
     133    '');
     134
    115135/* ── Preview overrides (support tool, admin-only): ?error1=preview … ?error7=preview, ?preview=all, ?preview=mixed ── */
    116136$importify_preview_map = array(
    … …  
    122142    5 => array('info', 'Cloudflare detected. Its bot protection can block Importify.', 'Detected'),
    123143    6 => array('fail', 'Importify couldn’t find an account for this store’s plugin key.', 'Account not found'),
     144    7 => array('info', 'Version 9.9.9 is available. You have ' . IMPORTIFY_VERSION . '.', 'Update available'),
    124145);
    125146$importify_preview = isset($_GET['preview']) ? sanitize_key(wp_unslash($_GET['preview'])) : '';
    … …  
    147168if ($ok) {
    148169    $headline = 'Your store is ready for Importify';
    149     $sub = $infos ? 'All required checks passed. Blue items are worth a look but won’t stop imports.' : 'All 7 checks passed. You can start importing products.';
    150     $summary = $infos ? sprintf('%d passed · %d to review', $passed, $infos) : '7 of 7 passed';
     170    $sub = $infos ? 'All required checks passed. Blue items are worth a look but won’t stop imports.' : sprintf('All %d checks passed. You can start importing products.', count($checks));
     171    $summary = $infos ? sprintf('%d passed · %d to review', $passed, $infos) : sprintf('%d of %d passed', count($checks), count($checks));
    151172} else {
    152173    $headline = $fails === 1 ? '1 issue needs fixing before you import' : sprintf('%d issues need fixing before you import', $fails);
    … …  
    164185);
    165186$recheck_url = wp_nonce_url(admin_url('admin.php?page=importify&importify_recheck=1'), 'importify_recheck');
    166 $step_tags = array('code' => array(), 'em' => array(), 'strong' => array());
     187$step_tags = array('code' => array(), 'em' => array(), 'strong' => array(), 'a' => array('href' => array(), 'target' => array(), 'rel' => array()));
    167188?>
    168189<div id="importify-setup-wrap" class="wrap">
    … …  
    172193    <?php if ($importify_any_preview): ?>
    173194    <div class="imf-preview" role="note">
    174         <span>Preview mode: showing simulated data. <a href="<?php echo esc_url(remove_query_arg(array('preview', 'error1', 'error2', 'error3', 'error4', 'error5', 'error6', 'error7'))); ?>">Exit preview</a></span>
     195        <span>Preview mode: showing simulated data. <a href="<?php echo esc_url(remove_query_arg(array('preview', 'error1', 'error2', 'error3', 'error4', 'error5', 'error6', 'error7', 'error8'))); ?>">Exit preview</a></span>
    175196    </div>
    176197    <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.