6666 * @since 1.6.0
6767 */
6868function es_optimizer_init_plugin () {
69- // Clear options cache to ensure fresh data after all plugins are loaded
69+ // Clear options cache to ensure fresh data after all plugins are loaded.
7070 es_optimizer_clear_options_cache ();
7171
72- // Initialize admin functionality
72+ // Initialize admin functionality.
7373 es_optimizer_init_admin ();
7474
75- // Initialize frontend optimizations
75+ // Initialize frontend optimizations.
7676 es_optimizer_init_frontend_optimizations ();
7777
78- // Initialize plugin settings link
78+ // Initialize plugin settings link.
7979 es_optimizer_init_plugin_links ();
8080}
8181add_action ( 'plugins_loaded ' , 'es_optimizer_init_plugin ' );
@@ -86,12 +86,12 @@ function es_optimizer_init_plugin() {
8686 * @since 1.6.0
8787 */
8888function es_optimizer_activate_plugin () {
89- // Ensure default options are set on activation
89+ // Ensure default options are set on activation.
9090 if ( false === get_option ( 'es_optimizer_options ' ) ) {
9191 add_option ( 'es_optimizer_options ' , es_optimizer_get_default_options () );
9292 }
9393
94- // Clear any cached data
94+ // Clear any cached data.
9595 es_optimizer_clear_options_cache ();
9696}
9797register_activation_hook ( __FILE__ , 'es_optimizer_activate_plugin ' );
@@ -102,11 +102,11 @@ function es_optimizer_activate_plugin() {
102102 * @since 1.6.0
103103 */
104104function es_optimizer_deactivate_plugin () {
105- // Clear any cached data on deactivation
105+ // Clear any cached data on deactivation.
106106 es_optimizer_clear_options_cache ();
107107
108- // Note: We don't delete options on deactivation to preserve user settings
109- // Options are only deleted on plugin uninstall
108+ // Note: We don't delete options on deactivation to preserve user settings.
109+ // Options are only deleted on plugin uninstall.
110110}
111111register_deactivation_hook ( __FILE__ , 'es_optimizer_deactivate_plugin ' );
112112
@@ -249,17 +249,6 @@ function es_optimizer_add_settings_page() {
249249 if ( ! is_admin () ) {
250250 return ;
251251 }
252- // Only enqueue scripts/styles if we're on the plugin settings page.
253- }
254-
255- /**
256- * Enqueue admin scripts and styles for plugin settings page
257- *
258- * @since 1.5.13
259- */
260- function es_optimizer_enqueue_admin_scripts () {
261- // Add any future admin CSS/JS here - currently none needed.
262- // This function is prepared for future admin styling if needed.
263252}
264253
265254/**
@@ -786,8 +775,8 @@ function disable_emojis() {
786775 */
787776function es_optimizer_add_settings_link ( $ links ) {
788777 // The admin_url function is used to properly generate a URL within the WordPress admin area.
789- // Setting text is wrapped in translation function but doesn't need escaping here
790- // as WordPress core handles this when rendering plugin links.
778+ // Setting text is wrapped in translation function but doesn't need escaping here.
779+ // WordPress core handles escaping when rendering plugin links.
791780 $ settings_link = '<a href=" ' . admin_url ( 'options-general.php?page=es-optimizer-settings ' ) . '"> ' . __ ( 'Settings ' , 'simple-wp-optimizer ' ) . '</a> ' ;
792781 array_unshift ( $ links , $ settings_link );
793782 return $ links ;
0 commit comments