HEX
Server: Apache/2
System: Linux ns65.hostinglotus.net 4.18.0-553.16.1.el8_10.x86_64 #1 SMP Thu Aug 8 07:11:46 EDT 2024 x86_64
User: newsnnno (1225)
PHP: 8.2.20
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/newsnnno/public_html/wp-content/plugins/file-manager/inc/class.review.php
<?php
// Security Check
defined('ABSPATH') || die();

if(!class_exists('FMReviewClass')):
class FMReviewClass{

    // 0. Not asked yet
    // 1. Asked and clicked review
    // 2. Ask me later
    // 3. Not interested to review.

    public $status = array(
        'not-asked-yet',
        'review-successfull',
        'remind-me-later',
        'not-interested'
    );

    function __construct(){
        // Checking the review status
        $review_status = isset($_GET['fm-review-status']) ? sanitize_text_field($_GET['fm-review-status']): '';
        if( in_array( $review_status, $this->status ) ){

            switch($review_status){
                case 'review-successfull':
                    $this->set_status('review-successfull', time());
                    ?><script>window.location = "https://wordpress.org/support/plugin/file-manager/reviews/#new-post";</script><?php
                    break;
                case 'remind-me-later':
                    $this->set_status('remind-me-later', time());
                    break;
                case 'not-interested':
                    $this->set_status('not-interested', time());
                    break;
                default:
                    break;
            }
        }
    }

    // Get the current status of the review.
    function get_status(){
        // Check if any update is saved
        return unserialize(
            get_option(
                'fm-review-data',
                serialize(
                    array('not-asked-yet', time())
                )
            )
        );
    }

    function set_status($status, $time){
        update_option(
            'fm-review-data',
            serialize(
                array($status, $time)
            )
        );
    }

    // Trenders the block.
    function render(){
        $status = $this->get_status();
        if($status[0] == 'not-interested') if( time() < ( (int)$status[1] + ( 7 * 24 * 60 * 60 ) ) ) return;
        if($status[0] == 'remind-me-later') if( time() < ( (int)$status[1] + ( 24 * 60 * 60 ) ) ) return;
        if( $status[0] == 'review-successfull' ) return;

    ?>
        <div class="gb-fm-row review-block">
            <div class="message">
                <?php _e("We are continiously developing and maintining the plugin. If you like our plugin you can post a review. It is very much appriciated.", 'file-manager'); ?>
            </div>
            <div class="actions">
                <a target="_blank" href="admin.php?page=file-manager&fm-review-status=review-successfull" class="btn btn-review" title="<?php _e("Leave us a review.", 'file-manager'); ?>"><?php _e("I like your plugin!", 'file-manager'); ?></a>
                <a href="admin.php?page=file-manager&fm-review-status=remind-me-later" class="btn" title="<?php _e("Remind me later.", 'file-manager'); ?>"><?php _e("I don't have time right now.", 'file-manager'); ?></a>
                <a href="admin.php?page=file-manager&fm-review-status=not-interested" class="btn btn-not-interested" title="<?php _e("Don't ask again.", 'file-manager'); ?>"><?php _e("I don't care!", 'file-manager'); ?></a>
            </div>
		</div>
    <?php }

}
endif;