Skip to content

Refactor/Rewrite#3

Open
mattheu wants to merge 55 commits into
masterfrom
refactor
Open

Refactor/Rewrite#3
mattheu wants to merge 55 commits into
masterfrom
refactor

Conversation

@mattheu

@mattheu mattheu commented Oct 31, 2013

Copy link
Copy Markdown
Member

There were a couple of issues with this plugin...

  1. Authentication seemed to expire.
  2. Some sites didn't even seem to work properly on some accounts.
  3. A very low number of posts was returned each query, resulting in many many API requests on larger sites.
  4. I think The 3rd party API class was using an old vesion of the API

I have updated this to use the PHP class provided by Google. It does proper oAuth so should be more robust. Updated the admin to allow the user to save all the API details.

Also update the API to return 1000 results for each API request so should be much better on larger sites. Note this version of the API supports up to 10,000 results per query.

Todo - remove unused files from Google API PHP class. Not going to do this

@mattheu

mattheu commented Jun 30, 2014

Copy link
Copy Markdown
Member Author

Made a few more optimizations. I think this is good to go. I'd really like to go ahead and get this merged. Would be good to get a 2nd opinion though.

@rmccue

rmccue commented Jul 16, 2018

Copy link
Copy Markdown
Member

@kevinlangleyjr Looks like you want to take over maintaining this plugin 😉 Shall we merge this pull request, given everyone's using it?

@mikeselander

Copy link
Copy Markdown

Ping on this :D

I've got a client using this and it'd be great to get master updated to the latest, or declare it dead.

Comment thread hmtp.widget.php
$title = isset( $instance[ 'title' ] ) ? $instance[ 'title' ] : 'Most Popular';

$args = wp_parse_args(
(array) $instance['args'],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no check ensuring that this key exists and it is thusly throwing an notice:

[30-Oct-2018 18:45:00 UTC] PHP Notice:  Undefined index: args in /chassis/content/plugins/hm-top-posts/hmtp.widget.php on line 74
[30-Oct-2018 18:45:00 UTC] PHP Stack trace:
[30-Oct-2018 18:45:00 UTC] PHP   1. {main}() /chassis/wordpress/wp-admin/widgets.php:0
[30-Oct-2018 18:45:00 UTC] PHP   2. wp_list_widgets() /chassis/wordpress/wp-admin/widgets.php:401
[30-Oct-2018 18:45:00 UTC] PHP   3. wp_widget_control() /chassis/wordpress/wp-admin/includes/widgets.php:48
[30-Oct-2018 18:45:00 UTC] PHP   4. HMTP_Widget->form_callback() /chassis/wordpress/wp-admin/includes/widgets.php:243
[30-Oct-2018 18:45:00 UTC] PHP   5. HMTP_Widget->form() /chassis/wordpress/wp-includes/class-wp-widget.php:507
[30-Oct-2018 18:45:17 UTC] PHP Notice:  Undefined index: args in /chassis/content/plugins/hm-top-posts/hmtp.widget.php on line 74
[30-Oct-2018 18:45:17 UTC] PHP Stack trace:
[30-Oct-2018 18:45:17 UTC] PHP   1. {main}() /chassis/wordpress/wp-admin/widgets.php:0
[30-Oct-2018 18:45:17 UTC] PHP   2. wp_list_widgets() /chassis/wordpress/wp-admin/widgets.php:401
[30-Oct-2018 18:45:17 UTC] PHP   3. wp_widget_control() /chassis/wordpress/wp-admin/includes/widgets.php:48
[30-Oct-2018 18:45:17 UTC] PHP   4. HMTP_Widget->form_callback() /chassis/wordpress/wp-admin/includes/widgets.php:243
[30-Oct-2018 18:45:17 UTC] PHP   5. HMTP_Widget->form() /chassis/wordpress/wp-includes/class-wp-widget.php:507

@mikeselander mikeselander left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we possibly use Composer to pull in the GAPI client code? Would make it easier to maintain and much lighter.

goldenapples and others added 5 commits February 8, 2019 17:33
This plugin was trying to perform oAuth authentication with Google
anytime it received a URL containing the query string '?code='. In
addition to breaking any other oauth integrations on a site, this
seems like just a bad idea in general.

This commit checks to make sure that the oauth handshake only happens on
the page defined as the ga_redirect_uri in the plugin settings -
ideally, this would be an admin page to prevent abuse.
Only handle GA authentication on the defined redirect URI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants