Forum Replies Created

Viewing 15 replies - 16 through 30 (of 584 total)
  • Thread Starter brasofilo

    (@brasofilo)

    @pigglydev

    Curiosamente a fun??o $order->payment_complete(); n?o está atualizando o status do pedido. Ela retorna true mas o status continua sendo “Comprovante Pix Recebido”.

    Estou fazendo isto porém n?o encontrei referências quanto ao uso correto do método payment_complete():

    if ( $order ) { 
        $order->update_status( 'completed' );
        $order->payment_complete(); 
    }

    [edit]
    Acabo de testar no live site e ele dispara duas vezes a mensagem de Telegram (pra mim) sobre o faturamento concluído.
    Para o cliente, só um email foi enviado avisando da conclus?o…

    • This reply was modified 3 years, 10 months ago by brasofilo.
    Thread Starter brasofilo

    (@brasofilo)

    Oi @marcelosanches e @pigglydev,
    muito obrigado pelo feedback, agradecido mesmo ??

    O tro?o tá t?o corrido que esqueci de ver as respostas aqui.

    Bem que notei algumas inconsistências no comportamento. Vou trocar o código imediatamente.
    Com certeza que existe o risco do cliente enviar qualquer JPG/PNG, mas por enquanto vamos correr o risco e ver o que acontece.

    Quanto ao functions.php, n?o é o lugar pra ficar acrescentando essas coisas. é o que todo mundo faz? Sim. N?o quer dizer que é o correto. Tema é pra design, plugin é pra funcionalidades extras.

    Anyway, obrigad?o de novo!

    The function that shows the admin_notice is located on Loader.php:

    /**
     * Verifies which plugin version is being used. If WooCommerce Admin is installed and activated but not in use
     * it will show a warning.
     */
    public static function is_using_installed_wc_admin_plugin() {
    	if ( PluginsHelper::is_plugin_active( 'woocommerce-admin' ) ) {
    		$path = PluginsHelper::get_plugin_data( 'woocommerce-admin' );
    		if ( WC_ADMIN_VERSION_NUMBER !== $path['Version'] ) {
    			add_action(
    				'admin_notices',

    I don’t undersand why this error, if they’re indeed the same:

    FeaturePlugin.php: $this->define( 'WC_ADMIN_VERSION_NUMBER', '2.2.5' );

    woocommerce-admin.php: Version: 2.2.5

    [edit]
    Donnow what’s going on, but I’m disabling this notice on Loader.php, and it keeps appearing!… it’s mental, I better go sleep

    • This reply was modified 3 years, 10 months ago by brasofilo.
    Thread Starter brasofilo

    (@brasofilo)

    Another thing that needs fixing is your enqueue_scripts, it needs to check for $pagenow == 'upload.php'.
    Right now, it’s being encoded all over the admin and could affect something unrelated. And you put 2 actions to enqueue when only 1 is needed, change ‘wp_enqueue_scripts’ and ‘admin_init’ for ‘admin_enqueue_scripts’

    Also, please review the function umbu_media(), this line doesn’t have brackets (it’s not clear if it should affect only the next command or all of them):

    if ( $pagenow == 'upload.php' )

    Maybe you mean if ( $pagenow != 'upload.php' ) return; ?

    Finally, I just found another error, the action post-plupload-upload-ui is leaking on a WooCommerce page (edit.php?post_type=shop_order, maybe others), not sure how to solve it though… I tried to move it inside load-upload.php but it didn’t work.

    • This reply was modified 4 years, 1 month ago by brasofilo.
    • This reply was modified 4 years, 1 month ago by brasofilo.
    Thread Starter brasofilo

    (@brasofilo)

    Here’s the template.php I ended up writing, I cleaned and simplified the original one, adding OpenGraph meta tags:

    
    <?php
    /**
    * Custom template for the MyLinks page.
    */
    
    function g_meta($item){
        return get_post_meta( get_the_ID(), mylinks_prefix($item), true );
    }
    
    function g_social($social, $icon, $def_icon){
        if(empty($social)) return;
        printf(
            '<a href="%s" target="_blank" class="user-profile-link" rel="noopener noreferrer nofollow">',
            esc_html( $social )
        );
        if ( empty( $icon ) ) 
            printf(
                '<img align="middle" class="mylinks-social-icons" width="32" height="32" src="%s">',
                esc_url( plugins_url( "/wp-mylinks/public/images/{$def_icon}" ) )
            );
        else
            printf(
                '<img align="middle" class="mylinks-social-icons" width="32" height="32" src="%s">',
                esc_html( $icon )
            );
        echo '</a>';
    }
    
    $avatar = g_meta('avatar');
    $name = g_meta('name');
    $description = g_meta('description');
    
    # Check The SEO Framework names: https://github.com/sybrew/the-seo-framework/issues/169
    $seo_title = get_post_meta($post->ID, '_genesis_title', true );
    $my_title  = g_meta('meta-title');
    if (!empty($seo_title)) $meta_title = $seo_title;
    elseif (!empty($my_title)) $meta_title = $my_title;
    else $meta_title = get_option(sanitize_text_field('mylinks_meta_title'));
    
    $seo_desc = get_post_meta($post->ID, '_genesis_description', true );
    $my_desc = g_meta('meta-description');
    if (!empty($seo_desc)) $meta_description = $seo_desc;
    elseif (!empty($my_desc)) $meta_description = $my_desc;
    else $meta_description = get_option(sanitize_text_field('mylinks_meta_description'));
    
    $seo_url = get_post_meta($post->ID, '_genesis_canonical_url', true );
    if (!empty($seo_url)) $meta_canonical = $seo_url;
    else $meta_canonical = get_permalink();
    
    $seo_img = get_post_meta($post->ID, '_social_image_url', true );
    if (!empty($seo_img)) $meta_image = $seo_img;
    else $meta_image = $avatar;
    
    $meta_sitename = get_bloginfo( 'name' );
    
    $seo_noindex = get_post_meta($post->ID, '_genesis_noindex', true );
    $my_post_noindex = g_meta('noindex');
    $my_site_noindex = get_option(sanitize_text_field('wp_mylinks_noindex'));
    if (!empty($seo_noindex)) $set_noindex = $seo_noindex;
    elseif(!empty($my_post_noindex)) $set_noindex = $my_post_noindex;
    else $set_noindex = $my_site_noindex;
    
    $seo_nofollow = get_post_meta($post->ID, '_genesis_nofollow', true );
    $my_post_nofollow = g_meta('nofollow');
    $my_site_nofollow = get_option(sanitize_text_field('wp_mylinks_nofollow'));
    if (!empty($seo_nofollow)) $set_nofollow = $seo_nofollow;
    elseif(!empty($my_post_nofollow)) $set_nofollow = $my_post_nofollow;
    else $set_nofollow = $my_site_nofollow;
    
    $noindex = $set_noindex === "yes" ? "noindex" : "index";
    $nofollow = $set_nofollow === "yes" ? "nofollow" : "follow";
    
    $analytics_script = get_option(sanitize_text_field('wp_mylinks_analytics'));
    if ($header_script = g_meta('mylinks-single-custom-header-script'));
    else $header_script = get_option(sanitize_text_field('wp_mylinks_header_script'));
    
    if ($custom_css = g_meta('mylinks-single-custom-styles'));
    else $custom_css = get_option(sanitize_text_field('wp_mylinks_custom_css'));
    
    $theme_value =  get_option( 'mylinks_theme' ); 
    
    $options = wp_mylinks_theme_callback();
    $key = g_meta('theme');
    $option_name = isset( $options[ $key ] ) ? $options[ $key ] : $options['default'];
    
    $facebook_url = g_meta('facebook-url');
    $facebook_icon = g_meta('facebook-icon');
    $twitter_url = g_meta('twitter-url');
    $twitter_icon = g_meta('twitter-icon');
    $linkedin_url = g_meta('linkedin-url');
    $linkedin_icon = g_meta('linkedin-icon');
    $instagram_url = g_meta('instagram-url');
    $instagram_icon = g_meta('instagram-icon');
    $youtube_url = g_meta('youtube-url');
    $youtube_icon = g_meta('youtube-icon');
    $pinterest_url = g_meta('pinterest-url');
    $pinterest_icon = g_meta('pinterest-icon');
    $tiktok_url = g_meta('tiktok-url');
    $tiktok_icon = g_meta('tiktok-icon');
    
    $links = g_meta('links');
    
    if ($footer_script = g_meta('mylinks-single-custom-footer-script'));
    else $footer_script = get_option(sanitize_text_field('wp_mylinks_footer_script'));
    
    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head> 
    <meta charset="<?php bloginfo( 'charset' ); ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="profile" href="https://gmpg.org/xfn/11">
    <link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' ) ); ?>">
    <link rel="canonical" href="<?php echo $meta_canonical; ?>" />
    <!-- Start Favicon -->
    <?php $single_favicon = g_meta('single-favicon'); ?>
    <?php $global_favicon = get_option('mylinks_upload_favicon'); ?>
    <?php if ( empty( $single_favicon ) ) : ?>
        <link rel="icon" type="image/png" href="<?php echo esc_html( $global_favicon ); ?>">
    <?php else : ?>
        <link rel="icon" type="image/png" href="<?php echo esc_html( $single_favicon ); ?>">
    <?php endif; ?>
    <!-- End Favicon -->
    <title><?php echo $meta_title; ?></title>
    <meta name="description" content="<?php echo $meta_description; ?>">
    <meta name="robots" content="<?php echo $noindex ?>, <?php echo $nofollow ?>" />
    <meta name="googlebot" content="<?php echo $noindex ?>, <?php echo $nofollow ?>, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
    <meta name="bingbot" content="<?php echo $noindex ?>, <?php echo $nofollow ?>, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
    
    <meta name="image" content="<?php echo $meta_image; ?>">
    <!-- Schema.org for Google -->
    <meta itemprop="name" content="<?php echo $meta_title; ?>">
    <meta itemprop="description" content="<?php echo $meta_description; ?>">
    <meta itemprop="image" content="<?php echo $meta_image; ?>">
    <!-- Open Graph general (Facebook, Pinterest & Google+) -->
    <meta name="og:title" content="<?php echo $meta_title; ?>">
    <meta name="og:description" content="<?php echo $meta_description; ?>">
    <meta name="og:image" content="<?php echo $meta_image; ?>">
    <meta name="og:url" content="<?php echo $meta_canonical; ?>">
    <meta name="og:site_name" content="<?php echo $meta_sitename; ?>">
    <meta name="og:locale" content="pt_BR">
    <meta name="og:type" content="website">
    
    <?php
    wp_enqueue_style('mylinks-public-css');
    wp_styles()->do_item('mylinks-public-css');
    
    echo $analytics_script;
    echo $header_script;
    if ($custom_css == '') {
        echo '';
    } else {
        echo '<style type="text/css">'.$custom_css .'</style>';
    }
    ?>
    </head>
    <?php 
    printf(
        '<body class="mylinks-body %s">',
        'none' === $key ? $theme_value : $key
    );
    
    if ( have_posts() ): 
        while ( have_posts() ): the_post(); ?>    
        <div class="mylinks">
            <div class="avatar">
                <?php
                if ( !empty( $avatar ) ) : ?>
                    <img width="140" height="140" src="<?php echo esc_html( $avatar ); ?>">
                <?php endif; ?>
            </div>
            <div class="name">
                <?php echo $name; ?>
            </div>
            <div class="description">
                <?php echo $description; ?>
            </div>
            <div class="user-profile">
                <!-- Start Facebook -->
                <?php g_social($facebook_url, $facebook_icon, 'facebook.png'); ?>
                <!-- Start Twitter -->
                <?php g_social($twitter_url, $twitter_icon, 'twitter.png'); ?>
                <!-- Start Linkedin -->
                <?php g_social($linkedin_url, $linkedin_icon, 'linkedin.png'); ?>
                <!-- Start Instagram -->
                <?php g_social($instagram_url, $instagram_icon, 'instagram.png'); ?>
                <!-- Start Youtube -->
                <?php g_social($youtube_url, $youtube_icon, 'youtube.png'); ?>
                <!-- Start Pinterest -->
                <?php g_social($pinterest_url, $pinterest_icon, 'pinterest.png'); ?>
                <!-- Start TikTok -->
                <?php g_social($tiktok_url, $tiktok_icon, 'tiktok.png'); ?>
                <!-- End TikTok -->
            </div>
            <div class="links">
                <?php
                foreach ( (array) $links as $key => $link ) :
                
                    if ( empty( $link['image'] ) && empty( $link['url'] ) ) :
                    ?>
                    <div class="link">
                    </div>
                    <?php  elseif ( empty( $link['image'] ))  : ?>
                    <div class="link">
                        <a id="link_count" class="button link-without-image inline-photo show-on-scroll" href="<?php echo $link['url']; ?>" target="_blank" rel="noopener">
                            <span class="link-text"><?php echo $link['title']; ?></span>
                        </a>
                    </div>
                    <?php  else : ?>
                    <div class="link">
                        <a id="link_count" class="button link-with-image inline-photo show-on-scroll" href="<?php echo $link['url']; ?>" target="_blank" rel="noopener">
                            <div class="thumbnail-wrap">
                                <img src="<?php echo $link['image']; ?>" class="link-image" alt="thumbnail">
                            </div>
                            <span class="link-text"><?php echo $link['title']; ?></span>
                        </a>
                    </div>
                    <?php endif; ?>
                <?php endforeach; ?>
            </div>
        </div>
        <?php wp_mylinks_track_mylink_page(get_the_ID()); ?>
        <?php endwhile; ?>
    <?php endif; ?>
        <footer id="site-footer" role="contentinfo" class="mylinks-footer">
            <?php 
            $enable_credits = get_option(sanitize_text_field('wp_mylinks_credits'));
    		$credits = '<div class="wp-mylinks-credits">Made with ?? and ? by <a href="https://walterpinem.me" target="_blank" rel="noopener nofollow"><strong>Walter Pinem</strong></a></div>';
            if ($enable_credits === 'yes') {
                echo $credits;
            }
            echo $footer_script; 
            ?>
        </footer>
    </body>
    </html>

    @wfgerald
    Hi Gerroald,
    I had a similar issue and arrived here because Google only show 2 results for “wfls_twofactor_required“, the source code and this thread.

    I solved the 2FA and application password issues simply creating an editor user without 2FA and without app pw.

    I had another problem setting a post author with Ajax that I solved with JS fetch. I posted an answer on this question about Multisite, Wordfence and an error setting the post property “author”: https://wordpress.stackexchange.com/a/377721/12615

    Regards,
    Rodolfo

    The most hassle free way would be if they provided hooks for you to change the parent theme look and feel.

    But depending on the templates, this may not be possible and you’re left with comparing each theme update with your modifications…

    Plugin Author brasofilo

    (@brasofilo)

    I’d be really interested in what “lot of features” are not working for you. Would be nice if you could report on those too. I’ll check the redirect issue and file an update after confirming/fixing.

    Thanks for the feedback

    Try the following and post the output:

    if( function_exists('wp_pagenavi')) {
    	$test = wp_pagenavi( array( 'echo' => false) );
    	$output .= '<pre>'.print_r($test,true).'</pre>';

    Forum: Reviews
    In reply to: [Admin Tweaks] Wow
    Plugin Author brasofilo

    (@brasofilo)

    Gracias!
    :o[)

    Plugin Author brasofilo

    (@brasofilo)

    !!!!
    That’s amazing, Hassan ??
    I incorporated the feature after that Q&A, jejeje, talk about circularity..!

    I’m really not remembering which other issue I had with AME that lead me to believe it’s his fault… Well, alas, great that you dig the issue out.

    I created a Pastebin with your code. I don’t understand really why, but rules here are no more than 10 lines of code (!) and mods usually delete code from threads. I’ll check this the next time I open the plugin code.

    saludos!
    Rodolfo

    Plugin Author brasofilo

    (@brasofilo)

    Hi Amal,
    currently it’s not possible, we only have the skins white/dark.

    Plugin Author brasofilo

    (@brasofilo)

    Oh, I’ve seen Admin Menu Editor conflicting with other features of my plugin and with other plugins too. I ended up giving up on it.

    I think it does a complete rewrite of the Menu, overriding other plugin’s modifications. I’m afraid I won’t touch this issue as I’m more inclined to think it’s AME who should play nice with other plugins. Or maybe it’s impossible…

    Plugin Author brasofilo

    (@brasofilo)

    Hi Hassan, thanks for the great review ??

    I had the email tweaks in early versions, but it was not behaving nicely among servers, so I decided not to complicate my life and let other plugins handle the email thing.

    As for the bubbles, yes, I think you’re right to make them without changing the colors, I removed here in my dev version and looks allrite. And if the user wants to change the bubble colors it’s a simple matter of adding some rules in >Appearance>ExtraCSS:

    span.update-plugins {
    	background-color: white !important;
    	color: black !important
    }

    cheers!

    Plugin Author brasofilo

    (@brasofilo)

    Can you post a Pastebin with an export of the settings you’re using?

    Right now, I cannot reproduce the issue…

Viewing 15 replies - 16 through 30 (of 584 total)