first commit

This commit is contained in:
2024-11-10 21:08:49 +01:00
commit 0d932ce5ee
14455 changed files with 2567501 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
/*--------------------------------------------------------------
* ADMIN CSS MS
*--------------------------------------------------------------
*/
.settings_page_wsp-loader .editor{
height:250px;
}
.wsp-loader-block {
background-color: #fff;
border: 1px solid #ddd;
display: block;
height: 160px;
max-width: 320px;
width: 100%;
margin-top: 20px;
margin-bottom: 20px;
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .07);
-moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .07);
-ms-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .07);
-o-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .07);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, .07);
-webkit-transition: .05s border-color ease-in-out;
-moz-transition: .05s border-color ease-in-out;
-o-transition: .05s border-color ease-in-out;
-ms-transition: .05s border-color ease-in-out;
transition: .05s border-color ease-in-out;
}
.wsp-loader-block .wsp-loader-table {
display: table;
width: 100%;
height: 100%;
}
.wsp-loader-block #loader-preview {
display: table-cell;
vertical-align: middle;
text-align: center;
}
.wsp-loader-block .wp-smart-loader {
margin-left: auto;
margin-right: auto;
}
.wsp-loader-block .wp-smart-loader.smart-loader-three {
width: 65px;
}

View File

@@ -0,0 +1,30 @@
/*--------------------------------------------------------------
* Preloader CSS MS
*--------------------------------------------------------------
*/
.smart-page-loader {
display: block;
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #fefefe;
z-index: 100000;
}
.wp-smart-loader {
position: absolute;
top: 50%;
left: 50%;
margin: -25px 0 0 -25px;
font-size: 10px;
z-index: 100001;
}
.wp-smart-body{
visibility: hidden;
}

View File

@@ -0,0 +1,513 @@
/*--------------------------------------------------------------
* Preloader CSS MS
*--------------------------------------------------------------
*/
.wp-smart-loader {
text-indent: -12345px;
}
/*--------------------------------------------------------------
* Preloader One
*--------------------------------------------------------------
*/
.smart-loader-one {
width: 50px;
height: 50px;
border-top: 1px solid rgba(0, 0, 0, 0.08);
border-right: 1px solid rgba(0, 0, 0, 0.08);
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
border-left: 1px solid rgba(0, 0, 0, 0.5);
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
-ms-border-radius: 50%;
border-radius: 50%;
-webkit-animation: spinner 700ms infinite linear;
-moz-animation: spinner 700ms infinite linear;
-ms-animation: spinner 700ms infinite linear;
-o-animation: spinner 700ms infinite linear;
animation: spinner 700ms infinite linear;
}
@-webkit-keyframes spinner {
0% {
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-o-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@-moz-keyframes spinner {
0% {
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-o-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@-o-keyframes spinner {
0% {
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-o-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes spinner {
0% {
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-o-transform: rotate(360deg);
transform: rotate(360deg);
}
}
/*--------------------------------------------------------------
* Preloader Two
*--------------------------------------------------------------
*/
.smart-loader-two {
position: relative;
width: 80px;
height: 80px;
-webkit-animation: spinner 5s infinite linear;
animation: spinner 5s infinite linear;
}
.smart-loader-two span {
width: 40px;
height: 40px;
position: absolute;
background: red;
display: block;
-webkit-animation: spinner-two 1s infinite linear;
animation: spinner-two 1s infinite linear;
}
.smart-loader-two span:nth-child(1) {
background: #2ecc71;
}
.smart-loader-two span:nth-child(2) {
left: 44px;
background: #9b59b6;
-webkit-animation-delay: .2s;
animation-delay: .2s;
}
.smart-loader-two span:nth-child(3) {
top: 44px;
background: #3498db;
-webkit-animation-delay: .4s;
animation-delay: .4s;
}
.smart-loader-two span:nth-child(4) {
top: 44px;
left: 44px;
background: #f1c40f;
-webkit-animation-delay: .6s;
animation-delay: .6s;
}
@-webkit-keyframes spinner-two {
0% {
transform: scale(1);
}
50% {
transform: scale(0.5);
}
100% {
transform: scale(1);
}
}
@keyframes spinner-two {
0% {
transform: scale(1);
}
50% {
transform: scale(0.5);
}
100% {
transform: scale(1);
}
}
/*--------------------------------------------------------------
* Preloader Three
*--------------------------------------------------------------
*/
.smart-loader-three {
position: relative;
}
.smart-loader-three span {
display: block;
bottom: 0px;
width: 9px;
height: 5px;
background: #9b59b6;
position: absolute;
-webkit-animation: spinner-three 1.5s infinite ease-in-out;
animation: spinner-three 1.5s infinite ease-in-out;
}
.smart-loader-three span:nth-child(2) {
left: 11px;
-webkit-animation-delay: .2s;
animation-delay: .2s;
}
.smart-loader-three span:nth-child(3) {
left: 22px;
-webkit-animation-delay: .4s;
animation-delay: .4s;
}
.smart-loader-three span:nth-child(4) {
left: 33px;
-webkit-animation-delay: .6s;
animation-delay: .6s;
}
.smart-loader-three span:nth-child(5) {
left: 44px;
-webkit-animation-delay: .8s;
animation-delay: .8s;
}
@-webkit-keyframes spinner-three {
0% {
height: 5px;
transform: translateY(0px);
background: #9b59b6;
}
25% {
height: 30px;
transform: translateY(15px);
background: #3498db;
}
50% {
height: 5px;
transform: translateY(0px);
background: #9b59b6;
}
100% {
height: 5px;
transform: translateY(0px);
background: #9b59b6;
}
}
@keyframes spinner-three {
0% {
height: 5px;
transform: translateY(0px);
background: #9b59b6;
}
25% {
height: 30px;
transform: translateY(15px);
background: #3498db;
}
50% {
height: 5px;
transform: translateY(0px);
background: #9b59b6;
}
100% {
height: 5px;
transform: translateY(0px);
background: #9b59b6;
}
}
/*--------------------------------------------------------------
* Preloader Four
*--------------------------------------------------------------
*/
.smart-loader-four {
width: 80px;
height: 80px;
}
.smart-loader-four .spinner-cube {
width: 33%;
height: 33%;
background-color: #9b59b6;
float: left;
-webkit-animation: spinner-four 1.3s infinite ease-in-out;
animation: spinner-four 1.3s infinite ease-in-out;
}
.smart-loader-four .spinner-cube1 {
-webkit-animation-delay: 0.2s;
animation-delay: 0.2s;
}
.smart-loader-four .spinner-cube2 {
-webkit-animation-delay: 0.3s;
animation-delay: 0.3s;
}
.smart-loader-four .spinner-cube3 {
-webkit-animation-delay: 0.4s;
animation-delay: 0.4s;
}
.smart-loader-four .spinner-cube4 {
-webkit-animation-delay: 0.1s;
animation-delay: 0.1s;
}
.smart-loader-four .spinner-cube5 {
-webkit-animation-delay: 0.2s;
animation-delay: 0.2s;
}
.smart-loader-four .spinner-cube6 {
-webkit-animation-delay: 0.3s;
animation-delay: 0.3s;
}
.smart-loader-four .spinner-cube7 {
-webkit-animation-delay: 0s;
animation-delay: 0s;
}
.smart-loader-four .spinner-cube8 {
-webkit-animation-delay: 0.1s;
animation-delay: 0.1s;
}
.smart-loader-four .spinner-cube9 {
-webkit-animation-delay: 0.2s;
animation-delay: 0.2s;
}
@-webkit-keyframes spinner-four {
0%, 70%, 100% {
-webkit-transform: scale3D(1, 1, 1);
transform: scale3D(1, 1, 1);
}
35% {
-webkit-transform: scale3D(0, 0, 1);
transform: scale3D(0, 0, 1);
}
}
@keyframes spinner-four {
0%, 70%, 100% {
-webkit-transform: scale3D(1, 1, 1);
transform: scale3D(1, 1, 1);
}
35% {
-webkit-transform: scale3D(0, 0, 1);
transform: scale3D(0, 0, 1);
}
}
/*--------------------------------------------------------------
* Preloader Five
*--------------------------------------------------------------
*/
.smart-loader-five {
width: 80px;
height: 80px;
position: relative;
}
.smart-loader-five .spinner-cube {
border: 2px solid transparent;
float: left;
width: 50%;
height: 50%;
position: relative;
-webkit-transform: scale(1.1);
-moz-transform: scale(1.1);
-ms-transform: scale(1.1);
-o-transform: scale(1.1);
transform: scale(1.1);
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
-o-box-sizing: border-box;
box-sizing: border-box;
}
.smart-loader-five .spinner-cube:before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #9b59b6;
-webkit-animation: spinner-five 2.4s infinite linear both;
animation: spinner-five 2.4s infinite linear both;
-webkit-transform-origin: 100% 100%;
-ms-transform-origin: 100% 100%;
transform-origin: 100% 100%;
}
.smart-loader-five .spinner-cube-2 {
-webkit-transform: scale(1.1) rotateZ(90deg);
transform: scale(1.1) rotateZ(90deg);
}
.smart-loader-five .spinner-cube-3 {
-webkit-transform: scale(1.1) rotateZ(180deg);
transform: scale(1.1) rotateZ(180deg);
}
.smart-loader-five .spinner-cube-4 {
-webkit-transform: scale(1.1) rotateZ(270deg);
transform: scale(1.1) rotateZ(270deg);
}
.smart-loader-five .spinner-cube-2:before {
-webkit-animation-delay: 0.3s;
animation-delay: 0.3s;
}
.smart-loader-five .spinner-cube-3:before {
-webkit-animation-delay: 0.6s;
animation-delay: 0.6s;
}
.smart-loader-five .spinner-cube-4:before {
-webkit-animation-delay: 0.9s;
animation-delay: 0.9s;
}
@-webkit-keyframes spinner-five {
0%, 10% {
-webkit-transform: perspective(140px) rotateX(-180deg);
transform: perspective(140px) rotateX(-180deg);
opacity: 0;
}
25%, 75% {
-webkit-transform: perspective(140px) rotateX(0deg);
transform: perspective(140px) rotateX(0deg);
opacity: 1;
}
90%, 100% {
-webkit-transform: perspective(140px) rotateY(180deg);
transform: perspective(140px) rotateY(180deg);
opacity: 0;
}
}
@keyframes spinner-five {
0%, 10% {
-webkit-transform: perspective(140px) rotateX(-180deg);
transform: perspective(140px) rotateX(-180deg);
opacity: 0;
}
25%, 75% {
-webkit-transform: perspective(140px) rotateX(0deg);
transform: perspective(140px) rotateX(0deg);
opacity: 1;
}
90%, 100% {
-webkit-transform: perspective(140px) rotateY(180deg);
transform: perspective(140px) rotateY(180deg);
opacity: 0;
}
}
/*--------------------------------------------------------------
* Preloader Six
*--------------------------------------------------------------
*/
.smart-loader-six {
width: 70px;
height: 70px;
position: relative;
}
.smart-loader-six .spinner-cube-1,
.smart-loader-six .spinner-cube-2 {
width: 100%;
height: 100%;
border-radius: 50%;
background-color: #3498db;
opacity: 0.6;
position: absolute;
top: 0;
left: 0;
-webkit-animation: spinner-six 2.0s infinite ease-in-out;
animation: spinner-six 2.0s infinite ease-in-out;
}
.smart-loader-six .spinner-cube-2 {
-webkit-animation-delay: -1.0s;
animation-delay: -1.0s;
}
@-webkit-keyframes spinner-six {
0%, 100% {
-webkit-transform: scale(0.0)
}
50% {
-webkit-transform: scale(1.0)
}
}
@keyframes spinner-six {
0%, 100% {
transform: scale(0.0);
-webkit-transform: scale(0.0);
}
50% {
transform: scale(1.0);
-webkit-transform: scale(1.0);
}
}
/*--------------------------------------------------------------
* Preloader Seven
*--------------------------------------------------------------
*/

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,63 @@
jQuery(document).ready(function($){
var editor_css = ace.edit("wsp-loader-opt[custom_css]"),
textarea_css = $('textarea[name="wsp-loader-opt[custom_css]"]').hide();
editor_css.setTheme("ace/theme/monokai");
editor_css.$blockScrolling = Infinity;
editor_css.getSession().setMode("ace/mode/css");
editor_css.getSession().setValue(textarea_css.val());
editor_css.getSession().on('change', function(){
textarea_css.val(editor_css.getSession().getValue());
});
var editor_html = ace.edit("wsp-loader-opt[custom_animation]"),
textarea_html = $('textarea[name="wsp-loader-opt[custom_animation]"]').hide();
editor_html.setTheme("ace/theme/monokai");
editor_html.$blockScrolling = Infinity;
editor_html.getSession().setMode("ace/mode/html");
editor_html.getSession().setValue(textarea_html.val());
editor_html.getSession().on('change', function(){
textarea_html.val(editor_html.getSession().getValue());
});
var loader_image = $('#loader-img'),
preview_image = $('#loader-preview');
wsp_init();
loader_image.on('change',function(){
wsp_init();
});
function wsp_init(){
var value =loader_image.val(),
block ='<div class="smart-page-loader">';
if( value != "" ){
$('.wsp-loader-block').show();
if(value == "Loader 1") {
block += '<div class="wp-smart-loader smart-loader-one">Loading...</div>';
} else if(value == "Loader 2") {
block += '<div class="wp-smart-loader smart-loader-two"> <span></span> <span></span> <span></span> <span></span> </div>';
} else if(value == "Loader 3") {
block += ' <div class="wp-smart-loader smart-loader-three"> <span></span> <span></span> <span></span> <span></span> <span></span> </div>';
} else if(value == "Loader 4") {
block += ' <div class="wp-smart-loader smart-loader-four"> <span class="spinner-cube spinner-cube1"></span> <span class="spinner-cube spinner-cube2"></span> <span class="spinner-cube spinner-cube3"></span> <span class="spinner-cube spinner-cube4"></span> <span class="spinner-cube spinner-cube5"></span> <span class="spinner-cube spinner-cube6"></span> <span class="spinner-cube spinner-cube7"></span> <span class="spinner-cube spinner-cube8"></span> <span class="spinner-cube spinner-cube9"></span> </div>';
} else if(value == "Loader 5") {
block += ' <div class="wp-smart-loader smart-loader-five"> <span class="spinner-cube-1 spinner-cube"></span> <span class="spinner-cube-2 spinner-cube"></span> <span class="spinner-cube-4 spinner-cube"></span> <span class="spinner-cube-3 spinner-cube"></span> </div>';
} else if(value == "Loader 6") {
block += ' <div class="wp-smart-loader smart-loader-six"> <span class=" spinner-cube-1 spinner-cube"></span> <span class=" spinner-cube-2 spinner-cube"></span> </div>';
} else if(value == "Custom Animation") {
block += '';
$('.wsp-loader-block').hide();
}
block += "</div>";
preview_image.html(block);
}
}
});

View File

@@ -0,0 +1,81 @@
(function($){
var bdy = jQuery("body:not('.elementor-editor-active')");
var value = wsp_obj.loader,
duration = ( wsp_obj.hasOwnProperty('fadeout') && wsp_obj.fadeout!="" )?wsp_obj.fadeout:2500,
delay = ( wsp_obj.hasOwnProperty('delay') && wsp_obj.delay!="" )?wsp_obj.delay:1500;
jQuery(document).ready(function() {
var flag;
if( wsp_obj.hasOwnProperty("homepage") && ( "1" == wsp_obj.homepage ) ){
if (jQuery('body:not(".elementor-editor-active")').hasClass('home') ){
add_block_after_body();
flag = "home";
}
} else {
add_block_after_body();
}
setTimeout(wsp_front_loader(),1000);
function wsp_front_loader() {
var block = '';
if( value != "" ){
switch (value){
case "Loader 1":
block += '<div class="wp-smart-loader smart-loader-one">Loading...</div>';
break;
case "Loader 2":
block += '<div class="wp-smart-loader smart-loader-two"> <span></span> <span></span> <span></span> <span></span> </div>';
break;
case "Loader 3":
block += ' <div class="wp-smart-loader smart-loader-three"> <span></span> <span></span> <span></span> <span></span> <span></span> </div>';
break;
case "Loader 4":
block += ' <div class="wp-smart-loader smart-loader-four"> <span class="spinner-cube spinner-cube1"></span> <span class="spinner-cube spinner-cube2"></span> <span class="spinner-cube spinner-cube3"></span> <span class="spinner-cube spinner-cube4"></span> <span class="spinner-cube spinner-cube5"></span> <span class="spinner-cube spinner-cube6"></span> <span class="spinner-cube spinner-cube7"></span> <span class="spinner-cube spinner-cube8"></span> <span class="spinner-cube spinner-cube9"></span> </div>';
break;
case "Loader 5":
block += ' <div class="wp-smart-loader smart-loader-five"> <span class="spinner-cube-1 spinner-cube"></span> <span class="spinner-cube-2 spinner-cube"></span> <span class="spinner-cube-4 spinner-cube"></span> <span class="spinner-cube-3 spinner-cube"></span> </div>';
break;
case "Loader 6":
block += ' <div class="wp-smart-loader smart-loader-six"> <span class=" spinner-cube-1 spinner-cube"></span> <span class=" spinner-cube-2 spinner-cube"></span> </div>';
break;
case "Custom Animation":
block += wsp_obj.custom_animation;
break;
}
if( "home" == flag ){
jQuery('body.home:not(".elementor-editor-active") .smart-page-loader').prepend(block);
}else {
// all pages
jQuery('.smart-page-loader').prepend(block);
}
}
}
function add_block_after_body(){
// jQuery('body:not(".elementor-editor-active")').prepend('<div class="smart-page-loader"></div>');
jQuery('body:not(".elementor-editor-active")').removeClass('wp-smart-body');
}
});
window.addEventListener('load',function(event){
fade_away();
function fade_away(){
jQuery('.smart-page-loader').delay(delay).fadeOut(duration);
jQuery('body:not(".elementor-editor-active")').removeClass('wp-smart-body');
}
});
}(jQuery));

View File

@@ -0,0 +1,293 @@
<?php
/**
* WP_smart_preloader a php class for creating option page with sub menu
*/
class WP_smart_preloader{
/**
* Holds the values to be used in the fields callbacks
*/
private $options;
/**
* [__construct class contructer]
*/
public function __construct() {
add_action( 'admin_menu', array( $this, 'wsp_add_submenu_option' ) );
add_action( 'admin_init', array( $this, 'wsp_register_settings' ) );
add_filter('wp_enqueue_scripts',array($this,'wsp_enqueue_styles'),0);
add_action('admin_enqueue_scripts',array($this,'wsp_enqueue_styles'));
if( !is_admin() ) {
add_action( 'wp_footer', array($this,'wsp_custom_css_front'),0);
}
add_filter( 'body_class', array($this,'wsp_add_class_body') );
}
public function wsp_enqueue_styles($hook_suffix){
if( is_admin() ){
if('settings_page_wsp-loader' == $hook_suffix ){
wp_register_script('wsp-admin-editor', 'https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.3/ace.js', '', SMART_PRELOADER_VERSION );
wp_enqueue_script( 'wsp-admin-editor' );
wp_register_script( 'wsp-admin-script',SMART_PRELOADER_URL.'assets/js/wsp-admin-script.js' , array('jquery','wsp-admin-editor'), SMART_PRELOADER_VERSION );
wp_enqueue_script( 'wsp-admin-script' );
}
wp_register_style( 'wsp-admin-style', SMART_PRELOADER_URL.'assets/css/wsp-admin-preloader.css', false, SMART_PRELOADER_VERSION );
wp_enqueue_style( 'wsp-admin-style' );
} else{
wp_register_style( 'wsp-main-style', SMART_PRELOADER_URL.'assets/css/wsp-front-preloader.css', false, SMART_PRELOADER_VERSION );
wp_enqueue_style( 'wsp-main-style' );
/*if(!wp_script_is('jquery','enqueued')){
wp_enqueue_script( 'jquery' );
} */
wp_register_script( 'wsp-main-script',SMART_PRELOADER_URL.'assets/js/wsp-main-script.js' , array('jquery'), SMART_PRELOADER_VERSION );
wp_enqueue_script( 'wsp-main-script');
// Localize the script with new data
$localized_array = $this->wsp_localized_script();
wp_localize_script( 'wsp-main-script', 'wsp_obj', $localized_array );
}
wp_register_style( 'wsp-style', SMART_PRELOADER_URL.'assets/css/wsp-smart-preload-style.css', false, SMART_PRELOADER_VERSION );
wp_enqueue_style( 'wsp-style' );
}
/**
* [wsp_add_class_body description]
* @param [array] $classes [list of body classes]
* @return [array] [list of body classes]
*/
public function wsp_add_class_body($classes){
$wsp = get_option( 'wsp-loader-opt' );
if( isset($wsp['homepage']) && $wsp['homepage'] == "1"){
if( is_home() || is_front_page() ) {
$classes[] = 'wp-smart-body';
}
} else {
$classes[] = 'wp-smart-body';
}
return $classes;
}
public function wsp_localized_script(){
$wsp = get_option( 'wsp-loader-opt' );
return $wsp;
}
public function wsp_custom_css_front(){
$wsp = get_option( 'wsp-loader-opt' );
$style = '<style type="text/css" media="all">';
$style .= $wsp['custom_css'];
$style .= '</style>';
echo $style;
}
public function wsp_add_submenu_option(){
add_submenu_page(
'options-general.php', // parent slug
'WP Smart Preloader', // page title
'WP Smart Preloader', // menu title
'manage_options', // capability
'wsp-loader', // menu slug
array($this,'wsp_submenu_callback_fn') // Callback
);
}
/**
* [wsp_submenu_callback_fn callback function of option page]
*/
public function wsp_submenu_callback_fn(){
// Set class property
$this->options = get_option( 'wsp-loader-opt' );
?>
<div class="wrap">
<form method="post" action="options.php">
<?php
// This prints out all hidden setting fields
settings_fields( 'wsp_loader' ); //option group
do_settings_sections( 'wsp-loader' ); // option name
submit_button();
?>
</form>
</div>
<?php
}
/**
* [wsp_register_settings register setting fields ]
*/
public function wsp_register_settings(){
// Register the settings with Validation callback
register_setting(
'wsp_loader', // option group
'wsp-loader-opt', // option name
array($this,'wsp_sanitize') // sanitize
);
// general info above
add_settings_section(
'wsp_loader_id', // ID
'WP Smart Preloader', // Title
array( $this, 'wsp_section_info' ), // Callback
'wsp-loader' // Page (same as submenu page menu_slug)
);
// adding fields
add_settings_field(
'wsp-loader-select', // ID
'Select Preloader', // Title
array( $this, 'wsp_preloader_list' ), // Callback
'wsp-loader', // Page (same as submenu page menu_slug)
'wsp_loader_id' // Section id
);
add_settings_field(
'wsp-loader-home-page', // ID
'Show only on Home Page', // Title
array( $this, 'wsp_preloader_homepage' ), //callback
'wsp-loader', // Page (same as submenu page menu_slug)
'wsp_loader_id' // Section id
);
// custom animation
add_settings_field(
'wsp_loader_custom-animation', // ID
'Custom Animation', // Title
array($this,'wsp_custom_animation'), // Callback
'wsp-loader', // Page (same as submenu page menu_slug)
'wsp_loader_id' // Section id
);
add_settings_field(
'wsp_loader_custom-css', // ID
'Custom CSS', // Title
array($this,'wsp_loader_custom_css'), // Callback
'wsp-loader', // Page (same as submenu page menu_slug)
'wsp_loader_id' // Section id
);
add_settings_field(
'wsp_loader_duration', // ID
'Duration to show Loader', // Title
array($this,'wsp_loader_delay'), // Callback
'wsp-loader', // Page (same as submenu page menu_slug)
'wsp_loader_id' // Section id
);
add_settings_field(
'wsp_loader_fadeout', // ID
'Loader to Fade Out', // Title
array($this,'wsp_loader_fadeOut'), // Callback
'wsp-loader', // Page (same as submenu page menu_slug)
'wsp_loader_id' // Section id
);
}
/**
* setting functions
*/
public function wsp_preloader_list(){
// wsp-loader-opt
$loader = array('Loader 1','Loader 2','Loader 3','Loader 4','Loader 5','Loader 6','Custom Animation');
$select = "<select id='loader-img' name='wsp-loader-opt[loader]'>";
$select .= "<option value=''>Select Loader</option>";
foreach($loader as $load){
$sel = ( isset( $this->options['loader'] ) && $this->options['loader'] == $load ) ? 'selected="selected"' : '';
$select .= '<option value="'.$load.'" '.$sel.'>'.$load.'</option>';
}
$select .= "</select><div class='wsp-loader-block'><div class='wsp-loader-table'><div id='loader-preview'> <span>Loading...</span> </div></div></div>";
_e($select,"wp-smart-preloader");
}
/**
* setting function for home page
*/
public function wsp_preloader_homepage(){
printf(__('<input type="checkbox" name="%s" value="1" %s />','wp-smart-preloader'),"wsp-loader-opt[homepage]",(isset($this->options['homepage']) && $this->options['homepage'] == "1")?'checked="checked"':'' );
}
/**
* setting function fadeout
*/
public function wsp_loader_fadeOut(){
printf(__('<input type="text" name="%s" value="%s" /><div>%s</div>','wp-smart-preloader'),"wsp-loader-opt[fadeout]",(isset($this->options['fadeout']) )?$this->options['fadeout']:'',__('Default:2500<br />1 second => 1000',"wp-smart-preloader") );
}
/**
* setting function delay
*/
public function wsp_loader_delay(){
printf(__('<input type="text" name="%s" value="%s" /><div>%s</div>','wp-smart-preloader'),"wsp-loader-opt[delay]",(isset($this->options['delay']) )?$this->options['delay']:'',__('Default:1500<br />1 second => 1000',"wp-smart-preloader") );
}
/**
* setting function custom css
*/
public function wsp_loader_custom_css(){
printf("Want to change Look and feel. Add your desired css here :)","wp-smart-preloader");
echo "<br />";
printf("Or add CSS for your Custom html5 animation :)","wp-smart-preloader");
echo "<br/><br/>";
printf(__('<textarea rows="12" cols="70" name="%s">%s</textarea><div class="editor" id="%s"></div>','wp-smart-preloader'),"wsp-loader-opt[custom_css]",isset($this->options['custom_css'])? esc_attr( $this->options['custom_css'] ):'',"wsp-loader-opt[custom_css]" );
}
public function wsp_custom_animation(){
printf("Want to add you own custom html5 animation? Enter your html code here.","wp-smart-preloader");
echo "<br/><br/>";
printf(__('<textarea rows="12" cols="70" name="%s">%s</textarea><div class="editor" id="%s"></div>','wp-smart-preloader'),"wsp-loader-opt[custom_animation]",isset($this->options['custom_animation'])? esc_attr( $this->options['custom_animation'] ):'',"wsp-loader-opt[custom_animation]" );
}
/**
* [wsp_sanitize sanitize function for setting]
*/
public function wsp_sanitize( $input ){
foreach($input as $k => $v) {
$newinput[$k] = trim($v);
// Check the input is a letter or a number
if(!preg_match('/^[A-Z0-9 _]*$/i', $v)) {
$newinput[$k] = '';
}
}
return $input;
}
/**
* [wsp_section_info function for section info]
* @return [echo] [display info]
*/
public function wsp_section_info(){
_e('WP Smart Preloader Setting:','wp-smart-preloader');
}
/**
* [wsp_uninstall to delete options after uninstall]
*/
public function wsp_uninstall(){
delete_option( 'wsp-loader-opt' );
}
}
// if( is_admin() ){
$wp_smart_preloader = new WP_smart_preloader();
// }

View File

@@ -0,0 +1,5 @@
<?php
/**
* uninstall hook
*/
register_uninstall_hook( __FILE__, array( 'WP_smart_preloader', 'wsp_uninstall' ) );

View File

@@ -0,0 +1,126 @@
=== WP Smart Preloader ===
Contributors: catchsquare, ashokmhrj, subedimadhu
Tags: WP Smart Preloader, Site preloader, Wordpress Preloader,posts, preload, preloader, responsive, plugin, preloader
Requires at least: 2.8
Tested up to: 6.0
Stable tag: 1.15
Donate link:https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=contact%40catchsquare%2ecom&lc=US&item_name=WP%20smart%20preloader&no_note=0&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHostedGuest
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
A Plugin to add awesome collection of Loaders and Spinners. Delightful and performance-focused Pure CSS animations.
== Description ==
WP Smart Preloader is a Simple CSS spinners and throbbers made with CSS and minimal HTML markup. It offers visual feedback in the event of content being loaded, thereby managing expectations and reducing the chance of a user abandoning your wordpress website.
You will find following features with this plugin:
* Full Responsive with Cross Broser compatible
* CSS only Preloader no Gif no Image
* Full Customize.
* Faster Loading
* Icon to circle
* No coding necessary. Activate it and play with its settings and you're Good to go
== Installation ==
1. Download and activate the plugin
2. Go to `settings` => `WP Smart Preloader`
3. Choose the Options of your choice
4. Click `Save changes` button.
Or
1. Put the plug-in folder `WP Smart Preloader` into [wordpress_dir]/wp-content/plugins/
2. Go into the WordPress admin interface and activate the plugin
3. Go to `settings` => `WP Smart Preloader`
4. Choose the Options of your choice
5. Click `Save changes` button.
Have fun!!!
== Frequently Asked Questions ==
= What does this plugin do? =
* WP Smart Preloader takes a simple, extendable approach to display Simple CSS spinners and throbbers onto your website
= Still have some questions ? =
Please use support forum or you can directly mail us at
[wearecatchsquare@gmail.com](mailto:wearecatchsquare@gmail.com)
== Screenshots ==
1. 1 **WP Smart Preloader Backend Settings**
2. 2 **WP Smart Preloader Backend Settings with Custom HTML5 animation and CSS**
== Changelog ==
= 1.15 =
tested upto wordPress 6.0
= 1.14 =
resolved deprecated load function
= 1.13 =
tested upto Wordpress ver 5.6
= 1.12 =
Fixed showing loader in elementor active edit state
= 1.11.6 =
change ownership
= 1.11.5 =
change version
tested upto Wordpress ver 5.2
= 1.11.4 =
change version
= 1.11.3 =
change version
= 1.11.2 =
fixed console error and warning for showing ace editor js
= 1.11.1 =
fixed console error for showing ace editor js
= 1.11 =
fixed js for removing class name after page loads
= 1.10 =
Fixed link for editor for html and css textarea
= 1.9 =
Add editor for html and css textarea
= 1.8 =
Add Custom animation and css for loader
= 1.7 =
fixed js for removing class after page loads
= 1.6 =
fixed loader 5 border to transparent
= 1.5 =
fixed showing preloader on page loading
= 1.4 =
fixed js to load
= 1.3 =
fixed css if only home page is selected (checked)
= 1.2 =
fixed showing page before preloader
= 1.1 =
Added function to delete setting after uninstall/deleting plugin
= 1.0 =
Initial version

View File

@@ -0,0 +1,30 @@
<?php
/*
Plugin Name: WP Smart Preloader
Plugin URI: https://wordpress.org/plugins/wp-smart-preloader
Description: WP Smart Preloader is a Simple CSS spinners and throbbers made with CSS and minimal HTML markup.
Version: 1.15
Author: catchsquare
Author URI: http://catchsquare.com
License: GPLv2 or later
Text Domain: wp-smart-preloader
*/
/*Make sure we don't expose any info if called directly*/
if ( !function_exists( 'add_action' ) ) {
echo "Hi there! I'm just a plugin, not much I can do when called directly.";
exit;
}
/*Define Constants for this plugin*/
define( 'SMART_PRELOADER_VERSION', '1.15' );
define( 'SMART_PRELOADER_PATH', plugin_dir_path( __FILE__ ) );
define( 'SMART_PRELOADER_URL', plugin_dir_url( __FILE__ ) );
// setting page
require SMART_PRELOADER_PATH."inc/wsp-option_page.php";
// uninstall hook
require SMART_PRELOADER_PATH."inc/wsp_uninstall.php";