diff --git a/admin/settings.php b/admin/settings.php new file mode 100644 index 0000000..35e88cb --- /dev/null +++ b/admin/settings.php @@ -0,0 +1,47 @@ + +
+

+
+ + + + + + + +
Lazy Load Images + +
+ +
+
+ ]+)\/?>/i', + '$1 loading="lazy" />', + $content + ); + return $content; +} +add_filter( 'the_content', 'wpa_superstar_lazy_load_images' ); +add_filter( 'wp_get_attachment_image', 'wpa_superstar_lazy_load_images' ); \ No newline at end of file diff --git a/wpa-superstar-plugin.php b/wpa-superstar-plugin.php index 49f5d1b..f975871 100644 --- a/wpa-superstar-plugin.php +++ b/wpa-superstar-plugin.php @@ -16,11 +16,22 @@ // If this file is called directly, abort. if ( ! defined( 'WPINC' ) ) { - die; + die; } -/** - * Currently plugin version. - * Start at version 1.0.0 and use SemVer - https://semver.org - */ +// Define plugin version define( 'WPA_SUPERSTAR_VERSION', '1.0.0' ); + +// Activation hook +function wpa_superstar_activate() { + // Add activation logic later if needed +} +register_activation_hook( __FILE__, 'wpa_superstar_activate' ); + +// Load core functionality +require_once plugin_dir_path( __FILE__ ) . 'includes/speed-functions.php'; + +// Load admin UI +if ( is_admin() ) { + require_once plugin_dir_path( __FILE__ ) . 'admin/settings.php'; +} \ No newline at end of file