Plugin Directory

Changeset 3115646

Timestamp:
07/10/2024 01:55:07 PM (2 weeks ago)
Author:
Md. Jahidul Islam
Message:

Release new version 3.1.0 with code optimization and data migration process

Location:
x-scroll-to-top-responsive/trunk
Files:
24 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • x-scroll-to-top-responsive/trunk/assets/css/custom.css

    r2238460 r3115646  
    2424
    2525.scroll-to-top {
     26
    2627    position:  fixed;
    2728    bottom: 4%;
  • x-scroll-to-top-responsive/trunk/assets/js/active.js

    r2238460 r3115646  
    11(function ($) {
    2     "use strict";
    3    
    4     /* =========================================================================
    5           Window Scroll Function
    6        =========================================================================*/
    7     jQuery(window).on('scroll', function () {
    8         /* =================================================================
    9             Scroll to Top active
    10           ===================================================================*/
    11         if ($(window).scrollTop() > 300) {
    12             $(".scroll-to-top").fadeIn();
    13         } else {
    14             $(".scroll-to-top").fadeOut();
    15         }
     2    "use strict";
     3   
     4    // Cache the selectors for better performance
     5    var $window = $(window);
     6    var $scrollToTop = $(".scroll-to-top");
    167
    17     });
    18     /* =================================================================
    19             Window Load Function
    20     ===================================================================*/
    21     $(window).on('load', function () {
    22         /* =================================================================
    23                 Scroll Bottom to Top
    24           ===================================================================*/
    25         $(".scroll-to-top").on("click", function () {
    26             $('html, body').animate({ scrollTop: 0 }, 800);
    27             return false;
    28         });
    29     });
     8    // Ensure the button is hidden initially using JavaScript
     9    $scrollToTop.hide();
    3010
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
    3166
    3267}(jQuery));
  • x-scroll-to-top-responsive/trunk/plugin-hook.php

    r2238460 r3115646  
    11<?php
    22/*
    3 Plugin Name:X-Scroll To Top - Responsive
     3Plugin Name:X-Scroll To Top - Responsive
    44Plugin URI: https://wordpress.org/plugins/x-scroll-to-top-responsive/
    5 Description: This plugin will add a scroll to top button on footer center.
     5Description: This plugin will add a scroll to top.
    66Author: Jahid
    77Author URI: https://jahid.co
    8 Version: 3.0.0
    9 Copyright 2014-2019  Md. Jahidul Islam  (email : contact@jahid.co)
     8Text Domain: x-scroll-to-top-responsive
     9Domain Path: /i18n/languages
     10Version: 3.1.0
     11*/
    1012
    11 This program is free software; you can redistribute it and/or modify
    12 it under the terms of the GNU General Public License, version 2, as
    13 published by the Free Software Foundation.
     13if (!defined('ABSPATH')) exit; // Exit if accessed directly
    1414
    15 This program is distributed in the hope that it will be useful,
    16 but WITHOUT ANY WARRANTY; without even the implied warranty of
    17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    18 GNU General Public License for more details.
    19 
    20 You should have received a copy of the GNU General Public License
    21 along with this program; if not, write to the Free Software
    22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    23 */
    24 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
     15// Include the Composer autoloader
     16require_once __DIR__ . '/vendor/autoload.php';
    2517
    2618/**
    27  *  Plugin Text Domain
     19 * Plugin Text Domain
    2820 */
    2921function xscroll_domain_load_function(){
    30     load_plugin_textdomain('xscroll', false, dirname(__FILE__)."/languages");
     22/languages");
    3123}
    32 add_action('plugins_loaded','xscroll_domain_load_function');
    33 
     24add_action('plugins_loaded', 'xscroll_domain_load_function');
    3425
    3526/**
    3627 * Currently plugin version.
    37  * Start at version 1.0.0
     28 * Start at version .0
    3829 * Rename this for your plugin and update it as you release new versions.
    3930 */
    40 define( 'XSTR_VERSION', '3.0.0' );
     31define();
    4132
    4233define('XSTR_PLUGIN_URL', plugin_dir_url(__FILE__));
     
    5041/**
    5142 * The code that runs during plugin activation.
    52  * This action is documented in includes/class-jahid-activator.php
    5343 */
    5444function activate_XSTR() {
    55     require_once XSTR_PLUGIN_PATH . 'inc/class-XSTR-activator.php';
    56     XSTR_Activator::activate();
     45    CoderPlus\XScrollTopResponsive\Activator::activate();
    5746}
    5847
    5948/**
    6049 * The code that runs during plugin deactivation.
    61  * This action is documented in includes/class-jahid-deactivator.php
    6250 */
    6351function deactivate_XSTR() {
    64     require_once XSTR_PLUGIN_PATH . 'inc/class-XSTR-deactivator.php';
    65     XSTR_Deactivator::deactivate();
     52    CoderPlus\XScrollTopResponsive\Deactivator::deactivate();
    6653}
    6754
    68 register_activation_hook( __FILE__, 'activate_XSTR');
    69 register_deactivation_hook( __FILE__, 'deactivate_XSTR' );
     55register_activation_hook(__FILE__, 'activate_XSTR');
     56register_deactivation_hook();
    7057
    71 /**
    72  * The core plugin class that is used to define internationalization,
    73  * admin-specific hooks, and public-facing site hooks.
    74  */
     58use CoderPlus\XScrollTopResponsive\Core;
     59use CoderPlus\XScrollTopResponsive\Assets;
     60use CoderPlus\XScrollTopResponsive\Customizer;
     61use CoderPlus\XScrollTopResponsive\AdminNotice;
     62use CoderPlus\XScrollTopResponsive\CoreUpdate;
    7563
     64
    7665
    77 require_once XSTR_PLUGIN_PATH.'inc/class-XSTR-core.php';
    78 require_once XSTR_PLUGIN_PATH.'inc/class-XSTR-assets.php';
    79 require XSTR_PLUGIN_PATH.'inc/class-XSTR-custom-customizer.php';
    80 require_once XSTR_PLUGIN_PATH.'inc/class-XSTR-customizer.php';
    81 require_once XSTR_PLUGIN_PATH.'inc/class-XSTR-admin-notice.php';
    82 
    83 
    84 
    85 add_action('admin_notices', 'XSTR_admin_notice::admin_notices_old_user');
    86 
    87 $core = new XSTR_core();
     66// Initialize the Core class
     67$core = new Core();
    8868$core->init();
    8969
    90 $assets = new XSTR_assets();
     70// Initialize the CoreUpdate class
     71CoreUpdate::init();
     72
     73// Hook the migration function
     74register_activation_hook(__FILE__, [CoreUpdate::class, 'run_migrations']);
     75add_action('upgrader_process_complete', function($upgrader_object, $options) {
     76    if ($options['action'] == 'update' && $options['type'] == 'plugin' ) {
     77        if (isset($options['plugins']) && in_array(plugin_basename(__FILE__), $options['plugins'])) {
     78            CoreUpdate::run_migrations();
     79        }
     80    }
     81}, 10, 2);
     82
     83$assets = new Assets();
    9184$assets->init();
    9285
    93 $customizer = new XSTR_customizer();
     86$customizer = new ustomizer();
    9487$customizer->init();
    9588
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
  • x-scroll-to-top-responsive/trunk/readme.txt

    r2238516 r3115646  
    11=== X-Scroll To Top - Responsive ===
    22Contributors: Md. Jahidul Islam
    3 Tags: scroll to top, scroll up, Responsive, Scroll button, free scroll to top, scroll up button
    4 Requires at least: 4.0
    5 Tested up to: 5.3.2
     3Tags: scroll to top, scroll up, Responsive, scroll up button
     4Requires at least: .0
     5Tested up to:
    66Stable tag: 3.0.0
    77Requires PHP: 5.4
     
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 "X-Scroll To Top - Responsives" plugin will add a scroll up button bottom center of your website. It came with bunch of custom option.
     11.
    1212
    1313== Description ==
    1414
    15 **X Scroll to top plugin makes the scrolling of a page easier. It appends an icon at bottom of the page which attracts user attention. When the user click on this button
    16 
    17 it smoothly scrolls to the top of Webpage. X Scroll To Top plugin offers custom settings flexibility which no other plugin have. It is a simple scroll up plugin just
    18 
    19 with 4 option but it has ability to fulfill all needed about scroll up button.
     15The X-Scroll To Top plugin makes scrolling a webpage easier by adding an attention-grabbing icon at the bottom. When users click this button, it smoothly scrolls the page back to the top. The plugin offers a unique level of customization with flexible settings, allowing users to personalize the button's appearance and behavior. Users can also see changes visually in real-time, making it easy to tailor the scroll-up button to their site’s design and functionality. Despite its simplicity with just four options, it effectively meets all the needs for a scroll-up button.
    2016
    2117
    22 > Features:
    23 > 1.    15 Different scroll up icon
    24 > 2.    Custom icon size
    25 > 3.    Custom Circle or border radius option
    26 > 4.    Unlimited icon color
    27 > 5.    Unlimited icon background color option
    28 > 6.    Unlimited icon hover color
    29 > 7.    Unlimited icon background color
    30 > 8.    Custom Scroll up icon position
    31 > 9.    Fully responsive design
    32 > 10.   Custom scroll up  position for mobile & tab
    33 > 11.   Add option for hide notice in mobile version
     18###Features
     19* 15 Different Scroll-Up Icons: Choose from 15 unique icons to customize the scroll-up button.
     20* Custom Icon Size: Easily adjust the icon size to fit your website’s design.
     21* Custom Circle or Border Radius Option: Personalize the button’s shape with customizable border radius settings.
     22* Unlimited Icon Color Options: Select any color for your scroll-up icon to match your site’s theme.
     23* Unlimited Icon Background Color Options: Customize the background color of the icon for better visibility and style.
     24* Unlimited Icon Hover Color: Change the icon color when hovered over to enhance user interaction.
     25* Unlimited Icon Hover Background Color: Adjust the background color of the icon on hover for a dynamic effect.
     26* Custom Scroll-Up Icon Position: Position the scroll-up button anywhere on the screen to suit your layout.
     27* Fully Responsive Design: Ensures the scroll-up button looks great on all devices, including desktops, tablets, and mobile phones.
     28* Custom Scroll-Up Position for Mobile & Tablet: Set different positions for the scroll-up button on mobile and tablet devices for better accessibility.
     29* Option to Hide Notice on Mobile: Add an option to hide the scroll-up button on mobile devices to improve user experience.
    3430
    3531https://vimeo.com/389293056
     
    5652== Frequently Asked Questions ==
    5753
    58 = Does it works with all theme? =
     54= ? =
    5955
    60 We tested with mejor themes & it works really fine. Still if it not works just contact with me via support forum or email me contact@jahid.co.
     56To access the settings for the X-Scroll To Top plugin, go to your WordPress dashboard and navigate to Appearance -> Customize -> X-Scroll To Top Settings. Here you can customize the scroll-up button according to your preferences.
     57
     58= Can I customize the colors of the scroll-up button? =
     59
     60Absolutely! You can customize the icon color, background color, hover color, and hover background color. These options are available in the Customizer settings, allowing you to match the scroll-up button with your site’s design.
     61
     62= What if I want to hide the scroll-up button on mobile devices? =
     63
     64You can choose to hide the scroll-up button on mobile devices by enabling the corresponding option in the Customizer settings.
     65
     66= How do I set the border radius for the scroll-up button? =
     67
     68You can set the border radius from the Customizer settings under the X-Scroll To Top section. This allows you to create a circular or rounded scroll-up button based on your preference.
     69
     70= Can I set different settings for mobile and tablet devices? =
     71
     72Yes, the X-Scroll To Top plugin allows you to set different scroll-up button positions for mobile and tablet devices, ensuring optimal user experience across all devices.
     73
     74
     75= Does it work with all themes? =
     76
     77Yes, the X-Scroll To Top plugin is designed to be compatible with all WordPress themes. It integrates seamlessly to provide a smooth scroll-to-top functionality regardless of the theme you are using.
     78
     79= How do I change the icon of the scroll-to-top button? =
     80
     81You can change the icon from the WordPress Customizer. Go to Appearance -> Customize -> X-Scroll To Top Settings and choose your preferred icon from the available options.
    6182
    6283
     
    7091
    7192== Changelog ==
     93
     94
     95
     96
     97
     98
     99
     100
     101
     102
    72103=3.0.0=
    73104Note: Before update please check new Screenshots and documentation
     
    84115
    85116= 2.0 =
    86 -Improve Code
     117Improve Code
    87118
    88119= 1.0 =
    89 - initial release
     120** initial release
     121
     122== Upgrade Notice ==
     123
     124= 3.1.0 =
     125Before updating, please review the new screenshots and documentation. We've made significant changes to the core functionalities and added a migration feature to transfer data from the old settings in version 2.0.2 to the new version.
  • x-scroll-to-top-responsive/trunk/uninstall.php

    r2238460 r3115646  
    3434 */
    3535 
    36 global $wpdb;
    37 $name = 'xstr_option';
    38 $table = $wpdb->prefix.'_options';
    39 $wpdb->delete( $table, array( 'option_name' => $name ) );
     36 global $wpdb;
     37 $name = 'xstr_option';
     38 $table = $wpdb->prefix . 'options'; // Corrected the table name concatenation
     39 
     40 // Check if the option exists
     41 $option_exists = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM $table WHERE option_name = %s", $name));
     42 
     43 if ($option_exists) {
     44     // If the option exists and name is not empty, delete it
     45     if (!empty($name)) {
     46         $wpdb->delete($table, array('option_name' => $name));
     47     }
     48 }
     49 
     50 
    4051
    4152
Note: See TracChangeset for help on using the changeset viewer.