Viewing 15 replies - 1 through 15 (of 16 total)
  • Thread Starter pako69

    (@pako69)

    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'
    Plugin Author Presslabs

    (@presslabs)

    Hi @pako69,

    If you’re installing from our GIT repo, please make sure to use composer install --prefer-dist --o to generate the necessary vendor files. That is why it’s throwing a file not an existing error for the autoloader.

    Thread Starter pako69

    (@pako69)

    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

    Plugin Author Presslabs

    (@presslabs)

    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.zip

    Thread Starter pako69

    (@pako69)

    No 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 retry

    Thread Starter pako69

    (@pako69)

    But I see your zip is 10Mo ?! It’s the reason why… we are limited to 8Mo upload

    Plugin Author Presslabs

    (@presslabs)

    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.

    Thread Starter pako69

    (@pako69)

    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

    Plugin Author Presslabs

    (@presslabs)

    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?

    Thread Starter pako69

    (@pako69)

    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…

    Thread Starter pako69

    (@pako69)

    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 / required

    Thanks

    Plugin Author Presslabs

    (@presslabs)

    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);

    Thread Starter pako69

    (@pako69)

    I understand but it becomes very technical… ??

    It’s no possible to use the custome.template.php?

    Thanks

    Thread Starter pako69

    (@pako69)

    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.
    Plugin Author Presslabs

    (@presslabs)

    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 new toplytics-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.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Upload Auth Config File: do not work’ is closed to new replies.