Forum Replies Created

Viewing 15 replies - 16 through 30 (of 628 total)
  • Plugin Author Pixelbart

    (@pixelbart)

    Thank you for the hint. Here is the repo on GitHub:

    https://github.com/pixelbart/helpful

    Plugin Author Pixelbart

    (@pixelbart)

    @tri3shnyirl5a3f

    Hello,

    Exactly. There was only one problem at first, which I had solved. As a response, I then received a very long text with more points. Among other things, that you can no longer load files via CDN.

    Because I don’t have time to solve all the problems myself, Helpful might not come online any more. Helpful was always open source, but the participation of other people was never given. Since I do everything alone and currently have no time, this will probably not be solved.

    I apologize for this!

    Greetings Kevin

    Plugin Author Pixelbart

    (@pixelbart)

    @nelsonleemiller

    This is a known problem, which I could not solve yet. I have also written this in the patch notes. Here, I have to rewrite the system for the options so that this no longer happens. Unfortunately, I don’t have the time for this presently, which is why I have reduced the updates somewhat so that it doesn’t happen so often.

    I have to write another update now because there seems to be a security problem with the exports of the CSV files.

    Here again the patch notes: https://github.com/pixelbart/helpful/releases/tag/4.5.25

    Thanks for your feedback!

    Greetings Kevin

    Plugin Author Pixelbart

    (@pixelbart)

    @infernoprime

    Currently, there are no plans to expand Helpful, at least not from my side, since I hardly have time for it at the moment.

    Your image is also not shown, so I can’t quite understand what you mean.

    Stay healthy and thanks for your time!

    Greetings Kevin

    Plugin Author Pixelbart

    (@pixelbart)

    @pikashoo

    Now I hope I have understood you. Here, this should work (functions.php):

    add_shortcode('pikashoo_helpful', function ($atts) {
        $defaults = [
            'type' => 'pro',
            'percentage' => true,
            'format_percentage' => '%d%%',
            'format' => '%d',
            'post_id' => null,
        ];
    
        $atts = shortcode_atts($defaults, $atts);
    
        extract($atts);
    
        $is_percentage = ($percentage === true);
    
        if ($post_id === null) {
            $post_id = get_the_ID();
        }
    
        if ($type === 'pro') {
            $value = Helpful\Core\Helpers\Stats::get_pro( $post_id, $is_percentage );
        } else {
            $value = Helpful\Core\Helpers\Stats::get_contra( $post_id, $is_percentage );
        }
    
        if ($is_percentage) {
            $content = sprintf($format, $value));
        } else {
            $content = sprintf($format_percentage, $value));
        }
    
        return apply_filters('pikashoo_helpful_content', $content, $atts);
    });

    default options
    [pikashoo_helpful type="pro" percentage="true" format_percentage="%d%%" format="%d" post_id="null"]

    pro percentage
    [pikashoo_helpful type="pro"]

    contra percentage
    [pikashoo_helpful type="contra"]

    It is best to show only one value at a time, as there can sometimes be differences due to rounding.

    Greetings Kevin

    Plugin Author Pixelbart

    (@pixelbart)

    @pikashoo

    Unfortunately, this is not so easy. You have to copy the template and adapt it to make it work.

    You copy this file: https://gist.github.com/pixelbart/3f81d45ec0fdbf5da4ca779ba6bcff33
    Into the folder: wp-content/themes/your-theme/helpful/helpful.php

    You can also help out with JavaScript if you like. Here’s an example, completely unoptimized, but it should work:

    jQuery('.helpful').each(function() {
        let helpful = jQuery(this);
        let proButton = helpful.find('.helpful-pro');
        let contraButton = helpful.find('.helpful-contra');
        let pro = parseInt(proButton.find('.helpful-counter').text());
        let contra = parseInt(contraButton.find('.helpful-counter').text());
        let total = pro + contra;
        let proPercent = Math.round((pro / total) * 100);
        let contraPercent = Math.round((contra / total) * 100);
    
        proButton.find('.helpful-counter').text(proPercent + '%');
        contraButton.find('.helpful-counter').text(contraPercent + '%');
    });

    If you’d rather put this in your functions.php, that works too:

    add_action('wp_footer', function() {
        ?>
    <script type="text/javascript">
    jQuery('.helpful').each(function() {
        let helpful = jQuery(this);
        let proButton = helpful.find('.helpful-pro');
        let contraButton = helpful.find('.helpful-contra');
        let pro = parseInt(proButton.find('.helpful-counter').text());
        let contra = parseInt(contraButton.find('.helpful-counter').text());
        let total = pro + contra;
        let proPercent = Math.round((pro / total) * 100);
        let contraPercent = Math.round((contra / total) * 100);
    
        proButton.find('.helpful-counter').text(proPercent + '%');
        contraButton.find('.helpful-counter').text(contraPercent + '%');
    });
    </script>
    <?php
    });

    Hopefully I could help you in some way. If I have misunderstood you, then write me briefly what exactly you have in mind.

    Greetings Kevin

    Plugin Author Pixelbart

    (@pixelbart)

    @cemsid

    You can activate the feedback. To do so, visit the settings of Helpful and click on Feedback. There you can also determine what kind of text is displayed in front of the form.

    Thanks for your message and stay healthy!

    Greetings Kevin

    Plugin Author Pixelbart

    (@pixelbart)

    Hello @david78987,

    I didn’t know exactly what to do now, since Helpful doesn’t actually touch the caching header. Then I noticed that cache set to false in Helpful’s Ajax request. I have now changed that, or removed the property cache, so that the jQuery default is used.

    If this doesn’t solve the problem, I’m afraid I don’t know what will. Here I would need to know more. I haven’t found anything else either.

    Here you can have a look yourself: https://github.com/pixelbart/helpful/search?q=cache

    I noticed that with you on the site, my browser console is getting numerous messages. This GIF in particular keeps loading but not being found, causing network errors in the browser: https://socialself.com/detroitchicago/greenoaks.gif

    You might want to take a look at that as well.

    Thank you for your feedback, please stay well!

    Greetings Kevin

    Plugin Author Pixelbart

    (@pixelbart)

    @konstantinm

    Then try this once. But it must not be in a widget, otherwise the post will not be recognized. So the shortcode then when you use it.

    add_shortcode('helpful_inline', function ($atts) {
        global $post;
    
        if (!function_exists('helpful_get_contra')) {
            return;
        }
    
        $defaults = [
            'type' => 'pro',
            'singular' => '%d person found this post useful.',
            'plural' => '%d persons found this post useful.',
        ];
    
        extract(shortcode_atts($defaults, $atts));
    
        // Contra
        if ($type === 'contra') {
            $contra = helpful_get_contra($post->ID) ?: 0;
    
            // Singular
            if ($contra == 1) {
                return '<span class="helpful_inline">' . sprintf($singular, intval($contra)) . '</span>';
            }
    
            // Plural
            return '<span class="helpful_inline">' . sprintf($plural, intval($contra)) . '</span>';
        }
    
        // Pro
        $pro = helpful_get_pro($post->ID) ?: 0;
    
        // Singular
        if ($pro == 1) {
            return '<span class="helpful_inline">' . sprintf($singular, intval($pro)) . '</span>';
        }
    
        // Plural
        return '<span class="helpful_inline">' . sprintf($plural, intval($pro)) . '</span>';
    });
    • This reply was modified 3 years, 10 months ago by Pixelbart.
    Plugin Author Pixelbart

    (@pixelbart)

    @konstantinm

    Thank you for your feedback!

    The first proposal can be done quite well, already now. However, you need to place this in the functions.php or similar. Read more here: https://helpful-plugin.info/docs/professionals/how-to-execute-php-code-on-your-wordpress-website/

    functions.php:

    
    add_shortcode('helpful_inline', function ($atts) {
        global $post;
    
        if (!function_exists('helpful_get_contra')) {
            return;
        }
    
        if (!property_exists('ID', $post)) {
            return;
        }
    
        $defaults = [
            'type' => 'pro',
            'singular' => '%d person found this post useful.',
            'plural' => '%d persons found this post useful.',
        ];
    
        extract(shortcode_atts($defaults, $atts));
    
        // Contra
        if ($type === 'contra') {
            $contra = helpful_get_contra($post->ID) ?: 0;
    
            // Singular
            if ($contra == 1) {
                return '<span class="helpful_inline">' . sprintf($singular, intval($contra)) . '</span>';
            }
    
            // Plural
            return '<span class="helpful_inline">' . sprintf($plural, intval($contra)) . '</span>';
        }
    
        // Pro
        $pro = helpful_get_pro($post->ID) ?: 0;
    
        // Singular
        if ($pro == 1) {
            return '<span class="helpful_inline">' . sprintf($singular, intval($pro)) . '</span>';
        }
    
        // Plural
        return '<span class="helpful_inline">' . sprintf($plural, intval($pro)) . '</span>';
    });
    

    After that, you can output the text you want within a post or page with the following shortcode:

    Pro

    
    [helpful_inline type="pro" singular="%d guy liked this" plural="%d guys liked this"]
    

    Contra

    
    [helpful_inline type="contra" singular="%d guy liked this" plural="%d guys liked this"]
    

    Warning: The %d is always the number, it must always be specified.

    CSS-class for this: .helpful_inline

    You can use it to make the text red, for example:

    
    .helpful_inline { color: red; }
    

    Your second suggestion I would have to program, which is more effort and costs time, which is why I have only created this as an issue on GitHub for now. Maybe there will be someone who wants to do it meanwhile. Otherwise, you’ll have to wait a bit.

    I hope this helps you.

    Stay healthy and have a good time!

    Greetings Kevin

    • This reply was modified 3 years, 10 months ago by Pixelbart.
    Plugin Author Pixelbart

    (@pixelbart)

    @david78987

    Thank you for the message and the screenshots!

    What version of Helpful are you using? I can’t reproduce the error unfortunately, so I might need more information there.

    Thank you and stay healthy!

    Greetings Kevin

    Plugin Author Pixelbart

    (@pixelbart)

    @indigotherapies

    I just had some thoughts about this, the WP-Optimize hint was great, as I found here that WP-Optimize works with buffering. That explains your problems if we are lucky.

    I have now built something that may solve your problem. It’s not an optimal solution, but it may work for you this way.

    Otherwise, feel free to use the older version again. Maybe you can find an alternative to Helpful, which would make me happy too, as long as you are happy!

    Changelogs: https://github.com/pixelbart/helpful/releases/tag/4.5.21

    Plugin Author Pixelbart

    (@pixelbart)

    Hi, @indigotherapies

    Thank you for your message.

    Unfortunately, I cannot solve the problem for you. Helpful is now working with output buffering again because it is the best solution. Everything I changed for you afterwards was not good and caused problems for many others.

    You must somehow have a cache on the server that does buffer. How you get rid of that I can’t say, you have to contact your provider.

    The version that worked for you at the time was this one:

    4.5.6: https://downloads.wordpress.org/plugin/helpful.4.5.6.zip

    Unfortunately, I won’t be able to address the problem in future versions. Either you stay with the old version then, or you have to solve the problem with your server.

    Old issue: https://wordpress.org/support/topic/fatal-error-after-latest-update-16/

    If you don’t want to receive updates any more, you just have to set the version to 9999.0.0 under /wp-content/plugins/helpful/helpful.php. Then you should still have some breathing room.

    Unfortunately, I have not received any support from other developers since ever, so the current solution, is the only solution for me. I build this all by myself.

    Thread Starter Pixelbart

    (@pixelbart)

    @daanvandenbergh

    Sorry Daan, you went to so much trouble. Everything is working as it should. Themify has now still internal problems with the Concate CSS, that is not deleted when it should be deleted.

    Your plugin works fine. Thank you! The pages are also no longer down when you activate your plugin.

    So it’s done! Thanks a lot!

    Thread Starter Pixelbart

    (@pixelbart)

    Hey Daan,

    from my side there is no hurry. Take as much time as you need. Get on your feet first, then the rest will go on.

    Get well soon and have a nice weekend!

    Greetings Kevin

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