PluginProbe ʕ •ᴥ•ʔ
Admin and Site Enhancements (ASE) / 5.5.2
Admin and Site Enhancements (ASE) v5.5.2
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
896 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 '"Please consider supporting it if you use it on multiple sites / it saves you a lot of time, we as a community need to keep good devs like this and gems like this plugin alive." ~<a href="https://wordpress.org/support/topic/you-need-this-19/" target="_blank">@kiikiikii</a>',
77 '"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>',
78 '"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>',
79 '"Not only free, but worth a donation. This plugins does so many little things that there\'s bound to be a bunch that will make your life easier." ~<a href="https://wordpress.org/support/topic/not-only-free-but-worth-a-donation/" target="_blank">Darryl</a>',
80 '"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>',
81 '"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>',
82 '"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>',
83 '"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>',
84 '"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>',
85 '"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>',
86 '"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>',
87 '"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>',
88 '"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>',
89 '"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>',
90 '"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>',
91 '"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>',
92 '"A must have plugin for most sites, So many useful features. along with a great developer who is open to suggestions." ~<a href="https://wordpress.org/support/topic/amazing-plugin-2443/" target="_blank">@akgt</a>',
93 '"Great plugin and awesome developer!" ~<a href="https://wordpress.org/support/topic/awesome-9998/" target="_blank">@mrgy05</a>',
94 '"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>',
95 '"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>',
96 '"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>',
97 '"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>',
98 '"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>'
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 '"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>',
123 '"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>',
124 '"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>',
125 '"So many useful features it blows my mind, as well as enabling me to ditch so many other plugins." ~<a href="https://wordpress.org/support/topic/amazing-plugin-2441/" target="_blank">@simonclay</a>',
126 '"One of those plugins that feels like it should be part of the core, lots of useful features without the bloat." ~<a href="https://wordpress.org/support/topic/great-contribution-5/" target="_blank">@mohobook</a>',
127 '"One of the best and feature-rich plugins to add simple functions without using all sorts of separate plugins." ~<a href="https://wordpress.org/support/topic/amazing-all-purpose-plugin/" target="_blank">@toineenzo</a>'
128 );
129 $random_support_quote = $support_quotes[rand( 0, count( $support_quotes ) - 1 )];
130 $share_quotes = array(
131 '"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>',
132 '"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>',
133 '"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>',
134 '"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>',
135 '"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>',
136 '"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>',
137 '"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>',
138 '"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>"',
139 '"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>',
140 '"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>',
141 '"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>',
142 '"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>',
143 '"This is one of the best utility plugins that eliminates the need to use multiple plugins. It has become a standard plugin used in my WP site blueprint." ~<a href="https://wordpress.org/support/topic/must-have-wp-utility-tool/" target="_blank">Ken Sim</a>',
144 '"Necessary plugin to every WordPress site." ~<a href="https://wordpress.org/support/topic/its-a-very-useful-plugin/" target="_blank">@ntamas</a>',
145 '"ASE is a highly recommended plugin for anyone looking to improve the functionality and usability of their WordPress site" ~<a href="https://wordpress.org/support/topic/amazing-plugin-in-place-of-multiple-plugins/" target="_blank">Ayyaz Ahmad</a>'
146 );
147 $random_share_quote = $share_quotes[rand( 0, count( $share_quotes ) - 1 )];
148 ?>
149 <div class="nudge-quotes">
150 <div class="user-quote"><?php
151 echo $random_sponsorship_quote ;
152 ?></div>
153 <div class="user-quote"><?php
154 echo $random_support_quote ;
155 ?></div>
156 </div>
157 <div class="nudge-content">
158 <div class="nudge-primary">
159 <h4>Sponsor ASE from as little as USD 1, monthly or one-time</h4>
160 <div class="nudge-info">
161 <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>
162 </div>
163 <div class="nudge-ctas">
164 <a href="https://bowo.io/asenha-sp-gth-ndg" class="button button-primary sponsorship-button monthly" target="_blank">Sponsor Monthly</a>
165 <a href="https://bowo.io/asenha-sp-ppl-ndg" class="button sponsorship-button one-time" target="_blank">Sponsor One-Time</a>
166 <a href="#" id="have-sponsored" class="asenha-have-sponsored">I've sponsored ASE</a>
167 </div>
168 <div class="nudge-stats">
169 <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.5.2 (released on August 9, 2023) and 8,000+ active installs, there have been <a href="https://bowo.io/asenha-sp-gth-ndg" target="_blank">6 monthly sponsors</a> and <a href="https://bowo.io/asenha-sp-ppl-ndg" target="_blank">39 one-time sponsors</a>. You can be one today!</p>
170 </div>
171 </div>
172 <div class="nudge-secondary">
173 <h4>Give ASE your 5-star review or provide detailed feedback</h4>
174 <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>
175 <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>
176 </div>
177 </div>
178 <div class="user-quote share-quote"><?php
179 echo $random_share_quote ;
180 ?></div>
181 <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>
182 <a href="https://bowo.io/asenha-bw-ndg" target="_blank" class="nudge-photo-link"><img src="<?php
183 echo esc_attr( ASENHA_URL . 'assets/img/bowo.jpg' ) ;
184 ?>" class="nudge-photo" /></a>
185 <h3>Thank you!</h3>
186 <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>
187 <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>
188 </div>
189 </div>
190 <form action="options.php" method="post">
191 <div class="asenha-vertical-tabs">
192 <div class="asenha-tab-buttons">
193 <input id="tab-content-management" type="radio" name="tabs" checked><label for="tab-content-management">Content Management</label>
194 <input id="tab-admin-interface" type="radio" name="tabs"><label for="tab-admin-interface">Admin Interface</label>
195 <input id="tab-login-logout" type="radio" name="tabs"><label for="tab-login-logout">Log In | Log Out</label>
196 <input id="tab-custom-code" type="radio" name="tabs"><label for="tab-custom-code">Custom Code</label>
197 <input id="tab-disable-components" type="radio" name="tabs"><label for="tab-disable-components">Disable Components</label>
198 <input id="tab-security" type="radio" name="tabs"><label for="tab-security">Security</label>
199 <input id="tab-optimizations" type="radio" name="tabs"><label for="tab-optimizations">Optimizations</label>
200 <input id="tab-utilities" type="radio" name="tabs"><label for="tab-utilities">Utilities</label>
201 </div>
202 <div class="asenha-tab-contents">
203 <section class="asenha-fields fields-content-management">
204 <table class="form-table" role="presentation">
205 <tbody></tbody>
206 </table>
207 </section>
208 <section class="asenha-fields fields-admin-interface">
209 <table class="form-table" role="presentation">
210 <tbody></tbody>
211 </table>
212 </section>
213 <section class="asenha-fields fields-login-logout">
214 <table class="form-table" role="presentation">
215 <tbody></tbody>
216 </table>
217 </section>
218 <section class="asenha-fields fields-custom-code">
219 <table class="form-table" role="presentation">
220 <tbody></tbody>
221 </table>
222 </section>
223 <section class="asenha-fields fields-disable-components">
224 <table class="form-table" role="presentation">
225 <tbody></tbody>
226 </table>
227 </section>
228 <section class="asenha-fields fields-security">
229 <table class="form-table" role="presentation">
230 <tbody></tbody>
231 </table>
232 </section>
233 <section class="asenha-fields fields-optimizations">
234 <table class="form-table" role="presentation">
235 <tbody></tbody>
236 </table>
237 </section>
238 <section class="asenha-fields fields-utilities">
239 <table class="form-table" role="presentation">
240 <tbody></tbody>
241 </table>
242 </section>
243 </div>
244 </div>
245 <div style="display:none;"><!-- Hide to prevent flash of fields appearing at the bottom of the page -->
246 <?php
247 settings_fields( ASENHA_ID );
248 ?>
249 <?php
250 do_settings_sections( ASENHA_SLUG );
251 ?>
252 <?php
253 submit_button(
254 'Save Changes',
255 // Button copy
256 'primary',
257 // Type: 'primary', 'small', or 'large'
258 'submit',
259 // The 'name' attribute
260 true,
261 // Whether to wrap in <p> tag
262 array(
263 'id' => 'asenha-submit',
264 )
265 );
266 ?>
267 </div>
268 </form>
269 </div>
270
271 <div class="asenha-footer">
272 </div>
273
274 <div id="asenha-sponsor" class="cta-modal-content sponsorship" style="display:none;">
275 <div class="sponsorship-content">
276 <div class="sponsorship-header">
277 <a href="https://bowo.io/asenha-bw-sp" target="_blank" class="sponsorship-photo-link"><img src="<?php
278 echo esc_attr( ASENHA_URL . 'assets/img/bowo.jpg' ) ;
279 ?>" class="sponsorship-bio-photo" /></a>
280 <h2>Thank you for your interest in sponsoring ASE!</h2>
281 <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>
282 </div>
283 <div class="sponsorship-content-sections">
284 <div class="sponsorship-info">
285 <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>
286 </div>
287 <div class="sponsorship-methods">
288 <p class="sponsorship-amount">Sponsorship can be <strong>as little as USD 1</strong>, monthly or one-time.</p>
289 <div class="sponsorship-method sponsor-via-github">
290 <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>
291 </div>
292 <div class="sponsorship-method sponsor-via-paypal">
293 <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>
294 </div>
295 </div>
296 </div>
297 <p>More about me and my work at <a href="https://bowo.io/asenha-bw-sp" target="_blank">bowo.io</a>.</p>
298 </div>
299 </div>
300 </div>
301 <?php
302 // Record the number of times changes were saved as well as the date of last save
303 $asenha_stats = get_option( ASENHA_SLUG_U . '_stats', array() );
304 $changes_saved = ( isset( $_GET['settings-updated'] ) && 'true' == $_GET['settings-updated'] ? true : false );
305
306 if ( $changes_saved ) {
307 $current_date = date( 'Y-m-d', time() );
308
309 if ( !isset( $asenha_stats['first_save_date'] ) ) {
310 $asenha_stats['first_save_date'] = $current_date;
311 $asenha_stats['last_save_date'] = $current_date;
312 $asenha_stats['save_count'] = 1;
313 $asenha_stats['have_sponsored'] = false;
314 $asenha_stats['sponsorship_nudge_dismissed'] = false;
315 $asenha_stats['sponsorship_nudge_last_shown_date'] = '';
316 $asenha_stats['sponsorship_nudge_last_shown_save_count'] = 0;
317 } else {
318 $asenha_stats['last_save_date'] = $current_date;
319 $save_count = $asenha_stats['save_count'];
320 $save_count++;
321 $asenha_stats['save_count'] = $save_count;
322 }
323
324 update_option( ASENHA_SLUG_U . '_stats', $asenha_stats );
325 }
326
327 }
328
329 /**
330 * Suppress all notices, then add notice for successful settings update
331 *
332 * @since 1.1.0
333 */
334 function asenha_suppress_notices()
335 {
336 global $plugin_page ;
337 // Suppress all notices
338 if ( ASENHA_SLUG === $plugin_page ) {
339 remove_all_actions( 'admin_notices' );
340 }
341 // Add notice for successful settings update
342 if ( isset( $_GET['page'] ) && ASENHA_SLUG == $_GET['page'] && isset( $_GET['settings-updated'] ) && true == $_GET['settings-updated'] ) {
343 ?>
344 <script>
345 jQuery(document).ready( function() {
346 jQuery('.asenha-changes-saved').fadeIn(400).delay(2500).fadeOut(400);
347 });
348 </script>
349
350 <?php
351 }
352 }
353
354 /**
355 * Suppress all generic notices on the plugin settings page
356 *
357 * @since 2.7.0
358 */
359 function asenha_suppress_generic_notices()
360 {
361 global $plugin_page ;
362 // Suppress all notices
363 if ( ASENHA_SLUG === $plugin_page ) {
364 remove_all_actions( 'all_admin_notices' );
365 }
366 }
367
368 /**
369 * Enqueue admin scripts
370 *
371 * @since 1.0.0
372 */
373 function asenha_admin_scripts( $hook_suffix )
374 {
375 global
376 $wp_version,
377 $pagenow,
378 $typenow,
379 $taxnow,
380 $hook_suffix
381 ;
382 $current_screen = get_current_screen();
383 // Get all WP Enhancements options, default to empty array in case it's not been created yet
384 $options = get_option( 'admin_site_enhancements', array() );
385 // For main page of this plugin
386
387 if ( is_asenha() ) {
388 wp_enqueue_style(
389 'asenha-jbox',
390 ASENHA_URL . 'assets/css/jBox.all.min.css',
391 array(),
392 ASENHA_VERSION
393 );
394 wp_enqueue_script(
395 'asenha-jbox',
396 ASENHA_URL . 'assets/js/jBox.all.min.js',
397 array(),
398 ASENHA_VERSION,
399 false
400 );
401 wp_enqueue_script(
402 'asenha-jsticky',
403 ASENHA_URL . 'assets/js/jquery.jsticky.mod.min.js',
404 array( 'jquery' ),
405 ASENHA_VERSION,
406 false
407 );
408 wp_enqueue_script(
409 'asenha-js-cookie',
410 ASENHA_URL . 'assets/js/js.cookie.min.js',
411 array(),
412 ASENHA_VERSION,
413 false
414 );
415 // jQuery UI Sortables. In use, e.g. for Admin Interface >> Admin Menu Organizer
416 // Re-register and re-enqueue jQuery UI Core and plugins required for sortable, draggable and droppable when ordering menu items
417 wp_deregister_script( 'jquery-ui-core' );
418 wp_register_script(
419 'jquery-ui-core',
420 get_site_url() . '/wp-includes/js/jquery/ui/core.min.js',
421 array( 'jquery' ),
422 ASENHA_VERSION,
423 false
424 );
425 wp_enqueue_script( 'jquery-ui-core' );
426
427 if ( version_compare( $wp_version, '5.6.0', '>=' ) ) {
428 wp_deregister_script( 'jquery-ui-mouse' );
429 wp_register_script(
430 'jquery-ui-mouse',
431 get_site_url() . '/wp-includes/js/jquery/ui/mouse.min.js',
432 array( 'jquery-ui-core' ),
433 ASENHA_VERSION,
434 false
435 );
436 wp_enqueue_script( 'jquery-ui-mouse' );
437 } else {
438 wp_deregister_script( 'jquery-ui-widget' );
439 wp_register_script(
440 'jquery-ui-widget',
441 get_site_url() . '/wp-includes/js/jquery/ui/widget.min.js',
442 array( 'jquery' ),
443 ASENHA_VERSION,
444 false
445 );
446 wp_enqueue_script( 'jquery-ui-widget' );
447 wp_deregister_script( 'jquery-ui-mouse' );
448 wp_register_script(
449 'jquery-ui-mouse',
450 get_site_url() . '/wp-includes/js/jquery/ui/mouse.min.js',
451 array( 'jquery-ui-core', 'jquery-ui-widget' ),
452 ASENHA_VERSION,
453 false
454 );
455 wp_enqueue_script( 'jquery-ui-mouse' );
456 }
457
458 wp_deregister_script( 'jquery-ui-sortable' );
459 wp_register_script(
460 'jquery-ui-sortable',
461 get_site_url() . '/wp-includes/js/jquery/ui/sortable.min.js',
462 array( 'jquery-ui-mouse' ),
463 ASENHA_VERSION,
464 false
465 );
466 wp_enqueue_script( 'jquery-ui-sortable' );
467 wp_deregister_script( 'jquery-ui-draggable' );
468 wp_register_script(
469 'jquery-ui-draggable',
470 get_site_url() . '/wp-includes/js/jquery/ui/draggable.min.js',
471 array( 'jquery-ui-mouse' ),
472 ASENHA_VERSION,
473 false
474 );
475 wp_enqueue_script( 'jquery-ui-draggable' );
476 wp_deregister_script( 'jquery-ui-droppable' );
477 wp_register_script(
478 'jquery-ui-droppable',
479 get_site_url() . '/wp-includes/js/jquery/ui/droppable.min.js',
480 array( 'jquery-ui-draggable' ),
481 ASENHA_VERSION,
482 false
483 );
484 wp_enqueue_script( 'jquery-ui-droppable' );
485 // Script to set behaviour and actions of the sortable menu
486 wp_enqueue_script(
487 'asenha-custom-admin-menu',
488 ASENHA_URL . 'assets/js/custom-admin-menu.js',
489 array( 'jquery-ui-draggable' ),
490 ASENHA_VERSION,
491 false
492 );
493 // First, we unload the CodeMirror libraries included in WP core
494 wp_deregister_script( 'wp-codemirror' );
495 wp_deregister_script( 'code-editor' );
496 wp_deregister_script( 'htmlhint' );
497 wp_deregister_script( 'csslint' );
498 wp_deregister_script( 'esprima' );
499 wp_deregister_script( 'jshint' );
500 // Then, we load ASENHA's CodeMirror libraries. In use, e.g. for Utilities >> Enable Custom Admin / Frontend CSS / ads.txt / app-ads.txt
501 wp_enqueue_style(
502 'asenha-codemirror',
503 ASENHA_URL . 'assets/css/codemirror/codemirror.min.css',
504 array(),
505 ASENHA_VERSION
506 );
507 wp_enqueue_script(
508 'asenha-codemirror',
509 ASENHA_URL . 'assets/js/codemirror/codemirror.min.js',
510 array( 'jquery' ),
511 ASENHA_VERSION,
512 true
513 );
514 wp_enqueue_script(
515 'asenha-codemirror-htmlmixed-mode',
516 ASENHA_URL . 'assets/js/codemirror/htmlmixed.js',
517 array( 'asenha-codemirror' ),
518 ASENHA_VERSION,
519 true
520 );
521 wp_enqueue_script(
522 'asenha-codemirror-xml-mode',
523 ASENHA_URL . 'assets/js/codemirror/xml.js',
524 array( 'asenha-codemirror' ),
525 ASENHA_VERSION,
526 true
527 );
528 wp_enqueue_script(
529 'asenha-codemirror-javascript-mode',
530 ASENHA_URL . 'assets/js/codemirror/javascript.js',
531 array( 'asenha-codemirror' ),
532 ASENHA_VERSION,
533 true
534 );
535 wp_enqueue_script(
536 'asenha-codemirror-css-mode',
537 ASENHA_URL . 'assets/js/codemirror/css.js',
538 array( 'asenha-codemirror' ),
539 ASENHA_VERSION,
540 true
541 );
542 wp_enqueue_script(
543 'asenha-codemirror-markdown-mode',
544 ASENHA_URL . 'assets/js/codemirror/markdown.js',
545 array( 'asenha-codemirror' ),
546 ASENHA_VERSION,
547 true
548 );
549 // DataTables. In use, e.g. for Security >> Limit Login Attempts
550 wp_enqueue_style(
551 'asenha-datatables',
552 ASENHA_URL . 'assets/css/datatables/datatables.min.css',
553 array(),
554 ASENHA_VERSION
555 );
556 wp_enqueue_script(
557 'asenha-datatables',
558 ASENHA_URL . 'assets/js/datatables/datatables.min.js',
559 array( 'jquery' ),
560 ASENHA_VERSION,
561 false
562 );
563 // Main style and script for the admin page
564 wp_enqueue_style(
565 'asenha-admin-page',
566 ASENHA_URL . 'assets/css/admin-page.css',
567 array( 'asenha-jbox', 'asenha-codemirror', 'asenha-datatables' ),
568 ASENHA_VERSION
569 );
570 wp_enqueue_script(
571 'asenha-admin-page',
572 ASENHA_URL . 'assets/js/admin-page.js',
573 array(
574 'asenha-jsticky',
575 'asenha-jbox',
576 'asenha-js-cookie',
577 'asenha-codemirror-htmlmixed-mode',
578 'asenha-codemirror-xml-mode',
579 'asenha-codemirror-javascript-mode',
580 'asenha-codemirror-css-mode',
581 'asenha-codemirror-markdown-mode',
582 'asenha-datatables',
583 'asenha-custom-admin-menu'
584 ),
585 ASENHA_VERSION,
586 false
587 );
588 }
589
590 // Enqueue on all wp-admin
591 wp_enqueue_style(
592 'asenha-wp-admin',
593 ASENHA_URL . 'assets/css/wp-admin.css',
594 array(),
595 ASENHA_VERSION
596 );
597 // Content Management >> Show IDs, for list tables in wp-admin, e.g. All Posts page
598 if ( false !== strpos( $current_screen->base, 'edit' ) || false !== strpos( $current_screen->base, 'users' ) || false !== strpos( $current_screen->base, 'upload' ) ) {
599 wp_enqueue_style(
600 'asenha-list-table',
601 ASENHA_URL . 'assets/css/list-table.css',
602 array(),
603 ASENHA_VERSION
604 );
605 }
606 // Content Management >> Enable Media Replacement
607
608 if ( $current_screen->base == 'upload' || $current_screen->id == 'attachment' ) {
609 // wp_enqueue_style( 'asenha-jbox', ASENHA_URL . 'assets/css/jBox.all.min.css', array(), ASENHA_VERSION );
610 // wp_enqueue_script( 'asenha-jbox', ASENHA_URL . 'assets/js/jBox.all.min.js', array(), ASENHA_VERSION, false );
611 wp_enqueue_style(
612 'asenha-media-replace',
613 ASENHA_URL . 'assets/css/media-replace.css',
614 array(),
615 ASENHA_VERSION
616 );
617 wp_enqueue_script(
618 'asenha-media-replace',
619 ASENHA_URL . 'assets/js/media-replace.js',
620 array(),
621 ASENHA_VERSION,
622 false
623 );
624 }
625
626 // Content Management >> Hide Admin Notices
627
628 if ( array_key_exists( 'hide_admin_notices', $options ) && $options['hide_admin_notices'] ) {
629 wp_enqueue_style(
630 'asenha-jbox',
631 ASENHA_URL . 'assets/css/jBox.all.min.css',
632 array(),
633 ASENHA_VERSION
634 );
635 wp_enqueue_script(
636 'asenha-jbox',
637 ASENHA_URL . 'assets/js/jBox.all.min.js',
638 array(),
639 ASENHA_VERSION,
640 false
641 );
642 wp_enqueue_style(
643 'asenha-hide-admin-notices',
644 ASENHA_URL . 'assets/css/hide-admin-notices.css',
645 array(),
646 ASENHA_VERSION
647 );
648 wp_enqueue_script(
649 'asenha-hide-admin-notices',
650 ASENHA_URL . 'assets/js/hide-admin-notices.js',
651 array( 'asenha-jbox' ),
652 ASENHA_VERSION,
653 false
654 );
655 }
656
657 // Utilities >> Multiple User Roles
658 if ( array_key_exists( 'multiple_user_roles', $options ) && $options['multiple_user_roles'] ) {
659 if ( 'user-edit.php' == $hook_suffix || 'user-new.php' == $hook_suffix ) {
660 // Only replace roles dropdown with checkboxes for users that can assign roles to other users, e.g. administrators
661 if ( current_user_can( 'promote_users', get_current_user_id() ) ) {
662 wp_enqueue_script(
663 'asenha-multiple-user-roles',
664 ASENHA_URL . 'assets/js/multiple-user-roles.js',
665 array( 'jquery' ),
666 ASENHA_VERSION,
667 false
668 );
669 }
670 }
671 }
672 // Pass on ASENHA stats to admin-page.js to determine whether to show sponsorship nudge
673 $asenha_stats = get_option( ASENHA_SLUG_U . '_stats', array() );
674 $current_date = date( 'Y-m-d', time() );
675 $show_sponsorship_nudge = false;
676 $asenha_stats_localized = array(
677 'firstSaveDate' => '',
678 'lastSaveDate' => '',
679 'saveCount' => 0,
680 'showSponsorshipNudge' => false,
681 );
682
683 if ( !empty($asenha_stats) ) {
684 $have_sponsored = $asenha_stats['have_sponsored'];
685 $changes_saved = ( isset( $_GET['settings-updated'] ) && 'true' == $_GET['settings-updated'] ? true : false );
686 // Compensate for redirect from settings-updated=true URL
687
688 if ( $changes_saved ) {
689 $save_count = $asenha_stats['save_count'] + 1;
690 } else {
691 $save_count = $asenha_stats['save_count'];
692 }
693
694 $saves_to_nudge_sponsorship = 5;
695
696 if ( $save_count < $saves_to_nudge_sponsorship ) {
697 $save_count_modulo = -1;
698 } else {
699 $save_count_modulo = $save_count % $saves_to_nudge_sponsorship;
700 }
701
702 // User have not sponsored ASE
703 if ( false === $have_sponsored ) {
704 // Sponsorship nudge have not been dismissed
705
706 if ( false === $asenha_stats['sponsorship_nudge_dismissed'] ) {
707 // Show sponsorship nudge after every x saves
708
709 if ( $save_count_modulo >= 0 ) {
710 $show_sponsorship_nudge = true;
711 } else {
712 $show_sponsorship_nudge = false;
713 }
714
715
716 if ( $show_sponsorship_nudge && $save_count_modulo >= 0 ) {
717 $asenha_stats['sponsorship_nudge_last_shown_date'] = $current_date;
718 $asenha_stats['sponsorship_nudge_last_shown_save_count'] = $save_count;
719 update_option( ASENHA_SLUG_U . '_stats', $asenha_stats );
720 }
721
722 } else {
723
724 if ( $save_count_modulo == 0 ) {
725
726 if ( $save_count > $asenha_stats['sponsorship_nudge_last_shown_save_count'] ) {
727 $asenha_stats['sponsorship_nudge_dismissed'] = false;
728 update_option( ASENHA_SLUG_U . '_stats', $asenha_stats );
729 $show_sponsorship_nudge = true;
730 } else {
731 $show_sponsorship_nudge = false;
732 }
733
734 } else {
735 $show_sponsorship_nudge = false;
736 }
737
738 }
739
740 }
741 $asenha_stats_localized = array(
742 'firstSaveDate' => $asenha_stats['first_save_date'],
743 'lastSaveDate' => $asenha_stats['last_save_date'],
744 'saveCount' => $save_count,
745 'showSponsorshipNudge' => $show_sponsorship_nudge,
746 );
747 }
748
749 wp_localize_script( 'asenha-admin-page', 'asenhaStats', $asenha_stats_localized );
750 }
751
752 /**
753 * Enqueue public scripts
754 *
755 * @since 3.9.0
756 */
757 function asenha_public_scripts( $hook_suffix )
758 {
759 // Get all WP Enhancements options, default to empty array in case it's not been created yet
760 $options = get_option( 'admin_site_enhancements', array() );
761
762 if ( array_key_exists( 'enable_external_permalinks', $options ) ) {
763 $enable_external_permalinks = $options['enable_external_permalinks'];
764 } else {
765 $enable_external_permalinks = false;
766 }
767
768
769 if ( $enable_external_permalinks ) {
770 wp_enqueue_script(
771 'asenha-public',
772 ASENHA_URL . 'assets/js/public.js',
773 array( 'jquery' ),
774 ASENHA_VERSION,
775 false
776 );
777 wp_localize_script( 'asenha-public', 'phpVars', array(
778 'externalPermalinksEnabled' => $enable_external_permalinks,
779 ) );
780 }
781
782 }
783
784 /**
785 * Add 'Access now' plugin action link.
786 *
787 * @since 1.0.0
788 */
789 function asenha_plugin_action_links( $links )
790 {
791 $settings_link = '<a href="tools.php?page=' . ASENHA_SLUG . '">Configure now</a>';
792 array_unshift( $links, $settings_link );
793 return $links;
794 }
795
796 /**
797 * Modify footer text
798 *
799 * @since 1.0.0
800 */
801 function asenha_footer_text()
802 {
803 if ( is_asenha() ) {
804 ?>
805 <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>.
806 <?php
807 }
808 }
809
810 /**
811 * Change WP version number text in footer
812 *
813 * @since 4.8.3
814 */
815 function asenha_footer_version_text()
816 {
817 ?>
818 Also by Bowo &#8594; <a href="https://bowo.io/asenha-wpn" target="_blank">WordPress Newsboard</a>: The latest from 100+ sources
819 <?php
820 }
821
822 /**
823 * Check if current screen is this plugin's main page
824 *
825 * @since 1.0.0
826 */
827 function is_asenha()
828 {
829 $request_uri = sanitize_text_field( $_SERVER['REQUEST_URI'] );
830 // e.g. /wp-admin/index.php?page=page-slug
831
832 if ( strpos( $request_uri, 'page=' . ASENHA_SLUG ) !== false ) {
833 return true;
834 // Yes, this is the plugin's main page
835 } else {
836 return false;
837 // Nope, this is NOT the plugin's page
838 }
839
840 }
841
842 /**
843 * Mark that user have sponsored ASE
844 *
845 * @since 5.2.7
846 */
847 function asenha_have_sponsored()
848 {
849
850 if ( isset( $_REQUEST ) ) {
851 $asenha_stats = get_option( ASENHA_SLUG_U . '_stats', array() );
852 $asenha_stats['have_sponsored'] = true;
853 $asenha_stats['sponsorship_nudge_dismissed'] = true;
854 $success = update_option( ASENHA_SLUG_U . '_stats', $asenha_stats );
855
856 if ( $success ) {
857 echo json_encode( array(
858 'success' => true,
859 ) ) ;
860 } else {
861 echo json_encode( array(
862 'success' => false,
863 ) ) ;
864 }
865
866 }
867
868 }
869
870 /**
871 * Dismiss sponsorship nudge
872 *
873 * @since 5.2.7
874 */
875 function asenha_dismiss_sponsorship_nudge()
876 {
877
878 if ( isset( $_REQUEST ) ) {
879 $asenha_stats = get_option( ASENHA_SLUG_U . '_stats', array() );
880 $asenha_stats['sponsorship_nudge_dismissed'] = true;
881 $success = update_option( ASENHA_SLUG_U . '_stats', $asenha_stats );
882
883 if ( $success ) {
884 echo json_encode( array(
885 'success' => true,
886 ) ) ;
887 } else {
888 echo json_encode( array(
889 'success' => false,
890 ) ) ;
891 }
892
893 }
894
895 }
896