• Resolved rrjmdpa

    (@rrjmdpa)


    Ever since your last update the admin printout of popular posts activity is completely worthless to me. Why would you spread the graph across the entire page so far that each point is spread an inch? It’s bizarre to read – did you forget that some people actually have desktop screens?

    Additionally, making every entry in the posts list take up an inch is worthless. Only 10 entries (out of over 100) show up on the screen and now I must scroll endlessly. Only ONE typewritten line is PLENTY for every post on the list, all the rest of the formatting just makes using the list miserable.

    And, lastly, you helped me with the code that allowed me to create a function which allowed me to add a column (showing if custom field was set or not – ACF) to the printout and include a link to be able to edit the page – all of that is gone now. [I know your warnings about styling being changed with upgraded and we should avoid that so I put the code in a functions plugin that doesn’t’ get overwritten; but – it seems the hooks have changed too because none of that works anymore.

    Am I just S.O.L. now or is it a bug you are working on or is there a workaround? I’d be happy if I could just revert back to the previous version which was working well – I’m not shure what or why you changed it. thanks DJ

    My existing code – WPPP supplied:

    /********************************************************************/
    /* Alter the WP popular posts plugin's stat page to include         */
    /*   additional fields: views, date published and has_ad custom     */
    /*   field                                                          */
    /* (Taken from WPPP forum pages - help from Hector Cabrera, author) */
    /*                                                                  */
    /********************************************************************/
    function custom_wppp_list_fields( $post_html, $p, $instance ){ 
    
            $stats = ''; // placeholder for the stats tag
    
            // Pageviews option checked, display views
            if ( $instance['stats_tag']['views'] ) {
    
                // If sorting posts by average views
                if ($instance['order_by'] == 'avg') {
                    // display text in singular or plural, according to views count
                    $stats = '<span class="wpp-views">' . sprintf(
                        _n('1 view per day', '%s views per day', intval($p->pageviews), 'wordpress-popular-posts'),
                        number_format_i18n($p->pageviews, 2)
                    ) . '</span>';
                } else { // Sorting posts by views
                    // display text in singular or plural, according to views count
                    $stats = '<span class="wpp-views">' . sprintf(
                        _n('1 view', '%s views', intval($p->pageviews), 'wordpress-popular-posts'),
                        number_format_i18n($p->pageviews)
                    ) . '</span>';
                }
            }
    
    	// builds the output for each line of WPP stat listing
            $output  = '<li>';
    
    	// the title and link
            $output .= '<a>id) . '" class="my-custom-title-class" title="' . esc_attr($p->title) . '">' . $p->title . '</a> ';
    
    	// wpp's normal stat fields
            $output .= '<span class="wppp-stats"> <em>&emsp;' . $stats . '&emsp;</em></span> ';
    
    	// the post's date published
            $output .= '<span class="my-custom-date-class"> (' . date( 'Y-m-d', strtotime($p->date) ) . ') </span>';
    
    	// the 'has_ad' custom field I've set up already IF checked
            if(get_field('has_ad',  $p->id) ) { //this is the way ACF gets the custom field data
       	$output .= ' <strong class="ad-box">&emsp;[Ad]</strong> ';
    	}
    
    	// a 'link' button to edit the selected post **HARD CODED URL may need changing**
            $output .= '<a>id . '&action=edit" target="_blank"><sup>Edit</sup></a>';
            $output .= '</li>';
    
            return $output;
    }
    add_filter( 'wpp_post', 'custom_wppp_list_fields', 10, 3 );
    
    /*********************************************************************/
    /*  adds styling for worpress popular posts plugin inside admin head */
    /*********************************************************************/
    
    function WPP_styling() {
       echo '<style type="text/css">
            .ad-box {color: #800000;}</style>';
    }
    add_action( 'admin_head', 'WPP_styling' );
    
    //   $purl = '/* ' . plugins_url( 'wpp.css', __FILE__ ) . '*/'; echo $purl;
    • This topic was modified 7 years, 4 months ago by James Huff. Reason: placed code into code tags to keep it from breaking the forums
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    Alright. First things first.

    While you may have some valid points there, labelling WPP as “worthless” is an unfortunate thing and an overreaction on your part. Personally, I love it (but of course, I made it). I understand that not everyone likes change but it’s the only way to move forward. You either accept it or you try something else.

    Fortunately, no one is forcing you to use WPP and you even got the plugin for free. So, if you really don’t like it / feel it doesn’t suit your needs anymore then please use whatever you like best.

    Now, regarding the admin section: everything on the Stats section was made from scratch so as you may already guess everything is hard-coded as well (it’s not like I intended for this page to be customizable via filter hooks in the first place anyways, it just happened to work on older versions of the plugin). Will I add filter hooks in the future to make it customizable again? Who knows, if enough people request it I might.

    Right now your options are:

    • Venture into the incredibly fun land of programming and tweak the Stats section to your liking.
    • Use another plugin.

    Cheers.

    Thread Starter rrjmdpa

    (@rrjmdpa)

    If you hadn’t flown off the handle and actually read what I wrote, the actual words say: “Worthless TO ME” which is a true representation of FACT. It is worthless to me – which by all precepts of UI is what a programmer is trying to avoid at all costs. In fact major businesses set up entire “focus groups” to obtain feedback like I just gave you. Your new “hard-coding” has squashed out your graph across the entire screen and makes it look like anything BUT a graph. I thought you’d like to have known that. If I HAD said something like “pisses me off” or “IT IS a bunch of junk” or in other ways maligned your programming skills I might better understand the bristles on the back of your neck. [That, to me, seems an “unfortunate over reaction.”

    I wanted to convey what your upgrade (even if it was an accidental oversight) did to the functionality of the program I was using – it isn’t just an “annoyance” or “cosmetic preference” or a simple something to “get around to.” It actually renders your product more difficult to use (I would think to everyone on a wide screen) and in situations like I’m describing completely non-functioning–that’s what I was trying to convey. And “what the crap has happened” is a representation of the astonishment one is overwhelmed with when one walks out to get in one’s car and sees oil running down the driveway. It was working minutes before and now is un-drivable; and the only thing that happened is that the mechanic worked on it!

    Regarding the programming – the code I used before came graciously, and readily, from YOU; like you had run into the request many, many times previously and had it to hand. Like you intended it to be used for just such a purpose. I see that WordPress itself, and many other plugins, use hooks like that for such a purpose. From your PREVIOUS willingness to share such code it seemed like: A – you had already vetted the value of the request and found it worthy of your time; B – you understood the value of the “hooks” that WP uses and modular programming and either already had, or intended to implement them; and, C – valued user feedback.

    I did see your several warnings against doing things that would be “overwritten” when your programming was updated and broke none of them. You warned that styling was being done in a separate file which would get overwritten when updated so I left that alone like you advised. However, what seems like styling has now broken even though I followed your warnings.

    In addition, I took extra care to put the functions code (again which I received from you) in a functionality plugin, also like you advised. I admit that it may have been just an assumption on my part, but I assumed that by your warnings and suggestions you fully intended to use that methodology in order to make future “upgrades” were backwards compatible.

    Lastly, after what Yost did a few months back with his plugin, I’ve begun making sure to read all the so-called “enhancements” given in the change log for any upgrade BEFORE I commit them into production. I did read what was available from your descriptions and didn’t find any warnings that internal tags or programming had changed which might cause problems with previous versions. That would have been nice.

    Now, it’s just my guess, but it seems TO ME that the problems I’ve reported are of such a minor nature (or oversight) that they could be readily corrected, or worked around with a few simple instructions listed in your change log; and, in the time we’ve both already spent crafting our replies probably could have already been resolved… your call.

    At very least it seems that a “warning” in the change log about possible failures to those who’ve made modifications would be in order. Like I said, it seemed to be working fine for me before your “upgrade.” If I can figure out how to revert back to the previous version maybe that’s what I’ll do.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘What has happened???? New version of PPP worthless to me’ is closed to new replies.