Giter Site home page Giter Site logo

revisionize's People

Contributors

jamiechong avatar kshaner avatar onegreypaw avatar piscis avatar thefrosty avatar thegaffney avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

revisionize's Issues

Exlude custom post types by filter

Hi, we use your plugin and it is quite useful most of the times.

However there are some custom post types that we'd like to exclude from the revisionize feature, because sometimes we click it by mistake and then have problems.

Example: WooCommerce coupons which are also custom post types.

Please allow developers to exclude custom post types by a filter.

Thank you.

acf cache is not cleared after publishing a revision

I am using Revisionize together with ACF and FacetWP. I have noticed that when I publish a post that has ACF fields that are indexed by FacetWP, the facet is not updating. After a bit of digging, it looks like the cause is that ACF caches the values for its fields but in the way that these fields are copied from the revision to the original, the ACF cache is not updated.

Steps to reproduce

  • Create ACF field group with 1 text field called test and in location rules, Show this field group if post type is post
  • Add a function to the revisionize_after_publish action:
add_action( 'revisionize_after_publish', function( $post_id ) {
  echo '<p>get_field: ' . get_field( 'test', $post_id ) . '<br>';
  echo 'get_post_meta: ' . get_post_meta( $post_id, 'test', true ) .'</p>';
  wp_die();
});
  • Create a new post and set a value for test
  • Create a revision of the post
  • Update the test field and publish

Expected result
Both the get_field and get_post_meta return the new value

Actual result
Only get_post_meta returns the new value whilst get_field returns the old value.

Add support for "type" Nav Menu Item post type

Currently the get_current_post_type function doesn't get the nav_menu_item post type and throws an error when visiting the nav-menus.php page.

You could add, which would allow that post type to be ignored (or add that as a default type to ignore):

 else if ($pagenow == 'nav-menus.php') {
      $type = 'nav_menu_item';
  }

PHP Notices on all non-edit screens

When WP_DEBUG is enabled, there are php notices on all non-edit screens. Here's an screenshot callstack from xdebug...

revisionize-notices

Looks like a simple !empty($post) check on line 397 would solve it.

if (!empty($post) && is_post_type_enabled() && is_create_enabled($post)) { 

Isn't publishing draft page after changes

I am using Wordpress 5.1.1 with the new block editor. Iam clicking in the Revisionize link of a page in the page list. Then I edited and saved as draft multiple times [ here I observed that the slug was totally different (historico-do-sema) compared with the original (sema-historico) ]. Then I tryed to publish. Nothing happened with the sema-historico page. The page just publish it self as other page tith historico-do-sema slug.

Error when publishing a revision with post status 'pending'

We have our instance of revisionize setup to allow contributors to submit revisions a particular post. We setup a new capability called create_revisions that we're assigning to most roles and filtered revisionize_user_can_revisionize.

However, when someone with publish_posts publishes the post, an error occurs because the call to get_latest_wp_revision returns null because wp_get_post_revisions assumes the 'revision' status and not pending. Then it is used directly in is_wp_revision_different assuming it's an object. It creates a waterfall of errors including not deleting the revision.

![image](https://user-images.githubusercontent.com/1686106/39539188-d9c42976-4df3-11e8-90e4-d6aff22d132d.png

The errors subside after modifying line 236 to the following:

    if ( is_object($revision_before) && is_object($revision_after) && is_wp_revision_different($revision_before, $revision_after)) {

I know we may be using it a bit custom, but this check would help with many use cases I believe for advanced publishing flows.

Editing ACF fields then Publish ignores changes

  1. Revisionize
  2. Edit ACF Fields
  3. Click Publish

Result: The revision is published, but the ACF fields aren't.
Reason: transition_post_status hook fires too early. The revision $post content has been saved, but its meta fields have not (they're saved shortly after). So the meta fields of the revision aren't updated when we copy_post over top of the original.
Fix: Need to hook into an action later on. Possibly publish_post.

Work Around

  1. Revisionize
  2. Edit ACF Fields
  3. Click Save Draft
  4. Click Publish

Make plugin root adjustable via filter

Would it be possible to have a filter where we can set an alternative plugin root for the revision addons. The problem we currently having is that our plugins are not versioned but get installed from a composer repository. After every deploy the plugins get scrapped and reinstalled. Having the addons folder inside of the plugin folder would lead to changes in our deployment process where we have to copy over the files every time.

Just want to know what your view on the topic is before I provide a pull request.

Unique class on the revisionize button

In the post edit screen, the revisonise button simply has a class of 'button'. It would be good to have a unique class for revisionise also on the button to ease styling. Happy to submit a PR if this would help.

Scheduled Update first publishes draft revision, copies it to original and then deletes the revision draft

I don't know whether this is an expected behaviour or not, the scheduled update first publishes draft revision, copies it to original and then deletes the revision draft. Although it seems like a legit solution to the problem, here are the number of unexpected behaviour this causes:

  • While using Jetpack's Publicize feature, this causes the revision (published post for a very short interval) to be posted in social media accounts, which of course, causes 404 error as the post will be deleted as soon as it is copied to original post.

  • If Onesignal Web Push Notification is active, the revision (published post for a very short interval) will fire a push notification, which will also send subscribers the link to the revision post causing 404 error.

  • Likewise, any other Plugins using post status transition hooks might get affected, especially if they are used to perform some action when the post gets published.

Fatal error on multisite installation

Warning: require_once(/home/langone/public_html/wp-content/plugins/revisionize/settings.php): failed to open stream: No such file or directory in /home/langone/public_html/wp-content/plugins/revisionize/revisionize.php on line 34

Fatal error: require_once(): Failed opening required '/home/langone/public_html/wp-content/plugins/revisionize/settings.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/langone/public_html/wp-content/plugins/revisionize/revisionize.php on line 34

Steps to reproduce on my end.

  1. Delete plugin - had to get site back
  2. Install 1.3.6 - network activate
  3. Update to 2.0 through wp-admin
  4. Network Activate 2.0
  5. Errors, see Screenshots

I have deactivated all other plugins, and retried these steps to the same error. This is on a go-daddy dedicated server. Let me know if I can help in any way, if you would like a temp login to reproduce the issue. I use this site to test things so there will be no issues if you need to use it to troubleshoot.

screen shot 2018-03-04 at 8 17 03 am
screen shot 2018-03-04 at 8 30 59 am
screen shot 2018-03-04 at 8 32 13 am

Delete Replaced Article?

Once you create a revision of a page, make changes, then publish that revision. Should, or can, the revision be deleted automatically? That's not currently happening for me. The revision is still within Pages as a Draft.

Ideally, once you publish the revision, it replaces the original and then the revision itself gets removed from the pages.

Post dates are not updated anymore

After fixing issue #9 post dates are not updated anymore by default. For us this has the implication that post that received a update will not appear in our daily updated feeds section anymore.

Can we have a filter to turn on/off this behaviour.

I'm happy to send a PR please let me know

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.