WordPress.org

Forums

WPbook: Where to find upgrade's code changes, for use on hacked plugin files? (5 posts)

  1. sitemaker
    Member
    Posted 4 years ago #

    For my website, I made changes to the following WPbook files:

    wpbook.php
    publish-to-facebook.php
    theme/index.php
    theme/default/style.css

    Now there's a WPbook upgrade (from 2.0.9.2 to 2.0.12), the first since I built my site. I need either to reapply all my hacks to the new version's files, or else apply the new version's changes to my hacked files.

    Where can I go to see all the specific code changes that the upgrade makes to WPbook's files?

    Thank you for your attention.

  2. elfin
    Moderator
    Posted 4 years ago #

    review this:
    http://plugins.trac.wordpress.org/log/wpbook/

    accessible for every plugin via the development log link.

  3. John Eckman
    Member
    Posted 4 years ago #

    Might be easier to keep track of what changes you make to the files, and remake those with each new release.

  4. John Eckman
    Member
    Posted 4 years ago #

    And if they are changes others might benefit from, submit them as patches/diffs and we'll consider integrating them into the next release . . .

  5. sitemaker
    Member
    Posted 4 years ago #

    OK, I've gone through the files looking for the hacks, and I don't have to worry about the wpbook.php file. The only change I made to that was what you suggested here, and I'm sure you put that in already.

    I assume that my modified app template will still work from one WPbook release to another. Is that reasonable?

    If so, then it's only the publish_to_facebook.php file where I have to be careful.

    Here is a hack that I recommend you do add to publish_to_facebook.php for everybody:

    // your original line 55:
    //    $wpbook_description = stripslashes(wp_filter_nohtml_kses(apply_filters('the_content',$my_post->post_content))); 
    
    // replacement code begins:
    	  $JLW_description = apply_filters('the_content',$my_post->post_content);
    	  $JLW_beforeMore = strpos($JLW_description,'<!--more-->') ;
    	  if ( $JLW_beforeMore === false) { }
    	  else {
             $JLW_description = substr( $JLW_description, 0, $JLW_beforeMore ) . '...' ;
    	  }
    	  $wpbook_description = stripslashes(wp_filter_nohtml_kses( $JLW_description ));
    // replacement code ends.

    This makes WPbook respect the <!--more--> tag, as described in the installation instructions.

    My other suggestion would be to pull any echoed text out into a language file. For example, somewhere around line 95, I have:

    $action_links = array( array('text' => 'Rate &middot; Read More', // JLW: originally  was 'Read More'

    If an admin could specify strings like these in a language file outside of publish_to_facebook.php, upgrades would be easier. It would especially help translators.

    (I changed that text because my customization of the app template shows the Five-Star-Ratings plugin's rating of each post. Although it is visible on both the Wall and the App's category/tag/archive lists, you can't actually vote with the stars until viewing the whole post in the App.)

    The other changes were also of that nature. So if the READ MORE tag is respected and the default strings are in a language file, I'd never be scared of upgrades.

    Thanks again for a great plugin!

Topic Closed

This topic has been closed to new replies.

About this Topic