Conversation
…actor Conflicts: hmtp.admin.php
Coding standards and inline docs
…actor Conflicts: hmtp.admin.php
…ded in the returned posts
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. |
adding access to ga client and settings
…s count if so otherwise, set count.
Check if post_id exists in the array of top posts and add to the view…
Member
|
@kevinlangleyjr Looks like you want to take over maintaining this plugin 😉 Shall we merge this pull request, given everyone's using it? |
|
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. |
| $title = isset( $instance[ 'title' ] ) ? $instance[ 'title' ] : 'Most Popular'; | ||
|
|
||
| $args = wp_parse_args( | ||
| (array) $instance['args'], |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
Could we possibly use Composer to pull in the GAPI client code? Would make it easier to maintain and much lighter.
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
Fix PHP 7.4 warnings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There were a couple of issues with this plugin...
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