Git Product home page Git Product logo

parsely / wp-parsely Goto Github PK

View Code? Open in Web Editor NEW
61.0 29.0 31.0 57.63 MB

The official WordPress plugin for Parse.ly - makes it a snap to add the required tracking code to enable Parse.ly on your WordPress site.

Home Page: https://wordpress.org/plugins/wp-parsely/

License: GNU General Public License v2.0

PHP 62.99% CSS 0.01% Shell 0.49% JavaScript 0.19% SCSS 3.32% TypeScript 33.00%
wordpress wordpress-plugin parsely analytics wpvip-plugin

wp-parsely's People

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  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  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar

wp-parsely's Issues

Clean up the settings page

We're more than a little bit text heavy on the settings page. Much of the information is good, but we don't need it in everyone's faces all the time and some of the copy is probably too verbose. We should migrate to using something like https://jqueryui.com/tooltip/ to show information on demand maybe.

Option to maintain modifications to tracker placement

We frequently encourage publishers who face consistent discrepancies to move our tracking code closer to GA (or similar). They can modify this in their WP instance, but every new release would undo it.

Can we please make it an option to keep this (and other) modifications?

Support Google AMP

WordPress actually has an example using Parse.ly of how to hook into their amp_post_template_analytics filter: https://github.com/Automattic/amp-wp/blob/master/readme.md#analytics

cc: @hbbtstar

More context from them:

"You could pretty easily integrate this into the existing Parsely plugin to make it even more seamless for both VIP and self-hosted users (warning: code is untested)":

add_action( 'pre_amp_render_post', 'parsely_amp_add_actions' );
function parsely_add_amp_actions() {
    add_filter( 'amp_post_template_analytics', 'parsely_amp_add_analytics' );
}

function parsely_amp_add_analytics( $analytics ) {
    global $parsely;
    $parsely_options = $parsely->get_options();

    if ( empty( $parsely_options['apikey'] ) ) {
        return $analytics;
    }

    $analytics['wp-parsely'] = array(
        'type' => 'parsely',
        'attributes' => array(),
        'config_data' => array(
            'vars' => array(
                'apikey' => $parsely_options['apikey'],
            )
        ),
    );

    return $analytics;
}

Build horizontal version of recommendations widget

The WordPress recommendations widget currently comes in a vertical flavor, good for sidebars.

Might we get a horizontal version, something that could be used on index pages and at the bottom of article columns, similar to the Outbrains and Taboolas of the world?

Provide support for users to whitelist specific post types

Currently, when implemented, the Parse.ly tracker is set for all post types in the publisher's database. A user has suggested that we allow users to whitelist custom post types.

As the user noted, "If you have a site with multiple post types, you probably only want analytics on one or two."

Add content recommendations

Parse.ly customers have the ability to display personalized or contextual content recommendations on their site with the Parse.ly API. We should enable this maybe via a sidebar widget?

Find and remove escaped static strings?

From the 2018-05-02 WordPress VIP feedback:

I noticed a number of escaped static strings. Escaping is unnecessary for hardcoded strings, e.g.:

echo 'hello'; // this does not need escaping
echo esc_html( 'hello' ); // not a blocker, but unnecessary

It's only when variables are used that escaping is required. Static hardcoded primitives are fine.

I couldn't find any examples of this. @jtotoole or @richeymichael do you see what the referrer is talking about?

Allow users to add "top posts" widgets easily to templates

As an author/admin of a WordPress blog, I'd like to be able to easily add a widget to my blog that shows the top posts so that users can easily see popular content and (hopefully) remain on my site.

I'd be able to configure this widget to limit to a specific time range and style it to my needs.

Check compatibility with WordPress 4.6

Got this email today -- new WordPress version comes out August 16th, so I guess we can test locally at that point and then update our ReadME? The field guide they link to will be a solid resource to peruse to gauge whether there are any changes that could affect this plugin.

WordPress 4.6 is scheduled to be released on 16 August 2016. Are your plugins ready?

After testing your plugins and ensuring compatibility, it only takes a few moments to change the readme "Tested up to:" value to 4.6. This information provides peace of mind to users and helps encourage them to update to the latest version.

Here are the current "Tested up to:" values for each of your plugins:

For each plugin that is compatible, you don't need to release a new version -- just change the stable version's readme value.

Looking to get more familiar with 4.6? Read this roundup post on the core development blog to check out the changes made to register_meta(), native fonts, persistent comment cache, Customizer APIs, WP_HTTP API, and much, much more: https://make.wordpress.org/core/2016/07/26/wordpress-4-6-field-guide/

Revisit author name grabbing logic

We've gotten reports that we aren't fetching author name properly in parsely-page values. Need to revisit the logic there and ensure we're pulling author name correctly.

parsely-page values are not properly escaped

If a post has a the following tags: ['something', '"another thing"'], it'll be converted to:

{
  ...
  "tags": ""another thing"",
  ...
}

which Parse.ly crawlers read as "tags": ""another thing"" which is invalid JSON.

We should follow escaping instructions outlined here until we move to JSON-LD.

Investigate WP channels for sections

A Parse.ly customer asked if we could use "channels" for parsely-page sections. I'm currently unfamiliar with channels, but sounds like something we should investigate.

Compatibility with official Wordpress FBIA plugin

Per Wordpress:

"We've added a couple of compat layers into the FBIA plugin for some common plugins, but we can also do this outside of the plugin. That'd probably be better for you, as you can maintain that code yourselves without relying on us and it can sit alongside the AMP integration.

The Google Analytics code is a good example: https://github.com/Automattic/facebook-instant-articles-wp/blob/master/compat/class-instant-articles-google-analytics-for-wordpress.php

In the Parse.ly plugin, you could add a class with a similar structure.

The key bit is to hook into instant_articles_compat_registry_analytics to register your compatibility layer with the FBIA plugin.

Then, get_raw_embed_code() simply returns the HTML. This HTML is then put through the Facebook Instant Article SDK to produce FBIA-compatible markup.

In the GA example you can see that get_raw_embed_code() goes elsewhere to fetch the code, but you can do that however works best for you."

Add multiple author support

Parse.ly recently introduced multiple author support via parsely-meta, the plugin should support this at the same time we look at our author grabbing logic in #13.

Make sure LD+JSON is schema compliant

On vanilla WP installs, the WebPage JSON is not schema compliant according to Google's structured data tool. We should make sure that all the JSON the plugin outputs has no errors in the structured data tool, for index pages or for post pages.

Not escaping unicode quotes properly

The New Yorker is using our WP Plugin and have recently run into an issue where some posts are not surfacing in the dashboard. Upon inspection, these posts are being discarded due to improperly escaped quotes. However, the quotes that are not properly escaped are the unicode equivalent of a double quote. ( " )

I've copied a few of the missing posts below:

http://www.newyorker.com/tech/elements/holocene-anthropocene-human-epoch

http://www.newyorker.com/culture/cultural-comment/possessed-james-brown-eighteen-minutes

http://www.newyorker.com/culture/cultural-comment/invisibilia-evolving-art-radio

In the first URL above, here is the part of the metadata tag that is breaking the tag.

tags; magazine","anthropocene","extinction","fossils","geologists","geology","holocene","jan zalasiewicz","nuclear weapons","stratigraphy","the european discovery of america","post_type: post"]}'

The first of the above tags has the unicode double quote and it is not escaped. Do we need to apply a change to our WP plugin? Or is this something that is happening on the New Yorker's end?

Add setting for disabling JS

Some publishers want to use the plugin only for metadata, and use Tealium / Segment or other tag managers to manage the JS. There should be an option in settings to use our plugin just for metadata and not for JS

Split main plugin file into smaller files

From 2018-05-02 VIP review:

the main plugin file and class Parsely is 1300 lines long, which is rather large. For future reviews it would reduce churn to break this into smaller files.

Check for wpcom_vip_get_term_by before using get_term_by

wpcom-vip_get_term_by is the cached version of get_term_by, though it's not part of the Wordpress core. We should make a new function to check for the existence of the former before falling back to the latter. That would look something like:

public function parsely_get_term_by(args) {
    if( function_exists('wpcom_vip_get_term_by') ) {
        wpcom_vip_get_term_by(args);
    } else {
       get_term_by(args);
    }
}

Lines to be changed:
https://github.com/Parsely/wp-parsely/blob/master/wp-parsely.php#L670
https://github.com/Parsely/wp-parsely/blob/master/wp-parsely.php#L672
https://github.com/Parsely/wp-parsely/blob/master/wp-parsely.php#L700
https://github.com/Parsely/wp-parsely/blob/master/wp-parsely.php#L707

Support custom Section field option

Some publishers use custom variables instead of Section; unfortunately this means that their "section" keys are null when passed as is through the wp plugin.

Could we add a feature kind of like "use sections as tags" that allows publishers to specify what field they're using as their section?

Add roadmap.md

To encourage a wider range of users to contribute to wp-parsely, we should develop and maintain a roadmap document hosted here on github that allows users to understand various ways they can contribute to the future of the plugin.

I'll put forward some initial ideas, but will look to others to improve on / curate the list.

Debug mode reports strict standards error that results in "headers already sent" notices

When I have debug mode turned on in WordPress, I get a notice saying "Strict standards: Redefining already defined constructor for class Parsely in .../wp-parsely.php on line 64".

This creates a headers already sent notice right after causing my site to stop loading. The only way around is to disable debug mode which the results in bugs in my code because I can't receive errors and the like.

Any idea of what the fix is exactly?

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.