Upload Auth Config File: do not work
-
Hi
When I try to upload my .json file: https://i.postimg.cc/9fzmSzST/toplytics-2.jpg the same page refresh and return here: https://i.postimg.cc/JhgrWMVF/toplytics-1.jpg
Nothing more…
Thanks
-
I tried to install your new 4.0.2 version but…:
PHP Fatal error: require_once(): Failed opening required '/home/mysite/public_html/wp-content/plugins/src/vendor/autoload.php'
Hi @pako69,
If you’re installing from our GIT repo, please make sure to use
composer install --prefer-dist --o
to generate the necessaryvendor
files. That is why it’s throwing a file not an existing error for the autoloader.Hi @presslabs
I’m not technical enough to do this… So is there a solution to this issue or it’s better the new version?
Thanks
Hi @pako69,
Please try to install this version and let me know how it works for you:
https://dl.presslabs.net/toplytics_4.0.2.zipNo it do not install, I have an error message at the upload of the plugin (/wp-admin/update.php?action=upload-plugin)
> The followed link is expired.
> Please retryBut I see your zip is 10Mo ?! It’s the reason why… we are limited to 8Mo upload
I see. Please e-mail us at support[at]presslabs.com and if possible share an admin account with us so we can further investigate this issue. You can use https://onetimesecret.com/ to share sensitive info like login details when e-mailing us.
I can’t give you access to this production website right now because all our admin websites are IPs restricted.
I will try to upload it by FTP
I see, yet the ZIP with the new version is ~10MB due to the large vendor folder. Please let me know how it works when uploading via FTP?
The install works with Upload.
I’m using the tricky Private Authorization method ^^ and I had a problem, Google said:
Google hasn’t verified this app
The app is requesting access to sensitive info in your Google Account. Until the developer verifies this app with Google, you shouldn’t use it.
If you’re the developer, submit a verification request to remove this screen.Ok but when I go to the Google OAuth consent screen, it say: Verification not required
Very strange, so I click on link “Advanced” where the Google warning message was and continue with a “Unsafe method”… the it return to the WordPress admin and I was able to chose my G.A. View…
Ok it works ?? but it do not show the featured images…
I have check this option: Include Featured Image in JSON Output
I have created a custom.template.php but in this file it seems that there is no option to get the featured images ?
* (object) $posts – all the posts to be displayed in the top with the following format
* {
* ‘permalink’ = ‘https://permalink.com/’,
* ‘title’ = ‘This is the post title’,
* ‘views’ = 123
* } => default: none / requiredThanks
Hi @pako69,
That option will add the ‘featured_image’ parameter in the JSON output via WP REST API or via the custom path you configured. In the backend, it uses the get_the_post_thumbnail_url function to get the URL of the image. You can also use this in your custom code if you’re not using AJAX to load the post content. Only the AJAX method uses this custom JSON file so it’s not required to enable this.
You can find more details and implementation examples in the docs here: https://www.presslabs.com/docs/code/toplytics/how-to-use-toplytics/
Right at the very end of this help page you can see an example:
$toplytics_results = toplytics_get_results( $toplytics_args ); if ( $toplytics_results ) { $k = 0; foreach ( $toplytics_results as $post_id => $post_views ) { echo (++$k) . ') <a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_the_title( $post_id ) ) . '">' . get_the_title( $post_id ) . '</a> - ' . $post_views . ' Views<br />'; } }
Where you could for example get the featured image using get_the_post_thumbnail_url as such:
get_the_post_thumbnail_url($post_id);
I understand but it becomes very technical… ??
It’s no possible to use the custome.template.php?
Thanks
The top will be an Elementor Widget that can use Javascript (for people like me that use WP Rocket as caching)… ??
- This reply was modified 3 years, 7 months ago by pako69.
Sure @pako69, it is possible. Follow the steps:
1. Copy the resources > views > frontend > widget.template.php file to your active theme folder and rename it to
toplytics-template.php
(if you have not done this already)
2. Make sure you’re not using Ajax loading from your widget settings.
3. Open the newtoplytics-template.php
file you have just copied and renamed and edit the part between lines 142 and 156. Here you should add the featured image. For example, you could add it on line 146 by adding the bellow code right after the<li class="toplytics-list-item">
code on a new line:<?php $toplytics_featured_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post ) )[0]; if ($toplytics_featured_image) : ?> <a class="toplytics-anchor" href="<?php echo $post['permalink']; ?>" title="<?php echo $post['title']; ?>" target="<?php echo ( isset( $target ) && $target ) ? $target : 'self'; ?>"> <img src="<?php echo $toplytics_featured_image; ?>" alt="<?php echo $post['title']; ?>" /> </a> <?php endif; ?>
I have not tested this code, so please do let me know how it works for you. You might need to adjust it a bit further for it to look good via CSS.
- The topic ‘Upload Auth Config File: do not work’ is closed to new replies.