Skip to content

Commit b745f0c

Browse files
committed
Upload latest code v1.8.0
0 parents  commit b745f0c

File tree

150 files changed

+48150
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+48150
-0
lines changed

LICENSE.txt

+674
Large diffs are not rendered by default.

a3-lazy-load.php

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?php
2+
/*
3+
Plugin Name: a3 Lazy Load
4+
Description: Speed up your site and enhance frontend user's visual experience in PC's, Tablets and mobile with a3 Lazy Load.
5+
Version: 1.8.0
6+
Author: a3rev Software
7+
Author URI: https://a3rev.com/
8+
Requires at least: 4.0
9+
Tested up to: 4.7.5
10+
License: GPLv2 or later
11+
Copyright © 2011 a3 Revolution Software Development team
12+
a3 Revolution Software Development team
13+
14+
PO Box 1170
15+
Gympie 4570
16+
QLD Australia
17+
*/
18+
?>
19+
<?php
20+
define('A3_LAZY_VERSION', '1.7.1');
21+
define('A3_LAZY_LOAD_FILE_PATH', dirname(__FILE__));
22+
define('A3_LAZY_LOAD_DIR_NAME', basename(A3_LAZY_LOAD_FILE_PATH));
23+
define('A3_LAZY_LOAD_FOLDER', dirname(plugin_basename(__FILE__)));
24+
define('A3_LAZY_LOAD_NAME', plugin_basename(__FILE__));
25+
define('A3_LAZY_LOAD_URL', str_replace(array('http:','https:'), '', untrailingslashit(plugins_url('/', __FILE__))));
26+
define('A3_LAZY_LOAD_DIR', WP_CONTENT_DIR . '/plugins/' . A3_LAZY_LOAD_FOLDER);
27+
define('A3_LAZY_LOAD_JS_URL', A3_LAZY_LOAD_URL . '/assets/js');
28+
define('A3_LAZY_LOAD_CSS_URL', A3_LAZY_LOAD_URL . '/assets/css');
29+
define('A3_LAZY_LOAD_IMAGES_URL', A3_LAZY_LOAD_URL . '/assets/images');
30+
31+
include( 'admin/admin-ui.php' );
32+
include( 'admin/admin-interface.php' );
33+
34+
include( 'admin/admin-pages/admin-settings-page.php' );
35+
36+
include( 'admin/admin-init.php' );
37+
include( 'admin/less/sass.php' );
38+
39+
include( 'classes/class-a3-lazy-load.php' );
40+
include( 'classes/class-a3-lazy-load-filter.php' );
41+
42+
include( 'admin/a3-lazy-load-admin.php' );
43+
44+
// Defined this function for check Lazy Load is enabled that 3rd party plugins or theme can use to check
45+
$a3_lazy_load_global_settings = get_option( 'a3_lazy_load_global_settings', array( 'a3l_apply_lazyloadxt' => 1, 'a3l_apply_to_images' => 1, 'a3l_apply_to_videos' => 1 ) );
46+
if ( 1 == $a3_lazy_load_global_settings['a3l_apply_lazyloadxt'] && !is_admin() && ( 1 == $a3_lazy_load_global_settings['a3l_apply_to_images'] || 1 == $a3_lazy_load_global_settings['a3l_apply_to_videos'] ) ) {
47+
function a3_lazy_load_enable() {
48+
return true;
49+
}
50+
}
51+
if ( 1 == $a3_lazy_load_global_settings['a3l_apply_lazyloadxt'] && !is_admin() && 1 == $a3_lazy_load_global_settings['a3l_apply_to_images'] ) {
52+
function a3_lazy_load_image_enable() {
53+
return true;
54+
}
55+
}
56+
if ( 1 == $a3_lazy_load_global_settings['a3l_apply_lazyloadxt'] && !is_admin() && 1 == $a3_lazy_load_global_settings['a3l_apply_to_videos'] ) {
57+
function a3_lazy_load_video_enable() {
58+
return true;
59+
}
60+
}
61+
62+
/**
63+
* Call when the plugin is activated
64+
*/
65+
register_activation_hook(__FILE__, 'a3_lazy_load_activated');
66+
?>

admin/a3-lazy-load-admin.php

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?php
2+
update_option('a3rev_lazy_load_plugin', 'a3_lazy_load');
3+
4+
function a3_lazy_load_activated(){
5+
update_option('a3_lazy_load_version', '1.8.0');
6+
7+
// Set Settings Default from Admin Init
8+
global $a3_lazy_load_admin_init;
9+
$a3_lazy_load_admin_init->set_default_settings();
10+
11+
delete_metadata( 'user', 0, $a3_lazy_load_admin_init->plugin_name . '-' . 'plugin_framework_global_box' . '-' . 'opened', '', true );
12+
13+
update_option('a3_lazy_load_just_installed', true);
14+
}
15+
16+
/**
17+
* Load languages file
18+
*/
19+
function a3_lazy_load_init() {
20+
global $a3_lazy_load_global_settings;
21+
22+
if ( get_option( 'a3_lazy_load_just_installed' ) ) {
23+
delete_option( 'a3_lazy_load_just_installed' );
24+
wp_redirect( admin_url( 'options-general.php?page=a3-lazy-load', 'relative' ) );
25+
exit;
26+
}
27+
28+
load_plugin_textdomain( 'a3_lazy_load', false, A3_LAZY_LOAD_FOLDER.'/languages' );
29+
30+
a3_lazy_load_upgrade_plugin();
31+
}
32+
33+
global $a3_lazy_load_admin_init;
34+
$a3_lazy_load_admin_init->init();
35+
36+
// Add upgrade notice to Dashboard pages
37+
add_filter( $a3_lazy_load_admin_init->plugin_name . '_plugin_extension_boxes', array( 'A3_Lazy_Load_Hook_Filter', 'plugin_extension_box' ) );
38+
39+
// Add language
40+
add_action('init', 'a3_lazy_load_init');
41+
42+
// Add custom style to dashboard
43+
add_action( 'admin_enqueue_scripts', array( 'A3_Lazy_Load_Hook_Filter', 'a3_wp_admin' ) );
44+
45+
// Add extra link on left of Deactivate link on Plugin manager page
46+
add_action( 'plugin_action_links_'.A3_LAZY_LOAD_NAME, array( 'A3_Lazy_Load_Hook_Filter', 'settings_plugin_links' ) );
47+
48+
// Add text on right of Visit the plugin on Plugin manager page
49+
add_filter( 'plugin_row_meta', array( 'A3_Lazy_Load_Hook_Filter', 'plugin_extra_links'), 10, 2 );
50+
51+
// Add admin sidebar menu css
52+
add_action( 'admin_enqueue_scripts', array( 'A3_Lazy_Load_Hook_Filter', 'admin_sidebar_menu_css' ) );
53+
54+
// Check upgrade functions
55+
function a3_lazy_load_upgrade_plugin() {
56+
57+
if (version_compare(get_option('a3_lazy_load_version'), '1.1.0') === -1) {
58+
update_option('a3_lazy_load_version', '1.1.0');
59+
include( A3_LAZY_LOAD_DIR. '/includes/updates/a3-lazy-load-update-1.1.0.php' );
60+
}
61+
62+
// Upgrade to 1.7.0
63+
if ( version_compare(get_option('a3_lazy_load_version'), '1.7.0') === -1 ) {
64+
update_option('a3_lazy_load_version', '1.7.0');
65+
update_option('a3_lazy_load_style_version', time() );
66+
}
67+
68+
update_option('a3_lazy_load_version', '1.8.0');
69+
}
70+
?>

0 commit comments

Comments
 (0)