Plugin Directory

Changeset 3762702


Ignore:
Timestamp:
10/24/2026 03:34:41 AM (16 hours ago)
Author:
leminhhung
Message:

Update Hung

Location:
handmade-dropshipping-for-etsy-and-woo/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • handmade-dropshipping-for-etsy-and-woo/trunk/CHANGELOG.txt

    r3734180 r3762702  
    11*** HANDMADE - Dropshipping for Etsy and Woo Changelog ***
     2
     32026.10.24 - version 1.0.11
     4- Fixed: Deleting an imported product requires shop management permission, and only the linked WooCommerce product can be removed
     5- Fixed: The setup wizard opens only for administrators
    26
    372026.10.08 - version 1.0.10
  • handmade-dropshipping-for-etsy-and-woo/trunk/admin/imported.php

    r3734180 r3762702  
    681681                        wp_send_json( $response );
    682682                }
    683 //              if ( ! current_user_can( apply_filters( 'villatheme_'.$prefix.'_admin_sub_menu_capability', 'manage_woocommerce', $prefix.'-imported' ) ) ) {
    684 //                      $response['status']  = 'error';
    685 //                      $response['message'] = esc_html__( 'Sorry, You are not allowed to do this. Please check you permission.', 'handmade-dropshipping-for-etsy-and-woo' );
    686 //                      wp_send_json( $response );
    687 //              }
     683                if ( ! current_user_can( apply_filters( 'villatheme_' . $prefix . '_admin_sub_menu_capability', 'manage_woocommerce', $prefix . '-imported' ) ) ) {
     684                        $response['status']  = 'error';
     685                        $response['message'] = esc_html__( 'Sorry, You are not allowed to do this. Please check you permission.', 'handmade-dropshipping-for-etsy-and-woo' );
     686                        wp_send_json( $response );
     687                }
    688688                villatheme_set_time_limit();
    689689
    690         if ( apply_filters( 'villatheme_' . $prefix . '_product_count_in_menu', true ) ||
    691             current_user_can( apply_filters( 'villatheme_' . $prefix . '_admin_sub_menu_capability', 'manage_woocommerce', $prefix . '-imported' ) ) ) {
    692             // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    693             $product_id         = isset( $_POST['product_id'] ) ? absint( wc_clean( wp_unslash( $_POST['product_id'] ) ) ) : '';
    694             // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    695             $woo_product_id     = isset( $_POST['woo_product_id'] ) ? absint( wc_clean( wp_unslash( $_POST['woo_product_id'] ) ) ) : '';
    696             $delete_woo_product = isset( $_POST['delete_woo_product'] ) ? sanitize_text_field( wp_unslash( $_POST['delete_woo_product'] ) ) : '';
    697             if ( $delete_woo_product != self::$settings->get_params( 'delete_woo_product' ) ) {
    698                 $args                       = self::$settings->get_params();
    699                 $args['delete_woo_product'] = $delete_woo_product;
    700                 update_option( 'handmade_params', $args );
    701             }
    702             if ( $product_id ) {
    703                 if ( HANDMADE_Post::get_post( $product_id ) ) {
    704                     $delete = HANDMADE_Post::delete_post( $product_id, true );
    705                     if ( false === $delete ) {
    706                         $response['status']  = 'error';
    707                         $response['message'] = esc_html__( 'Can not delete product', 'handmade-dropshipping-for-etsy-and-woo' );
    708                     }
    709                 }
    710                 $product = wc_get_product($woo_product_id);
    711                 if ( $product) {
    712                     $product->delete_meta_data('_'.$prefix.'_product_id');
    713                     $product->save();
    714                     if ( 1 == $delete_woo_product ) {
    715                         $delete = $product->delete(true);
    716                         if ( false === $delete ) {
    717                             $response['status']  = 'error';
    718                             $response['message'] = esc_html__( 'Can not delete product', 'handmade-dropshipping-for-etsy-and-woo' );
    719                         }
    720                     }
    721                 }
    722             }
    723         }
     690                // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
     691                $product_id         = isset( $_POST['product_id'] ) ? absint( wc_clean( wp_unslash( $_POST['product_id'] ) ) ) : '';
     692                // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
     693                $woo_product_id     = isset( $_POST['woo_product_id'] ) ? absint( wc_clean( wp_unslash( $_POST['woo_product_id'] ) ) ) : '';
     694                $delete_woo_product = isset( $_POST['delete_woo_product'] ) ? sanitize_text_field( wp_unslash( $_POST['delete_woo_product'] ) ) : '';
     695                if ( $delete_woo_product != self::$settings->get_params( 'delete_woo_product' ) ) {
     696                        $args                       = self::$settings->get_params();
     697                        $args['delete_woo_product'] = $delete_woo_product;
     698                        update_option( 'handmade_params', $args );
     699                }
     700                if ( $product_id ) {
     701                        $linked_woo_id = 0;
     702                        if ( HANDMADE_Post::get_post( $product_id ) ) {
     703                                $linked_woo_id = (int) HANDMADE_Post::get_post_meta( $product_id, '_' . $prefix . '_woo_id', true );
     704                                $delete        = HANDMADE_Post::delete_post( $product_id, true );
     705                                if ( false === $delete ) {
     706                                        $response['status']  = 'error';
     707                                        $response['message'] = esc_html__( 'Can not delete product', 'handmade-dropshipping-for-etsy-and-woo' );
     708                                }
     709                        }
     710                        if ( $woo_product_id && $linked_woo_id === (int) $woo_product_id && current_user_can( 'delete_post', $woo_product_id ) ) {
     711                                $product = wc_get_product( $woo_product_id );
     712                                if ( $product ) {
     713                                        $product->delete_meta_data( '_' . $prefix . '_product_id' );
     714                                        $product->save();
     715                                        if ( 1 == $delete_woo_product ) {
     716                                                $delete = $product->delete( true );
     717                                                if ( false === $delete ) {
     718                                                        $response['status']  = 'error';
     719                                                        $response['message'] = esc_html__( 'Can not delete product', 'handmade-dropshipping-for-etsy-and-woo' );
     720                                                }
     721                                        }
     722                                }
     723                        }
     724                }
    724725
    725726                wp_send_json( $response );
  • handmade-dropshipping-for-etsy-and-woo/trunk/admin/recommend.php

    r3734180 r3762702  
    44
    55class HANDMADE_Admin_Recommend {
    6         protected $dismiss;
    7         protected static $settings;
    8 
    9         public function __construct() {
    10                 self::$settings = HANDMADE_DATA::get_instance();
    11                 $this->dismiss  = 'villatheme_'.self::$settings::$prefix.'_install_recommended_plugins_dismiss';
    12                 add_action( 'admin_menu', array( $this, 'admin_menu' ), 30 );
    13                 add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
    14         }
    15 
    16         /**
    17         * Register a custom menu page.
    18         */
    19         public function admin_menu() {
    20                 $menu_slug = self::$settings::$prefix.'-recommend';
    21                 add_submenu_page(
    22                         self::$settings::$prefix,
    23                         sprintf( esc_html__( 'Recommended plugins for %s', 'handmade-dropshipping-for-etsy-and-woo' ), HANDMADE_NAME ),// phpcs:ignore WordPress.WP.I18n.MissingTranslatorsComment
    24                         esc_html__( 'Recommended Plugins', 'handmade-dropshipping-for-etsy-and-woo' ),
    25                         apply_filters( 'villatheme_'.self::$settings::$prefix.'_admin_sub_menu_capability', 'manage_options', $menu_slug ),
    26                         $menu_slug,
    27                         array( $this, 'page_callback' )
    28                 );
    29         }
    30 
    31         public function admin_enqueue_scripts() {
    32                 $page = isset( $_REQUEST['page'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['page'] ) ) : '';
    33                 if ( $page === self::$settings::$prefix.'-recommend' ) {
    34                         wp_dequeue_style( 'eopa-admin-css' );
    35                         self::$settings::remove_other_script();
    36                         self::$settings::enqueue_style(
    37                                 array(
    38                                         'semantic-ui-button',
    39                                         'semantic-ui-segment',
    40                                         'semantic-ui-form',
    41                                         'semantic-ui-icon',
    42                                         'semantic-ui-table'
    43                                 ),
    44                                 array( 'button', 'segment', 'form', 'icon', 'table' ),
    45                                 array( 1, 1, 1, 1, 1 )
    46                         );
     6    protected $dismiss;
     7    protected static $settings;
     8
     9    public function __construct() {
     10        self::$settings = HANDMADE_DATA::get_instance();
     11        $this->dismiss  = 'villatheme_'.self::$settings::$prefix.'_install_recommended_plugins_dismiss';
     12        add_action( 'admin_menu', array( $this, 'admin_menu' ), 30 );
     13        add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
     14    }
     15
     16    /**
     17    * Register a custom menu page.
     18    */
     19    public function admin_menu() {
     20        $menu_slug = self::$settings::$prefix.'-recommend';
     21        add_submenu_page(
     22            self::$settings::$prefix,
     23            sprintf( esc_html__( 'Recommended plugins for %s', 'handmade-dropshipping-for-etsy-and-woo' ), HANDMADE_NAME ),// phpcs:ignore WordPress.WP.I18n.MissingTranslatorsComment
     24            esc_html__( 'Recommended Plugins', 'handmade-dropshipping-for-etsy-and-woo' ),
     25            apply_filters( 'villatheme_'.self::$settings::$prefix.'_admin_sub_menu_capability', 'manage_options', $menu_slug ),
     26            $menu_slug,
     27            array( $this, 'page_callback' )
     28        );
     29    }
     30
     31    public function admin_enqueue_scripts() {
     32        $page = isset( $_REQUEST['page'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['page'] ) ) : '';
     33        if ( $page === self::$settings::$prefix.'-recommend' ) {
     34            wp_dequeue_style( 'eopa-admin-css' );
     35            self::$settings::remove_other_script();
     36            self::$settings::enqueue_style(
     37                array(
     38                    'semantic-ui-button',
     39                    'semantic-ui-segment',
     40                    'semantic-ui-form',
     41                    'semantic-ui-icon',
     42                    'semantic-ui-table'
     43                ),
     44                array( 'button', 'segment', 'form', 'icon', 'table' ),
     45                array( 1, 1, 1, 1, 1 )
     46            );
    4747            wp_add_inline_style('villatheme-support','.fist-col {min-width: 300px;}.vi-wad-plugin-name {font-weight: 600;}.vi-wad-plugin-name a {text-decoration: none;}');
    48                 } elseif (strpos( $page , self::$settings::$prefix ) === 0 ) {
     48        } elseif (strpos( $page , self::$settings::$prefix ) === 0 ) {
    4949            $prefix = self::$settings::$prefix;
    50                         $dismiss_nonce = isset( $_REQUEST[$prefix.'_dismiss_nonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST[$prefix.'_dismiss_nonce'] ) ) : '';
    51                         if ( wp_verify_nonce( $dismiss_nonce,  $prefix.'_dismiss_nonce' ) && ! get_option( $this->dismiss ) ) {
    52                                 update_option( $this->dismiss , time() );
    53                         }
     50            $dismiss_nonce = isset( $_REQUEST[$prefix.'_dismiss_nonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST[$prefix.'_dismiss_nonce'] ) ) : '';
     51            if ( wp_verify_nonce( $dismiss_nonce,  $prefix.'_dismiss_nonce' ) && ! get_option( $this->dismiss ) ) {
     52                update_option( $this->dismiss , time() );
     53            }
    5454            if (! get_option( $this->dismiss ) ) {
    55                     add_action( 'admin_notices', array( $this, 'admin_notices' ) );
    56             }
    57                 }
    58         }
    59 
    60         public function admin_notices() {
    61                 global $pagenow;
     55                add_action( 'admin_notices', array( $this, 'admin_notices' ) );
     56            }
     57        }
     58    }
     59
     60    public function admin_notices() {
     61        global $pagenow;
    6262        if ( $pagenow === 'update.php'){
    6363            return;
    6464        }
    65                 $recommended_plugins = HANDMADE_Admin_Setup_Wizard::recommended_plugins();
     65        $recommended_plugins = HANDMADE_Admin_Setup_Wizard::recommended_plugins();
    6666        $notices =[];
    6767        $prefix = self::$settings::$prefix;
    68                 foreach ( $recommended_plugins as $recommended_plugin ) {
    69                         $plugin_slug = $recommended_plugin['slug'];
     68        foreach ( $recommended_plugins as $recommended_plugin ) {
     69            $plugin_slug = $recommended_plugin['slug'];
    7070            if (empty( $recommended_plugin['message_not_install'] ) && empty( $recommended_plugin['message_not_active'] )){
    7171                continue;
    7272            }
    73                         if ( ! get_option( "{$this->dismiss}__{$plugin_slug}" ) ) {
     73            if ( ! get_option( "{$this->dismiss}__{$plugin_slug}" ) ) {
    7474                $pro_install = false;
    75                                 $button = '';
    76                                 if ( ! empty( $recommended_plugin['pro'] )  ) {
    77                                         $plugin_status =install_plugin_install_status( [
    78                                                 'slug' => $recommended_plugin['pro'],
    79                                                 'name' => $recommended_plugin['name'],
    80                                                 'version' => '',
    81                                         ]);
     75                $button = '';
     76                if ( ! empty( $recommended_plugin['pro'] )  ) {
     77                    $plugin_status =install_plugin_install_status( [
     78                        'slug' => $recommended_plugin['pro'],
     79                        'name' => $recommended_plugin['name'],
     80                        'version' => '',
     81                    ]);
    8282                    if ($plugin_status['status'] !== 'install'){
    8383                        $pro_install = true;
    8484                        $pro_file = "{$recommended_plugin['pro']}/{$recommended_plugin['pro']}.php";
    85                             if ( ! empty( $recommended_plugin['message_not_active'] ) && ! is_plugin_active( $pro_file) ){
     85                        if ( ! empty( $recommended_plugin['message_not_active'] ) && ! is_plugin_active( $pro_file) ){
    8686                            if (current_user_can( 'activate_plugin',$pro_file)) {
    87                                     $button = sprintf( '<br><br> <a href="%s" target="_blank" class="button button-primary">%s %s</a>',
    88                                             esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'activate', 'plugin' => $plugin_status['file'] ), self_admin_url( 'plugins.php' ) ), "activate-plugin_{$plugin_status['file']}" ) ),
    89                                             esc_html__( 'Activate', 'handmade-dropshipping-for-etsy-and-woo' ),
    90                                             $recommended_plugin['name']);
     87                                $button = sprintf( '<br><br> <a href="%s" target="_blank" class="button button-primary">%s %s</a>',
     88                                    esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'activate', 'plugin' => $plugin_status['file'] ), self_admin_url( 'plugins.php' ) ), "activate-plugin_{$plugin_status['file']}" ) ),
     89                                    esc_html__( 'Activate', 'handmade-dropshipping-for-etsy-and-woo' ),
     90                                    $recommended_plugin['name']);
    9191                            }
    9292                            $notices[]= $recommended_plugin['message_not_active'] . $button;
    93                             }
     93                        }
    9494                    }
    95                                 }
     95                }
    9696                if ($pro_install ){
    9797                    continue;
    9898                }
    99                                 $plugin_status =install_plugin_install_status( [
    100                                         'slug' => $plugin_slug,
    101                                         'name' => $recommended_plugin['name'],
    102                                         'version' => '',
    103                                 ]);
    104                                 if ($plugin_status['status'] === 'install' && ! empty( $recommended_plugin['message_not_install'] ) ){
    105                                         if ( current_user_can( 'install_plugins' )  ) {
    106                                                 $button = sprintf( '<br><br> <a href="%s" target="_blank" class="button button-primary">%s %s</a>',
    107                                                         esc_url( wp_nonce_url( network_admin_url( "update.php?action=install-plugin&plugin={$plugin_slug}" ), "install-plugin_{$plugin_slug}" ) ),
    108                                                         esc_html__( 'Install', 'handmade-dropshipping-for-etsy-and-woo' ),
    109                                                         $recommended_plugin['name']);
    110                                         }
    111                                         $notices[] = $recommended_plugin['message_not_install']. $button;
    112                                 }elseif ( ! empty( $recommended_plugin['message_not_active'] ) && !empty($plugin_status['file']) && ! is_plugin_active( $plugin_status['file'] ) ){
     99                $plugin_status =install_plugin_install_status( [
     100                    'slug' => $plugin_slug,
     101                    'name' => $recommended_plugin['name'],
     102                    'version' => '',
     103                ]);
     104                if ($plugin_status['status'] === 'install' && ! empty( $recommended_plugin['message_not_install'] ) ){
     105                    if ( current_user_can( 'install_plugins' )  ) {
     106                        $button = sprintf( '<br><br> <a href="%s" target="_blank" class="button button-primary">%s %s</a>',
     107                            esc_url( wp_nonce_url( network_admin_url( "update.php?action=install-plugin&plugin={$plugin_slug}" ), "install-plugin_{$plugin_slug}" ) ),
     108                            esc_html__( 'Install', 'handmade-dropshipping-for-etsy-and-woo' ),
     109                            $recommended_plugin['name']);
     110                    }
     111                    $notices[] = $recommended_plugin['message_not_install']. $button;
     112                }elseif ( ! empty( $recommended_plugin['message_not_active'] ) && !empty($plugin_status['file']) && ! is_plugin_active( $plugin_status['file'] ) ){
    113113                    if ( current_user_can( 'activate_plugin', $plugin_status['file'] )) {
    114                             $button = sprintf( '<br><br> <a href="%s" target="_blank" class="button button-primary">%s %s</a>',
    115                                     esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'activate', 'plugin' => $plugin_status['file'] ), self_admin_url( 'plugins.php' ) ), "activate-plugin_{$plugin_status['file']}" ) ),
    116                                     esc_html__( 'Activate', 'handmade-dropshipping-for-etsy-and-woo' ),
    117                                     $recommended_plugin['name']);
     114                        $button = sprintf( '<br><br> <a href="%s" target="_blank" class="button button-primary">%s %s</a>',
     115                            esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'activate', 'plugin' => $plugin_status['file'] ), self_admin_url( 'plugins.php' ) ), "activate-plugin_{$plugin_status['file']}" ) ),
     116                            esc_html__( 'Activate', 'handmade-dropshipping-for-etsy-and-woo' ),
     117                            $recommended_plugin['name']);
    118118                    }
    119                                         $notices[]= $recommended_plugin['message_not_active'] . $button;
    120                                 }
    121                         }
    122                 }
     119                    $notices[]= $recommended_plugin['message_not_active'] . $button;
     120                }
     121            }
     122        }
    123123        if (!empty($notices)){
    124124            ?>
    … …  
    126126                <?php
    127127                if (count($notices) > 1){
    128                         printf( "<p>%s will work better with:</p>", wp_kses_post(HANDMADE_NAME ));
     128                    printf( "<p>%s will work better with:</p>", wp_kses_post(HANDMADE_NAME ));
    129129                    ?>
    130130                    <ol>
    131131                        <?php
    132132                        foreach ( $notices as $notice ) {
    133                                 printf( "<li>%s</li>", wp_kses_post( $notice ) );
     133                            printf( "<li>%s</li>", wp_kses_post( $notice ) );
    134134                        }
    135135                        ?>
    … …  
    147147            <?php
    148148        }
    149         }
    150 
    151         public function page_callback() {
    152                 $plugins = HANDMADE_Admin_Setup_Wizard::recommended_plugins();
    153                 ?>
     149    }
     150
     151    public function page_callback() {
     152        $plugins = HANDMADE_Admin_Setup_Wizard::recommended_plugins();
     153        ?>
    154154        <div class="wrap">
    155155            <h2><?php esc_html_e( 'Recommended plugins', 'handmade-dropshipping-for-etsy-and-woo' ) ?></h2>
    … …  
    163163                </thead>
    164164                <tbody>
    165                                 <?php
    166                                 $installed_plugins = get_plugins();
    167                                 foreach ( $plugins as $plugin ) {
    168                                         $plugin_id = "{$plugin['slug']}/{$plugin['slug']}.php";
    169                                         ?>
     165                <?php
     166                $installed_plugins = get_plugins();
     167                foreach ( $plugins as $plugin ) {
     168                    $plugin_id = "{$plugin['slug']}/{$plugin['slug']}.php";
     169                    ?>
    170170                    <tr>
    171171                        <td>
    … …  
    183183                            </div>
    184184                            <div>
    185                                                                 <?php
    186                                                                 if ( ! isset( $installed_plugins[ $plugin_id ] ) ) {
    187                                                                         if ( current_user_can( 'install_plugins' ) ) {
    188                                                                                 ?>
     185                                <?php
     186                                if ( ! isset( $installed_plugins[ $plugin_id ] ) ) {
     187                                    if ( current_user_can( 'install_plugins' ) ) {
     188                                        ?>
    189189                                        <a href="<?php echo esc_url( wp_nonce_url( self_admin_url( "update.php?action=install-plugin&plugin={$plugin['slug']}" ), "install-plugin_{$plugin['slug']}" ) ) ?>"
    190190                                           target="_blank">
    191                                                                                         <?php esc_html_e( 'Install', 'handmade-dropshipping-for-etsy-and-woo' ); ?>
     191                                            <?php esc_html_e( 'Install', 'handmade-dropshipping-for-etsy-and-woo' ); ?>
    192192                                        </a>
    193                                                                                 <?php
    194                                                                         } else {
    195                                                                                 esc_html_e( 'Not installed', 'handmade-dropshipping-for-etsy-and-woo' );
    196                                                                         }
    197                                                                 } elseif ( ! is_plugin_active( $plugin_id ) ) {
    198                                                                         if ( current_user_can( 'activate_plugins' ) ) {
    199                                                                                 ?>
     193                                        <?php
     194                                    } else {
     195                                        esc_html_e( 'Not installed', 'handmade-dropshipping-for-etsy-and-woo' );
     196                                    }
     197                                } elseif ( ! is_plugin_active( $plugin_id ) ) {
     198                                    if ( current_user_can( 'activate_plugins' ) ) {
     199                                        ?>
    200200                                        <a href="<?php echo esc_url( wp_nonce_url( add_query_arg( [
    201                                                                                         'action' => 'activate',
    202                                                                                         'plugin' => $plugin_id
    203                                                                                 ], admin_url( 'plugins.php' ) ), "activate-plugin_{$plugin_id}" ) ) ?>"
     201                                            'action' => 'activate',
     202                                            'plugin' => $plugin_id
     203                                        ], admin_url( 'plugins.php' ) ), "activate-plugin_{$plugin_id}" ) ) ?>"
    204204                                           target="_blank">
    205                                                                                         <?php esc_html_e( 'Activate', 'handmade-dropshipping-for-etsy-and-woo' ); ?>
     205                                            <?php esc_html_e( 'Activate', 'handmade-dropshipping-for-etsy-and-woo' ); ?>
    206206                                        </a>
    207                                                                                 <?php
    208                                                                         } else {
    209                                                                                 esc_html_e( 'Inactive', 'handmade-dropshipping-for-etsy-and-woo' );
    210                                                                         }
    211                                                                 } else {
    212                                                                         esc_html_e( 'Currently active', 'handmade-dropshipping-for-etsy-and-woo' );
    213                                                                 }
    214                                                                 ?>
     207                                        <?php
     208                                    } else {
     209                                        esc_html_e( 'Inactive', 'handmade-dropshipping-for-etsy-and-woo' );
     210                                    }
     211                                } else {
     212                                    esc_html_e( 'Currently active', 'handmade-dropshipping-for-etsy-and-woo' );
     213                                }
     214                                ?>
    215215                            </div>
    216216                        </td>
    217217                        <td><?php echo esc_html( $plugin['desc'] ) ?></td>
    218218                    </tr>
    219                                         <?php
    220                                 }
    221                                 ?>
     219                    <?php
     220                }
     221                ?>
    222222                </tbody>
    223223            </table>
    224224        </div>
    225                 <?php
    226         }
     225        <?php
     226    }
    227227}
  • handmade-dropshipping-for-etsy-and-woo/trunk/admin/settings.php

    r3425726 r3762702  
    444444                }
    445445        // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    446         elseif ( isset( $_GET['handmade_setup_wizard'], $_GET['_wpnonce'] ) && ! empty( $_GET['handmade_setup_wizard'] ) && wp_verify_nonce( wc_clean( wp_unslash( $_GET['_wpnonce'] ) ), 'handmade_setup' )) {
     446        elseif ( current_user_can( 'manage_options' ) && isset( $_GET['handmade_setup_wizard'], $_GET['_wpnonce'] ) && ! empty( $_GET['handmade_setup_wizard'] ) && wp_verify_nonce( wc_clean( wp_unslash( $_GET['_wpnonce'] ) ), 'handmade_setup' )) {
    447447                        $enqueue = true;
    448448                }
  • handmade-dropshipping-for-etsy-and-woo/trunk/handmade-dropshipping-for-etsy-and-woo.php

    r3734180 r3762702  
    44 * Plugin URI: https://villatheme.com/extensions/handmade-dropshipping-for-etsy-and-woo/
    55 * Description: Transfer data from Etsy products to WooCommerce effortlessly.
    6  * Version: 1.0.10
     6 * Version: 1.0.11
    77 * Author: VillaTheme
    88 * Author URI: https://villatheme.com
    … …  
    2424
    2525if ( ! defined( 'HANDMADE_VERSION' ) ) {
    26         define( 'HANDMADE_VERSION', '1.0.10' );
     26        define( 'HANDMADE_VERSION', '1.0.11' );
    2727        define( 'HANDMADE_NAME', 'HANDMADE - Dropshipping for Etsy and WooCommerce' );
    2828        define( 'HANDMADE_BASENAME', plugin_basename( __FILE__ ) );
    … …  
    4848                add_action( 'activated_plugin', array( $this, 'after_activated' ), 10, 2 );
    4949                add_action( 'plugins_loaded', array( $this, 'check_environment' ) );
     50
     51//        add_filter( 'http_request_args', function( $parsed_args, $url ) {
     52//            if ( strpos( $url, 'localhost' ) !== false || strpos( $url, '127.0.0.1' ) !== false ) {
     53//                $parsed_args['sslverify'] = false;
     54//            }
     55//            return $parsed_args;
     56//        }, 10, 2 );
    5057        }
    5158
    … …  
    8289                        return;
    8390                }
    84                 if ( get_option( 'handmade_setup_wizard' ) &&
     91                if ( current_user_can( 'manage_options' ) && get_option( 'handmade_setup_wizard' ) &&
    8592                      ( ! empty( $_GET['page'] ) && strpos( sanitize_text_field( wp_unslash( $_GET['page'] ) ), "handmade" ) === 0 )  ) {// phpcs:ignore WordPress.Security.NonceVerification.Recommended
    8693                        $url = add_query_arg( [
  • handmade-dropshipping-for-etsy-and-woo/trunk/readme.txt

    r3734180 r3762702  
    228228
    229229== Changelog ==
     2302026.10.24 - version 1.0.11
     231- Fixed: Deleting an imported product requires shop management permission, and only the linked WooCommerce product can be removed
     232- Fixed: The setup wizard opens only for administrators
     233
    2302342026.10.08 - version 1.0.10
    231235- Fixed: Setup wizard installs recommended plugins only for administrators who can install and activate plugins
Note: See TracChangeset for help on using the changeset viewer.