PluginProbe ʕ •ᴥ•ʔ
Admin and Site Enhancements (ASE) / 5.3.0
Admin and Site Enhancements (ASE) v5.3.0
9.1.0 9.0.2 9.0.1 9.0.0 8.9.2 8.9.1 8.9.0 8.8.8 8.8.7 8.8.6 8.8.5 8.8.4 8.8.3 8.8.2 8.8.1 8.8.0 8.7.3 8.7.2 8.7.1 8.2.1 8.2.2 8.2.3 8.3.0 8.3.1 8.3.2 8.4.0 8.4.1 8.4.2 8.5.0 8.5.1 8.5.2 8.6.0 8.6.1 8.6.2 8.7.0 5.0.1 5.0.2 5.0.2.1 5.0.2.2 5.0.2.3 5.0.2.4 5.1.0 5.2.0 5.2.1 5.2.10 5.2.11 5.2.2 5.2.3 5.2.4 5.2.5 5.2.6 5.2.7 5.2.8 5.2.9 5.3.0 5.3.1 5.3.2 5.4.0 5.4.1 5.5.0 5.5.1 5.5.2 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.8.0 5.8.1 6.0.0 6.0.3 6.0.4 6.0.5 6.0.5.1 6.0.6 6.0.7 6.0.8.1 6.1.0 6.1.3 6.2.0 6.2.1 6.2.2 6.2.3 6.2.4 6.2.5 6.2.6 6.2.7 6.3.0 6.3.1 6.3.2 6.4.0 6.5.0 6.5.1 6.6.0 6.7.0 6.8.0 6.8.2 6.8.3 6.9.0 6.9.1 6.9.10 6.9.11 6.9.12 6.9.13.1 6.9.13.2 6.9.2 6.9.3 6.9.4 6.9.5 6.9.6 6.9.7 6.9.8 6.9.9 7.0.0 7.0.2 7.0.2.1 7.0.2.2 7.0.2.3 7.0.3 7.1.0 7.1.1 7.1.2 7.1.3 7.1.4 7.1.5 7.2.0 7.2.1 7.3.0 7.3.1 7.3.2 7.3.3 7.4.0 7.4.2 7.4.4 7.4.5 7.4.6 7.4.7 7.4.8 7.5.0 7.5.1 7.5.2 7.5.3 7.5.4 7.6.0 7.6.1 7.6.1.1 7.6.10 7.6.11 7.6.2 7.6.3 7.6.4 7.6.5 7.6.6 7.6.7 7.6.7.1 7.6.8 7.6.9 7.7.0 7.8.0 7.8.1 7.8.10 7.8.11 7.8.12 7.8.13 7.8.14 7.8.15 7.8.16 7.8.17 7.8.18 7.8.2 7.8.3 7.8.4 7.8.5 7.8.5.1 7.8.6 7.8.7 7.8.8 7.8.9 7.9.0 7.9.1 7.9.10 7.9.11 7.9.2 7.9.3 7.9.4 7.9.5 7.9.6 7.9.7 7.9.8 7.9.9 8.0.0 8.0.1 8.0.2 8.0.3 8.0.4 8.0.5 8.0.6 8.0.7 8.0.8 8.1.0 8.1.1 8.1.2 8.1.3 8.1.4 8.2.0 trunk 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.7.0 1.8.0 1.9.0 2.0.0 2.1.0 2.2.0 2.3.0 2.4.0 2.5.0 2.6.0 2.7.0 2.8.0 2.8.1 2.8.2 2.8.3 2.9.0 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.1.0 3.2.0 3.3.0 3.4.0 3.5.0 3.6.1 3.7.0 3.8.0 3.9.0 3.9.1 3.9.2 4.0.0 4.0.1 4.1.0 4.2.0 4.2.1 4.2.2 4.3.0 4.3.1 4.4.0 4.5.0 4.6.0 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.8.0 4.8.1 4.8.2 4.8.3 4.9.0 4.9.1 4.9.2 4.9.3 5.0.0
admin-site-enhancements / settings.php
admin-site-enhancements Last commit date
assets 3 years ago classes 3 years ago includes 3 years ago vendor 3 years ago LICENSE.md 3 years ago README.md 3 years ago admin-site-enhancements.php 3 years ago bootstrap.php 3 years ago settings.php 3 years ago
settings.php
880 lines
1 <?php
2
3 /**
4 * Register admin menu
5 *
6 * @since 1.0.0
7 */
8 function asenha_register_admin_menu()
9 {
10 add_submenu_page(
11 'tools.php',
12 // Parent page/menu
13 'Admin and Site Enhancements',
14 // Browser tab/window title
15 'Enhancements',
16 // Sube menu title
17 'manage_options',
18 // Minimal user capabililty
19 ASENHA_SLUG,
20 // Page slug. Shows up in URL.
21 'asenha_add_settings_page'
22 );
23 }
24
25 /**
26 * Create the settings page of the plugin
27 *
28 * @since 1.0.0
29 */
30 function asenha_add_settings_page()
31 {
32 ?>
33 <div class="wrap asenha">
34
35 <div id="asenha-header" class="asenha-header">
36 <div class="asenha-header-left">
37 <h1 class="asenha-heading"><?php
38 echo get_admin_page_title() ;
39 ?> <small><?php
40 esc_html_e( 'by', 'admin-site-enhancements' );
41 ?> <a href="https://bowo.io/asenha-bw" target="_blank">Bowo</a></small></h1>
42 <!-- <a href="https://wordpress.org/plugins/admin-site-enhancements/" target="_blank" class="asenha-header-action"><span>&#8505;</span> <?php
43 // esc_html_e( 'Info', 'admin-site-enhancements' );
44 ?></a> -->
45 </div>
46 <div class="asenha-header-right">
47 <a href="https://bowo.io/asenha-rvw" target="_blank" class="asenha-header-action"><span>&starf;</span> <?php
48 esc_html_e( 'Review', 'admin-site-enhancements' );
49 ?></a>
50 <a href="https://bowo.io/asenha-fdbk" target="_blank" class="asenha-header-action">&#10010; <?php
51 esc_html_e( 'Feedback', 'admin-site-enhancements' );
52 ?></a>
53 <a href="https://bowo.io/asenha-trnslt" target="_blank" class="asenha-header-action">&#9654; <?php
54 esc_html_e( 'Translate', 'admin-site-enhancements' );
55 ?></a>
56 <div id="plugin-sponsor" class="button button-primary plugin-sponsor">
57 <?php
58 esc_html_e( 'Sponsor', 'admin-site-enhancements' );
59 ?>
60 </div>
61 <a class="button button-primary asenha-save-button">Save Changes</a>
62 <div class="asenha-changes-saved" style="display:none;">Changes have been saved.</div>
63 </div>
64 </div>
65
66 <div class="asenha-body">
67 <div class="asenha-sponsorship-nudge nudge-show-more is-enabled" style="display: none;">
68 <h3>Looks like some of these enhancements have been useful for your site?</h3>
69 <p class="nudge-description intro">Please consider supporting Admin and Site Enhancements (ASE).</p>
70 <a id="sponsorship-nudge-show-moreless" class="nudge-show-more-less show-more-less show-more" href="#">Find Out How </a>
71 <div class="nudge-wrapper-show-more">
72 <?php
73 // Quotes on sponsorship
74 $sponsorship_quotes = array(
75 '"A very very useful plugin. I have made a little sponsorship and encourage other users to do the same as it is so much deserved. Thank you Bowo!" ~<a href="https://wordpress.org/support/topic/very-very-useful-54/" target="_blank">@pgrand83</a>',
76 '"Tried it and was blown away with all the options! How is this free? I will sponsor you because this is simply... [insert your favorite superlative here]" ~<a href="https://wordpress.org/support/topic/installed-on-all-my-sites-3/" target="_blank">@mgjaltema</a>',
77 '"This replaces so many plugins and snippets! Support the developer (reviews, donations etc.)" ~<a href="https://wordpress.org/support/topic/this-relpaces-many-plugins-and-snippets/" target="_blank">Max Ziebell</a>',
78 '"Replaced 6 plugins with this. Very easy plugin and great support. Found a bug and was fixed in hours!" ~<a href="https://wordpress.org/support/topic/replaced-6-plugins-with-this/" target="_blank">@dagaloni</a>',
79 '"Amazing plugin that has replaced at least 10 plugins for me. Lightweight, clean and easy to use. The developer is also very helpful and responsive." ~<a href="https://wordpress.org/support/topic/replaced-atleast-10-plugins-for-me/" target="_blank">@sk209</a>',
80 '"Very handy plugin by a great dev. Reported a bug yesterday, it was fixed today. Can’t ask for better than that." ~<a href="https://wordpress.org/support/topic/very-handy-plugin-by-a-great-dev/" target="_blank">Greg Mount</a>',
81 '"Excellent and very well-supported plugin. I had a small issue, posted a support comment, and the developer had things sorted in a couple of days with a patch upgrade." ~<a href="https://wordpress.org/support/topic/excellent-and-very-well-supported-plugin-saves-me-a-lot-of-work/" target="_blank">@grizdev</a>',
82 '"Bowo is awesome! Thanks to his great plugin my WP backend UI is cleaned up and organized, and I was able to uninstall other plugins too. Super useful, really recommended!" ~<a href="https://wordpress.org/support/topic/love-that-plugin-2/" target="_blank">@adminmax</a>',
83 '"A very useful plugin that also has great support. Amazing that this plugin is free too. Great work and thanks to the author." ~<a href="https://wordpress.org/support/topic/very-helpful-1357/" target="_blank">@tomo55555</a>',
84 '"Great plugin! I will definitely support it’s development because I know it will save me time and frustration on all of the websites I set up." ~<a href="https://wordpress.org/support/topic/great-plugin-clear-useful-and-a-joy-to-use/" target="_blank">@toddneufeld</a>',
85 '"Love the work you’ve done with this plugin! Incredibly powerful and well organized. It’s a real accomplishment to put this many features into a plugin and still make it easy to navigate." ~<a href="https://wordpress.org/support/topic/holy-cow-this-is-excellent/" target="_blank">Nathan Ingram</a>',
86 '"I must express gratitude to the author for the exceptional effort invested in developing this plugin... it nearly aligns entirely with the options I typically apply to each website." ~<a href="https://wordpress.org/support/topic/excellent-features-selection/" target="_blank">@cvladan</a>',
87 '"This plugin is what I have been waiting for to see for years! It has so many useful options that previously you needed to google to find snippets for and it was hard to keep track of all of them." ~<a href="https://wordpress.org/support/topic/amazing-swiss-army-tool-for-wordpress/" target="_blank">@alexgraphicd</a>',
88 '"I’m already in love with this plugin... it will make my WP-life a lot easier 🙂" ~<a href="https://wordpress.org/support/topic/im-allready-in-love-with-this-plugin/" target="_blank">@medieskolen</a>',
89 '"This plugin allows you to install and maintain one plugin instead of a host of smaller ones. My tests were all successful and I was happy to simplify my maintenance with fewer plugins." ~<a href="https://wordpress.org/support/topic/replaced-4-plugins-worked-well-a/" target="_blank">Vic Drover</a>',
90 '"Great plugin and awesome developer!" ~<a href="https://wordpress.org/support/topic/awesome-9998/" target="_blank">@mrgy05</a>',
91 '"This one plug-in has replaced at the very least four other plug-ins I was using regularly. I can’t thank you enough for your work. Amazing job!" ~<a href="https://wordpress.org/support/topic/amazing-work-63/" target="_blank">@tbutcher</a>',
92 '"Technical support? Unbelievable, one problem and quick response with immediate solution. It has become one of my essential plugins. Just amazing!" ~<a href="https://wordpress.org/support/topic/there-are-no-words-just-amazing/" target="_blank">@samirhp</a>',
93 '"I just can’t believe I’ll be able to start using this single plugin instead of all the separate ones... what a relief! Thanks man for this great plugin, it’s like you’ve read my mind 🙂" ~<a href="https://wordpress.org/support/topic/amazing-how-many-separate-plugins-this-replaces/" target="_blank">@yudayuda</a>',
94 '"Awesome plugin! What a time saver and workflow improvements. Having all these setting in one place, one plugin. Replaces many free and paid for plugins." ~<a href="https://wordpress.org/support/topic/awesome-plugin-replaces-so-many-other-plugins/" target="_blank">@greggwatson</a>',
95 '"This plugin has quickly become my go-to solution for all my projects. It\'s a game-changer, saving me valuable time and sparing me the frustration of dealing with bloated plugins. " ~<a href="https://wordpress.org/support/topic/must-have-plugin-for-every-website-2/" target="_blank">Aronu</a>',
96 '"The support is awesome – I had an issue which I was able to pin down with the creator. Very fast response time, polite conversation and successful in the end 🙂. Fully recommended!" ~<a href="https://wordpress.org/support/topic/simple-yet-powerful-103/" target="_blank">@gulpman</a>',
97 '"I\'ve started installing this plugin as part of my \'standard\' set up. It is continually improving and seems very stable and reliable. I have made 6 installations so far and I am very impressed. Thanks Bowo." ~<a href="https://wordpress.org/support/topic/excellent-plugin-8681/" target="_blank">@jacalakie</a>',
98 '"I\'ve been looking for something like this for a long time. The developer is also very friendly and helpful. Highly recommended!" ~<a href="https://wordpress.org/support/topic/must-have-684/" target="_blank">@jdudi</a>'
99 );
100 $random_sponsorship_quote = $sponsorship_quotes[rand( 0, count( $sponsorship_quotes ) - 1 )];
101 // Quotes on general support
102 $support_quotes = array(
103 '“Simply the best! Still looking for the sixth star for you. Don’t stop developing… We are supporting you!“ ~<a href="https://wordpress.org/support/topic/too-good-to-be-true-22/" target="_blank">@springbreak</a>',
104 '"Amazing job – premium functions in free plugin. Everything is clear, fast, consistent and lightweight. Best possible rating." ~<a href="https://wordpress.org/support/topic/amazing-job-premium-functions-in-free-plugin/" target="_blank">@pijag</a>',
105 '"Really grateful and impressed at the pace of development and adding new features including some I have suggested, so feedback is really worthwhile." ~<a href="https://wordpress.org/support/topic/fantastic-plugin-replacing-many-other-plugins/" target="_blank">Dale Reardon</a>',
106 '"Greatest plugin ever. All in one solution to most of my problems. Thank you very much." ~<a href="https://wordpress.org/support/topic/greatest-plugin-ever-11/" target="_blank">@angelaustr</a>',
107 '"It’s worth 10 stars (or more). This plugin eliminates the need to install many other plugins and also makes functions.php smaller since I have to insert fewer code snippets." ~<a href="https://wordpress.org/support/topic/its-worth-10-stars-or-more/" target="_blank">Angelika Reisiger</a>',
108 '"This plugin is a real Swiss Army knife... combines multiple plugins and is still lightweight. Also Bowo, the developer, is friendly and replies quite quickly!" ~<a href="https://wordpress.org/support/topic/amazing-3728/" target="_blank">@olpo24</a>',
109 '"Great job! Saved me lots of time to add lots of plugins to get ready for my work. It’s a relief to have everything streamlined and ready to go." ~<a href="https://wordpress.org/support/topic/super-2817/" target="_blank">Tao Sheng</a>',
110 '"Very powerful tool. With this plugin, I can remove tons of plugins to reduce the possibility of plugin conflicts." ~<a href="https://wordpress.org/support/topic/very-powerful-tool-13/" target="_blank">@chiehliniceday</a>',
111 '"Very useful! Great compilation of settings and options. It had quickly become one of my essential plugins." ~<a href="https://wordpress.org/support/topic/very-useful-3276/" target="_blank">@unapersona</a>',
112 '"This plugin easily replaces a dozen or more plugins I install on every website project... and support has been wonderful and responsive. Highly recommended!" ~<a href="https://wordpress.org/support/topic/amazing-must-have-plugin-2/" target="_blank">@netzzjd</a>',
113 '"I love that the whole plugin is smaller in file-size than some of the plugins that it replaces, which do only one of these things. Thank you for the great work!" ~<a href="https://wordpress.org/support/topic/very-useful-swiss-army-knife/" target="_blank">@dvaer</a>',
114 '"This is a great plugin, it replaces many single purpose plugins which bloat up the site and the admin area. Great idea, good work!" ~<a href="https://wordpress.org/support/topic/replaces-a-lot-of-single-purpose-plugins/" target="_blank">@tageins</a>',
115 '"Probably the best WP swiss army knife I’ve ever come across... Has noticeably improved performance on many of my sites. Keep up the great work!" ~<a href="https://wordpress.org/support/topic/im-replacing-so-many-plugins-with-this/" target="_blank">@instadesign</a>',
116 '"ASE’s enhanced admin dashboard, improved site performance, and robust security features have truly transformed our website management." ~<a href="https://wordpress.org/support/topic/this-has-reduced-my-plugin-list-by-6-7/" target="_blank">@tomhung</a>',
117 '"I love your plugin! All this needed functionality in one place is very helpful and saves me from writing (pasting) a lot of custom code every time." ~<a href="https://wordpress.org/support/topic/lifesaver-this-saves-so-much-time-and-custom-coding/" target="_blank">@prosite</a>',
118 '"Amazingly good... you can easily replace several plugins with this easy-to-use one. It’s well thought out and offers features I didn’t even realize I needed." ~<a href="https://wordpress.org/support/topic/amazingly-good-8/" target="_blank">@brenteades</a>',
119 '"Favorite!!! It has replaced several plugins I had in the past. This has become one of the first plugins I install." ~<a href="https://wordpress.org/support/topic/favorite-11/" target="_blank">@cck23</a>',
120 '"ASE has been a game-changer for us... we were able to remove numerous duplicate plugins, reducing clutter and improving efficiency." ~<a href="https://wordpress.org/support/topic/this-has-reduced-my-plugin-list-by-6-7/" target="_blank">@tomhung</a>',
121 '"This plugin is amazing. It replaces so many plugins and still removes bloat. For efficiency, security, flexibility and speed, it doesn’t get better." ~<a href="https://wordpress.org/support/topic/covers-all-manner-of-wp-sins/" target="_blank">Mary C. Dunford</a>'
122 );
123 $random_support_quote = $support_quotes[rand( 0, count( $support_quotes ) - 1 )];
124 $share_quotes = array(
125 '"Will recommend to everyone! A nice plugin, which will grow and become the best plugin ever made!!" ~<a href="https://wordpress.org/support/topic/will-recommend-to-everyone/" target="_blank">@simonvinther</a>',
126 '"It’s very honorable that you created this intentionally to give back to the WP community! I’ll be sure to share this plugin with all the freelance WP-builders at my shared office space!" ~<a href="https://wordpress.org/support/topic/installed-on-all-my-sites-3/" target="_blank">@mgjaltema</a>',
127 '"Simple and gold. This plugin so awesome and it should be known by more people." ~<a href="https://wordpress.org/support/topic/simple-and-gold/" target="_blank">Julian Song</a>',
128 '"ASE is a must-have plugin for anyone looking to optimize their WordPress site and streamline their workflow." ~<a href="https://wordpress.org/support/topic/this-has-reduced-my-plugin-list-by-6-7/" target="_blank">@tomhung</a>',
129 '"Admin Site Enhancements has made my list of \'must install\' plug-ins, since it makes so many other tasks much easier." ~<a href="https://wordpress.org/support/topic/excellent-and-very-well-supported-plugin-saves-me-a-lot-of-work/" target="_blank">@grizdev</a>',
130 '"I was super skeptical that this plugin could do so much without any problems, but i was wrong... 100% recommended!" ~<a href="https://wordpress.org/support/topic/the-all-in-one-plugin-you-need-in-your-arsenal/" target="_blank">@scarlywebs</a>',
131 '"The selection of tools... nearly aligns entirely with the options I typically apply to each website. This plugin is commendable." ~<a href="https://wordpress.org/support/topic/excellent-features-selection/" target="_blank">@cvladan</a>',
132 '"This plugin is amazing. So much useful functionality packed in. This is now a must-use plugin in my development stack. Thank you! ~<a href="https://wordpress.org/support/topic/amazing-now-part-of-my-must-use-dev-stack/" target="_blank">@phillcoxon</a>"',
133 '"Very good, must use plugin, that makes life easier for everyone." ~<a href="https://wordpress.org/support/topic/very-good-6977/" target="_blank">@alexeerma</a>',
134 '"Must-have plugin for every website. It\'s a game-changer." ~<a href="https://wordpress.org/support/topic/must-have-plugin-for-every-website-2/" target="_blank">Aronu</a>',
135 '"This plugin has quickly become my go-to solution for all my projects." ~<a href="https://wordpress.org/support/topic/must-have-plugin-for-every-website-2/" target="_blank">Aronu</a>',
136 '"Awesome plugin, it\'s an all in one solution!" ~<a href="https://wordpress.org/support/topic/everything-in-one-place-3/" target="_blank">@gabikod</a>'
137 );
138 $random_share_quote = $share_quotes[rand( 0, count( $share_quotes ) - 1 )];
139 ?>
140 <div class="nudge-quotes">
141 <div class="user-quote"><?php
142 echo $random_sponsorship_quote ;
143 ?></div>
144 <div class="user-quote"><?php
145 echo $random_support_quote ;
146 ?></div>
147 </div>
148 <div class="nudge-content">
149 <div class="nudge-primary">
150 <h4>Sponsor ASE from as little as USD 1, monthly or one-time</h4>
151 <div class="nudge-info">
152 <p class="nudge-description">Please consider sponsoring ASE's ongoing development and maintenance so it can remain functional and useful for years to come. Thank you!</p>
153 </div>
154 <div class="nudge-ctas">
155 <a href="https://bowo.io/asenha-sp-gth-ndg" class="button button-primary sponsorship-button monthly" target="_blank">Sponsor Monthly</a>
156 <a href="https://bowo.io/asenha-sp-ppl-ndg" class="button sponsorship-button one-time" target="_blank">Sponsor One-Time</a>
157 <a href="#" id="have-sponsored" class="asenha-have-sponsored">I've sponsored ASE</a>
158 </div>
159 <div class="nudge-stats">
160 <p class="nudge-description">ASE has consumed more than <a href="https://bowo.io/asenha-sp-ndg-chnlg" target="_blank">250 hours of dev time</a>. At v5.3.0 (released on July 8, 2023) and 5,000+ active installs, there have been <a href="https://bowo.io/asenha-sp-gth-ndg" target="_blank">4 monthly sponsors</a> and <a href="https://bowo.io/asenha-sp-ppl-ndg" target="_blank">24 one-time sponsors</a>. You can be one today!</p>
161 </div>
162 </div>
163 <div class="nudge-secondary">
164 <h4>Give ASE your 5-star review or provide detailed feedback</h4>
165 <p class="nudge-description">If financial sponsorship is not something you can provide at the moment, you can always <a href="https://bowo.io/asenha-rvw-ndg" target="_blank">add a quick, 5-star review</a> to support ASE. It has received <a href="https://bowo.io/asenha-rvw-ndg" target="_blank">70+ 5-star reviews</a> so far. Help make it 100, or more!</p>
166 <p class="nudge-description">Or, if you find something is lacking or not working as you expect it to, you can provide a good and detailed <a href="https://bowo.io/asenha-fdbk-ndg" target="_blank">feature request or feedback</a>, which is much more appreciated than a 4-star review or less. This is how we can work together to improve ASE.</p>
167 </div>
168 </div>
169 <div class="user-quote share-quote"><?php
170 echo $random_share_quote ;
171 ?></div>
172 <p class="nudge-description">Do <a href="https://bowo.io/asenha-dotorg" target="_blank">share about ASE</a> with your colleagues and/or community.</p>
173 <a href="https://bowo.io/asenha-bw-ndg" target="_blank" class="nudge-photo-link"><img src="<?php
174 echo esc_attr( ASENHA_URL . 'assets/img/bowo.jpg' ) ;
175 ?>" class="nudge-photo" /></a>
176 <h3>Thank you!</h3>
177 <p class="nudge-description nudge-closing">I hope you continue to benefit from ASE. ~<a href="https://bowo.io/asenha-bw-ndg" target="_blank">Bowo</a></p>
178 <div class="dismiss-sponsorship-nudge"><a id="sponsorship-nudge-show-less" href="#">Show less</a> &bull; <a href="#" id="sponsorship-nudge-dismiss" class="asenha-sponsorship-nudge-dismiss">Dismiss</a></div>
179 </div>
180 </div>
181 <form action="options.php" method="post">
182 <div class="asenha-vertical-tabs">
183 <div class="asenha-tab-buttons">
184 <input id="tab-content-management" type="radio" name="tabs" checked><label for="tab-content-management">Content Management</label>
185 <input id="tab-admin-interface" type="radio" name="tabs"><label for="tab-admin-interface">Admin Interface</label>
186 <input id="tab-login-logout" type="radio" name="tabs"><label for="tab-login-logout">Log In | Log Out</label>
187 <input id="tab-custom-code" type="radio" name="tabs"><label for="tab-custom-code">Custom Code</label>
188 <input id="tab-disable-components" type="radio" name="tabs"><label for="tab-disable-components">Disable Components</label>
189 <input id="tab-security" type="radio" name="tabs"><label for="tab-security">Security</label>
190 <input id="tab-optimizations" type="radio" name="tabs"><label for="tab-optimizations">Optimizations</label>
191 <input id="tab-utilities" type="radio" name="tabs"><label for="tab-utilities">Utilities</label>
192 </div>
193 <div class="asenha-tab-contents">
194 <section class="asenha-fields fields-content-management">
195 <table class="form-table" role="presentation">
196 <tbody></tbody>
197 </table>
198 </section>
199 <section class="asenha-fields fields-admin-interface">
200 <table class="form-table" role="presentation">
201 <tbody></tbody>
202 </table>
203 </section>
204 <section class="asenha-fields fields-login-logout">
205 <table class="form-table" role="presentation">
206 <tbody></tbody>
207 </table>
208 </section>
209 <section class="asenha-fields fields-custom-code">
210 <table class="form-table" role="presentation">
211 <tbody></tbody>
212 </table>
213 </section>
214 <section class="asenha-fields fields-disable-components">
215 <table class="form-table" role="presentation">
216 <tbody></tbody>
217 </table>
218 </section>
219 <section class="asenha-fields fields-security">
220 <table class="form-table" role="presentation">
221 <tbody></tbody>
222 </table>
223 </section>
224 <section class="asenha-fields fields-optimizations">
225 <table class="form-table" role="presentation">
226 <tbody></tbody>
227 </table>
228 </section>
229 <section class="asenha-fields fields-utilities">
230 <table class="form-table" role="presentation">
231 <tbody></tbody>
232 </table>
233 </section>
234 </div>
235 </div>
236 <div style="display:none;"><!-- Hide to prevent flash of fields appearing at the bottom of the page -->
237 <?php
238 settings_fields( ASENHA_ID );
239 ?>
240 <?php
241 do_settings_sections( ASENHA_SLUG );
242 ?>
243 <?php
244 submit_button(
245 'Save Changes',
246 // Button copy
247 'primary',
248 // Type: 'primary', 'small', or 'large'
249 'submit',
250 // The 'name' attribute
251 true,
252 // Whether to wrap in <p> tag
253 array(
254 'id' => 'asenha-submit',
255 )
256 );
257 ?>
258 </div>
259 </form>
260 </div>
261
262 <div class="asenha-footer">
263 </div>
264
265 <div id="asenha-sponsor" class="cta-modal-content sponsorship" style="display:none;">
266 <div class="sponsorship-content">
267 <div class="sponsorship-header">
268 <a href="https://bowo.io/asenha-bw-sp" target="_blank" class="sponsorship-photo-link"><img src="<?php
269 echo esc_attr( ASENHA_URL . 'assets/img/bowo.jpg' ) ;
270 ?>" class="sponsorship-bio-photo" /></a>
271 <h2>Thank you for your interest in sponsoring ASE!</h2>
272 <p class="sponsorship-user-quote">“A very very useful plugin. I have made a little sponsorship and encourage other users to do the same as it is so much deserved. Thank you Bowo! ~<a href="https://wordpress.org/support/topic/very-very-useful-54/" target="_blank">@pgrand83</a></p>
273 </div>
274 <div class="sponsorship-content-sections">
275 <div class="sponsorship-info">
276 <p class="sponsorship-description">Your sponsorship will help justify the time and effort I spend in <strong>developing and maintaining Admin and Site Enhancements (ASE)</strong>, so it can remain functional and be more useful for <strong>your personal project(s), paid dev work, client site(s) and/or agency workflow</strong>... hopefully for years to come.</p>
277 </div>
278 <div class="sponsorship-methods">
279 <p class="sponsorship-amount">Sponsorship can be <strong>as little as USD 1</strong>, monthly or one-time.</p>
280 <div class="sponsorship-method sponsor-via-github">
281 <a href="https://bowo.io/asenha-sp-gth" target="_blank" class="button button-primary button-hero sponsorship-button monthly">Monthly Sponsorship via Github <span class="dashicons dashicons-arrow-right-alt2"></span></a>
282 </div>
283 <div class="sponsorship-method sponsor-via-paypal">
284 <a href="https://bowo.io/asenha-sp-ppl" target="_blank" class="button button-hero sponsorship-button one-time">One-time Sponsorship via PayPal <span class="dashicons dashicons-arrow-right-alt2"></span></a>
285 </div>
286 </div>
287 </div>
288 <p>More about me and my work at <a href="https://bowo.io/asenha-bw-sp" target="_blank">bowo.io</a>.</p>
289 </div>
290 </div>
291 </div>
292 <?php
293 // Record the number of times changes were saved as well as the date of last save
294 $asenha_stats = get_option( ASENHA_SLUG_U . '_stats', array() );
295 $changes_saved = ( isset( $_GET['settings-updated'] ) && 'true' == $_GET['settings-updated'] ? true : false );
296
297 if ( $changes_saved ) {
298 $current_date = date( 'Y-m-d', time() );
299
300 if ( !isset( $asenha_stats['first_save_date'] ) ) {
301 $asenha_stats['first_save_date'] = $current_date;
302 $asenha_stats['last_save_date'] = $current_date;
303 $asenha_stats['save_count'] = 1;
304 $asenha_stats['have_sponsored'] = false;
305 $asenha_stats['sponsorship_nudge_dismissed'] = false;
306 $asenha_stats['sponsorship_nudge_last_shown_date'] = '';
307 $asenha_stats['sponsorship_nudge_last_shown_save_count'] = 0;
308 } else {
309 $asenha_stats['last_save_date'] = $current_date;
310 $save_count = $asenha_stats['save_count'];
311 $save_count++;
312 $asenha_stats['save_count'] = $save_count;
313 }
314
315 update_option( ASENHA_SLUG_U . '_stats', $asenha_stats );
316 }
317
318 }
319
320 /**
321 * Suppress all notices, then add notice for successful settings update
322 *
323 * @since 1.1.0
324 */
325 function asenha_suppress_notices()
326 {
327 global $plugin_page ;
328 // Suppress all notices
329 if ( ASENHA_SLUG === $plugin_page ) {
330 remove_all_actions( 'admin_notices' );
331 }
332 // Add notice for successful settings update
333 if ( isset( $_GET['page'] ) && ASENHA_SLUG == $_GET['page'] && isset( $_GET['settings-updated'] ) && true == $_GET['settings-updated'] ) {
334 ?>
335 <script>
336 jQuery(document).ready( function() {
337 jQuery('.asenha-changes-saved').fadeIn(400).delay(2500).fadeOut(400);
338 });
339 </script>
340
341 <?php
342 }
343 }
344
345 /**
346 * Suppress all generic notices on the plugin settings page
347 *
348 * @since 2.7.0
349 */
350 function asenha_suppress_generic_notices()
351 {
352 global $plugin_page ;
353 // Suppress all notices
354 if ( ASENHA_SLUG === $plugin_page ) {
355 remove_all_actions( 'all_admin_notices' );
356 }
357 }
358
359 /**
360 * Enqueue admin scripts
361 *
362 * @since 1.0.0
363 */
364 function asenha_admin_scripts( $hook_suffix )
365 {
366 global
367 $wp_version,
368 $pagenow,
369 $typenow,
370 $taxnow,
371 $hook_suffix
372 ;
373 $current_screen = get_current_screen();
374 // Get all WP Enhancements options, default to empty array in case it's not been created yet
375 $options = get_option( 'admin_site_enhancements', array() );
376 // For main page of this plugin
377
378 if ( is_asenha() ) {
379 wp_enqueue_style(
380 'asenha-jbox',
381 ASENHA_URL . 'assets/css/jBox.all.min.css',
382 array(),
383 ASENHA_VERSION
384 );
385 wp_enqueue_script(
386 'asenha-jbox',
387 ASENHA_URL . 'assets/js/jBox.all.min.js',
388 array(),
389 ASENHA_VERSION,
390 false
391 );
392 wp_enqueue_script(
393 'asenha-jsticky',
394 ASENHA_URL . 'assets/js/jquery.jsticky.mod.min.js',
395 array( 'jquery' ),
396 ASENHA_VERSION,
397 false
398 );
399 wp_enqueue_script(
400 'asenha-js-cookie',
401 ASENHA_URL . 'assets/js/js.cookie.min.js',
402 array(),
403 ASENHA_VERSION,
404 false
405 );
406 // jQuery UI Sortables. In use, e.g. for Admin Interface >> Admin Menu Organizer
407 // Re-register and re-enqueue jQuery UI Core and plugins required for sortable, draggable and droppable when ordering menu items
408 wp_deregister_script( 'jquery-ui-core' );
409 wp_register_script(
410 'jquery-ui-core',
411 get_site_url() . '/wp-includes/js/jquery/ui/core.min.js',
412 array( 'jquery' ),
413 ASENHA_VERSION,
414 false
415 );
416 wp_enqueue_script( 'jquery-ui-core' );
417
418 if ( version_compare( $wp_version, '5.6.0', '>=' ) ) {
419 wp_deregister_script( 'jquery-ui-mouse' );
420 wp_register_script(
421 'jquery-ui-mouse',
422 get_site_url() . '/wp-includes/js/jquery/ui/mouse.min.js',
423 array( 'jquery-ui-core' ),
424 ASENHA_VERSION,
425 false
426 );
427 wp_enqueue_script( 'jquery-ui-mouse' );
428 } else {
429 wp_deregister_script( 'jquery-ui-widget' );
430 wp_register_script(
431 'jquery-ui-widget',
432 get_site_url() . '/wp-includes/js/jquery/ui/widget.min.js',
433 array( 'jquery' ),
434 ASENHA_VERSION,
435 false
436 );
437 wp_enqueue_script( 'jquery-ui-widget' );
438 wp_deregister_script( 'jquery-ui-mouse' );
439 wp_register_script(
440 'jquery-ui-mouse',
441 get_site_url() . '/wp-includes/js/jquery/ui/mouse.min.js',
442 array( 'jquery-ui-core', 'jquery-ui-widget' ),
443 ASENHA_VERSION,
444 false
445 );
446 wp_enqueue_script( 'jquery-ui-mouse' );
447 }
448
449 wp_deregister_script( 'jquery-ui-sortable' );
450 wp_register_script(
451 'jquery-ui-sortable',
452 get_site_url() . '/wp-includes/js/jquery/ui/sortable.min.js',
453 array( 'jquery-ui-mouse' ),
454 ASENHA_VERSION,
455 false
456 );
457 wp_enqueue_script( 'jquery-ui-sortable' );
458 wp_deregister_script( 'jquery-ui-draggable' );
459 wp_register_script(
460 'jquery-ui-draggable',
461 get_site_url() . '/wp-includes/js/jquery/ui/draggable.min.js',
462 array( 'jquery-ui-mouse' ),
463 ASENHA_VERSION,
464 false
465 );
466 wp_enqueue_script( 'jquery-ui-draggable' );
467 wp_deregister_script( 'jquery-ui-droppable' );
468 wp_register_script(
469 'jquery-ui-droppable',
470 get_site_url() . '/wp-includes/js/jquery/ui/droppable.min.js',
471 array( 'jquery-ui-draggable' ),
472 ASENHA_VERSION,
473 false
474 );
475 wp_enqueue_script( 'jquery-ui-droppable' );
476 // Script to set behaviour and actions of the sortable menu
477 wp_enqueue_script(
478 'asenha-custom-admin-menu',
479 ASENHA_URL . 'assets/js/custom-admin-menu.js',
480 array( 'jquery-ui-draggable' ),
481 ASENHA_VERSION,
482 false
483 );
484 // CodeMirror. In use, e.g. for Utilities >> Enable Custom Admin / Frontend CSS / ads.txt / app-ads.txt
485 wp_enqueue_style(
486 'asenha-codemirror',
487 ASENHA_URL . 'assets/css/codemirror/codemirror.min.css',
488 array(),
489 ASENHA_VERSION
490 );
491 wp_enqueue_script(
492 'asenha-codemirror',
493 ASENHA_URL . 'assets/js/codemirror/codemirror.min.js',
494 array( 'jquery' ),
495 ASENHA_VERSION,
496 true
497 );
498 wp_enqueue_script(
499 'asenha-codemirror-htmlmixed-mode',
500 ASENHA_URL . 'assets/js/codemirror/htmlmixed.js',
501 array( 'asenha-codemirror' ),
502 ASENHA_VERSION,
503 true
504 );
505 wp_enqueue_script(
506 'asenha-codemirror-xml-mode',
507 ASENHA_URL . 'assets/js/codemirror/xml.js',
508 array( 'asenha-codemirror' ),
509 ASENHA_VERSION,
510 true
511 );
512 wp_enqueue_script(
513 'asenha-codemirror-javascript-mode',
514 ASENHA_URL . 'assets/js/codemirror/javascript.js',
515 array( 'asenha-codemirror' ),
516 ASENHA_VERSION,
517 true
518 );
519 wp_enqueue_script(
520 'asenha-codemirror-css-mode',
521 ASENHA_URL . 'assets/js/codemirror/css.js',
522 array( 'asenha-codemirror' ),
523 ASENHA_VERSION,
524 true
525 );
526 wp_enqueue_script(
527 'asenha-codemirror-markdown-mode',
528 ASENHA_URL . 'assets/js/codemirror/markdown.js',
529 array( 'asenha-codemirror' ),
530 ASENHA_VERSION,
531 true
532 );
533 // DataTables. In use, e.g. for Security >> Limit Login Attempts
534 wp_enqueue_style(
535 'asenha-datatables',
536 ASENHA_URL . 'assets/css/datatables/datatables.min.css',
537 array(),
538 ASENHA_VERSION
539 );
540 wp_enqueue_script(
541 'asenha-datatables',
542 ASENHA_URL . 'assets/js/datatables/datatables.min.js',
543 array( 'jquery' ),
544 ASENHA_VERSION,
545 false
546 );
547 // Main style and script for the admin page
548 wp_enqueue_style(
549 'asenha-admin-page',
550 ASENHA_URL . 'assets/css/admin-page.css',
551 array( 'asenha-jbox', 'asenha-codemirror', 'asenha-datatables' ),
552 ASENHA_VERSION
553 );
554 wp_enqueue_script(
555 'asenha-admin-page',
556 ASENHA_URL . 'assets/js/admin-page.js',
557 array(
558 'asenha-jsticky',
559 'asenha-jbox',
560 'asenha-js-cookie',
561 'asenha-codemirror-htmlmixed-mode',
562 'asenha-codemirror-xml-mode',
563 'asenha-codemirror-javascript-mode',
564 'asenha-codemirror-css-mode',
565 'asenha-codemirror-markdown-mode',
566 'asenha-datatables',
567 'asenha-custom-admin-menu'
568 ),
569 ASENHA_VERSION,
570 false
571 );
572 }
573
574 // Enqueue on all wp-admin
575 wp_enqueue_style(
576 'asenha-wp-admin',
577 ASENHA_URL . 'assets/css/wp-admin.css',
578 array(),
579 ASENHA_VERSION
580 );
581 // Content Management >> Show IDs, for list tables in wp-admin, e.g. All Posts page
582 if ( false !== strpos( $current_screen->base, 'edit' ) || false !== strpos( $current_screen->base, 'users' ) || false !== strpos( $current_screen->base, 'upload' ) ) {
583 wp_enqueue_style(
584 'asenha-list-table',
585 ASENHA_URL . 'assets/css/list-table.css',
586 array(),
587 ASENHA_VERSION
588 );
589 }
590 // Content Management >> Enable Media Replacement
591
592 if ( $current_screen->base == 'upload' || $current_screen->id == 'attachment' ) {
593 // wp_enqueue_style( 'asenha-jbox', ASENHA_URL . 'assets/css/jBox.all.min.css', array(), ASENHA_VERSION );
594 // wp_enqueue_script( 'asenha-jbox', ASENHA_URL . 'assets/js/jBox.all.min.js', array(), ASENHA_VERSION, false );
595 wp_enqueue_style(
596 'asenha-media-replace',
597 ASENHA_URL . 'assets/css/media-replace.css',
598 array(),
599 ASENHA_VERSION
600 );
601 wp_enqueue_script(
602 'asenha-media-replace',
603 ASENHA_URL . 'assets/js/media-replace.js',
604 array(),
605 ASENHA_VERSION,
606 false
607 );
608 }
609
610 // Content Management >> Hide Admin Notices
611
612 if ( array_key_exists( 'hide_admin_notices', $options ) && $options['hide_admin_notices'] ) {
613 wp_enqueue_style(
614 'asenha-jbox',
615 ASENHA_URL . 'assets/css/jBox.all.min.css',
616 array(),
617 ASENHA_VERSION
618 );
619 wp_enqueue_script(
620 'asenha-jbox',
621 ASENHA_URL . 'assets/js/jBox.all.min.js',
622 array(),
623 ASENHA_VERSION,
624 false
625 );
626 wp_enqueue_style(
627 'asenha-hide-admin-notices',
628 ASENHA_URL . 'assets/css/hide-admin-notices.css',
629 array(),
630 ASENHA_VERSION
631 );
632 wp_enqueue_script(
633 'asenha-hide-admin-notices',
634 ASENHA_URL . 'assets/js/hide-admin-notices.js',
635 array( 'asenha-jbox' ),
636 ASENHA_VERSION,
637 false
638 );
639 }
640
641 // Utilities >> Multiple User Roles
642 if ( array_key_exists( 'multiple_user_roles', $options ) && $options['multiple_user_roles'] ) {
643 if ( 'user-edit.php' == $hook_suffix || 'user-new.php' == $hook_suffix ) {
644 // Only replace roles dropdown with checkboxes for users that can assign roles to other users, e.g. administrators
645 if ( current_user_can( 'promote_users', get_current_user_id() ) ) {
646 wp_enqueue_script(
647 'asenha-multiple-user-roles',
648 ASENHA_URL . 'assets/js/multiple-user-roles.js',
649 array( 'jquery' ),
650 ASENHA_VERSION,
651 false
652 );
653 }
654 }
655 }
656 // Pass on ASENHA stats to admin-page.js to determine whether to show sponsorship nudge
657 $asenha_stats = get_option( ASENHA_SLUG_U . '_stats', array() );
658 $current_date = date( 'Y-m-d', time() );
659 $show_sponsorship_nudge = false;
660 $asenha_stats_localized = array(
661 'firstSaveDate' => '',
662 'lastSaveDate' => '',
663 'saveCount' => 0,
664 'showSponsorshipNudge' => false,
665 );
666
667 if ( !empty($asenha_stats) ) {
668 $have_sponsored = $asenha_stats['have_sponsored'];
669 $changes_saved = ( isset( $_GET['settings-updated'] ) && 'true' == $_GET['settings-updated'] ? true : false );
670 // Compensate for redirect from settings-updated=true URL
671
672 if ( $changes_saved ) {
673 $save_count = $asenha_stats['save_count'] + 1;
674 } else {
675 $save_count = $asenha_stats['save_count'];
676 }
677
678 $saves_to_nudge_sponsorship = 10;
679
680 if ( $save_count < $saves_to_nudge_sponsorship ) {
681 $save_count_modulo = -1;
682 } else {
683 $save_count_modulo = $save_count % $saves_to_nudge_sponsorship;
684 }
685
686 // User have not sponsored ASE
687 if ( false === $have_sponsored ) {
688 // Sponsorship nudge have not been dismissed
689
690 if ( false === $asenha_stats['sponsorship_nudge_dismissed'] ) {
691 // Show sponsorship nudge after every x saves
692
693 if ( $save_count_modulo >= 0 ) {
694 $show_sponsorship_nudge = true;
695 } else {
696 $show_sponsorship_nudge = false;
697 }
698
699
700 if ( $show_sponsorship_nudge && $save_count_modulo >= 0 ) {
701 $asenha_stats['sponsorship_nudge_last_shown_date'] = $current_date;
702 $asenha_stats['sponsorship_nudge_last_shown_save_count'] = $save_count;
703 update_option( ASENHA_SLUG_U . '_stats', $asenha_stats );
704 }
705
706 } else {
707
708 if ( $save_count_modulo == 0 ) {
709
710 if ( $save_count > $asenha_stats['sponsorship_nudge_last_shown_save_count'] ) {
711 $asenha_stats['sponsorship_nudge_dismissed'] = false;
712 update_option( ASENHA_SLUG_U . '_stats', $asenha_stats );
713 $show_sponsorship_nudge = true;
714 } else {
715 $show_sponsorship_nudge = false;
716 }
717
718 } else {
719 $show_sponsorship_nudge = false;
720 }
721
722 }
723
724 }
725 $asenha_stats_localized = array(
726 'firstSaveDate' => $asenha_stats['first_save_date'],
727 'lastSaveDate' => $asenha_stats['last_save_date'],
728 'saveCount' => $save_count,
729 'showSponsorshipNudge' => $show_sponsorship_nudge,
730 );
731 }
732
733 wp_localize_script( 'asenha-admin-page', 'asenhaStats', $asenha_stats_localized );
734 }
735
736 /**
737 * Enqueue public scripts
738 *
739 * @since 3.9.0
740 */
741 function asenha_public_scripts( $hook_suffix )
742 {
743 // Get all WP Enhancements options, default to empty array in case it's not been created yet
744 $options = get_option( 'admin_site_enhancements', array() );
745
746 if ( array_key_exists( 'enable_external_permalinks', $options ) ) {
747 $enable_external_permalinks = $options['enable_external_permalinks'];
748 } else {
749 $enable_external_permalinks = false;
750 }
751
752
753 if ( $enable_external_permalinks ) {
754 wp_enqueue_script(
755 'asenha-public',
756 ASENHA_URL . 'assets/js/public.js',
757 array( 'jquery' ),
758 ASENHA_VERSION,
759 false
760 );
761 wp_localize_script( 'asenha-public', 'phpVars', array(
762 'externalPermalinksEnabled' => $enable_external_permalinks,
763 ) );
764 }
765
766 }
767
768 /**
769 * Add 'Access now' plugin action link.
770 *
771 * @since 1.0.0
772 */
773 function asenha_plugin_action_links( $links )
774 {
775 $settings_link = '<a href="tools.php?page=' . ASENHA_SLUG . '">Configure now</a>';
776 array_unshift( $links, $settings_link );
777 return $links;
778 }
779
780 /**
781 * Modify footer text
782 *
783 * @since 1.0.0
784 */
785 function asenha_footer_text()
786 {
787 if ( is_asenha() ) {
788 ?>
789 <a href="https://bowo.io/asenha-dotorg" target="_blank">Admin Site Enhancements</a> is on <a href="https://bowo.io/asenha-gthb" target="_blank">github</a>.
790 <?php
791 }
792 }
793
794 /**
795 * Change WP version number text in footer
796 *
797 * @since 4.8.3
798 */
799 function asenha_footer_version_text()
800 {
801 ?>
802 Also by Bowo &#8594; <a href="https://bowo.io/asenha-wpn" target="_blank">WordPress Newsboard</a>: The latest from 100+ sources
803 <?php
804 }
805
806 /**
807 * Check if current screen is this plugin's main page
808 *
809 * @since 1.0.0
810 */
811 function is_asenha()
812 {
813 $request_uri = sanitize_text_field( $_SERVER['REQUEST_URI'] );
814 // e.g. /wp-admin/index.php?page=page-slug
815
816 if ( strpos( $request_uri, 'page=' . ASENHA_SLUG ) !== false ) {
817 return true;
818 // Yes, this is the plugin's main page
819 } else {
820 return false;
821 // Nope, this is NOT the plugin's page
822 }
823
824 }
825
826 /**
827 * Mark that user have sponsored ASE
828 *
829 * @since 5.2.7
830 */
831 function asenha_have_sponsored()
832 {
833
834 if ( isset( $_REQUEST ) ) {
835 $asenha_stats = get_option( ASENHA_SLUG_U . '_stats', array() );
836 $asenha_stats['have_sponsored'] = true;
837 $asenha_stats['sponsorship_nudge_dismissed'] = true;
838 $success = update_option( ASENHA_SLUG_U . '_stats', $asenha_stats );
839
840 if ( $success ) {
841 echo json_encode( array(
842 'success' => true,
843 ) ) ;
844 } else {
845 echo json_encode( array(
846 'success' => false,
847 ) ) ;
848 }
849
850 }
851
852 }
853
854 /**
855 * Dismiss sponsorship nudge
856 *
857 * @since 5.2.7
858 */
859 function asenha_dismiss_sponsorship_nudge()
860 {
861
862 if ( isset( $_REQUEST ) ) {
863 $asenha_stats = get_option( ASENHA_SLUG_U . '_stats', array() );
864 $asenha_stats['sponsorship_nudge_dismissed'] = true;
865 $success = update_option( ASENHA_SLUG_U . '_stats', $asenha_stats );
866
867 if ( $success ) {
868 echo json_encode( array(
869 'success' => true,
870 ) ) ;
871 } else {
872 echo json_encode( array(
873 'success' => false,
874 ) ) ;
875 }
876
877 }
878
879 }
880