GithubHelp home page GithubHelp logo

extendable-aggregator's Introduction

Extendable Aggregator

Aggregates articles across multisite install

Basic Usage

Network activated plugin. It allows publishing posts from one site to all other network sites. There isn't any setting required for this plugin, You will get meta box Post Syndication with the list of other network sites, you can choose the sites and it will start syncing. By default, this plugin supports Post, Comment, Attachment, and Terms.

Also initially all synced posts will be linked to the source so that they will get updates. you can unlink by detaching from source.

Step-by-step instructions

  1. Log in to WordPress
  2. Go to Add New Post
  3. Prepare the post, Choose sites in Post Syndication on which you want to publish this post.
  4. Click on Publish
  5. Wait for 5 mins
  6. Go to other network site dashboard to verify the post.

Troubleshooting

My content is not syndicating as expected

  • This may happen due to long queues of syndication jobs enqueued. To overcome that, you can click the Sync Now link beside the country name ( ie the refresh icon ), which executes the syndication process instantly rather than via the queue system.

  • Reason for that is that we have a hard limit ( filterable though ) of how many jobs can exist in a queue, for performance reasons, which should not be a problem in most cases. In cases where the queue is growing larger than expected, the plugin sends an email notification to the site admin email with the incident so it can be monitored/investigated further.

Is there a dashboard where I can track the syndication process ?

  • There are plans to create a dashboard of sorts to monitor the syndication queues and status, but nothing that has been started yet. It is recommended to use the same tracking method as we have in the job feeds plugin ( reporting to NewRelic custom events, and to plain emails when NewRelic is not present ( eg in cron containers ) ).

Development tips

  • The plugin has many usable filters/actions, feel free to use them before updating the main plugin files, to avoid any unexpected bugs or broken dependencies.
  • The site repo has an integration plugin, cg-syndication, which controls the behavior of the plugin and hooks into many of the features/logic to customize it to the site needs. Look there first while debugging problems or tweaking the syndication logic.
  • Most of the methods have inline documentation, and due to the complexity of the syndication process for Client, lots of the filters are already used in the integration plugin and would serve as good examples for future customization.

Next / recommended enhancements

There are a few updates that can make the plugin more usable, accessible, and easy to monitor track:

  • A Dashboard of sorts to display the list of posts marked for syndication
  • Integration with NewRelic custom events / email notifications
  • UI hints on the last time a post has been synced for each post
  • ?

extendable-aggregator's People

Contributors

faishal avatar mikeselander avatar rayhatron avatar stuartshields avatar tareiking avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

extendable-aggregator's Issues

Issue when syncing JSON stored in meta

In certain scenarios the plugin can cause issues when syncing JSON stored in meta.

An example of this is when paired with the NewsPress plugin "Multi Title Support" which stores a headline of the post, along with other attributes such as a kicker as JSON in a single meta field.

If a headline is created that contains speech marks, such as This is my "Example" headline, the JSON will look a little like the following with the speech marks slashed:

{"titles":{"headline":{"value":" This is my \"Example\" headline"}}}

This is copied using the following method:

public static function set_meta( $object_id, $meta_key, $meta_value ) {
update_post_meta( $object_id, $meta_key, $meta_value );
}

This uses update_post_meta which under the hood performs runs a remove slash function. This breaks the JSON stored in the meta field, and breaks the block in the editor.

Integration with ElasticPress

Currently the plugin doesn't add the syndicated posts to index. This behavior happens because the plugin runs it's actions on the background for a better user experience, but doing so it doesn't check all the necessary conditions for ElasticPress to index it automatically.

Possible Solution:
Artificially run the necessary actions to trigger post indexing after syndicating posts or just run the indexing action.

Write up developer documentation

I've noticed a pattern where projects making use of this plugin consistently run into unforeseen delays which can be traced back to misunderstandings of the basic data model used by the plugin, the functionality enabled by default, and the expected points to extend it at. This is exacerbated by the fact that it's written in an OOP style which isn't consistent with most of the Human Made libraries.

Opening this ticket as a reminder that we want to go back through this and write up solid developer documentation for future engineers who try to integrate it into custom workflows.

Leave a note of pain points to cover below:

  • TK

Term syncing not scheduled

Term syncing is not scheduled due to use of hooks create_term and edit_term that fire before term cache is cleaned. So when a new term is created, a site is selected for syncing and the term updated, the term isn't synced. An extra click of the "Update" button has to be done.

To fix this properly, the hooks create_term and edit_term should replaced with created_term and edited_term which fire after the term cache has been cleaned making sure that any newly selected sites on term edit screen will have CRON jobs scheduled for them to receive the term.

Static variables in inherited method changes in PHP 8.1 affect the plugin admin features

Static variables in inherited method changes in PHP 8.1 affect the plugin admin features.

Before PHP 8.1, when a method containing static variables is inherited, the inherited method uses an independent set of static variables. After PHP 8.1, one set of static variables per method is maintained, which means it is shared across classes. You can find more details here. Unfortunately, this is causing a problem with the extendable-aggregator plugin.

See how the output change between different PHP versions here.

It can be fixed by changing the get_instance method here like below or with better alternative.

    /**
     * Get the singleton class instance
     *
     * @return static Base
     */
    public static function get_instance() {

        static $instance = [];

        if ( empty( $instance[ static::class ] ) ) {
            $instance[ static::class ] = new static();
        }

        return $instance[ static::class ];
    }

See it in action here with a similar example as above.

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.