GithubHelp home page GithubHelp logo

hberberoglu / wp-favorite-posts Goto Github PK

View Code? Open in Web Editor NEW
26.0 26.0 37.0 166 KB

This WordPress plugin allows visitors to add favorite posts.

Home Page: http://wordpress.org/plugins/wp-favorite-posts

PHP 97.56% CSS 0.24% JavaScript 2.20%

wp-favorite-posts's People

Contributors

hassanrazmy avatar hberberoglu avatar joeygeo avatar marcofbb avatar maxfenton avatar miya0001 avatar mtedwards avatar mustafauysal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

wp-favorite-posts's Issues

Favorite Pages?

Would it be possible to extend the features to include also Pages?

Depreciated Code on save button

Notice: get_usermeta is deprecated since version 3.0! Use get_user_meta() instead. in /data/vhosts/backpacker.dc-dev.com/httpdocs/wp/wp-includes/functions.php on line 2900

update_usermeta deprecated as well

No longer displays listing of favorited posts. Page is blank.

The plugin has worked perfectly for us for the past year but recently it's stopped working. We use it to favorite video posts on our site and compile a favorites list. The favorites list is now blank. Nothing is being listed although the data is available. When we favorite something and check the list, the "Clear favorites" link no longer displays so it works to some extent, just doesn't output anything. I'm thinking it may be the latest Wordpress update (4.2.2).

div in ul

your <div class="navigation"> is inside the ul.
can u please fix this?

Deprecated functions

register_sidebar_widget and register_widget_control functions have been retired.

wpfp link disappears on click

We love this plugin!

However, in browsers other than Firefox, clicking on the Add to Favorite button makes the button disappear on the ajax refresh - if you refresh the page, the action has happened successfully, but the button disappears on click - see below:

Before click:

screen shot 2016-08-30 at 8 40 03 am

After click:
screen shot 2016-08-30 at 8 40 09 am

On page refresh:
screen shot 2016-08-30 at 8 40 49 am

Any help you can offer will be greatly appreciated!

Do not reload the page when deleting from favorites

Hello! The plugin settings I removed the reload by adding \ removing, but at the first removal occurs reload the page. With further deletions, there is no reboot.
With what it can be connected and how to fix it?

Suggested Modifications to Fix Bug and Add Thumbnail

Misbehaving Shortcode Output

The shortcode [wp-favorite-posts] displays output outside of defined content areas in some circumstances. As an example, when using Beaver Builder the favourites list displays outside of the content loop.

The fix is to use the output buffer.

Replace this code in wp-favorite-posts.php:

function wpfp_shortcode_func() {
               wpfp_list_favorite_posts();
}
add_shortcode('wp-favorite-posts', 'wpfp_shortcode_func');

With this code:

function wpfp_shortcode_func() {
    // Add next line
    ob_start();
               wpfp_list_favorite_posts();
    // Add next line
    return ob_get_clean();
}
add_shortcode('wp-favorite-posts', 'wpfp_shortcode_func');

Thumbnail Feature

Would be nice to display thumbnails next to the list items in the favourite links.

Replace the following code in wpfp-page-template.php:

        echo "<ul>";
        while ( have_posts() ) : the_post();
            echo "<li><a href='".get_permalink()."' title='". get_the_title() ."'>" . get_the_title() . "</a> ";
            wpfp_remove_favorite_link(get_the_ID());
            echo "</li>";
        endwhile;
        echo "</ul>";

With this code (this also makes the list item width 90%):

        echo "<ul>";
        while ( have_posts() ) : the_post();
    // Add next if block
            if ( has_post_thumbnail() ) {
//                $thumbnail = get_the_post_thumbnail( get_the_ID(), array( 100,100), array( 'class' => 'alignleft' ) );
                $thumbnail = get_the_post_thumbnail( get_the_ID(), array( 100,100) );
            } else {
                $thumbnail = '';
            }


    // Modify next echo statement
            echo "<li style='display:block;width:90%;'><a href='".get_permalink()."' title='". get_the_title() ."'>$thumbnail " . get_the_title() . "</a> ";
            wpfp_remove_favorite_link(get_the_ID());
            echo "</li>";
        endwhile;
        echo "</ul>";

The thumbnail addition was code change was crafted for a specific need. Would be good to add options in the settings page to set a default image to use where no feature image is set, to set the image dimensions, and to set image alignment.

More

I'm considering to add a method to share the favourites list by email or to social networks. Will update if I make the change.

Fatal Error with PHP8

I have a problem with wpfp_link() function and PHP 8.0:

PHP Fatal error: Uncaught Error: Attempt to modify property "ID" on null in /wp-content/plugins/wp-favorite-posts/wp-favorite-posts.php:152 Stack trace: #0 /wp-content/plugins/wp-favorite-posts/wp-favorite-posts.php(80): wpfp_link() #1 /wp-content/plugins/wp-favorite-posts/wp-favorite-posts.php(57): wpfp_add_favorite() #2 /wp-includes/class-wp-hook.php(303): wp_favorite_posts() #3 /wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters() #4 /wp-includes/plugin.php(470): WP_Hook->do_action() #5 /wp-settings.php(600): do_action() #6 /wp-config.php(96): require_once('/home/...') #7 /wp-load.php(50): require_once('/home/...') #8 /wp-blog-header.php(13): require_once('/home/...') #9 /index.php(17): require('/home/...') #10 {main} thrown in /wp-content/plugins/wp-favorite-posts/wp-favorite-posts.php on line 152

nginx support

When installed on an nginx site the plugin displays the content of the page

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.